Created
April 15, 2013 06:00
-
-
Save abramhindle/5385994 to your computer and use it in GitHub Desktop.
Abusing a bus to get a scalar value.
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
| ~mkscalarfun = { | |
| arg f={ 0 }; | |
| var last = 0.0; | |
| var mbus = Bus.control(s, 1); | |
| var pf = f.play(s,mbus); | |
| var scalarf = { | |
| mbus.get({|v| last = v;}); | |
| last; | |
| }; | |
| scalarf; | |
| }; | |
| ~mousescalarf = ~mkscalarfun.({ var start=40, end=440, del=0; MouseX.kr(start, end, del); }); | |
| ~mousescalarf.(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment