You are here

Thoughts about MIDI import enhancements

Oh no it's me again...

I would like to enhance MIDI import so that the tracks created can be played after import without any further user interaction. To do so I suggest to add some plugin information for all tracks created.

So how about the following modification:

When user selects MIDI track import instead of file-select dialog a dialog pops up which looks very much like the plugins-tab when adding a new track with the following additions:
* Edit+Button (in the bottom) for MIDI filename / opening file-selection dialog
* Two combo-boxes (right to plugin-list / in the upper area): 'Instrument Bank' / 'Drums Bank'. These are filled by the bank information of the topmost plugin in the list if possible (plugin supports banks) otherwise empty.

One question regarding drum-banks: I have played around with fluidsynth-dssi and a downloaded sf2. It contains one drum-bank with bank number 128. If I read GM2 specs correctly, there is only one bank 120 for drums defined. So is 128 a sf2 specific bank number (or is it just a fault of the guy that created sf2)? Is there a common rule in which banks to expect instruments and in which drums?

Opinions/Stoppers?

Andreas

Forums: 
rncbc's picture

you're welcome ;)

re. ...add some plugin information for all tracks created
this would be good just for the case you wish to add the same plugin on each MIDI track/channel that is being imported; each plugin instance might also have to be configured appropriately and that just doesn't come as easy as suggested: not all plugins are configured in the same manner and there's no standard way to do it in a single and generic way.

I'd suggest a multi-timbral instrument plugin on the Master MIDI output bus instead. Then all new MIDI tracks that get created on import will converge to it and play on their own MIDI track/channel according to plugin's instrument map; fluidsynth, linuxsampler, zynaddsubfx are just examples of multi-timbral engines. Once you setup the single plugin instance then it's just a matter of saving as a new session template and then, every time you open up a new session it will get all ready for all your MIDI tracks import and play immediately.

re. is 128 a sf2 specific bank number
yes, more or less: bank 128, program 1 is by SF2 convention the one that should be set as percussion/drums instrument (key-)map, otherwise it's assumed to be a melodic instrument map; also a GM convention, the percussion-drum-kit bank/program patch should be assigned to MIDI channel 10, something that is often usually hard-wired on the sf2 file by default (but you can change that, provided the SF2 player engine in use allows or supports for that, as mostly do).

hth.
cheers

Funny things happening: I am working on this, have something working but on certain cases I receive segfaults with fluidsynth-dssi (this is btw. my favorite as it shares sf2 fur multiple plugin-instances).

The segfault can be reproduced in qtractor by:
* Open Track-add dialog on an empty session
* Select Midi track
* add fluidsynth-dssi / remove it / add it again -> crash

I installed all the debuginfo stuff on my PC, debugged and found out, that it is caused fluidsynth-dssi using memory already deleted. OK check fluidsynth-dssi git and what do I find?:

commit d62316e8330d8824d4c3939de85656987348f1a8
Author: Sean Bolton
Date: Sat Mar 24 21:40:23 2012 +0000

* fsd_cleanup() bugfix from Rui Nuno Capela
* MIDI sysex patch from Albert Graef
* Use reentrant strtok_r()

LOL

rncbc's picture

is this a joke?

may i understand that the fluidsynth-dssi version you're running probably *is not* the bugfix'ed one? say, more than 5 years old and counting? :)

cheers

no joke - it is on my PC/Fedora. I opened a bug but no response yet. [1]. So I do my tests with hexter which is not very GMish...

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1505484

Add new comment