Skip to content

Instantly share code, notes, and snippets.

@madskjeldgaard
Last active April 22, 2020 14:22
Show Gist options
  • Save madskjeldgaard/193ec2b5c7d600a2b6c893bd7d543fbd to your computer and use it in GitHub Desktop.
Save madskjeldgaard/193ec2b5c7d600a2b6c893bd7d543fbd to your computer and use it in GitHub Desktop.
Set Ndef using custom event
(
// 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