Discussion:
\VoicerMIDI : how does it work?
rev
2014-08-03 10:40:43 UTC
Permalink
Hi list,

I'm bothering You again after a week I'm struggling with \VoicerMIDI event
generator. My goal is to register some notes from a MIDI keyboard to a
MIDIRecBuf, then play them again on a Voicer I defined. Here is my code:

---CODE---
//Instr definition
Instr(\base, {
arg freq =440, gate=1, ctrl=#[0,0,0], ctrr=#[0,0,0];
var signal, amp;
amp = Latch.kr(gate, gate);
signal=LFSaw.ar(Vibrato.ar(DC.ar(freq),ctrr[0]*1000,ctrl[0]*0.5));

Out.ar(0,abs(ctrr[0]*ctrl[0])*EnvGen.ar(Env([0,1,0.6,0.3,0],[0.01,0.5,0.2,1]),
gate) * signal);
},#[nil]);

//Voicer, MIDISocket and MIDIManager
v = Voicer(10, \base,[\ctrl, b.asMap, \ctrr, c.asMap]); //it is taking some
external controls
t = TempoClock.new(100/60);
v.clock_(t);
k = VoicerMIDISocket([3,\omni], v);
m = MIDIBufManager.new(chan:[3,\omni]);
m.gui

---END CODE---

The above is working for direct keyboard notes interpretation (i.e: I hear
my instr playing when I press the keyboard keys) and for MIDI registration
(I see the MIDIRecBuf getting full on its GUI and I can play some notes with
a Pbind).
But I can't hear the buffer using:

---CODE---
// A slightly edited version of \VoicerMIDI example found in Voicer help
p = Pbind(
\note, Pseq(m[0].notes, inf),
\voicer, v,
\latency, 0.5,
\midi, true,
\gate, 1
).play(protoEvent: Event.makeProto(\voicerMIDI));
---END CODE---

Although this simpler structure is working but non playing on my instrument:

---CODE---
p = Pbind(
#[midinote, delta, sustain, amp], Pseq(m[0].notes).collect(_.asArray);
).play;
---END CODE---

I feel like I'm missing some details in \VoicerMIDI but I couldn't find
other working examples over the web, nor I was able to get any more
information from the source code and the help file.

Maybe someone could help?

Thank You!

Regards,
rev




--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/VoicerMIDI-how-does-it-work-tp7612667.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/
ddw_music
2014-09-04 02:00:25 UTC
Permalink
Post by rev
The above is working for direct keyboard notes interpretation (i.e: I hear
my instr playing when I press the keyboard keys) and for MIDI registration
(I see the MIDIRecBuf getting full on its GUI and I can play some notes
with a Pbind).
---CODE---
// A slightly edited version of \VoicerMIDI example found in Voicer help
p = Pbind(
\note, Pseq(m[0].notes, inf),
\voicer, v,
\latency, 0.5,
\midi, true,
\gate, 1
).play(protoEvent: Event.makeProto(\voicerMIDI));
---END CODE---
Apologies for the very late reply. I haven't been reading the mailing list
for a few months, and I'm the only person who knows the answer to your
question :(

It seems that something drifted with Event.makeProto(\voicerMIDI) and it's
no longer working. I don't have time today to debug it.

If you have installed ddwChucklib, you can use this instead:

v = Voicer(5, \default);
b = MIDIRecBuf(\test, [SequenceNote(60, 1, 1, 1)]);

p = Pbind(
\voicer, v,
\note, Pseq(b.notes),
\midi, true
).play(protoEvent: ProtoEvent(\voicerNote).copy);

I'll take a look at the other issue later. I think the solution will be to
remove the voicerMIDI parent event, and change the help file to refer to the
chucklib ProtoEvent. (Programmers will always tell you that having the same
functionality in multiple places becomes a maintenance problem. Here, one of
them is maintained and the other isn't.)

hjh



--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/VoicerMIDI-how-does-it-work-tp7612667p7613237.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/
rev
2014-09-14 15:22:44 UTC
Permalink
Having finally found time to try this, I can confirm that worked.
Thank You very much!



--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/VoicerMIDI-how-does-it-work-tp7612667p7613402.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/

Loading...