danigb / soundfont-player

Quick soundfont loader and player for browser
MIT License
454 stars 59 forks source link

How to convert sf2 file? #40

Closed infojunkie closed 7 years ago

infojunkie commented 7 years ago

Could you please provide a guide on how to convert a regular SoundFont file into a format supported by soundfont-player? I can only see pre-generated JS soundfonts, but could not find scripts to perform the conversion for existing sf2 files.

danigb commented 7 years ago

From https://github.com/mudcube/MIDI.js/:

There is two generators for MIDI.js soundfonts:

  • NodeJS package for creating soundfonts from WAV files - by Patrick Wolleb
  • Ruby package for creating soundsfonts from SF2 files - by Mohit Muthanna

Hope it helps!

infojunkie commented 7 years ago

Thanks!

infojunkie commented 7 years ago

Fwiw, I got locally-generated soundfonts working at http://ethereum.karimratib.me:8080/

danigb commented 7 years ago

Hi Karim!

You demo looks awesome. I see you are using VexFlow. Are you experimenting, or do you have a kind of a plan? ;-)

Regarding the generated soundfonts, thats good news. I've never tried, but I'm interested because the mp3 version of the soundfont looses the loop information, that would be really nice to have. I don't know if you found something about it. Anyway, if you have new and nice soundfonts, I would recommend you to add them to the https://github.com/gleitz/midi-js-soundfonts/ package via PR.

Congrats.

infojunkie commented 7 years ago

My end goal is to create a sheet music player like iRealPro, but supporting full music notation, and more customization features like changing the tuning, extracting info from the sheet, generating voices, etc. I tried to articulate the "plan" in the demo's README.

I don't understand what you mean about the soundfont's loop information. Where can I find out more?

A friend is helping me create a soundfont for Middle Eastern instruments, which is my primary interest for the work on an "Arabic Real Book". I'll be happy to share them once it sounds good :-)

danigb commented 7 years ago

Great! The project looks amazing. Looking forward to see the progress.

Some sounds are sustained (think a violin or an organ) and for that, each soundfont sample contains a "loop" information: an start and end point where the sample could be looped to create a sustained sound. Currently, with the mp3 version of the soundfont, sustained sounds are not possible.

I'm very interested in the "Arabic Real Book" ;-)