# Write MIDI file

**URL:** <https://discourse.processing.org/t/write-midi-file/25225>\
**Category:** Libraries\
**Created:** [November 5, 2020, 11:04pm UTC](https://discourse.processing.org/t/write-midi-file/25225 "2020-11-05T23:04:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prokophapala](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@prokophapala](https://discourse.processing.org/u/prokophapala)\
**Post date:** [November 5, 2020, 11:04pm UTC](https://discourse.processing.org/t/write-midi-file/25225/1 "2020-11-05T23:04:42Z")

</div>

inside Minim library I found nice example of reading and playing MIDI file.  
I was thinking to make some algoritmic MIDI generator. But I cannot find any functioonality or example how to write MIDI file using Minim or other processing library.

There I found some library called SoundCipher from processing 1.0, which is veryold and I guess not working any more.

> **[SoundCipher - Music and Sound in Processing - Download](http://explodingart.com/soundcipher/download.html)**

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [November 6, 2020, 8:30pm UTC](https://discourse.processing.org/t/write-midi-file/25225/2 "2020-11-06T20:30:08Z")

</div>

Have you seen [this](https://github.com/sparks/themidibus) one?

---

<div class="post-metadata">

**Author:** ![prokophapala](https://avatars.discourse-cdn.com/v4/letter/p/f9ae1b/32.png) [@prokophapala](https://discourse.processing.org/u/prokophapala)\
**Post date:** [November 6, 2020, 9:13pm UTC](https://discourse.processing.org/t/write-midi-file/25225/3 "2020-11-06T21:13:27Z")

</div>

Aha, I overlooked it.  
It seems to be dedicated to communication with external MIDI hardware (like keyborad) which is not what I need. Nevertheless, they say it can also read/write MIDI files, but I don’t see example how to do it.

In the meantime I found [this example](http://www.automatic-pilot.com/midifile.html) how to write MIDI directly using `javax.sound.midi.*`which seems rather clear. Also they say _" MidiBus offers little functionality that isn’t available from Java’s native [javax.sound.midi package](http://docs.oracle.com/javase/6/docs/api/javax/sound/midi/package-summary.html)."_, so perhaps I stick to `javax.sound.midi.*`
