FluidNode is a wrapper for the FluidSynth software synthesizer.
npm install fluidnode
Futhermore, the fluidsynth
binary must be installed on your system.
You can find installation instructions for your system
here.
Use FluidNode in your files like this:
import "fs" from "fs/promises"
import { renderFile } from "fluidnode"
const wavBuffer = await renderFile(
filePath, // Path to MIDI file to get rendered
options, // Set gain and alternative soundfont path (both optional)
)
await fs.writeFile("out.wav", wavBuffer, { encoding: "binary" })
Default soundfont is GeneralUser.
Check out the [test/main.ts] file for a complete example.
Check out the makefile for available commands.