[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] new list member - with a ribbon controller



Dear James,

thanks a lot for the suggestion. Your code works! I slide my finger on the controller and I get a continous change of pitch (I will have to re-scale the pitch range). Also the volume responds to pressure. Latency seems to be not an issue. Feels most like an analogue device. Excellent! There are some improvements needed for better playability.

On 24 Oct 2007, at 04:30, James Harkins wrote:

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]);

I will have to test some modifications because there are some problems (mainly with the controller):

(1) The pressure data only starts coming when I apply significant pressure, so the range in which one can play with the pressure is relatively limited. So I will need some amp also when there is no pressure. To test it, I changed the

~touchR = TouchResponder({ |src, chan, value| ~ampbus.set(~ampspec.map (value / 127).postln) });

line to this

~touchR = TouchResponder({ |src, chan, value| ~ampbus.set(~ampspec.map ((128 + value) / 256).postln) });

Is this OK? If yes, why do I get always 0.25 (instead of 0.5) printed after releasing the controller? Also, when I apply pressure, it seems to print numbers in the range of 0.25-1 (well I can not reach the extremes) and not between 0.5 and 1. I don't understand this.

(2) The oscillator is going on at a constant (probably 0.25) amplitude when I am not touching the controller (also before touching it - so I have set the initial amp to 0). I think I should also use NoteOffResponder to either set amp to zero or turn it off.

(3) I will of course have to change the synth to get roughly frequency independent percieved volume (the lower pitches are too silent), some frequency and amplitude dependent coloration, etc.. I am thinking about one of the Moog Etherwave Pro like sound (a combination of female opera singer and chello :-)).

(4) Because of (1) I can easily change pitch without pressure (this is because the position sensor is much more sensitive than the pressure sensor). This seems to happen at constant (0.25 amp value - again, why not 0.5?). Probably because of this, the controller generates a NoteOn message when the position sensor is touched (independently of the pressure sensor being activated or not) and a NoteOff when released. So I am thinking about a NoteOnResponder, which should trigger an ADSR curve for the oscillator. The attack peak and sustain level of the ADSR could be combined with the pressure data if present or be constant if there is no pressure. The note off should turn down the oscillator's volume or turn it off.

Overall, very promising.

With best wishes,


--
Tibor