Csound Csound-dev Csound-tekno Search About

[Csnd] MIDI Inputs for two different instruments

Date2013-05-30 15:58
FromRodolfo Cangiotti
Subject[Csnd] MIDI Inputs for two different instruments
Hello all,
I'm trying to compile a Csound project to send a MIDI Note value to two
different instruments (instr 1, 2) at the same time, in this case two simple
oscillators.

I tried first using "notnum" with "cpsmidinn" in one of the two instruments
with a global output argument; I set a dummy function as "f 0 3600" in Score
to perform in real time. In this case only the first instrument works:

[...]
instr 1
ikey /notnum/	/* Input MIDI Keyboard */
ivel /veloc/
[...]
gkcps = /cpsmidinn/ (ikey)
[...]
instr 2
[...]

f 0 3600


Then I tried to move these opcodes to a third instrument, moving this one
before the previous two instruments containing the oscillators (instr 1,
then 2, 3) and still using a global output argument. In this case it works
only if I set two i- statements for instr 2 and 3 but the MIDI Note keep
playing even when no key is pressed:

[...]
instr 1
ikey /notnum/	/* Input MIDI Keyboard */
ivel /veloc/
gkcps = /cpsmidinn/ (ikey)
[...]
instr 2
[...]
instr 3
[...]

f 0 3600
i 2 0 3600
i 3 0 3600


Anyway, I know that almost certainly I can go round the matter setting all
of the oscillators in the same instrument, but, if it's possible, I'd like
to keep them in different instruments.
So, how can I solve this?
Thanks ahead.



--
View this message in context: http://csound.1045644.n5.nabble.com/MIDI-Inputs-for-two-different-instruments-tp5724048.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-05-30 16:14
FromJustin Smith
SubjectRe: [Csnd] MIDI Inputs for two different instruments
if you want instruments 2 and 3 to stop when instrument 1 exits, you can use scoreline to trigger instrument -2 and -3 when the release opcode is triggered

krel release

scoreline {{
                i -2 0 0
                i -3 0 0
              }}, krel

if you need polyphony you can use fractional instruments with the note numbers


On Thu, May 30, 2013 at 7:58 AM, Rodolfo Cangiotti <cangio.ps@hotmail.it> wrote:
Hello all,
I'm trying to compile a Csound project to send a MIDI Note value to two
different instruments (instr 1, 2) at the same time, in this case two simple
oscillators.

I tried first using "notnum" with "cpsmidinn" in one of the two instruments
with a global output argument; I set a dummy function as "f 0 3600" in Score
to perform in real time. In this case only the first instrument works:

[...]
instr 1
ikey /notnum/   /* Input MIDI Keyboard */
ivel /veloc/
[...]
gkcps = /cpsmidinn/ (ikey)
[...]
instr 2
[...]
<CsScore>
f 0 3600
</CsScore>

Then I tried to move these opcodes to a third instrument, moving this one
before the previous two instruments containing the oscillators (instr 1,
then 2, 3) and still using a global output argument. In this case it works
only if I set two i- statements for instr 2 and 3 but the MIDI Note keep
playing even when no key is pressed:

[...]
instr 1
ikey /notnum/   /* Input MIDI Keyboard */
ivel /veloc/
gkcps = /cpsmidinn/ (ikey)
[...]
instr 2
[...]
instr 3
[...]
<CsScore>
f 0 3600
i 2 0 3600
i 3 0 3600
</CsScore>

Anyway, I know that almost certainly I can go round the matter setting all
of the oscillators in the same instrument, but, if it's possible, I'd like
to keep them in different instruments.
So, how can I solve this?
Thanks ahead.



--
View this message in context: http://csound.1045644.n5.nabble.com/MIDI-Inputs-for-two-different-instruments-tp5724048.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2013-05-30 16:25
FromRory Walsh
SubjectRe: [Csnd] MIDI Inputs for two different instruments
I agree, if you are only using MIDI to trigger other instruments it
would be far easier to use one MIDI listener instrument, and simply
spawn events from that. If on the other hand you want to use the MIDI
data to control other MIDI software, you'll need to look at the -Q
command line flag for MIDI output.

On 30 May 2013 16:14, Justin Smith  wrote:
> if you want instruments 2 and 3 to stop when instrument 1 exits, you can use
> scoreline to trigger instrument -2 and -3 when the release opcode is
> triggered
>
> krel release
>
> scoreline {{
>                 i -2 0 0
>                 i -3 0 0
>               }}, krel
>
> if you need polyphony you can use fractional instruments with the note
> numbers
>
>
> On Thu, May 30, 2013 at 7:58 AM, Rodolfo Cangiotti 
> wrote:
>>
>> Hello all,
>> I'm trying to compile a Csound project to send a MIDI Note value to two
>> different instruments (instr 1, 2) at the same time, in this case two
>> simple
>> oscillators.
>>
>> I tried first using "notnum" with "cpsmidinn" in one of the two
>> instruments
>> with a global output argument; I set a dummy function as "f 0 3600" in
>> Score
>> to perform in real time. In this case only the first instrument works:
>>
>> [...]
>> instr 1
>> ikey /notnum/   /* Input MIDI Keyboard */
>> ivel /veloc/
>> [...]
>> gkcps = /cpsmidinn/ (ikey)
>> [...]
>> instr 2
>> [...]
>> 
>> f 0 3600
>> 
>>
>> Then I tried to move these opcodes to a third instrument, moving this one
>> before the previous two instruments containing the oscillators (instr 1,
>> then 2, 3) and still using a global output argument. In this case it works
>> only if I set two i- statements for instr 2 and 3 but the MIDI Note keep
>> playing even when no key is pressed:
>>
>> [...]
>> instr 1
>> ikey /notnum/   /* Input MIDI Keyboard */
>> ivel /veloc/
>> gkcps = /cpsmidinn/ (ikey)
>> [...]
>> instr 2
>> [...]
>> instr 3
>> [...]
>> 
>> f 0 3600
>> i 2 0 3600
>> i 3 0 3600
>> 
>>
>> Anyway, I know that almost certainly I can go round the matter setting all
>> of the oscillators in the same instrument, but, if it's possible, I'd like
>> to keep them in different instruments.
>> So, how can I solve this?
>> Thanks ahead.
>>
>>
>>
>> --
>> View this message in context:
>> http://csound.1045644.n5.nabble.com/MIDI-Inputs-for-two-different-instruments-tp5724048.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>