Csound Csound-dev Csound-tekno Search About

[Csnd] multiple instruments with one midi file

Date2007-11-01 17:59
FromRory Walsh
Subject[Csnd] multiple instruments with one midi file
I'm trying to play two instruments with data from one midi file but I 
can't manage it. Should the following csd not do the trick or am I just 
having a bad day??



-odevaudio -F bach.mid  -m0d


sr = 44100
kr = 44100
ksmps = 1
nchnls = 1

instr 1
         kcps init 0
         kvelocity init 0
         midinoteoncps kcps, kvelocity
         a1 oscili 1000, kcps, 1
         out a1
endin

instr 2
         kcps init 0
         kvelocity init 0
         midinoteoncps kcps, kvelocity
         a1 oscili 1000, kcps*2, 1
         out a1
endin




f1 0 1024 10 1
i1 0 100
i2 0 100



Date2007-11-02 09:51
From"Chuckk Hubbard"
Subject[Csnd] Re: multiple instruments with one midi file
AttachmentsNone  None  

Date2007-11-02 10:04
FromRory Walsh
Subject[Csnd] Re: Re: multiple instruments with one midi file
I do have an instrument lying around somewhere that uses the event 
opcodes to trigger other instruments but it seems like a hack. I was 
hoping there would be an easier way. I also thought it might be posible 
with massign somehow? Thanks for the reply.

Rory.


Chuckk Hubbard wrote:
> There are plenty here who know more than I do, but here's my understanding:
> the doc says that, for file-driven performance, the instrument defaults 
> to MIDI channel + 1.  Obviously there is no MIDI channel 0, so instr 1 
> is only being triggered by the score, not the MIDI file.  Maybe you need 
> to have instr 2 call instr 18 and 19, if you want MIDI channel 1 to 
> trigger two instruments?
> 
> -Chuckk
> 
> On 11/1/07, *Rory Walsh* > wrote:
> 
>     I'm trying to play two instruments with data from one midi file but I
>     can't manage it. Should the following csd not do the trick or am I just
>     having a bad day??
> 
>     
>     
>     -odevaudio -F bach.mid  -m0d
>     
>     
>     sr = 44100
>     kr = 44100
>     ksmps = 1
>     nchnls = 1
> 
>     instr 1
>              kcps init 0
>              kvelocity init 0
>              midinoteoncps kcps, kvelocity
>              a1 oscili 1000, kcps, 1
>              out a1
>     endin
> 
>     instr 2
>              kcps init 0
>              kvelocity init 0
>              midinoteoncps kcps, kvelocity
>              a1 oscili 1000, kcps*2, 1
>              out a1
>     endin
> 
> 
>     
>     
>     f1 0 1024 10 1
>     i1 0 100
>     i2 0 100
>     
>     
> 
> 
> 
> 
> -- 
> http://www.badmuthahubbard.com