Csound Csound-dev Csound-tekno Search About

[Csnd] MIDI Output (outic / outkc) doesn't send everything

Date2024-10-13 11:40
FromPhilipp Neumann <0000119f78f3a4f9-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] MIDI Output (outic / outkc) doesn't send everything
Attachmentsdebug.pd  
hello everybody,

i’m on a journey for debugging a more complex MIDI Presets program and i’m getting closer to the problem.
`outic` and `outkc` is not sending every value how i expect. it’s only sending values that changed in some kind of way.

i wrote a little .csd for showing the problem and a PD patch for printing these values. i expect that 30 values are printed in pd, but only 14 are printed.

maybe it has something to do with the MIDI protocol?

i hope someone with more knowledge about the MIDI protocol can test this.

i’m on MaxcOS, sending MIDI ouput from Csound over IAC to PD receiving on IAC and printing there.



-d -odac
;;-+rtmidi=portmidi
-M0 -Q0


sr = 44100
ksmps = 16
nchnls = 2
0dbfs = 1.0


instr 1
  kp1 ctrlpreset 1, 1, 0,127, 1,0, 2,0, 3,0, 4,0, 5,0, 6,0, \
    7,0, 8,0, 9,0
  kp2 ctrlpreset 2, 1, 0,0, 1,127, 2,0, 3,0, 4,0, 5,0, 6,0, \
    7,0, 8,0, 9,0, 10,0
  kp3 ctrlpreset 3, 1, 0,0, 1,0, 2,0, 3,127, 4,0, 5,0, 6,0, \
    7,0, 8,0, 9,0

  ctrlselect p4

  k0 ctrl7 1, 0, 0, 127
  k1 ctrl7 1, 1, 0, 127
  k2 ctrl7 1, 2, 0, 127
  k3 ctrl7 1, 3, 0, 127
  k4 ctrl7 1, 4, 0, 127
  k5 ctrl7 1, 5, 0, 127
  k6 ctrl7 1, 6, 0, 127
  k7 ctrl7 1, 7, 0, 127
  k8 ctrl7 1, 8, 0, 127
  k9 ctrl7 1, 9, 0, 127
  
  outkc 1, 0, k0, 0, 127
  outkc 1, 1, k1, 0, 127
  outkc 1, 2, k2, 0, 127
  outkc 1, 3, k3, 0, 127
  outkc 1, 4, k4, 0, 127
  outkc 1, 5, k5, 0, 127
  outkc 1, 6, k6, 0, 127
  outkc 1, 7, k7, 0, 127
  outkc 1, 8, k8, 0, 127
  outkc 1, 9, k9, 0, 127

  turnoff
endin



i1 0 1 1
i1 + 1 2
i1 + 1 3




Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2024-10-13 13:23
Fromvlz
SubjectRe: [Csnd] MIDI Output (outic / outkc) doesn't send everything
From the manual on outkc

"k-rate opcodes send a message each time the MIDI converted value of argument kvalue changes."

Prof. Victor Lazzarini
Maynooth University
Ireland

On 13 Oct 2024, at 11:40, Philipp Neumann <0000119f78f3a4f9-dmarc-request@listserv.heanet.ie> wrote:

hello everybody,

i’m on a journey for debugging a more complex MIDI Presets program and i’m getting closer to the problem.
`outic` and `outkc` is not sending every value how i expect. it’s only sending values that changed in some kind of way.

i wrote a little .csd for showing the problem and a PD patch for printing these values. i expect that 30 values are printed in pd, but only 14 are printed.

maybe it has something to do with the MIDI protocol?

i hope someone with more knowledge about the MIDI protocol can test this.

i’m on MaxcOS, sending MIDI ouput from Csound over IAC to PD receiving on IAC and printing there.

<CsoundSynthesizer>
<CsOptions>
-d -odac
;;-+rtmidi=portmidi
-M0 -Q0
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 16
nchnls = 2
0dbfs = 1.0


instr 1
 kp1 ctrlpreset 1, 1, 0,127, 1,0, 2,0, 3,0, 4,0, 5,0, 6,0, \
   7,0, 8,0, 9,0
 kp2 ctrlpreset 2, 1, 0,0, 1,127, 2,0, 3,0, 4,0, 5,0, 6,0, \
   7,0, 8,0, 9,0, 10,0
 kp3 ctrlpreset 3, 1, 0,0, 1,0, 2,0, 3,127, 4,0, 5,0, 6,0, \
   7,0, 8,0, 9,0

 ctrlselect p4

 k0 ctrl7 1, 0, 0, 127
 k1 ctrl7 1, 1, 0, 127
 k2 ctrl7 1, 2, 0, 127
 k3 ctrl7 1, 3, 0, 127
 k4 ctrl7 1, 4, 0, 127
 k5 ctrl7 1, 5, 0, 127
 k6 ctrl7 1, 6, 0, 127
 k7 ctrl7 1, 7, 0, 127
 k8 ctrl7 1, 8, 0, 127
 k9 ctrl7 1, 9, 0, 127

 outkc 1, 0, k0, 0, 127
 outkc 1, 1, k1, 0, 127
 outkc 1, 2, k2, 0, 127
 outkc 1, 3, k3, 0, 127
 outkc 1, 4, k4, 0, 127
 outkc 1, 5, k5, 0, 127
 outkc 1, 6, k6, 0, 127
 outkc 1, 7, k7, 0, 127
 outkc 1, 8, k8, 0, 127
 outkc 1, 9, k9, 0, 127

 turnoff
endin

</CsInstruments>
<CsScore>
i1 0 1 1
i1 + 1 2
i1 + 1 3
</CsScore>
</CsoundSynthesizer>


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
<debug.pd>

Date2024-10-13 14:30
FromPhilipp Neumann <0000119f78f3a4f9-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] MIDI Output (outic / outkc) doesn't send everything
Ahhh, yes. The problem was that outic and outkc were not the right opcodes for my purpose.
i needed the midiout opcode…

this was quite a hustle.
now back to loving csound.

thanks all!

> Am 13.10.2024 um 14:23 schrieb vlz :
> 
> From the manual on outkc
> 
> "k-rate opcodes send a message each time the MIDI converted value of argument kvalue changes."
> 
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 13 Oct 2024, at 11:40, Philipp Neumann <0000119f78f3a4f9-dmarc-request@listserv.heanet.ie> wrote:
>> 
>> hello everybody,
>> 
>> i’m on a journey for debugging a more complex MIDI Presets program and i’m getting closer to the problem.
>> `outic` and `outkc` is not sending every value how i expect. it’s only sending values that changed in some kind of way.
>> 
>> i wrote a little .csd for showing the problem and a PD patch for printing these values. i expect that 30 values are printed in pd, but only 14 are printed.
>> 
>> maybe it has something to do with the MIDI protocol?
>> 
>> i hope someone with more knowledge about the MIDI protocol can test this.
>> 
>> i’m on MaxcOS, sending MIDI ouput from Csound over IAC to PD receiving on IAC and printing there.
>> 
>> 
>> 
>> -d -odac
>> ;;-+rtmidi=portmidi
>> -M0 -Q0
>> 
>> 
>> sr = 44100
>> ksmps = 16
>> nchnls = 2
>> 0dbfs = 1.0
>> 
>> 
>> instr 1
>>  kp1 ctrlpreset 1, 1, 0,127, 1,0, 2,0, 3,0, 4,0, 5,0, 6,0, \
>>    7,0, 8,0, 9,0
>>  kp2 ctrlpreset 2, 1, 0,0, 1,127, 2,0, 3,0, 4,0, 5,0, 6,0, \
>>    7,0, 8,0, 9,0, 10,0
>>  kp3 ctrlpreset 3, 1, 0,0, 1,0, 2,0, 3,127, 4,0, 5,0, 6,0, \
>>    7,0, 8,0, 9,0
>> 
>>  ctrlselect p4
>> 
>>  k0 ctrl7 1, 0, 0, 127
>>  k1 ctrl7 1, 1, 0, 127
>>  k2 ctrl7 1, 2, 0, 127
>>  k3 ctrl7 1, 3, 0, 127
>>  k4 ctrl7 1, 4, 0, 127
>>  k5 ctrl7 1, 5, 0, 127
>>  k6 ctrl7 1, 6, 0, 127
>>  k7 ctrl7 1, 7, 0, 127
>>  k8 ctrl7 1, 8, 0, 127
>>  k9 ctrl7 1, 9, 0, 127
>> 
>>  outkc 1, 0, k0, 0, 127
>>  outkc 1, 1, k1, 0, 127
>>  outkc 1, 2, k2, 0, 127
>>  outkc 1, 3, k3, 0, 127
>>  outkc 1, 4, k4, 0, 127
>>  outkc 1, 5, k5, 0, 127
>>  outkc 1, 6, k6, 0, 127
>>  outkc 1, 7, k7, 0, 127
>>  outkc 1, 8, k8, 0, 127
>>  outkc 1, 9, k9, 0, 127
>> 
>>  turnoff
>> endin
>> 
>> 
>> 
>> i1 0 1 1
>> i1 + 1 2
>> i1 + 1 3
>> 
>> 
>> 
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> 
> 
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here