Last active
April 22, 2020 14:22
-
-
Save madskjeldgaard/193ec2b5c7d600a2b6c893bd7d543fbd to your computer and use it in GitHub Desktop.
Set Ndef using custom event
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
( | |
// Create new Ndef setter event type | |
Event.addEventType(\ndset, {|server| | |
~type = \set; | |
~id = Ndef(~key).group; | |
~args = Ndef(~key).controlKeys(except: ~exceptArgs); | |
currentEnvironment.play; | |
}) | |
) | |
// Make a dummy Ndef for testing | |
Ndef(\output, {|a1, a2| | |
a1.poll; | |
a2.poll; | |
}) | |
// Test using pattern | |
Pbind( | |
\type, \ndset, | |
\key, \hello, | |
\a1, Pwhite(0.0,1.0), | |
\a2, Pwhite(0.0,1.0) | |
).play; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment