Last active
December 27, 2015 10:09
-
-
Save mohayonao/7309047 to your computer and use it in GitHub Desktop.
Task関数の書き換え
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Task.do -> | |
[s1] = [] | |
[ | |
=> | |
s1 = def.play() | |
@wait 100 | |
=> | |
s1.set freq:220 | |
@wait 200 | |
=> | |
@wait Task.each [1,2,3,4], -> | |
[s2] = [] # ここに s1 を含めてはいけない | |
[ | |
(i)=> | |
s2 = def.play(freq:220*i) | |
@wait 50 | |
(i)=> | |
s1 = def.play(freq:440*i) | |
@wait 100 | |
] | |
.play() | |
] | |
.play() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Task.do -> | |
s1 = def.play() | |
@wait 100 | |
s1.set freq:220 | |
@wait 200 | |
@wait Task.each [1,2,3,4], (i)-> | |
s2 = def.play(freq:220*i) # これはローカルスコープ | |
@wait 50 | |
s1 = def.plau(freq:440*i) # これは上のスコープ | |
@wait 100 | |
.play() | |
.play() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment