Discussion:
[fluid-dev] Linking MIDI files with sf2 files
Premkiran Mannava
2006-04-18 15:58:10 UTC
Permalink
hi,

I have some downloaded code of parsing the MIDI files as well as soundfont
files. Now how do I select the preset and bank initially basing on the MIDI
events. I basically donot know which instrument it is playing initially
right! Suppose my MIDI file events are playing a xylophone... then how do
I recognize from soundfont that its a xylophone? How do I identify the
instrument of the sample?
Regards,
Prem
Premkiran Mannava
2006-04-18 15:43:44 UTC
Permalink
hi,

I have some downloaded code of parsing the MIDI files as well as soundfont
files. Now how do I select the preset and bank initially basing on the MIDI
events. I basically donot know which instrument it is playing initially
right! Suppose my MIDI file events are playing a xylophone... then how do
I recognize from soundfont that its a xylophone? How do I identify the
instrument of the sample?
Regards,
Prem


--
" Excellence is not an act....but a habit..."
Josh Green
2006-04-21 03:25:41 UTC
Permalink
Post by Premkiran Mannava
hi,
I have some downloaded code of parsing the MIDI files as well as
soundfont files. Now how do I select the preset and bank initially
basing on the MIDI events. I basically donot know which instrument it
is playing initially right! Suppose my MIDI file events are playing
a xylophone... then how do I recognize from soundfont that its a
xylophone? How do I identify the instrument of the sample?
Regards,
Prem
I'm not exactly certain what you are asking, but I'll try to answer your
questions ;) Each preset in a SoundFont has a MIDI bank and preset
number associated with it. When playing a MIDI file through a SoundFont
synthesizer, it should be enough to send MIDI bank and program change
events for the instrument you desire to play. Are you using FluidSynth
as a shared library in a program, from the command line or within
another application? Changing the bank:preset of FluidSynth depends on
how you are using it. SoundFont presets are also identified by a name,
which will give you a better idea of what the sound is. This name can
be whatever the designer of the SoundFont chooses so a Xylophone won't
necessarily be exactly named that. There are some standards for mapping
specific program numbers to certain instruments, General MIDI is one of
those standards. This is a standard mapping of certain sounds to
numbers. Hope something in there covers what you were asking.
Josh Green
Premkiran Mannava
2006-04-24 16:08:52 UTC
Permalink
hi,

with fluidsynth 1.07a I could play MIDI files from the shell giving command
line arguments. I have chosen a MIDI file which is playing if it has only
melodic instrument i.e. say piano or guitar strings. I have a MIDI file
with both precurssion and melodic, it doesnot sound both when I paly it with
this version. Can you tell me which version of fluidsynth can play a multi
timbre - basically both melodic and drum kit at a time on its own on windows
say using a dsound driver? some of the MIDI files I used are only playing
drums and some are playing mere melodic without droms!! What does this say?

I have changed soundfont files basically .sf2 files and tested fluidsynth
but with different instruments I could not play the melodic and drum kit as
it is together.....

Can you suggest me a possible solution for this? I am struggling on this
from more than a week to look through the code and find the loophole...
Either you can suggest me a solution with that of changing the required
parameters in the code if needed... even that would help my investigatiion
to get a intact code

regards,
PRem
Post by Josh Green
Post by Premkiran Mannava
hi,
I have some downloaded code of parsing the MIDI files as well as
soundfont files. Now how do I select the preset and bank initially
basing on the MIDI events. I basically donot know which instrument it
is playing initially right! Suppose my MIDI file events are playing
a xylophone... then how do I recognize from soundfont that its a
xylophone? How do I identify the instrument of the sample?
Regards,
Prem
I'm not exactly certain what you are asking, but I'll try to answer your
questions ;) Each preset in a SoundFont has a MIDI bank and preset
number associated with it. When playing a MIDI file through a SoundFont
synthesizer, it should be enough to send MIDI bank and program change
events for the instrument you desire to play. Are you using FluidSynth
as a shared library in a program, from the command line or within
another application? Changing the bank:preset of FluidSynth depends on
how you are using it. SoundFont presets are also identified by a name,
which will give you a better idea of what the sound is. This name can
be whatever the designer of the SoundFont chooses so a Xylophone won't
necessarily be exactly named that. There are some standards for mapping
specific program numbers to certain instruments, General MIDI is one of
those standards. This is a standard mapping of certain sounds to
numbers. Hope something in there covers what you were asking.
Josh Green
--
" Excellence is not an act....but a habit..."
Josh Green
2006-04-27 12:17:38 UTC
Permalink
Post by Premkiran Mannava
hi,
with fluidsynth 1.07a I could play MIDI files from the shell giving
command line arguments. I have chosen a MIDI file which is playing if
it has only melodic instrument i.e. say piano or guitar strings. I
have a MIDI file with both precurssion and melodic, it doesnot sound
both when I paly it with this version. Can you tell me which version
of fluidsynth can play a multi timbre - basically both melodic and
drum kit at a time on its own on windows say using a dsound
driver? some of the MIDI files I used are only playing drums and some
are playing mere melodic without droms!! What does this say?
Hmm, not sure what could be causing that. I wouldn't be surprised if
there were some bugs with the MIDI implementation, but I'm not familiar
with that particular problem. Are you saying that it was working at
some point with a version of FluidSynth? It may be that you would find
the same behavior with any version, since not a lot of changes have
occurred with the MIDI code.
Post by Premkiran Mannava
I have changed soundfont files basically .sf2 files and tested
fluidsynth but with different instruments I could not play the melodic
and drum kit as it is together.....
Do you have some example SoundFont and MIDI files you could put
somewhere on the Internet for me to test?
Post by Premkiran Mannava
Can you suggest me a possible solution for this? I am struggling on
this from more than a week to look through the code and find the
loophole... Either you can suggest me a solution with that of
changing the required parameters in the code if needed... even that
would help my investigatiion to get a intact code
Not sure what to suggest at this point, since I would need to see the
problem in action. If you do have some example SoundFont/MIDI files
that would help a lot.
Post by Premkiran Mannava
regards,
PRem
Cheers.
Josh Green
Josh Green
2006-04-28 10:54:38 UTC
Permalink
Hi,
Attached is the SF2 database and also the MIDI files. Please do take
these and test with fluidsynth 1.07a. I could not play the files
correctly
Can you locate the problem in the code??
Regards,
Prem
Seems to be something with the MIDI files. Probably related to sending
bank/program change events. What program did you use to create them?
Either that program isn't doing things right, or its doing something in
a way which the FluidSynth MIDI parser doesn't like. I loaded up the
files in rosegarden though and then exported them again as MIDI and it
works fine. Here is a new version of the test1.mid. The next step is
to figure out what software is at fault. It would probably help to
analyze the MIDI file data, though I'm not real familiar with that
format.
Josh Green

P.S. The email you sent with the attachments was a little large for the
list, so I'm going to stop it there ;) If anyone is interested in the
attached material, just ask me and I can mail it to you personally (just
a GM SoundFont and 4 MIDI files).

Loading...