Giter VIP home page Giter VIP logo

midi-js-soundfonts's Introduction

MIDI.js Soundfonts

MIDI.js is a fantastic library for MIDI sequencing and playback in Javascript. It comes packaged with a soundfont-generator that is unfortunately a little difficult to get up and running (requires installation of Ruby, Node.js, FluidSynth, Lame, etc.)

This project contains pre-rendered General MIDI soundfonts that can be used immediately with MIDI.js.

Soundfonts Available

Notes

midi-js-soundfonts's People

Contributors

danigb avatar doomtay avatar gleitz avatar kant avatar kennystrawnmusic avatar ksinia avatar mk-pmb avatar nzjenkins avatar shivrajsa avatar supersational avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

midi-js-soundfonts's Issues

Synth instrument names in MusyngKite soundfont don't match GM names, breaking programChange events

For example, a code like this, based on http://gleitz.github.io/midi-js-soundfonts/MusyngKite/names.json

MIDI.loadPlugin({
	soundfontUrl: "http://gleitz.github.io/midi-js-soundfonts/MusyngKite/",
	instrument:"synthbrass_1",
	onsuccess: function() {
		var startingPoint = MIDI.getContext().currentTime;
		
		MIDI.programChange(0,62);
		MIDI.noteOn(0, 72, 127, startingPoint);
		MIDI.noteOn(0, 74, 127, startingPoint + 1);
		MIDI.noteOn(0, 70, 127, startingPoint + 2);
		MIDI.noteOn(0, 58, 127, startingPoint + 3);
		MIDI.noteOn(0, 65, 127, startingPoint + 4);
		
	}
});

will result in complete silence and the error synth is undefined. Changing the instrument input to synth_brass_1 like in the MIDI.GM object will cause a 404 when loading the instrument file.

FluidR3_GM, on the other hand, has the proper name, thus will play music

MIDI.loadPlugin({
	soundfontUrl: "http://gleitz.github.io/midi-js-soundfonts/FluidR3_GM/",
	instrument:"synth_brass_1",
	onsuccess: function() {
		var startingPoint = MIDI.getContext().currentTime;
		
		MIDI.programChange(0,62);
		MIDI.noteOn(0, 72, 127, startingPoint);
		MIDI.noteOn(0, 74, 127, startingPoint + 1);
		MIDI.noteOn(0, 70, 127, startingPoint + 2);
		MIDI.noteOn(0, 58, 127, startingPoint + 3);
		MIDI.noteOn(0, 65, 127, startingPoint + 4);
		
	}
});

Acoustic grand piano sounds distorted

Hi Benjamin,

thank you for the great soundfonts. I use the MusyngKite soundfont for a virtual piano in the browser. Since your last update (14 hours ago), the acoustic grand piano sounds somewhat distorted, as if the base note was mixed with the wrong overtones. To test it, I loaded some of the .mp3 files in an audio player. Result: The distortion is in the samples.

Kind regards
Thomas

Use github to serve files (via gh-pages)

Hi,

I'm the creator of soundfont-player, a small library that uses your prerender .js files to load soundfonts.

Currently I'm using a proxy (rawgit.com) to deliver the files to the browser, but this is not suitable for production.

And that's my proposal:

  • Create a gh-pages branch with the contents of master
  • Set gh-pages as default branch
  • Remove master branch

Then, we could access the files via gleitz.github.io/midi-js-soundfonts...

What do you think?

Missing semicolon in JS font files

Silly as it may sound, this prevents me from building my web app in which I have included some of the fonts as JavaScript files. (the concatenation results in an incorrect script.)

Where in the code is `MIDI.Soundfont` being filled?

When loading a MIDI file, I'd like to load only the audio for the notes that will play in that file, rather than also all other notes in the SoundFont for that instrument. The goal is to save loading time, internet traffic, and RAM.

Could you please give me a hint where in the code the global variable MIDI.Soundfont gets set?

(I tried various things to find that out. I didn't find it by searching the code. When I step through the code in debug mode, MIDI.Soundfont doesn't get updated, maybe because the code notices the slowness of my stepping and has a mechanic of giving up when some steps take too long. Surprisingly, debugPropertySet(MIDI, "Soundfont") from https://github.com/mattzeunert/javascript-breakpoint-collection doesn't get triggered by changes of MIDI.Soundfont. A Watch of MIDI.Soundfont in Chrome Developer Tools doesn't trigger a breakpoint and shows an outdated value of MIDI.Soundfont.)

loading new soundfonts

How can i load a new soundfont to play a midi file? What soundfont format do you use?

No Sound

I get the sounds fonts loaded but get no sound in my experience. Do you have a code example?

"clavichord" must be replaced by "clavinet"

Hello, I found that "clavichord" must be replaced by "clavinet" inside the clavinet-ogg.js and clavinet-mp3.js files. Otherwise the Midi sounds are not played in iWebkit browsers or google Chrome. Thanks for the soundfonts.

Convert samples

Hello, i have some samples for piano in wav, how to configure a covert in mp3/ogg - that would get the best sound? I tried to cbr and every note breaks off a second after the start, in the vbr the note breaks off later, but there is no effect of finishing(release) it like in the acoustic grand piano

Only grand piano soundfont works

Downloaded the library, tried to play with some sound fonts. Only default acoustic_grand_piano works. Tried downloading installing guitar_acoustic_nylon from provided fonts, it loads but doesn't make any sounds. Same for default synth_drum - loads, but no sounds.

404 on github page

Github page returns a 404.

  • Push new content to gh-pages
  • Create master branch for package managers (bower|npm)
  • Add a package.json for npm

Accessing files from the repo

Hi, the readme says we can fetch the files directly, but it's being wonky for me and I'm having trouble figuring out why (I'm new to JS).

I'm using mudcube/MIDI.js. Here's what I'm trying to do:

MIDI.loadPlugin({
		soundfontUrl: "http://gleitz.github.io/midi-js-soundfonts/FluidR3_GM/",
		instrument: "marimba",
		onsuccess: function() {
			var delay = 0; // play one note every quarter second
			var note = 50; // the MIDI note
			var velocity = 127; // how hard the note hits
			// play the note
			MIDI.setVolume(0, 127);
			MIDI.noteOn(0, 21, velocity, delay);
			MIDI.noteOff(0, 21, delay + 0.75);
		}
	});

This is just following the example from mudcube, only instead of using the local directory "/example/soundfont/" I'm using the repo.

Problem: it only works if the value of instrument is "acoustic_grand_piano". Any other instrument will not play any sound. I'm using the Source Inspector to try and find out what the problem is, but it says it works even when I change the instrument. I'm not getting an error. But the sound won't play. I tried this with a few different instruments. Any idea why this happens?

Use soundsfonts without fetching?

Hi,

How do you recommend I use the soundfonts without fetching them over the internet?

I'm having issues such as the following:

Content Security Policy: The page’s settings blocked the loading of a resource at https://gleitz.github.io/midi-js-soundfonts/MusyngKite/acoustic_guitar_steel-ogg.js (“default-src”).

Slow start when using `noteOn`

Hi my friend,

This library is awesome! But for real time playing, it is very slow. I tracked the reason of the slow execution and it looks like that noteOn creates the source variable everytime it runs (based on createBufferSource). Creating this variable, setting gain, effects... make it too slow. Even if I am not using any effect, the if (effects) gets executed.

Isnt it possible for you to implement a faster audio play, like using web audio .play() ? I used other real time libraries and all of them use the play() and everytime it needs to replay it, they use load() -> play() and it gets executed very fast.

Doing so, you could save each node/velocity in the array sources as you already do, and you can simply play it if the index in the array exists everytime the user requests a note, if it does not exist than you create the index and play. This would make your library near 0 latency and would improve a lot its performance and usage!

Fat Boy names.json has extraneous instruments

Hi,

The names.json file for Fat Boy lists synth_strings_1 & 2, but these sounds aren't present as .js or .mp3 samples. Is the names.json wrong or are the sound files missing (or am I missing something?)

Thanks

Rob

Readme mentions Musyng Kite but links to Musyng, which is a different SoundFont

"Musyng" and "Musyng Kite" are two slightly different SoundFonts. Their creator recommends "Musyng Kite".

Your readme says "Musyng Kite.sfpack", possibly you mean the file "Musyng_Kite.sfpack" with an underscore, which is located at http://www.synthfont.com/SoundFonts/Musyng_Kite.sfpack, but the URL it currently links to in your readme is http://www.synthfont.com/SoundFonts/Musyng.sfpack

Which SoundFont did you use?

In any case, thank you for this repo! Without it, it would be very difficult to even find out whether MIDI.js works or not. I did't get it to work yet: mudcube/MIDI.js#268

Links in README.md do not work

Hi, and first thanks for these sounds. Maybe you could merge master branch in gh-pages, and choose gh-pages as the default branch, maybe then remove master.

Musyng Kite drum kits missing

Hi,
Thanks for a great set of instruments.

According to this post from the author :
https://www.kvraudio.com/forum/viewtopic.php?t=351893
there are 12 drum kits in Musyng Kite. None of these appear to be present in this midi.js version.

I know that it is possible to use drum kits in this way, I've been using the one here :
https://github.com/johntu/midi-js-gm1-percussion

I would like to help, if I can, to create/convert these kits into the midi.js format, however I don't know where to begin (or indeed if they are already there somewhere and I am missing them!). Do you have any pointers?

Thanks,

Rob

Little things to fix

Hello, here is the issues I have found so far.

Lets start by missing Underscore:

  • Rename "synthstrings_1" to "synth_strings_1" in files synth_strings_1-ogg and synth_strings_1-mp3
  • Rename "synthstrings_2" to "synth_strings_2" in files synth_strings_2-ogg and synth_strings_2-mp3
  • Rename "synthbrass_1" to "synth_brass_1" in files synth_brass_1-ogg and synth_brass_1-mp3
  • Rename "synthbrass_2" to "synth_brass_2" in files synth_brass_2-ogg and synth_brass_2-mp3
  • Rename filename "lead_8_bass_lead-ogg" to "lead_8_bass__lead-ogg"
  • Rename filename "lead_8_bass_lead-mp3" to "lead_8_bass__lead-mp3"
  • Rename folder "lead_8_bass_lead" to "lead_8_bass__lead"

Removing Underscore:

  • Rename "bag_pipe" to "bagpipe" in files bagpipe-ogg and bagpipe-mp3

Renaming sound name:

  • Rename "synth_voice" to "synth_choir" in files synth_choir-ogg and synth_choir-mp3

Sincerely

Adblocker and chrome extensions lead to errors

I get net::ERR_BLOCKED_BY_CLIENT errors from line 290 in soundfont-player.js. It goes away when I turn adblocker off.

My solution was to download the soundfonts I use and update the URL in soundfont-player.js to point to my server. I'm curious if there is a way to avoid modifying the source. Maybe moving files to a CDN? The other CDNs I use had no issues. Happy to help if you have a preferred solution.

which Soundfonts have only one frequency?

I was listening to them, and i noticed that even though all the bird tweets are different, they are all basically the same frequency, i was wondering if you could tell me which of the others are like this, (i'm guessing it's probably all of the sound effects, and maybe a few others) because i would rather just load the one note into all of the note names to decrease the size file size of these instruments. Bird tweets is now about 17 kb instead of over 1mb.

Also on a side note, are you working on anymore, like the percussion range, because i have no idea how to use all of that stuff to make my own soundfonts in base 64.

Thanks

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.