-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Musyng Kite drum kits missing #32
Comments
Hey @RobAley, I did a little digging inside the Musyng Kite soundfont. Using As you can see there are the "usual suspects" in bank 000, which is the bank that generated most of the soundfonts in this repo. However, if you check out bank 128 it's full of drum kits and there are instruments like preset 025 which has "TR 808". MIDI.js does not have the concept of these banks. You can think of banks almost as their own separate soundfount that you would reference in A path forward might be to generate some of these other banks into soundfonts of their own, starting with bank 128 which seems to have some pretty sweet percussive instruments. You'd still have to reference these new instruments by MIDI.js's default names (or by id, which might make more sense), but you'd get access to a new world of sound. Finally, I really like the FatBoy soundfont that @Miserlou found which also has some cool banks. I've included them here so you can see what's available. Musyng Kite Banks and Presets
FatBoy Banks and Presets
p.s. If you're using |
Hi @gleitz, |
Hi @gleitz, I was using the |
Good call. I agree that we should probably just create a new font with the drumkits. Then there's just the question of how and where to map the instruments. We could do something like map the
|
Hi @gleitz - This project is great! I've been playing around with it and found the missing drum kit a bummer. I've tried the percussion-mp3.js file in the above PR, but it's not the same quality as the rest. Just curious if you're still considering creating a font with drum kits? |
@Maxiiimus Which drum file was low quality for you? The issue I was running into with my generation script, at least with Musyng Kite, is that percussion instruments are not in the default bank 0 of the soundfont, but instead in some higher number like 127 or 128. Here's the script. I'm using the
Here's how the midi file is generated. This equates to the following commands:
So where I got stuck is that I need a new midi command that will first change the bank to, say, 127 and then play the note. I was looking at the fluidsynth spec and the midi-bank-select instructions which seems to be how you go about switching to other banks. Here's what I came up with:
So I think if I modify my script slightly I can get percussion to render. The question then becomes how and where to map the instruments. We could do something like map the Standard kit (001 in bank 127) into Acoustic Grand Piano (000 in General MIDI). Unless there is a particular drum kit you're looking to use? |
When the percussion.json file was still available, I used it (just like the other fonts) with danigb/sound-fontplayer and it just worked. So at least for those who use soundfont-player it would work without mapping to banks. I now host all files myself, but since all the other fonts are available in this repository it certainly would be nice to have percussion as well, even if it is not mapped correctly. |
@gleitz my bad, totally missed your previous question! Bank 128 is not the source of drums but mainly sound effects and other misc sounds def generate_midi(program, note_value, file)
# rest of code unchanged
# pseudocode since I don't have the file to hand
if program == 254:
events.add(ChannelChange(10))
events.add(ProgramChange(0))
end
|
actually let me double check the above since it might apply differently to soundfonts than how I expect - I'll see if I've still got the exact generation code, probably more useful! |
Hey There! First, I want to preface everything by saying I'm not a musician and what I'm working on is a hobby and has been a lot of fun and I've learned a lot about MIDI along the way. A quick overview of my project. I have a NodeJS app running on a Raspberry Pi 4 that uses MidiPlayerJS to read MIDI files. I then take the MIDI events to drive playing keys on an antique player piano (driven by solenoid valves to control the pneumatics). That is all working well for solo piano MIDI files. For the interface, I have a mobile web app served by the Pi on my local network. Now I'm playing around with adding the ability to play non-piano channels to broaden what MIDI files can be played (and because, why not? :). To do this, I'm sending MIDI events to a page that plays the notes using the sound-fontplayer library. It's been simple for most instruments in files I've tried. First, I scan the file for all the instruments in the channels. I load them by index number on the client. Then when I receive an event, just play it (or stop it for "note off" events) on the corresponding instrument. Again, works pretty well running on my laptop (I haven't yet tried the SoundFont library functionality on the Pi). The exception is drums. For drums, I handle channel 10 differently. For now, I'm loading a local version of percussion-mp3.js I pulled down from this PR. I might be doing something wrong here, but the drum notes sound strange. Here's a video with a sample of what I mean: https://www.youtube.com/watch?v=85GznfPZwp4. The hi hat sounds "chirpy". As for which particular drum kit to use, I'm not sure what the options are. Mostly, I was thinking there is a "common" kit to map to the specification here. Thank you for the quick responses and for putting this together and sharing it! |
Ok so the above code should be: if program == 254:
# channel is 9 due to zero-indexing
track.events << NoteOn.new(9, note_value, VELOCITY, 0) # channel, note, velocity, delta
track.events << NoteOff.new(9, note_value, VELOCITY, DURATION)
else:
#normal note I'll put in a pull request soon with the generation code - however there are actually different drums on channel 10 which can be accessed using program-change message, such as the 808 and orchestral in fatboy which would be great to have alongside the standard kit! There are about 24 different kits and it's going to need program-change codes specific to each soundfont (since it's not 0,1,2,3 more like 0,24,25,32 etc.) , so to add them I'll just need to have maybe an extra json file to tell the generator which extra drumkits exists and what to call them (alternatively could parse the soundfont and check but that's more effort) - anyway I think the question here will be how to access different drumkits via MIDI https://www.midi.org/forum/1161-how-do-i-access-general-midi-s-alternate-drum-kit-sounds One thing to note is that with drums a lot of the notes are empty so shouldn't be rendered - will also need to remove those to make it a quicker download. |
Thanks for that info! Happy to accept a PR with the updated generation script. |
Hi @supersational & @gleitz, I just read through the above post on midi.org and also the spec (General_MIDI_Level_2_07-2-6_1.2a.pdf). It looks like there would be 9 different percussion sets defined there. Using that as a reference, we could soundfont files with program changes for 1, 9, 17, 25, 26, 33, 41, 49, 57. (I assume these would all be -1 to index). Could we have a .json file that assumes the standard set for most. Something like:
Most of the notes in the sets other than standard will be the same as standard or will be empty (as you said above). Then, when there's a program change to channel 10, load the soundfonts from these instead of from the other .json file based on the value (which I seem to usually see as 0 for the "standard_set"). You mention 24 kits, so perhaps there are more that can be added? I haven't looked at how these are generated or cloned this repo, but just keeping the conversation going. :) Thanks! |
Hey all, is this still on the table or being worked by anyone? I'd also love to see some percussion kits added as soundfonts so we can take advantage of the kits in these original sf2s. What's the current status? |
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
The text was updated successfully, but these errors were encountered: