|Reported by:||Pete||Owned by:||korli|
|Has a Patch:||yes||Platform:||All|
Here is a patch that puts back a couple of features that were in BeOS but missing from Haiku, and also improves the way it finds the necessary default Soundfont.
As originally written, BSynth inherited the BeOS/Beatnik naming of the instruments file, as "big_synth.sy". This is confusing because a soundfont, as used by the Haiku version has the standard extension ".sf2", and the old name referred to a proprietary BAE-format file. Also, in BeOS, the file was in the system area, because it was a component of the distributed system. The Haiku version inherited this convention and looks for the file in the system data directory.
However, a soundfont is not currently in the distributed system, and a user has to choose an appropriate font to download and install. In fact there are many choices, and the user may want to acquire several of them to be accessed at choice. So the system area, with all its protections against alteration, is not the most convenient place to put them.
With this patch, BSynth will look in a number of "synth" folders for "synth.sf2", which will usually be a link to the actual soundfont (which can be in the same folder or anywhere else convenient).
It looks first for "<B_USER_SETTINGS_DIRECTORY>/synth/synth.sf2". If that isn't found it tries "synth/synth.sf2" in <B_USER_DATA_DIRECTORY>, and then the same in <B_COMMON_DATA_DIRECTORY>. If all those fail, it still falls back to the old "<B_SYSTEM_DATA_DIRECTORY>/synth/big_synth.sy", in case the user has an earlier unchanged installation.
Note that any entry in the settings directory is expected to be a "setting" -- a link created by the user to designate the desired default soundfont. At the moment this must be done directly, but a Preferences app might be useful at some point.
The header MidiDefs.h has a new "#define B_SYNTH_FILE "synth/synth.sf2", and redefines B_SYNTH_DIRECTORY to B_COMMON_DATA_DIRECTORY.
The restored features are SetReverb and GetAudio.
The reverb settings try to match the old BeOS levels ("None" to "Dungeon") with fluidsynth equivalents. I'm not sure how close they are, as my BeOS machine no longer has audio for comparison.
GetAudio is probably similar to the way it was in BeOS. It is not an 'audio tap' that duplicates the audio stream; it simply grabs the current buffer contents (or less, depending on the request) and delivers the left and right parts. MidiPlayer's Scope is now appropriately active, anyway.
Change History (47)
by , 6 years ago