{"id":16188528,"url":"https://github.com/konsumer/hydro2sf2","last_synced_at":"2025-03-19T03:30:41.352Z","repository":{"id":32118995,"uuid":"35691457","full_name":"konsumer/hydro2sf2","owner":"konsumer","description":"convert a Hydrogen drumkit into a SF2 soundfont","archived":false,"fork":false,"pushed_at":"2020-11-03T03:43:20.000Z","size":41,"stargazers_count":14,"open_issues_count":3,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-28T14:53:22.953Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/konsumer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-15T19:01:56.000Z","updated_at":"2024-01-01T14:32:04.000Z","dependencies_parsed_at":"2022-09-12T17:11:06.092Z","dependency_job_id":null,"html_url":"https://github.com/konsumer/hydro2sf2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsumer%2Fhydro2sf2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsumer%2Fhydro2sf2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsumer%2Fhydro2sf2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konsumer%2Fhydro2sf2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konsumer","download_url":"https://codeload.github.com/konsumer/hydro2sf2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243965768,"owners_count":20375916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T07:27:25.000Z","updated_at":"2025-03-19T03:30:41.073Z","avatar_url":"https://github.com/konsumer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hydroToSf2\r\nA tool which allows you to convert a Hydrogen drumkit into a SF2 soundfont. It uses Learjeff's soundfont tools\r\nto do all the hard work.\r\n\r\n## Depracated\r\n\r\nI started working on [hydrotools](https://github.com/konsumer/hydrotools). It should do what this repo does, and more.\r\n\r\n\r\n## Requirements\r\nTo use the conversion functions (ie if you have flac or other-then-wav formatted drum samples) You will need `flac` and `sox` in your path. You'll also need `pyxml`, and `tarfile` for python (most people should have these) \r\n\r\ntested on Python 2.4.3 on Ubuntu Dapper Linux\r\nTo get what you need there, type:\r\n`sudo apt-get install python python-xml flac sox`\r\n\r\n## Quick usage\r\n\r\nDownload [hydrogen drumkits](http://sourceforge.net/projects/hydrogen/files/Sound%20Libraries/Main%20sound%20libraries/)\r\n\r\nIf it's a .h2kit file, just run the script like this:\r\n`./hydroToSf2 filename.h2kit` (replace filename.h2kit with the file)\r\n\r\nif you want to convert an already-installed (in hydrogen GUI) drumkit do this:\r\n`./hydroToSf2 $HOME/.hydrogen/data/kit_name` (replace kit_name withe the directory that has the kit.)\r\n\r\n\r\n## What to do with .SF2 file?\r\n\r\nIn linux, use swami to look at/play the soundfont.\r\n\r\nfluidsynth is a command-line soundfont-loader that works for everybody. asfxload will load it onto your emu10k1 running alsa sfxload will load it onto your emu10k1 running OSS.\r\n\r\nAfter it is loaded you can sequence to it with seq24 or rosegarden or whatever.\r\n\r\n## Why did I do this?\r\n\r\nI like the tiny overhead of using my souncard's (emu10k1) built-in wavetable better then loading up hydrogen whenever I need a drum maqchine. Hydrogen is better then what you get with this, but if you don't need LADSPA effects, humanizing, or jack capabilities, this is ideal.  I still use hydrogen for recording into ardour, making midi files to be played in seq24 (much nicer interface) or any time I want it to sound perfect.\r\n\r\nBelow is the original README from Learjeff's soundfont tools:\r\n\r\n```\r\nLearjeff's soundfont tools\r\nCopyright 2004, Jeff Learman\r\n\r\nNo warranties.  Programs are likely to be fragile, especially\r\nwhen taken outside the narrow range of test scenarios I've used!\r\n\r\nThings you'll need:\r\n    A way to capture the wave data (mike, soundcard, etc.)\r\n    A wave editor -- optional but useful for noise reduction or bit\r\n        depth conversion.\r\n    Python, download it from www.python.org and install it.  (Python\r\n        is a scripting language like Perl.)\r\n    A little ability to use the DOS command shell.\r\n\r\nInstallation:\r\n    Extract all the .py files into a new directory of your choice.\r\n    Put that directory on your executable path, or else you\r\n\tcan specify the path to the programs explicitly.\r\n    To run build the demo soundfont, you'll need to convert\r\n        the two .mp3 layer sample files in the \"demo\" directory\r\n        into wave files.  An excellent program for doing this\r\n\tis dBPowerAmp Music Converter, found at\r\n\t\"http://dBPowerAmp.com/dmc.htm\".\r\n\r\nA note on terminology:\r\n    I'm using the term \"layer\" only for the purpose of what\r\n    more sensible folks call \"velocity splits\", meaning a set\r\n    of samples that were recorded with the same key velocity\r\n    (or force or loudness).  I'm NOT using it to refer to\r\n    \"layered instruments\", where you have two sounds from\r\n    two different instruments when you hit one key.\r\n\r\nTo build your own soundfont:\r\n\r\n 1) Sample the instrument.\r\n\r\n    For each velocity layer, sample all keys you'll be sampling\r\n    into a single wave file.  The tools currently don't handle\r\n    two .wav files for the same velocity layer -- if you do end\r\n    up with two, there's a workaround.  (One for the feature list.)\r\n    Ideally, sample in 24 bits.\r\n\r\n    You might want to read about layer file names below before\r\n    starting this step.\r\n\r\n 2) Prepare the velocity layer files\r\n\r\n    De-noise the layer files in your favorite wave editor, such\r\n    as CoolEdit or (free) Audacity.  Then normalize, and convert\r\n    to 16 bit format if they aren't already.  Dithering optional\r\n    but probably best.\r\n\r\n    If there are any snarks (sample attempts you don't want to\r\n    keep) that are longer than the minimum sample duration\r\n    (a configurable parameter in jCutSamps.py, defaulting to\r\n    1 sec.), delete them from the layer wave file.  It's better\r\n    to delete them rather than silence them, because the \"silence\"\r\n    is sampled to help detect the end of a note, and a chunk of\r\n    absolute silence can throw the algorithm off.\r\n\r\n    Snarks smaller than the minimum sample duration will be\r\n    automatically ignored by the program.\r\n\r\n    Use the following format for the prepared layer file names:\r\n\r\n      \u003cprefix\u003e_\u003clayername\u003e.wav\r\n\r\n    where \u003cprefix\u003e is anything you want, usually an abbreviation\r\n    for the soundfont or instrument.  \u003clayername\u003e is also anything\r\n    you want, but something that indicates to you what velocity\r\n    the layer file samples were recorded at.\r\n\r\n    Examples for different layer file naming conventions:\r\n\r\n      using MIDI velocities:\r\n          sf1_v16.wav sf1_v32.wav sf1_v64.wav ...\r\n      using music notation:\r\n          sf1_pp.wav sf1_p.wav sf1_mp.wave sf1_m.wave sf1_mf.wav ...\r\n      using whatever:\r\n          sf1_soft.wav, sf1_medium.wav, sf1_hard.wav, sf1_nuke.wav\r\n\r\n    Use anything that's meaningful to you, but the layer names will\r\n    show up later.  The prefix will simply be preserved by the\r\n    program and don't mean anything specific.\r\n\r\n 3) Convert the layer files to individual sample files.\r\n\r\n    Run jCutSamps.py to chop up the layer files into sample files.\r\n    It produces a set of closely cropped sample files, suitable\r\n    for building into a soundfont.  Furthermore, it names them\r\n    according to this schema:\r\n\r\n      \u003cprefix\u003e_\u003clayer\u003e_\u003cnotenum\u003e_\u003cnotename\u003e.wav\r\n\r\n    \u003cprefix\u003e is as described above.\r\n    \u003clayer\u003e is as described above.\r\n    \u003cnotenum\u003e is the MIDI note number in the sample, or 000 if\r\n\t    it can't tell.\r\n    \u003cnotename\u003e is the note name in normal notation, using upper\r\n            case for the note, lower case 'b' to indicate flat,\r\n\t    and a one-digit octave number in normal MIDI parlance.\r\n\r\n    The program does not handle samples outside the range of an\r\n    88-key piano keyboard.  As you can imagine, it's also not\r\n    intended for percussion instruments and drums where the note\r\n    isn't clear.\r\n\r\n    The pitch detection algorithm (auto-correlation) isn't the\r\n    best algorithm, so it's touchy.  Let me know if it tends to\r\n    work or not for your instrument.  It seems to work well for\r\n    acoustic piano and Rhodes.\r\n\r\n    It's generally best to put all the samples in a single folder.\r\n    Keep different instruments in different folders.  For this\r\n    example, we'll keep the chopped samples in a \"samps\" directory,\r\n    and the input wave files in the current directory (along with\r\n    the soundfont and other control files).\r\n\r\n    Example:\r\n        mkdir samps\r\n        jCutSamps -f samps sf1_*.wav\r\n\r\n    Get a cup of coffee.  This one takes a long time, about 30\r\n    seconds per sample in my sample sets.\r\n\r\n    When it's done, inspect the sample names.  If you have samples\r\n    with note number 000, figure out what note they really are\r\n    and name them accordingly.  It's not necessary to get the MIDI\r\n    note number correct -- it's not used by the program.\r\n\r\n4)  Configure the keyboard mapping.\r\n\r\n    Create a file that's your soundfont name but with a \".sfc\" extension,\r\n    for \"soundfont control\".  See details in the example provided.\r\n\r\n5)  Build the keyboard map\r\n\r\n    Example:\r\n        jMap.py sf1 samps/*.wav\r\n\r\n    This reads the control file (sf1.sfc) and, based on the names of\r\n    the wave files found, creates a key map file (sf1.sfk).\r\n    Take a look at the file it created to see if that's\r\n    how you want your samples mapped.  Adjust accordingly.\r\n    This completes almost immediately.  It does verify that the\r\n    specified sample files exist, but doesn't inspect their contents.\r\n    It trusts the file names to specify the note.\r\n\r\n6)  Build the soundfont\r\n\r\n    Example, mono soundfonts:\r\n        jMksf.py sf1\r\n    Example, stereo soundfonts:\r\n        jMksf.py -s sf1\r\n\r\n    This spends most of its time copying wave data.  It generally\r\n    takes a second or so per sample.\r\n\r\n    Bingo, you're done.  Test your soundfont in your favorite player.\r\n    Make any necessary adjustments on the keymap config file and\r\n    run the second two programs again -- just takes a moment.\r\n\r\n7)  Resample everything and start over.\r\n\r\n    Most likely, you've learned what's not ideal about your sample\r\n    set.  Perhaps you needed more layers, or to sample more keys.\r\n    Adjust the layer definitions (if necessary) and start over.\r\n\r\n8)  Touch up the soundfont in a soundfont editor\r\n\r\n    Soundfonts have lots of parameters to play with.  Also, if your\r\n    samples aren't full-length, you'll need to loop them.\r\n    I recommend Extreme Sample Converter, at \"http://www.extranslator.com\",\r\n    which has an excellent loop editor.  Unfortunately, it doesn't adjust\r\n    the velocity map (an important aspect).\r\n\r\n\r\nHave fun!\r\nJeff\r\n\r\nlearjef@aol.com\r\nhttp://learjeff.com\r\n```\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonsumer%2Fhydro2sf2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonsumer%2Fhydro2sf2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonsumer%2Fhydro2sf2/lists"}