MIDI to WAV script Done here

Hi!

I have made up a bash script that convert Music MIDI Files from a directory to WAV Audio files.

I don’t see a MIDI player in Haiku (the one I have bug after a playback) then I do it.

You must install before fluidsynth (software synthetiser)
You need also a SounFont file in sf2 format (here is Basic_GM_GS.sf2)
Then copy the script lines in a File with *.sh extention. And put it in your MIDI Files directory.
Then open a terminal and Run it with this command line
Exemple: sh convert.sh

That convert midi files to a Audio directory with new wav files.

Script file:

Soundfont=Basic_GM_GS.sf2
DestFold=Audio

echo "Convertisseur MIDI to WAV File"
NumMID=$(ls *.mid -1 | wc -l)
echo $NumMID

mkdir $DestFold
for file in *.mid
do
	echo "$file"
	inputFile=$file
	outFile=${inputFile%.mid}.wav
	fluidsynth -F $DestFold/$outFile  -i -n -T wav $Soundfont $inputFile
done

You can edit the Soundfont file source in the bash script file
For now the Soundfont must be placed in the MIDI Directory.

1 Like

MIDI player is in the Haiku Application menu. You have to install some soundfonts first and select one in the media prefs however after installing the soundfonts.

I have one MIDI player in Haiku but every time I use it. The app crash after playing a File. The sound is OK but the MIDI player crash.

Did you reported it already?

No I don’t know the link for report a bug. But you had say you can choose your Soundfont file in it…I wonder if I have the same app as you. I will check it after my cours.

What is the name of your MIDI app?

bugreports at http://dev.haiku-os.org.

Thanks!

As i wrote it earlier: you can/have to pick a soundfont in the Media Preferences window.

This is the MIDI app I have in Haiku when I launch a MIDI File…I see nothing about Soundfont in it.
But here is the bug I always have with it when I Stop the sound or Quit the app.

VirtualBox_Haiku%20Beos_13_01_2020_21_44_42

Have find the Preference for MIDI in Haiku OS. But I can’t put new Soundfonts in the system (root access to the directory is denied).
If you have another Midi player you are welcome.

-Use HaikuDepot to install soundfonts or copy your soundfonts in the non-packaged folderstructure ( ~/config/non-packaged/data/synth/ )
-Use the Media preflet to select a soundfont
-Play midi files with MidiPlayer

For more info about reporting bugs check this guide: https://dev.haiku-os.org/wiki/ReportingBugs

Thanks for reply.
I view somes tickets already exist on the bug reports website about this App.

I will go try this(about Soundfont)

------------I Reply…again

I have tested the new Soundfont in non-package directory now after your reply and Midi Player app seem to no make error now. I don’t really understand why.

But I want to say Fluidsynth have a better quality for rendering midi file with the same Soundfont file. I don’t know what is it under the rendering of Midi Player.

I think MidiPlayer uses Fluidsynth also, so, not sure what the difference would be.

You can try Audacious player.
Audacious have fluidsynth based plugin for midi.

1 Like

waddlesplash

2h

Kitsune64:

But I want to say Fluidsynth have a better quality for rendering midi file with the same Soundfont file. I don’t know what is it under the rendering of Midi Player.

I think MidiPlayer uses Fluidsynth also, so, not sure what the difference would be.

Try it. Play a midi file in MIDI Player with the same Soundfont than you use in fluidsynth command line (I heard a difference). example: Drum Kits absance in one of my test.

3dEyes

1h

You can try Audacious player.
Audacious have fluidsynth based plugin for midi.

Thanks it work nicely.