0

I have a list of variables [bank number, patch number, note number, length and velocity] for every note extracted from a MIDI beforehand and I want to use a SoundFont to generate the correct sample from each note based on those variables, so a SoundFont + variables spits out a sample. I only need the wave data and I have the NAudio library. Can I use FluidSynth to generate the sample for me? I saw that there are .net wrappers for FluidSynth but I don't know how to implement it.

I tried making code myself that reads the SoundFont but it's not getting the right sample and it's missing many of the modulators and effects. It's just really jank and I barely got it to work.

SoundFont sf2 = new SoundFont(path);
WaveStream wave = ImportFromSoundFont(args, sf2);

1 Answers1

2

NAudio's SoundFont support will simply tell you what's in an SF2 file. It doesn't implement a software sampler, which is what FluidSynth is. So you'd need to either use .NET wrappers for FluidSynth, or alternatively, you could perhaps create single note MIDI files, then generate a command line to render the entire midi file through FluidSynth to WAV, with the desired SoundFont loaded. I think that would likely be the easiest route to what you want.

Mark Heath
  • 48,273
  • 29
  • 137
  • 194