Csound Csound-dev Csound-tekno Search About

[Csnd] midi question

Date2012-12-15 16:01
Frompeiman khosravi
Subject[Csnd] midi question
Being a complete midi newbie I cannot figure out how to get Csound to create several parts in the same midi file. The CSD below doesn't seem to work. 

Best,
Peiman   

<CsoundSynthesizer>

<CsOptions>
; amend device number accordingly
-odac --midioutfile=/Users/peimankhosravi/Desktop/FILENAME.mid
</CsOptions>

<CsInstruments>


sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1

midiout 192, 1, p6, 0 ;program change to instr. 21
inum = p4
ivel = p5
midion 1, inum, ivel

endin

</CsInstruments>
<CsScore>

i 1 0 3  80 100 0 ;play note for 3 seconds
i 1 0 3  85 100 21 ;play note for 3 seconds

e
</CsScore>
</CsoundSynthesizer>

Date2012-12-15 19:41
FromOeyvind Brandtsegg
SubjectRe: [Csnd] midi question
Hi Peiman,
 do you mean generate notes on several different channels perhaps?
You could try putting the program change statements in a separate instrument and then use channel assignment in midion to generate events on separate channels.

instr 1
midiout 192, 1, 1, 0 ;program change to instr.1, ch 1
midiout 192, 2, 21, 0 ;program change to instr. 21, ch 2
endin

instr 2
inum = p4
ivel = p5
ichn = p6
midion ichn, inum, ivel
endin

(not tested)

Oeyvind



2012/12/15 peiman khosravi <peimankhosravi@gmail.com>
Being a complete midi newbie I cannot figure out how to get Csound to create several parts in the same midi file. The CSD below doesn't seem to work. 

Best,
Peiman   

<CsoundSynthesizer>

<CsOptions>
; amend device number accordingly
-odac --midioutfile=/Users/peimankhosravi/Desktop/FILENAME.mid
</CsOptions>

<CsInstruments>


sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1

midiout 192, 1, p6, 0 ;program change to instr. 21
inum = p4
ivel = p5
midion 1, inum, ivel

endin

</CsInstruments>
<CsScore>

i 1 0 3  80 100 0 ;play note for 3 seconds
i 1 0 3  85 100 21 ;play note for 3 seconds

e
</CsScore>
</CsoundSynthesizer>



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp

Date2012-12-16 00:48
Frompeiman khosravi
SubjectRe: [Csnd] midi question
Thanks Oeyvind,

Probably yes! I have an inbuilt fear of midi! 

Let me give it a try. 

Best,
Peiman

On 15 December 2012 19:41, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
Hi Peiman,
 do you mean generate notes on several different channels perhaps?
You could try putting the program change statements in a separate instrument and then use channel assignment in midion to generate events on separate channels.

instr 1
midiout 192, 1, 1, 0 ;program change to instr.1, ch 1
midiout 192, 2, 21, 0 ;program change to instr. 21, ch 2
endin

instr 2
inum = p4
ivel = p5
ichn = p6
midion ichn, inum, ivel
endin

(not tested)

Oeyvind



2012/12/15 peiman khosravi <peimankhosravi@gmail.com>
Being a complete midi newbie I cannot figure out how to get Csound to create several parts in the same midi file. The CSD below doesn't seem to work. 

Best,
Peiman   

<CsoundSynthesizer>

<CsOptions>
; amend device number accordingly
-odac --midioutfile=/Users/peimankhosravi/Desktop/FILENAME.mid
</CsOptions>

<CsInstruments>


sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

instr 1

midiout 192, 1, p6, 0 ;program change to instr. 21
inum = p4
ivel = p5
midion 1, inum, ivel

endin

</CsInstruments>
<CsScore>

i 1 0 3  80 100 0 ;play note for 3 seconds
i 1 0 3  85 100 21 ;play note for 3 seconds

e
</CsScore>
</CsoundSynthesizer>



--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp