wyskoj / midis2jam2

🎶 A remaster of MIDIJam, a 3D MIDI file visualizer.
https://midis2jam2.xyz
GNU General Public License v3.0
165 stars 21 forks source link

Add a feature to modify program events of a MIDI file #146

Closed ghost closed 2 years ago

ghost commented 2 years ago

My issue

I loved the first version of Midijam, thanks for remastering it >:] But I have a problem…

I'm always frustrated when I use a generic DAW to edit midis and create nice woodman themes. DAWs often have very limited support for Midi, and the software I use (LMMS) just create a midi file with only one program (program 0 from bank 0) for each track. I see nowhere on the web, a software to just swap instruments except MidiEditor which only support programs from bank 0. So I'm doomed to never see my nice midi woodman remixes with the drum set from bank 128.

Feature request

My solution is to include a setting to change every track and/or channels from a midi file before playing it and add an option to save it. Almost like MidiEditor, we can change the program but also change the bank, so we have drum sets and other programs that don't fit in the first 128 from the first bank. image

Comparison with other midi programs

For preview. On LMMS with the soundfont VST, it's possible to choose the bank and the program. Since it's not real midi, it's just a VST for soundfonts. I emulated it by downloading the default GS Wavetable Soundfont. You can see that even a VST have a good support to select every bank and every program from a soundfont. image

On MidiEditor, it's only possible to select programs from 0 and 127 on bank 0. Shown only with the instrument name. It's not possible to select the programs from other banks, and when I import a Midi containing programs from other banks, previewing the song will play the programs correctly and the only issue is “Acoustic Grand Piano” showing. image image

What I tried

I also tried to edit the midis events myself by modifying the file directly with a Python library (I failed because I don't have enough knowledge about the midi format). I tried MidiEditor, but I stopped because of the issue stated earlier.

This feature would make my life simpler, especially when dealing with MidiFiles that have been created with generic DAWs. It will also be a great feature for everyone to mess with midifiles and look at how they look and hears with swapped instruments. Thanks for reading it.

wyskoj commented 2 years ago

From what I understand, your issue is that you aren't able to change the program bank for MIDI files. This sounds more like an issue with MidiEditor instead of midis2jam2. Also, midis2jam2 doesn't animate banks any differently—it treats all program events like bank 0, so there would be no visual distinction.

ghost commented 2 years ago

How did animated the drum sets ? I don't know much about midi format, but it's kinda weird Midis2Jam2 can't animate different banks because it just did with the standard drum set of bank 128 ? image

Is there a software somewhere hidden on the web that I can use to change programs and banks, so I can have my nice drum set ?

jamesa08 commented 2 years ago

I believe you can set the GM program change on channel 10 to be one of the different programs listed at the bottom here: https://www.pgmusic.com/tutorial_gm.htm (or here https://en.wikipedia.org/wiki/General_MIDI_Level_2#Drum_sounds)

image

This is a General MIDI 2 change, and it looks like MidiEditior does not support this at the moment. You might want to open an issue over here https://github.com/markusschwenk/midieditor (although the project seems to be stale at the moment, the last commit was in 2020). Read up on the General MIDI 2 spec here https://en.wikipedia.org/wiki/General_MIDI_Level_2

ghost commented 2 years ago

Thanks, I just understood how it works. Basically, I had to set program 0 on channel 9 to have drums (assuming everything start on 0) on MidiEditor.

That would be a nice feature to instruments before playing songs in midis2jam2 for the funnies to more general users, but it's okay if you won't add it. (You can close the topic)

wyskoj commented 2 years ago

I want to make sure the distinction between "program" and "bank" is clear. I like to think of a program being a specific instrument, and the bank is a variation on that instrument. The Wikipedia article James linked demonstrates that well.

In the interest of avoiding feature creep, more settings, and extraneous windows in the program, I'm not going to implement a feature to swap the instruments in a file. This can be done via any MIDI editor (e.g., MidiEditor), a MIDI conversion utility like MIDICSV, or editing the binary data of the file.