Csound Csound-dev Csound-tekno Search About

[Csnd] midiout in csound vs CsoundQT

Date2025-04-18 16:06
FromMaximilian Marcoll
Subject[Csnd] midiout in csound vs CsoundQT
Attachmentssmime.p7s  
Hi everyone!

I’m encountering a rather bizarre behaviour, where there is the expected midi output if I run a .csd from CsoundQT, but there is something else happening when I run from the terminal (on a mac).

I am sending PitchBend messages and in CsoundQT everything works fine.

If I run csound from the terminal, however, there is only two PB-Messages being sent, one at the very start and one at the very end. The last one being 8192 (the “0”), regardless of what the last message I am trying to send actually is. 

Both from the terminal and inside CsoundQT I’m running version 6.18.
In both cases the midi output connection (portmidi device) is the same, no additional midi options have been activated in CsoundQT.

If I use the “Run in Terminal” option in CsoundQT, I get the same faulty behaviour I am experiencing by directly running the patch in the terminal manually.

Can anybody guide me into the right direction?

Cheers

Max

<CsoundSynthesizer>

<CsOptions>

-+rtmidi=portmidi
-Ma
-Q2 ; MIDI OUT Device
-odac

</CsOptions>


<CsInstruments>


instr 1
kpi =int:k(line(7192, p3, 9192))
kch changed kpi

schedkwhen kch, 0, 0, "PBSend", 0, .01, kpi
endin

instr PBSend 
imsb = int(p4/128)
ilsb = int(p4%128)
print ilsb
print imsb
midiout 224, 1, ilsb, imsb
turnoff
endin

</CsInstruments>
<CsScore>


i1 0 10

</CsScore>

</CsoundSynthesizer>



________________________________

Prof. Maximilian Marcoll
Studio Director
Studio for Electroacoustic Music (SEAM)
University of Music Franz Liszt Weimar
Bauhaus University Weimar













Date2025-04-18 16:52
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] midiout in csound vs CsoundQT
yes, I can confirm csound 6 cli frontend here is also not sending the pitchbend messages, but CsoundQT works (both with portmidi and with internal midi). 

For what’s worth Csound 7 (command-line) works perfectly. 
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 18 Apr 2025, at 16:06, Maximilian Marcoll  wrote:
> 
> Hi everyone!
> 
> I’m encountering a rather bizarre behaviour, where there is the expected midi output if I run a .csd from CsoundQT, but there is something else happening when I run from the terminal (on a mac).
> 
> I am sending PitchBend messages and in CsoundQT everything works fine.
> 
> If I run csound from the terminal, however, there is only two PB-Messages being sent, one at the very start and one at the very end. The last one being 8192 (the “0”), regardless of what the last message I am trying to send actually is. 
> 
> Both from the terminal and inside CsoundQT I’m running version 6.18.
> In both cases the midi output connection (portmidi device) is the same, no additional midi options have been activated in CsoundQT.
> 
> If I use the “Run in Terminal” option in CsoundQT, I get the same faulty behaviour I am experiencing by directly running the patch in the terminal manually.
> 
> Can anybody guide me into the right direction?
> 
> Cheers
> 
> Max
> 
> 
> 
> 
> 
> -+rtmidi=portmidi
> -Ma
> -Q2 ; MIDI OUT Device
> -odac
> 
> 
> 
> 
> 
> 
> 
> instr 1
> kpi =int:k(line(7192, p3, 9192))
> kch changed kpi
> 
> schedkwhen kch, 0, 0, "PBSend", 0, .01, kpi
> endin
> 
> instr PBSend 
> imsb = int(p4/128)
> ilsb = int(p4%128)
> print ilsb print imsb midiout 224, 1, ilsb, imsb
> turnoff
> endin
> 
> 
> 
> 
> 
> i1 0 10
> 
> 
> 
> 
> 
> 
> 
> ________________________________
> 
> Prof. Maximilian Marcoll
> Studio Director
> Studio for Electroacoustic Music (SEAM)
> University of Music Franz Liszt Weimar
> Bauhaus University Weimar
> 
> http://seam.hfm-weimar.de/
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 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

Date2025-04-18 17:13
FromMaximilian Marcoll
SubjectRe: [Csnd] [EXTERNAL] [Csnd] midiout in csound vs CsoundQT
Attachmentssmime.p7s  
Thanks a lot!!!

________________________________

Prof. Maximilian Marcoll
Studio Director
Studio for Electroacoustic Music (SEAM)
University of Music Franz Liszt Weimar
Bauhaus University Weimar












On 18. Apr 2025, at 17:52, Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:

yes, I can confirm csound 6 cli frontend here is also not sending the pitchbend messages, but CsoundQT works (both with portmidi and with internal midi).

For what’s worth Csound 7 (command-line) works perfectly.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

On 18 Apr 2025, at 16:06, Maximilian Marcoll <maximilian.marcoll@HFM-WEIMAR.DE> wrote:

Hi everyone!

I’m encountering a rather bizarre behaviour, where there is the expected midi output if I run a .csd from CsoundQT, but there is something else happening when I run from the terminal (on a mac).

I am sending PitchBend messages and in CsoundQT everything works fine.

If I run csound from the terminal, however, there is only two PB-Messages being sent, one at the very start and one at the very end. The last one being 8192 (the “0”), regardless of what the last message I am trying to send actually is.

Both from the terminal and inside CsoundQT I’m running version 6.18.
In both cases the midi output connection (portmidi device) is the same, no additional midi options have been activated in CsoundQT.

If I use the “Run in Terminal” option in CsoundQT, I get the same faulty behaviour I am experiencing by directly running the patch in the terminal manually.

Can anybody guide me into the right direction?

Cheers

Max

<CsoundSynthesizer>

<CsOptions>

-+rtmidi=portmidi
-Ma
-Q2 ; MIDI OUT Device
-odac

</CsOptions>


<CsInstruments>


instr 1
kpi =int:k(line(7192, p3, 9192))
kch changed kpi

schedkwhen kch, 0, 0, "PBSend", 0, .01, kpi
endin

instr PBSend
imsb = int(p4/128)
ilsb = int(p4%128)
print ilsb print imsb midiout 224, 1, ilsb, imsb
turnoff
endin

</CsInstruments>
<CsScore>


i1 0 10

</CsScore>

</CsoundSynthesizer>



________________________________

Prof. Maximilian Marcoll
Studio Director
Studio for Electroacoustic Music (SEAM)
University of Music Franz Liszt Weimar
Bauhaus University Weimar

http://seam.hfm-weimar.de/











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