MIDI channels, programs to control several Synths

Hi!

I am trying to control several Synths with a MIDI controller. My approach has been to assign a different MIDI channel to each MIDI program in the controller to jump between programs and control the different Synths while the previous ones continue playing. The problem arises when I change the MIDI Program back to the previous one because it only triggers a new note if the MIDIdef.noteOn is executed again, despite the notesOn messages still coming from the controller as they are traced by MIDIFunc.trace(true). It happens with any MIDI Channel and Program. I am using the MonoPortaVoicer with no MIDIdef.noteOff because the intention is the keep the different sound layers active. I have not tried the traditional form without MonoPortaVoicer. This is a simple example I have been testing without the SynthDef:

x = MonoPortaVoicer(1, \sino);
x.portaTime = 0.15;

y = MonoPortaVoicer(1, \pulso);
y.portaTime = 0.15;

(
MIDIdef.noteOn(\on, {
	arg vel, num;
	[num, vel].postln;
	x.trigger(num.midicps, vel.lincurve(0, 127, 0.01, 1));
}, chan: 0);

)

(
MIDIdef.noteOn(\on, {
	arg vel, num;
	[num, vel].postln;
	y.trigger(num.midicps, vel.lincurve(0, 127, 0.01, 1));
}, chan: 1);
)

It is welcome any different approach or suggestion, thanks

I think the problem is you are using the same key - \on - for both MIDIdefs, so the second one overwrites the first.
If you give them different keys, they will both be active at the same time, e.g.:

(
MIDIdef.noteOn(\onC0, {
	arg vel, num;
	[num, vel].postln;
	x.trigger(num.midicps, vel.lincurve(0, 127, 0.01, 1));
}, chan: 0);

)

(
MIDIdef.noteOn(\onC1, {
	arg vel, num;
	[num, vel].postln;
	y.trigger(num.midicps, vel.lincurve(0, 127, 0.01, 1));
}, chan: 1);
)

Best,
Paul

ohhhh, how I did not get that. Now it works!! Thanks a lot