booth
2014-09-16 12:07:47 UTC
Probably a silly question, but I'm new to this. . .
I would like to control some parameters in my SynthDefs with a midi
controller. I can get the desired effect by instantiating a Synth and using
the set method controlled from a separate MidiDef, for example:
MIDIClient.init;
MIDIIn.connectAll
(
SynthDef (\noise,
{|freq =100|
var sig;
sig = BPF.ar(WhiteNoise.ar(), freq);
Out.ar(0, sig)
}).add;
a = Synth(\noise);
b = MIDIdef.cc(\f, { |val, ctr| if (ctr == 0,{ a.set(\freq,
val.linexp(0,127, 50, 5000))})});
)
Of course I can include the MIDIDef in the SynthDef body, and can use postln
to see that I am receiving the proper midi signals - but my question is how
can I use the internal MIDIdef to set values in the Synth? I seem unable to
do this by assigning arg or var values directly. Thanks
--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Using-MIDIdef-inside-SynthDef-tp7613419.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
I would like to control some parameters in my SynthDefs with a midi
controller. I can get the desired effect by instantiating a Synth and using
the set method controlled from a separate MidiDef, for example:
MIDIClient.init;
MIDIIn.connectAll
(
SynthDef (\noise,
{|freq =100|
var sig;
sig = BPF.ar(WhiteNoise.ar(), freq);
Out.ar(0, sig)
}).add;
a = Synth(\noise);
b = MIDIdef.cc(\f, { |val, ctr| if (ctr == 0,{ a.set(\freq,
val.linexp(0,127, 50, 5000))})});
)
Of course I can include the MIDIDef in the SynthDef body, and can use postln
to see that I am receiving the proper midi signals - but my question is how
can I use the internal MIDIdef to set values in the Synth? I seem unable to
do this by assigning arg or var values directly. Thanks
--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Using-MIDIdef-inside-SynthDef-tp7613419.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/