On Oct 23, 2007, at 5:52 PM, Tibor Páli wrote:
I think this is about as minimal as it gets. Kind of fun to use aftertouch as a volume control :) I'll have to use that in a piece someday. MIDIClient.init(3, 3); MIDIClient.sources.do({ |src, i| MIDIIn.connect(i, src) }); SynthDef(\sine, { |freq, amp| Out.ar(0, SinOsc.ar(freq, 0, amp) ! 2); }).send(s); ~fbus = Bus.control(s, 1).set(440); ~ampbus = Bus.control(s, 1).set(0.5); ~fspec = ControlSpec(48.midicps, 84.midicps, \exp); ~ampspec = ControlSpec(0, 1, \amp); ~bendR = BendResponder({ |src, chan, value| ~fbus.set(~fspec.map(value / 16383)) }); ~touchR = TouchResponder({ |src, chan, value| ~ampbus.set(~ampspec.map(value / 127).postln) }); ~synth = Synth(\sine, [\freq, ~fbus.asMap, \amp, ~ampbus.asMap]); ~synth.free; [~fbus, ~ampbus].do(_.free); [~bendR, ~touchR].do(_.remove);
Thanks! It isn't SC, but I'm proud of that piece too. hjh : H. James Harkins : jamshark70@xxxxxxxxxxxxxxxxx : http://www.dewdrop-world.net .::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..: "Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal." -- Whitman |