| Hello,
Question 1: I don't understand why you would use two different instruments to
do basically the same thing on the same instrument... could you please explain,
I'm curious...
Question 2: I suppose it depends of what values are received with kp3 and
kp4, maybe working with negative p3 (for indefinite duration - noteon) and
negative p1 (to turn off the instrument - noteoff) can work.
Bye
Stefano
>----Messaggio originale----
>Da: atte.jensen@gmail.com
>Data: 17/06/2009 0.37
>A: "Csound mailing list address"
>Ogg: [Csnd] triggering instruments from OSC
>
>Hi
>
>I'm just getting started with OSC, so forgive me if I ask something
obvious.
>
>I'm trying to trigger csound instruments from another application via
>OSC. I'd like to have the osc -> instrument triggering only going on at
>one place to make things cleaner. At the moment I have something like
>(which seems to work just great):
>
>--- begin csound code ---
> instr osc_listen_0
>kp3 init 0
>Sinstr = ""
> nxtmsg:
>kk OSClisten gihandle, "/csound/instr", "sf", Sinstr, kp3
>if (kk == 0) goto ex
> event "i", Sinstr, 0, kp3
> kgoto nxtmsg
>ex:
> endin
>
> instr osc_listen_1
>kp3 init 0
>kp4 init 0
>Sinstr = ""
> nxtmsg:
>kk OSClisten gihandle, "/csound/instr", "sff", Sinstr, kp3, kp4
>if (kk == 0) goto ex
> event "i", Sinstr, 0, kp3, kp4
> kgoto nxtmsg
>ex:
> endin
>--- end csound code ---
>
>So basically I have one instrument that listens for OSC events that
>contains only p3, one that has p3 and p4, and would also have others to
>handle any number of p-fields. I don't expect to be needing much more
>than a handful of these instruments (up to, say, p6), but still:
>
>Question #1:
>Is there a better way, for instance with everything done in one instrument?
>
>Question #2:
>Actually I would rather not have to worry about the p3, but instead have
>things working more in a MIDI fashion, with matching noteon/noteoff. Or
>even better; be able to use both p3 for duration and noteon/noteoff with
>the same instruments (and even be able to trigger them via MIDI from a
>keyboard). Is this possible and if so where do I have to look for
>examples and/or opcodes that does this?
>
>Also any general thoughts or experiences with this kind of approach are
>most welcome!
>
>--
>Atte
>
>http://atte.dk http://modlys.dk http://virb.com/atte
>
>
>Send bugs reports to this list.
>To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
csound"
>
|