Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Musical-scale/Lambdatalk/musical-scale.lambdatalk
Normal file
28
Task/Musical-scale/Lambdatalk/musical-scale.lambdatalk
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
Using the musicalScale() javascript function found in this wiki page, we build a lambdatalk interface to output the 8 notes of the C major diatonic scale, and more.
|
||||
|
||||
{def note
|
||||
{lambda {:i}
|
||||
{round {* 261.63 {pow 2 {/ :i 12}}}}}}
|
||||
|
||||
{def scale
|
||||
{lambda {:notes}
|
||||
[{S.map {lambda {:i} {note :i},} :notes}]}}
|
||||
|
||||
{def play
|
||||
{lambda {:n}
|
||||
{input {@ type="button"
|
||||
value="Play :n"
|
||||
onclick="musicalScale({scale :n});"}}}}
|
||||
|
||||
1) diatonic up
|
||||
{play 0 2 4 5 7 9 11 12}
|
||||
|
||||
2) diatonic down
|
||||
{play 12 11 9 7 5 4 2 0}
|
||||
|
||||
3) twelve notes of the octave plus one
|
||||
{play {S.serie 0 12}}
|
||||
|
||||
4) one more ... from Fantasia (Disney Studios, 1940)
|
||||
{play 0 2 3 5 7 3 7 7 6 2 6 6 7 3 7 7 0 2 3 5 7 3 7 12 10 7 3 7 10 10 10 10}
|
||||
->
|
||||
Loading…
Add table
Add a link
Reference in a new issue