Musical scale: Difference between revisions

add lambdatalk task
(add lambdatalk task)
Line 983:
g a b c
}</syntaxhighlight>
 
=={{header|Lambdatalk}}==
<syntaxhighlight lang="Scheme">
 
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}
->
</syntaxhighlight>
 
=={{header|Locomotive Basic}}==
99

edits