[Csnd] Problem writing a MIDI file

Using the following CsOptions:

-odac -Q1 --midioutfile=Carillon8MIDI4.mid

and using either of the following lines to create MIDI output:
noteon 1, 63, 100
midion 1, 63, 100

a “Carillon8MIDI4.mid” is created in my home directory, but it is empty (byte count = 0).

Meanwhile, the MIDI notes are playing fine on my output synth, command line shows no errors nor warnings, and realtime events are indicated on the console as notes are playing.

What am I missing?

I’m running (latest) Windows Csound 6 from a USB stick with a skeletal Csound installation; I could be missing a necessary .dll, though I have pmidi, rtpa, portaudio and portmidi in my home directory.

In short: all signs seem to be “mission going smoothly” - yet there are no results.

Art H.

Csound mailing list Send bugs reports to Discussions of bugs and features can be posted here

Thanks for the help with this issue, Victor. Your example worked fine on my system, so I had to dig deeper into my .csd.

Finally discovered the problem: my audio output was:
“I1 0 z” . (I think “z” won’t work for you either.) Indeed if you end a Csound run with CTRL-C, it will write an empty MIDI file. You need to put in a numerical value.

Csound mailing list Send bugs reports to Discussions of bugs and features can be posted here

Maybe it’s a Windows issue. I can close Csound with ctrl-c and a MIDI file is written properly on the Mac.

Is that with using “z”?

Or do you use a long duration (via “i” or “f”) then interrupt with CTRL-C?

Or does CTRL-C give a MIDI file regardless?

Art H.
Csound mailing list Send bugs reports to Discussions of bugs and features can be posted here

Could any other Windows Csound user comment on my issue - i.e., with both MIDI in and MIDI out, simultaneously trying to write a MIDI file (.mid)?

Is this just a Windows issue (or something having to do with my system setup)?

Both MIDI in and MIDI out work fine - just no MIDI file data is captured at the same time. Capture is fine with either -M or -Q, but not both - or so it seems.

Art H.
Csound mailing list Send bugs reports to Discussions of bugs and features can be posted here

FWIW:
ChatGPT confirms that, on Windows only, Csound will not write a MIDI file (.mid) out if it is “ended” (interrupted) by CTRL-C. (Windows needs a “regular” (clean) ending.)

Victor is correct when he suggests that “this could be a Windows thing.”

Perhaps the Csound manuals could reference this fact when documenting MIDI file output.

I’ve found ChatGPT to have significant knowledge of Csound, though it is hardly inerrant. (Or perhaps it is largely a matter of our not understanding each other!)
Csound mailing list Send bugs reports to Discussions of bugs and features can be posted here

Wouldn’t ChatGPT be just repeating what we said here?

Prof. Victor Lazzarini
Maynooth University
Ireland