Giter VIP home page Giter VIP logo

Comments (3)

frabert avatar frabert commented on May 29, 2024

I believe this is not in this library's scope. I personally use sf2cute for that.

from tinysoundfont.

schellingb avatar schellingb commented on May 29, 2024

Yeah as frabert mentioned.
I use Viena for looking into and modifying sf2 files. Creating one from scratch seems a daunting task to me :-)

from tinysoundfont.

KnIfER avatar KnIfER commented on May 29, 2024

Hah!I've figured out the file format.below I modified the minimal sf a little to make it recognizable and editable by an awesome software——polyphone.

//This is a minimal SoundFont with a single loopin saw-wave sample/instrument/preset (496 bytes)
//sf file structure reference : http://www.synthfont.com/sfspec24.pdf ,page13
const static  char MinimalSoundFont[] =
{
	
	'R','I','F','F',232,1,0,0,
	's','f','b','k',

	//list info start
	'L','I','S','T',4,0,0,0,
	'I','N','F','O',

	//list sample start
	'L','I','S','T',112,0,0,0,
	's','d','t','a',
	's','m','p','l',100,0,0,0,96,0,119,3,31,7,147,10,43,14,169,17,58,21,189,24,73,28,204,31,73,35,249,38,46,42,71,46,250,48,150,53,242,55,126,60,151,63,108,66,126,72,207,
	70,86,83,100,72,74,100,163,39,241,163,59,175,59,179,9,179,134,187,6,186,2,194,5,194,15,200,6,202,96,206,159,209,35,213,213,216,45,220,221,223,76,227,221,230,91,234,242,237,105,241,8,245,118,248,32,252,

	//list preset data start
	'L','I','S','T',88,1,0,0,
	'p','d','t','a',
	'p','h','d','r',76,0,0,0,59,69,69,69,69,69,69,69,69,0,TEN0,TEN0,0,0,0,0,0,0,0,0,69,69,69,69,69,69,69,69,69,0,TEN0,1,0,1,0,1,TEN0,0,0,0,// The Preset Headers P#21 x38 name20bytes,wPreset,wBank,presetBagIdx..
	'p','b','a','g',8,0,0,0,  0,0,0,0,1,0,0,0,//The Preset Index list
	'p','m','o','d',10,TEN0,0,0,0,//The Preset Modulator list
	'p','g','e','n',8,0,0,0,41,0,0,0,0,0,0,0,//The Preset Generator list

	'i','n','s','t',44,0,0,0,59,69,69,69,69,69,69,69,69,0,TEN0,0,0,69,69,69,69,69,69,69,69,69,0,TEN0,1,0,//The Instrument Names and Indices x22
	'i','b','a','g',8,0,0,0,0,0,0,0,2,0,0,0,//The Instrument Index list
	'i','m','o','d',10,TEN0,0,0,0,//The Instrument Modulator list
	'i','g','e','n',12,0,0,0,54,0,1,0,53,0,0,0,0,0,0,0,//The Instrument Generator list

	//The Sample Headers x46						name20bytes,dwStart,End,StartLoop,EndLoop,  sampleRate b c wSa
	's','h','d','r',92,0,0,0,59,69,69,69,69,69,69,69,69,0,TEN0,0,0,0,0,50,0,0,0,0,0,0,0,49,0,0,0,34,86,0,0,60,0,0,0,1,0,   69,69,69,69,69,69,69,69,69,0,TEN0,TEN0,TEN0,0,0,0,0,0,0,
																		//86*256+34=22050
	
};

from tinysoundfont.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.