-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinear mathematical music.nb
8186 lines (7983 loc) · 366 KB
/
linear mathematical music.nb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='WolframDesktop 13.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 161, 7]
NotebookDataLength[ 374119, 8178]
NotebookOptionsPosition[ 360185, 7975]
NotebookOutlinePosition[ 360580, 7991]
CellTagsIndexPosition[ 360537, 7988]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell["Mathematical Music", "Section",
CellChangeTimes->{{3.881164249977367*^9,
3.881164252468671*^9}},ExpressionUUID->"f47f6a60-ab4b-480d-86b3-\
384f2fa192b8"],
Cell["\<\
I first considered the connection between math and music when I was listening \
to the song \[OpenCurlyDoubleQuote]No Money\[CloseCurlyDoubleQuote] by \
Galantis. It\[CloseCurlyQuote]s a fascinating song with many different \
instruments and a touch of something electronic as well, and I was curious if \
I could somehow represent the song in a different way. Being a mathematician, \
I naturally tried to use equations and expressions to represent the song, and \
so began my journey in the realm of mathematical music.\
\>", "Text",
CellChangeTimes->{{3.880678402028748*^9, 3.8806784159107656`*^9}, {
3.881081302129986*^9,
3.881081530566742*^9}},ExpressionUUID->"921d517f-ec31-41b1-90c0-\
162cc5aa38b7"],
Cell["\<\
Mathematical music is a broad term and has varying meanings to people. It\
\[CloseCurlyQuote]s most commonly viewed as the math behind frequency, pitch, \
rhythm, and other facets of music, such as how chords of prime numbers (2nd, \
3rd, 5th, and 7th) sound instinctively right for musicians. However, I was \
interested in something different: what mathematical equation represents the \
melody of a song? If I had an equation, could I turn that into a piece of \
music?\
\>", "Text",
CellChangeTimes->{{3.881081531952589*^9, 3.881081594365638*^9}, {
3.88108162791395*^9, 3.881081759589541*^9}, {3.881081835991744*^9,
3.881081837452417*^9}},ExpressionUUID->"9ea40297-681b-43b4-b361-\
1970c9642a0f"],
Cell[CellGroupData[{
Cell["The General Plan", "Subsection",
CellChangeTimes->{{3.881164264433848*^9,
3.8811642675148277`*^9}},ExpressionUUID->"94b41c84-ae45-40da-ab6c-\
1fc98a1e7afb"],
Cell["\<\
Before I could start coming up with a solution, I had to determine precisely \
what I was trying to find. While I was trying to find the connection between \
math and music, it is important to note that I was pursuing this connection \
only one way\[LongDash] turning a given equation into a song. The \
corresponding connection would be to find an equation given a song, but that \
was not my goal in this part of the project. \
\>", "Text",
CellChangeTimes->{{3.881081868427864*^9,
3.881082053971106*^9}},ExpressionUUID->"501fe408-e80c-4695-bb0a-\
fdd5dc9fc206"],
Cell[TextData[{
"My general plan was to find the values of an equation at certain points and \
then convert these values into notes. For example, if I was looking at the \
function ",
StyleBox["y = x",
FontSlant->"Italic"],
", then at every integer value of ",
StyleBox["x",
FontSlant->"Italic"],
" from 1 to 10, the melody would be comprised of notes with number values \
from 1 to 10. However, this presented a problem immediately: the range of \
functions. "
}], "Text",
CellChangeTimes->{{3.8810820800755777`*^9, 3.8810822475814953`*^9}, {
3.881163425311059*^9,
3.881163426343494*^9}},ExpressionUUID->"a3f1733c-bf12-40f2-8463-\
74147b984e67"],
Cell["\<\
There were only so many notes that I could use, but some equations went on to \
infinity (such as quadratic equations) while others were periodic with ranges \
beyond possible notes (such as sin functions with large amplitudes). And so, \
I split my solution into two cases and came up with slightly separate ways of \
dealing with each type of function.\
\>", "Text",
CellChangeTimes->{{3.881082240573287*^9, 3.88108233078721*^9}, {
3.8810828957843723`*^9,
3.881082932473341*^9}},ExpressionUUID->"9aaa48db-8c28-49e7-8f23-\
506502e55295"]
}, Open ]],
Cell[CellGroupData[{
Cell["Case 1: Functions with an Infinite Range", "Subsection",
CellChangeTimes->{{3.881164303280099*^9,
3.881164309369626*^9}},ExpressionUUID->"367255f0-64f4-41f3-a61e-\
785ce29d4cd1"],
Cell[TextData[{
"My first case included all functions that had an infinite range. It didn\
\[CloseCurlyQuote]t matter if it went to positive or negative infinity\
\[LongDash] if the function increased/decreased without limit, then it was \
considered in this case. To determine whether a function had an infinite \
range, I used the functions MaxValue and MinValue. I used these functions \
with an if statement to determine if a function had an infinite range, and \
put it all inside a custom function, which I named ",
StyleBox["range",
FontSlant->"Italic"],
"."
}], "Text",
CellChangeTimes->{{3.881082958701779*^9,
3.881083103833645*^9}},ExpressionUUID->"ac5612d7-3637-40e3-b366-\
de2641de096e"],
Cell[TextData[{
"Determining if a function had an infinite range with my ",
StyleBox["range",
FontSlant->"Italic"],
" function",
":"
}], "CodeText",
CellChangeTimes->{{3.881083052325053*^9, 3.881083063007463*^9}, {
3.881083111870091*^9,
3.881083114911208*^9}},ExpressionUUID->"77cf7af6-c82d-4d4b-a342-\
a7a07b448ddc"],
Cell[BoxData[
RowBox[{
RowBox[{"range", "[", "f_", "]"}], ":=",
RowBox[{"If", "[",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"MaxValue", "[",
RowBox[{"f", ",", "x"}], "]"}], "==", "Infinity"}], "||",
RowBox[{
RowBox[{"MinValue", "[",
RowBox[{"f", ",", "x"}], "]"}], "==",
RowBox[{"-", "Infinity"}]}]}], ",", "True", ",", "False"}],
"]"}]}]], "Code",
CellChangeTimes->{{3.881083116946072*^9, 3.881083137244336*^9}},
CellLabel->"In[74]:=",ExpressionUUID->"14959e0f-8954-4b67-86a9-3aff22f28972"],
Cell["\<\
Testing it out on some functions, we see it works as intended:\
\>", "Text",
CellChangeTimes->{{3.881083146489238*^9,
3.881083158401726*^9}},ExpressionUUID->"6945047d-a358-48e9-924d-\
fbd0317f63b7"],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"range", "[",
RowBox[{"x", "^", "4"}], "]"}]], "Input",
CellLabel->"In[75]:=",ExpressionUUID->"868163f5-d209-404a-bc54-696531b73685"],
Cell[BoxData["True"], "Output",
CellChangeTimes->{3.881083167571419*^9, 3.881161017275074*^9,
3.881164505420436*^9, 3.8811646404897547`*^9},
CellLabel->"Out[75]=",ExpressionUUID->"3162824b-2b6c-45af-a007-bcdf4e86e27c"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"range", "[",
RowBox[{"Sin", "[", "x", "]"}], "]"}]], "Input",
CellChangeTimes->{{3.881083168670415*^9, 3.881083170806491*^9}},
CellLabel->"In[76]:=",ExpressionUUID->"1eceea26-fd38-444c-af6d-ef83ca20ae04"],
Cell[BoxData["False"], "Output",
CellChangeTimes->{3.881083171452611*^9, 3.8811610184631863`*^9,
3.881164505428689*^9, 3.881164640497311*^9},
CellLabel->"Out[76]=",ExpressionUUID->"54618c5f-abc1-4aee-b672-ff4c4c22221d"]
}, Open ]],
Cell[TextData[{
"Once I could determine if a function was infinite, I needed to find a way \
to express these infinite notes as values. My solution was to place a cap on \
the function\[CloseCurlyQuote]s values. After experimenting with number \
values for notes in the SoundNote function, I determined that a reasonable \
range was between -30 and +30, which meant I had to limit the values of these \
functions to be between negative and positive 30. And so, I created the ",
StyleBox["value",
FontSlant->"Italic"],
" function to find the values of the function for notes. Essentially, if the \
function\[CloseCurlyQuote]s value was below -30, I set it to -30, and if it \
was above +30, I set it to +30. If it was between -30 and +30, I set the note \
value to be the floor of the function\[CloseCurlyQuote]s value (since \
SoundNote only accepted integers)."
}], "Text",
CellChangeTimes->{{3.8810831785038633`*^9, 3.881083196444344*^9}, {
3.881083271135113*^9,
3.881083509230728*^9}},ExpressionUUID->"5d089fea-deb9-44b8-b3cc-\
6dc916e1e8e3"],
Cell["\<\
What exactly is the note value? To explain it best, think of the notes on a \
piano. Reduce the 88 keys to a reasonable range (which I took as 60 notes). \
Imagine middle C (C4) as 0, and for every half-step up, increase the note \
value by 1. In that sense, the note value for D# is 3. For every half-step \
down, decrease the note value by 1. In that sense, the note value for B is \
-1. With a range of -30 to +30, the notes go from F#1 to F#6, a range of 5 \
octaves.\
\>", "Text",
CellChangeTimes->{{3.881085070435145*^9, 3.8810852148882437`*^9}, {
3.88108528768752*^9, 3.881085342274692*^9}, {3.881085448973035*^9,
3.881085465569332*^9}, {3.881085512938979*^9,
3.881085522961672*^9}},ExpressionUUID->"ddd13941-697b-4c78-acd9-\
1190d1edb997"],
Cell[TextData[{
"Using the ",
StyleBox["value",
FontSlant->"Italic"],
" function to change a function\[CloseCurlyQuote]s values into usable note \
values:"
}], "CodeText",
CellChangeTimes->{{3.881083513989657*^9,
3.881083546301227*^9}},ExpressionUUID->"96d740ac-a3a9-442d-87bd-\
7f3a0225e41a"],
Cell[BoxData[
RowBox[{
RowBox[{"value", "[", "x_", "]"}], ":=",
RowBox[{"Which", "[",
RowBox[{
RowBox[{"x", "<",
RowBox[{"-", "30"}]}], ",",
RowBox[{"-", "30"}], ",",
RowBox[{"x", ">", "30"}], ",", "30", ",",
RowBox[{"NumberQ", "[", "x", "]"}], ",",
RowBox[{"Floor", "[", "x", "]"}]}], "]"}]}]], "Code",
CellChangeTimes->{3.88108355240944*^9},
CellLabel->"In[77]:=",ExpressionUUID->"9d1d85ed-d647-4f15-8e2d-d6801294f579"],
Cell["\<\
We can see this function working as intended after testing it out on a \
quadratic function.\
\>", "Text",
CellChangeTimes->{{3.8810835580660257`*^9,
3.881083585668605*^9}},ExpressionUUID->"877914ec-5c12-4ade-91e0-\
919065419e79"],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Plot", "[",
RowBox[{
RowBox[{"value", "[",
RowBox[{"x", "^", "2"}], "]"}], ",",
RowBox[{"{",
RowBox[{"x", ",",
RowBox[{"-", "7"}], ",", "7"}], "}"}]}], "]"}]], "Input",
CellLabel->"In[78]:=",ExpressionUUID->"cbf2b572-13bb-4df8-a9e5-fface69e8820"],
Cell[BoxData[
GraphicsBox[{{{}, {},
TagBox[
{RGBColor[0.368417, 0.506779, 0.709798], AbsoluteThickness[1.6], Opacity[
1.], LineBox[CompressedData["
1:eJxN2mc41+37B3Ajkr1SJLuMJAmF8FE0jVLIKCEqWd3ISCnyRURpyUqlSBLK
LMkoI32RjEqU7J1Rtt/9/9++n3fng+s8Xsd5nNdxPjqP68ElbutqbM9AR0fH
+e/x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), 0.6180339887498948],
Axes->{True, True},
AxesLabel->{None, None},
AxesOrigin->{0, 0},
DisplayFunction->Identity,
Frame->{{False, False}, {False, False}},
FrameLabel->{{None, None}, {None, None}},
FrameTicks->{{Automatic, Automatic}, {Automatic, Automatic}},
GridLines->{None, None},
GridLinesStyle->Directive[
GrayLevel[0.5, 0.4]],
ImagePadding->All,
Method->{
"DefaultBoundaryStyle" -> Automatic,
"DefaultGraphicsInteraction" -> {
"Version" -> 1.2, "TrackMousePosition" -> {True, False},
"Effects" -> {
"Highlight" -> {"ratio" -> 2}, "HighlightPoint" -> {"ratio" -> 2},
"Droplines" -> {
"freeformCursorMode" -> True,
"placement" -> {"x" -> "All", "y" -> "None"}}}}, "DefaultMeshStyle" ->
AbsolutePointSize[6], "ScalingFunctions" -> None,
"CoordinatesToolOptions" -> {"DisplayFunction" -> ({
(Identity[#]& )[
Part[#, 1]],
(Identity[#]& )[
Part[#, 2]]}& ), "CopiedValueFunction" -> ({
(Identity[#]& )[
Part[#, 1]],
(Identity[#]& )[
Part[#, 2]]}& )}},
PlotRange->{{-7, 7}, {0., 30.}},
PlotRangeClipping->True,
PlotRangePadding->{{
Scaled[0.02],
Scaled[0.02]}, {
Scaled[0.05],
Scaled[0.05]}},
Ticks->{Automatic, Automatic}]], "Output",
CellChangeTimes->{3.881083594506271*^9, 3.881161024792067*^9,
3.881164505853156*^9, 3.881164640934581*^9},
CellLabel->"Out[78]=",ExpressionUUID->"23ac976b-75ef-42a5-829b-6f2a76ed0b4e"]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"notes", "=",
RowBox[{"Table", "[",
RowBox[{
RowBox[{"value", "[",
RowBox[{"x", "^", "2"}], "]"}], ",",
RowBox[{"{",
RowBox[{"x", ",",
RowBox[{"-", "7"}], ",", "7", ",", ".5"}], "}"}]}], "]"}]}]], "Input",
CellLabel->"In[79]:=",ExpressionUUID->"003aa682-da9a-4e04-865f-945a8145d9ee"],
Cell[BoxData[
RowBox[{"{",
RowBox[{
"30", ",", "30", ",", "30", ",", "30", ",", "25", ",", "20", ",", "16", ",",
"12", ",", "9", ",", "6", ",", "4", ",", "2", ",", "1", ",", "0", ",",
"0", ",", "0", ",", "1", ",", "2", ",", "4", ",", "6", ",", "9", ",", "12",
",", "16", ",", "20", ",", "25", ",", "30", ",", "30", ",", "30", ",",
"30"}], "}"}]], "Output",
CellChangeTimes->{3.881083612958596*^9, 3.881161026406733*^9,
3.88116450586828*^9, 3.881164640960593*^9},
CellLabel->"Out[79]=",ExpressionUUID->"9c102d1c-2a1e-462e-8023-3c1859044011"]
}, Open ]],
Cell[TextData[{
"As shown above, the note values for the function ",
StyleBox["y = x^2",
FontSlant->"Italic"],
" from -7 to +7 (with a step of .5) are bounded at +30. "
}], "Text",
CellChangeTimes->{{3.881083631414378*^9,
3.881083698277109*^9}},ExpressionUUID->"8a6ec991-82f4-40fe-8a96-\
2e37fdd97666"],
Cell["\<\
Once I had a list of notes, it was trivial to simply play each of these notes \
with Sound after setting each note to play for .25 seconds.\
\>", "Text",
CellChangeTimes->{{3.8810837060493*^9, 3.881083715232185*^9}, {
3.881083757427229*^9,
3.881083815121097*^9}},ExpressionUUID->"64eb51df-81b2-4356-a9aa-\
97e106a13858"],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Sound", "[",
RowBox[{
RowBox[{
RowBox[{"SoundNote", "[",
RowBox[{"#", ",", ".25"}], "]"}], "&"}], "/@", "notes"}], "]"}]], "Input",\
CellLabel->"In[80]:=",ExpressionUUID->"4a4a048b-528b-4ed4-9bcc-df67f51e3590"],
Cell[BoxData[
InterpretationBox[
GraphicsBox[{
{RGBColor[0.9568627450980393, 0.9568627450980393, 0.9568627450980393],
RectangleBox[{0, 0}, {360, -164}]}, {InsetBox[
GraphicsBox[
{RGBColor[0.5, 0, 0.5],
StyleBox[{
RectangleBox[{3.25, 0.43198696602798653}, \
{3.4875, 0.4438917279327484}],
RectangleBox[{3.5, 0.43198696602798653}, \
{3.7375, 0.4438917279327484}],
RectangleBox[{3.75, 0.43198696602798653}, \
{3.9875, 0.4438917279327484}],
RectangleBox[{3., 0.4438917279327484}, \
{3.2375, 0.45579648983751037}],
RectangleBox[{4., 0.4438917279327484}, \
{4.2375, 0.45579648983751037}],
RectangleBox[{2.75, 0.45579648983751037}, \
{2.9875, 0.4677012517422721}],
RectangleBox[{4.25, 0.45579648983751037}, \
{4.4875, 0.4677012517422721}],
RectangleBox[{2.5, 0.4796060136470343}, \
{2.7375, 0.49151077555179606}],
RectangleBox[{4.5, 0.4796060136470343}, \
{4.7375, 0.49151077555179606}],
RectangleBox[{2.25, 0.5034155374565581}, \
{2.4875, 0.5153202993613198}],
RectangleBox[{4.75, 0.5034155374565581}, \
{4.9875, 0.5153202993613198}],
RectangleBox[{2., 0.5391298231708438}, \
{2.2375, 0.5510345850756055}],
RectangleBox[{5., 0.5391298231708438}, \
{5.2375, 0.5510345850756055}],
RectangleBox[{1.75, 0.5748441088851295}, \
{1.9875, 0.5867488707898912}],
RectangleBox[{5.25, 0.5748441088851295}, \
{5.4875, 0.5867488707898912}],
RectangleBox[{1.5, 0.6224631565041769}, \
{1.7375, 0.6343679184089389}],
RectangleBox[{5.5, 0.6224631565041769}, \
{5.7375, 0.6343679184089389}],
RectangleBox[{1.25, 0.6700822041232247}, \
{1.4875, 0.6819869660279864}],
RectangleBox[{5.75, 0.6700822041232247}, \
{5.9875, 0.6819869660279864}],
RectangleBox[{1., 0.7296060136470344}, \
{1.2375, 0.7415107755517961}],
RectangleBox[{6., 0.7296060136470344}, \
{6.2375, 0.7415107755517961}],
RectangleBox[{0., 0.7891298231708438}, \
{0.2375, 0.8010345850756058}],
RectangleBox[{0.25, 0.7891298231708438}, \
{0.4875, 0.8010345850756058}],
RectangleBox[{0.5, 0.7891298231708438}, \
{0.7375, 0.8010345850756058}],
RectangleBox[{0.75, 0.7891298231708438}, \
{0.9875, 0.8010345850756058}],
RectangleBox[{6.25, 0.7891298231708438}, \
{6.4875, 0.8010345850756058}],
RectangleBox[{6.5, 0.7891298231708438}, \
{6.7375, 0.8010345850756058}],
RectangleBox[{6.75, 0.7891298231708438}, \
{6.9875, 0.8010345850756058}],
RectangleBox[{7., 0.7891298231708438}, \
{7.2375, 0.8010345850756058}]},
Antialiasing->True]},
AspectRatio->NCache[
Rational[6, 35], 0.17142857142857143`],
Background->GrayLevel[1],
Frame->True,
FrameStyle->GrayLevel[0.75],
FrameTicks->False,
ImagePadding->None,
PlotRange->{All, All},
PlotRangePadding->{Automatic, 0.05}], {180, -35},
ImageScaled[{0.5, 0.5}], {350, 60},
Background->RGBColor[
0.9568627450980393, 0.9568627450980393, 0.9568627450980393]],
InsetBox[
GraphicsBox[
{GrayLevel[0.6], RectangleBox[{0, 0}]},
AspectRatio->NCache[
Rational[6, 35], 0.17142857142857143`],
Background->GrayLevel[1],
Frame->True,
FrameStyle->GrayLevel[0.75],
FrameTicks->False,
ImagePadding->None], {180, -100}, ImageScaled[{0.5, 0.5}], {350, 60},
Background->RGBColor[
0.9568627450980393, 0.9568627450980393, 0.9568627450980393]]}, InsetBox[
StyleBox[
TemplateBox[{
StyleBox[
"\" | \"", FontSize -> 14, FontColor ->
RGBColor[0.5098039215686274, 0.5098039215686274, 0.5098039215686274],
StripOnInput -> False],
StyleBox[
TemplateBox[{"\"7.25\"", "\" s\""}, "RowDefault"], FontColor ->
RGBColor[0.5098039215686274, 0.5098039215686274, 0.5098039215686274],
StripOnInput -> False]},
"RowWithSeparator"], "DialogStyle",
StripOnInput->False], {355, -159}, Scaled[{1, 0}]],
TagBox[{
{RGBColor[0.9568627450980393, 0.9568627450980393, 0.9568627450980393],
RectangleBox[{5, -158}, {29, -135}]},
{RGBColor[0.27450980392156865`, 0.5411764705882353, 0.796078431372549],
PolygonBox[
NCache[{{11, -157}, {11, -136}, {20., Rational[-293, 2]}, {
11, -157}}, {{11, -157}, {11, -136}, {20., -146.5}, {11, -157}}]],
StyleBox[{},
Antialiasing->False]}},
EventHandlerTag[{"MouseClicked" :> If[True, Sound`EmitMIDI[
Sound`MIDISequence[{
Sound`MIDITrack[{
Sound`MIDIEvent[0, "SetTempo", "Tempo" -> 1000000],
Sound`MIDIEvent[
0, "ProgramCommand", "Channel" -> 0, "Value" -> 0],
Sound`MIDIEvent[
0, "NoteOn", "Note" -> 90, "Channel" -> 0, "Velocity" -> 127],
Sound`MIDIEvent[
12, "NoteOff", "Note" -> 90, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
12, "NoteOn", "Note" -> 90, "Channel" -> 0, "Velocity" -> 127],
Sound`MIDIEvent[
24, "NoteOff", "Note" -> 90, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
24, "NoteOn", "Note" -> 90, "Channel" -> 0, "Velocity" -> 127],
Sound`MIDIEvent[
36, "NoteOff", "Note" -> 90, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
36, "NoteOn", "Note" -> 90, "Channel" -> 0, "Velocity" -> 127],
Sound`MIDIEvent[
48, "NoteOff", "Note" -> 90, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
48, "NoteOn", "Note" -> 85, "Channel" -> 0, "Velocity" -> 127],
Sound`MIDIEvent[
60, "NoteOff", "Note" -> 85, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
60, "NoteOn", "Note" -> 80, "Channel" -> 0, "Velocity" -> 127],
Sound`MIDIEvent[
72, "NoteOff", "Note" -> 80, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
72, "NoteOn", "Note" -> 76, "Channel" -> 0, "Velocity" -> 127],
Sound`MIDIEvent[
84, "NoteOff", "Note" -> 76, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
84, "NoteOn", "Note" -> 72, "Channel" -> 0, "Velocity" -> 127],
Sound`MIDIEvent[
96, "NoteOff", "Note" -> 72, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
96, "NoteOn", "Note" -> 69, "Channel" -> 0, "Velocity" -> 127],
Sound`MIDIEvent[
108, "NoteOff", "Note" -> 69, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
108, "NoteOn", "Note" -> 66, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
120, "NoteOff", "Note" -> 66, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
120, "NoteOn", "Note" -> 64, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
132, "NoteOff", "Note" -> 64, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
132, "NoteOn", "Note" -> 62, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
144, "NoteOff", "Note" -> 62, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
144, "NoteOn", "Note" -> 61, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
156, "NoteOff", "Note" -> 61, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
156, "NoteOn", "Note" -> 60, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
168, "NoteOff", "Note" -> 60, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
168, "NoteOn", "Note" -> 60, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
180, "NoteOff", "Note" -> 60, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
180, "NoteOn", "Note" -> 60, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
192, "NoteOff", "Note" -> 60, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
192, "NoteOn", "Note" -> 61, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
204, "NoteOff", "Note" -> 61, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
204, "NoteOn", "Note" -> 62, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
216, "NoteOff", "Note" -> 62, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
216, "NoteOn", "Note" -> 64, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
228, "NoteOff", "Note" -> 64, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
228, "NoteOn", "Note" -> 66, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
240, "NoteOff", "Note" -> 66, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
240, "NoteOn", "Note" -> 69, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
252, "NoteOff", "Note" -> 69, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
252, "NoteOn", "Note" -> 72, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
264, "NoteOff", "Note" -> 72, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
264, "NoteOn", "Note" -> 76, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
276, "NoteOff", "Note" -> 76, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
276, "NoteOn", "Note" -> 80, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
288, "NoteOff", "Note" -> 80, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
288, "NoteOn", "Note" -> 85, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
300, "NoteOff", "Note" -> 85, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
300, "NoteOn", "Note" -> 90, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
312, "NoteOff", "Note" -> 90, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
312, "NoteOn", "Note" -> 90, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
324, "NoteOff", "Note" -> 90, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
324, "NoteOn", "Note" -> 90, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
336, "NoteOff", "Note" -> 90, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
336, "NoteOn", "Note" -> 90, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
348, "NoteOff", "Note" -> 90, "Channel" -> 0, "Velocity" ->
0]}]}, "DivisionType" -> "PPQ", "Resolution" -> 48]];
Sound`EmitSampledSound[None, "Preemptive"],
FEPrivate`EmitSound[None, "Preemptive"]], Method -> "Preemptive",
PassEventsDown -> Automatic, PassEventsUp -> True}]],
TagBox[{
{RGBColor[0.9568627450980393, 0.9568627450980393, 0.9568627450980393],
RectangleBox[{29, -158}, {53, -135}]},
{RGBColor[0.27450980392156865`, 0.5411764705882353, 0.796078431372549],
RectangleBox[{35, -152}, {47, -141}],
StyleBox[{},
Antialiasing->False]}},
EventHandlerTag[{"MouseClicked" :> If[True, Sound`EmitSampledSound[
SampledSoundList[{{0.}}, 8000], "Preemptive"]; Sound`StopMIDI[],
FEPrivate`EmitSound[
SampledSoundList[{{0.}}, 8000], "Preemptive"]], Method ->
"Preemptive", PassEventsDown -> Automatic, PassEventsUp -> True}]],
{GrayLevel[0.75],
StyleBox[LineBox[{{0, 0}, {360, 0}, {360, -164}, {0, -164}, {0, 0}}],
Antialiasing->False]}},
ContentSelectable->False,
ImageSize->250,
PlotRange->{{0, 360}, {-164, 0}},
PlotRangePadding->1],
Sound[{
SoundNote[30, 0.25],
SoundNote[30, 0.25],
SoundNote[30, 0.25],
SoundNote[30, 0.25],
SoundNote[25, 0.25],
SoundNote[20, 0.25],
SoundNote[16, 0.25],
SoundNote[12, 0.25],
SoundNote[9, 0.25],
SoundNote[6, 0.25],
SoundNote[4, 0.25],
SoundNote[2, 0.25],
SoundNote[1, 0.25],
SoundNote[0, 0.25],
SoundNote[0, 0.25],
SoundNote[0, 0.25],
SoundNote[1, 0.25],
SoundNote[2, 0.25],
SoundNote[4, 0.25],
SoundNote[6, 0.25],
SoundNote[9, 0.25],
SoundNote[12, 0.25],
SoundNote[16, 0.25],
SoundNote[20, 0.25],
SoundNote[25, 0.25],
SoundNote[30, 0.25],
SoundNote[30, 0.25],
SoundNote[30, 0.25],
SoundNote[30, 0.25]}]]], "Output",
CellChangeTimes->{3.881083801684321*^9, 3.881161028746297*^9,
3.881164505969481*^9, 3.88116464109562*^9},
CellLabel->"Out[80]=",ExpressionUUID->"1cc16f59-4f46-427f-8d7c-dc18eaaa50ee"]
}, Open ]],
Cell[TextData[{
"I noticed that the shape of the notes were very similar to the quadratic \
function, which was exactly what I wanted. However, this didn\
\[CloseCurlyQuote]t feel right to me. The function ",
StyleBox["y = x^2",
FontSlant->"Italic"],
" doesn\[CloseCurlyQuote]t grow linearly\[LongDash] rather it increases \
faster as it grows farther from the origin. This meant the tempo of these \
notes was off."
}], "Text",
CellChangeTimes->{{3.881083818915172*^9,
3.881083974052203*^9}},ExpressionUUID->"a5a37d7f-fb7b-4413-96f0-\
856155e6a221"],
Cell["\<\
I experimented with many different things in order to reach the right timing \
for the music, such as using the x-coordinate of each note as it\
\[CloseCurlyQuote]s tempo or making the tempo a factor of the note values. I\
\[CloseCurlyQuote]ve included the some of my experiments below.\
\>", "Text",
CellChangeTimes->{{3.8810839418742657`*^9, 3.881083960942789*^9}, {
3.8810839945020237`*^9, 3.8810840058259153`*^9}, {3.8810840359341*^9,
3.881084103114743*^9}, {3.8810841517956944`*^9,
3.881084153862686*^9}},ExpressionUUID->"3947e997-62e9-4563-a6e7-\
a74f83869f9a"],
Cell["Experiment 1\[LongDash]directly scaling the tempo by the note values:", \
"CodeText",
CellChangeTimes->{{3.881084157753039*^9, 3.88108421015189*^9}, {
3.88108481534333*^9,
3.881084817733573*^9}},ExpressionUUID->"fee605a0-dfe9-4b36-9569-\
c92a87df80a8"],
Cell[BoxData[{
RowBox[{
RowBox[{"time1", "=",
RowBox[{"notes", "*",
RowBox[{".5", "/", "10"}]}]}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"If", "[",
RowBox[{
RowBox[{"#", "==", "0"}], ",", "0.01", ",", "#"}], "]"}], "&"}], "/@",
"time1"}], ";"}], "\n",
RowBox[{
RowBox[{"experiment1", "=",
RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]",
RowBox[{
RowBox[{"For", "[",
RowBox[{
RowBox[{"i", "=", "1"}], ",",
RowBox[{"i", "<=",
RowBox[{"Length", "[", "notes", "]"}]}], ",",
RowBox[{"i", "++"}], ",",
RowBox[{"experiment1", "=",
RowBox[{"Append", "[",
RowBox[{"experiment1", ",",
RowBox[{"SoundNote", "[",
RowBox[{
RowBox[{"notes", "[",
RowBox[{"[", "i", "]"}], "]"}], ",",
RowBox[{"time1", "[",
RowBox[{"[", "i", "]"}], "]"}]}], "]"}]}], "]"}]}]}], "]"}],
";"}]}], "Code",
CellChangeTimes->{{3.881084125257118*^9, 3.881084126223137*^9}, {
3.8810842141034403`*^9, 3.881084269225643*^9}},
CellLabel->"In[81]:=",ExpressionUUID->"05c1a970-7176-4470-9ba2-1afec0d2c002"],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Sound", "[", "experiment1", "]"}]], "Input",
CellChangeTimes->{{3.881084274111075*^9, 3.8810842812616568`*^9}},
CellLabel->"In[85]:=",ExpressionUUID->"d709e5ed-33ca-48a7-9cc3-39007904f9a3"],
Cell[BoxData[
InterpretationBox[
GraphicsBox[{
{RGBColor[0.9568627450980393, 0.9568627450980393, 0.9568627450980393],
RectangleBox[{0, 0}, {360, -164}]}, {InsetBox[
GraphicsBox[
{RGBColor[0.5, 0, 0.5],
StyleBox[{
RectangleBox[{10.75, 0.43198696602798653}, \
{10.75, 0.4438917279327484}],
RectangleBox[{10.75, 0.43198696602798653}, \
{10.75, 0.4438917279327484}],
RectangleBox[{10.75, 0.43198696602798653}, \
{10.75, 0.4438917279327484}],
RectangleBox[{10.7, 0.4438917279327484}, \
{10.7475, 0.45579648983751037}],
RectangleBox[{10.75, 0.4438917279327484}, \
{10.797500000000001, 0.45579648983751037}],
RectangleBox[{10.6, 0.45579648983751037}, \
{10.694999999999999, 0.4677012517422721}],
RectangleBox[{10.8, 0.45579648983751037}, \
{10.895, 0.4677012517422721}],
RectangleBox[{10.4, 0.4796060136470343}, \
{10.59, 0.49151077555179606}],
RectangleBox[{10.9, 0.4796060136470343}, \
{11.09, 0.49151077555179606}],
RectangleBox[{10.1, 0.5034155374565581}, \
{10.385, 0.5153202993613198}],
RectangleBox[{11.1, 0.5034155374565581}, \
{11.385, 0.5153202993613198}],
RectangleBox[{9.65, 0.5391298231708438}, \
{10.0775, 0.5510345850756055}],
RectangleBox[{11.4, 0.5391298231708438}, \
{11.8275, 0.5510345850756055}],
RectangleBox[{9.05, 0.5748441088851295}, \
{9.620000000000001, 0.5867488707898912}],
RectangleBox[{11.85, 0.5748441088851295}, \
{12.42, 0.5867488707898912}],
RectangleBox[{8.25, 0.6224631565041769}, \
{9.010000000000002, 0.6343679184089389}],
RectangleBox[{12.45, 0.6224631565041769}, \
{13.21, 0.6343679184089389}],
RectangleBox[{7.25, 0.6700822041232247}, {8.2, 0.6819869660279864}],
RectangleBox[{13.25, 0.6700822041232247}, \
{14.2, 0.6819869660279864}],
RectangleBox[{6., 0.7296060136470344}, {7.2, 0.7415107755517961}],
RectangleBox[{14.25, 0.7296060136470344}, \
{15.45, 0.7415107755517961}],
RectangleBox[{0., 0.7891298231708438}, {1.45, 0.8010345850756058}],
RectangleBox[{1.5, 0.7891298231708438}, {2.95, 0.8010345850756058}],
RectangleBox[{3., 0.7891298231708438}, {4.45, 0.8010345850756058}],
RectangleBox[{4.5, 0.7891298231708438}, \
{5.95, 0.8010345850756058}],
RectangleBox[{15.5, 0.7891298231708438}, \
{16.95, 0.8010345850756058}],
RectangleBox[{17., 0.7891298231708438}, \
{18.45, 0.8010345850756058}],
RectangleBox[{18.5, 0.7891298231708438}, \
{19.95, 0.8010345850756058}],
RectangleBox[{20., 0.7891298231708438}, \
{21.45, 0.8010345850756058}]},
Antialiasing->True]},
AspectRatio->NCache[
Rational[6, 35], 0.17142857142857143`],
Background->GrayLevel[1],
Frame->True,
FrameStyle->GrayLevel[0.75],
FrameTicks->False,
ImagePadding->None,
PlotRange->{All, All},
PlotRangePadding->{Automatic, 0.05}], {180, -35},
ImageScaled[{0.5, 0.5}], {350, 60},
Background->RGBColor[
0.9568627450980393, 0.9568627450980393, 0.9568627450980393]],
InsetBox[
GraphicsBox[
{GrayLevel[0.6], RectangleBox[{0, 0}]},
AspectRatio->NCache[
Rational[6, 35], 0.17142857142857143`],
Background->GrayLevel[1],
Frame->True,
FrameStyle->GrayLevel[0.75],
FrameTicks->False,
ImagePadding->None], {180, -100}, ImageScaled[{0.5, 0.5}], {350, 60},
Background->RGBColor[
0.9568627450980393, 0.9568627450980393, 0.9568627450980393]]}, InsetBox[
StyleBox[
TemplateBox[{
StyleBox[
"\" | \"", FontSize -> 14, FontColor ->
RGBColor[0.5098039215686274, 0.5098039215686274, 0.5098039215686274],
StripOnInput -> False],
StyleBox[
TemplateBox[{"\"21.5\"", "\" s\""}, "RowDefault"], FontColor ->
RGBColor[0.5098039215686274, 0.5098039215686274, 0.5098039215686274],
StripOnInput -> False]},
"RowWithSeparator"], "DialogStyle",
StripOnInput->False], {355, -159}, Scaled[{1, 0}]],
TagBox[{
{RGBColor[0.9568627450980393, 0.9568627450980393, 0.9568627450980393],
RectangleBox[{5, -158}, {29, -135}]},
{RGBColor[0.27450980392156865`, 0.5411764705882353, 0.796078431372549],
PolygonBox[
NCache[{{11, -157}, {11, -136}, {20., Rational[-293, 2]}, {
11, -157}}, {{11, -157}, {11, -136}, {20., -146.5}, {11, -157}}]],
StyleBox[{},
Antialiasing->False]}},
EventHandlerTag[{"MouseClicked" :> If[True, Sound`EmitMIDI[
Sound`MIDISequence[{
Sound`MIDITrack[{
Sound`MIDIEvent[0, "SetTempo", "Tempo" -> 1000000],
Sound`MIDIEvent[
0, "ProgramCommand", "Channel" -> 0, "Value" -> 0],
Sound`MIDIEvent[
0, "NoteOn", "Note" -> 90, "Channel" -> 0, "Velocity" -> 127],
Sound`MIDIEvent[
360, "NoteOff", "Note" -> 90, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
360, "NoteOn", "Note" -> 90, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
720, "NoteOff", "Note" -> 90, "Channel" -> 0, "Velocity" -> 0],
Sound`MIDIEvent[
720, "NoteOn", "Note" -> 90, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
1080, "NoteOff", "Note" -> 90, "Channel" -> 0, "Velocity" ->
0],
Sound`MIDIEvent[
1080, "NoteOn", "Note" -> 90, "Channel" -> 0, "Velocity" ->
127],
Sound`MIDIEvent[
1440, "NoteOff", "Note" -> 90, "Channel" -> 0, "Velocity" ->
0],
Sound`MIDIEvent[