# Recording midi event to file from csound

**URL:** <https://forum.cabbageaudio.com/t/recording-midi-event-to-file-from-csound/733>\
**Category:** Csound Noobs\
**Created:** [28 September 2017 16:45 UTC](https://forum.cabbageaudio.com/t/recording-midi-event-to-file-from-csound/733 "2017-09-28T16:45:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karamel1](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/karamel1/32/1680_2.png) [@Karamel1](https://forum.cabbageaudio.com/u/Karamel1)\
**Post date:** [28 September 2017 16:45 UTC](https://forum.cabbageaudio.com/t/recording-midi-event-to-file-from-csound/733/1 "2017-09-28T16:45:23Z")

</div>

Hello,  
Could anyone show me how to record all incoming midi events to cabbage patch into a midi file (.mid)\>

I wish to make a simple instrument with one button allowing to record the messages that are send to my synth .  
ie. in the cabbage patcher Cabbage -\> MidiREcorder -\> Synt h-\>Audio output

I tried the FLOSS manual example without success. I suspect that it is related to the fact that cabbage has its own midi management.  
Many thanks.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [28 September 2017 19:54 UTC](https://forum.cabbageaudio.com/t/recording-midi-event-to-file-from-csound/733/2 "2017-09-28T19:54:16Z")

</div>

I’ve never written any MIDI files with Csound but I don’t see why it shouldn’t work. MIDI is clearly getting to the instrument. And I know MIDI output works because many instruments use it. Does it at least create a MIDI file when you use the MIDI file output command line flags?

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [29 September 2017 09:03 UTC](https://forum.cabbageaudio.com/t/recording-midi-event-to-file-from-csound/733/3 "2017-09-29T09:03:27Z")

</div>

I just tried this here and I couldn’t get Csound to create a simple MIDI file for me. I’m not sure if why it doesn’t work. A work around would be to store the MIDI notes as text values, but it’s a bit of work.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [29 September 2017 09:30 UTC](https://forum.cabbageaudio.com/t/recording-midi-event-to-file-from-csound/733/4 "2017-09-29T09:30:43Z")

</div>

I managed to get a MIDI file created, although there are errors with it, but at least it’s progress. Try the following file. It generate MIDI output, and tries to write it to a file as the same time.

[deleteable.csd](https://forum.cabbageaudio.com/uploads/default/original/1X/a23fa4758a01d7ca33b4fe8782b48f40afd244e4.csd) (485 Bytes)
