Csound Csound-dev Csound-tekno Search About

[Csnd] midion2 and midiout

Date2010-07-01 15:13
Frommenno
Subject[Csnd] midion2 and midiout
Hi,

i,m looking at these examples and perhaps there is something not right with
these opcodes. I use it with an external GM synth.
What happens is that the notes hang, there are no noteoffs send.
Can someone try these out please?

Menno

;MIDION2.CSD


; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac           -iadc   -d -M0 ;;;RT audio I/O



; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

; Instrument #1.
instr 1
  ; Use a square-wave low frequency oscillator as the trigger.
  klf lfo 1, 2, 3
  ktr trigger klf, .5, 1

  ; When the value of the trigger isn't equal to 0, print it out.
  if (ktr == 0) kgoto contin
    ; Print the value of the trigger and the time it occurred.
    ktm times
    printks "time = %f seconds, trigger = %f\\n", 0, ktm, ktr
midion2	1, 60, 100, ktr
contin:
midion 1, 50, 80
midion 1, 53, 80
midion 1, 55, 80
endin





; Play Instrument #1 for one second.
i 1 0 2
e





and the other one is:

;MIDIOUT.CSD


; Select audio/midi flags here according to platform
; Audio out   Audio in
-odac           -iadc   -d -M0 ;;;RT audio I/O



; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

; Instrument #1.
instr 1
;accord
midion 1, 50, 80
midion 1, 53, 80
midion 1, 55, 80

kdata2	line 0, p3, 127
midiout	224, 1, 0, kdata2		; pitchbend
endin





; Play Instrument #1 for one second.
i 1 0 2
i 1 + 2
e





Date2010-07-04 08:53
Frommenno
Subject[Csnd] Re: midion2 and midiout
Because nobody at the moment seems to be in the position to verify the
problem of these opcodes i filed them as a bug, so that it won't be lost and
forgotten.

bye,
Menno
 

menno wrote:
> 
> Hi,
> 
> i,m looking at these examples and perhaps there is something not right
> with these opcodes. I use it with an external GM synth.
> What happens is that the notes hang, there are no noteoffs send.
> Can someone try these out please?
> 
> Menno
> 
> ;MIDION2.CSD
> 
> 
> ; Select audio/midi flags here according to platform
> ; Audio out   Audio in
> -odac           -iadc   -d -M0 ;;;RT audio I/O
> 
> 
> 
> ; Initialize the global variables.
> sr = 44100
> kr = 4410
> ksmps = 10
> nchnls = 1
> 
> ; Instrument #1.
> instr 1
>   ; Use a square-wave low frequency oscillator as the trigger.
>   klf lfo 1, 2, 3
>   ktr trigger klf, .5, 1
> 
>   ; When the value of the trigger isn't equal to 0, print it out.
>   if (ktr == 0) kgoto contin
>     ; Print the value of the trigger and the time it occurred.
>     ktm times
>     printks "time = %f seconds, trigger = %f\\n", 0, ktm, ktr
> midion2	1, 60, 100, ktr
> contin:
> midion 1, 50, 80
> midion 1, 53, 80
> midion 1, 55, 80
> endin
> 
> 
> 
> 
> 
> ; Play Instrument #1 for one second.
> i 1 0 2
> e
> 
> 
> 
> 
> 
> and the other one is:
> 
> ;MIDIOUT.CSD
> 
> 
> ; Select audio/midi flags here according to platform
> ; Audio out   Audio in
> -odac           -iadc   -d -M0 ;;;RT audio I/O
> 
> 
> 
> ; Initialize the global variables.
> sr = 44100
> kr = 4410
> ksmps = 10
> nchnls = 1
> 
> ; Instrument #1.
> instr 1
> ;accord
> midion 1, 50, 80
> midion 1, 53, 80
> midion 1, 55, 80
> 
> kdata2	line 0, p3, 127
> midiout	224, 1, 0, kdata2		; pitchbend
> endin
> 
> 
> 
> 
> 
> ; Play Instrument #1 for one second.
> i 1 0 2
> i 1 + 2
> e
> 
> 
> 
> 
> 
> 
>