# How to create a Hydrogen drumkit for fun and profit Drum machines are fun. They can make some amazing beats, and also because, at least traditionally, they tend to have an easy interface. The first drum machine I ever used was the [Alesis HR-16](http://www.vintagesynth.com/misc/hr16.php). It had 49 16-bit patches and an inbuilt sequencer. It annoyed me that it wasn't rack mountable, but then again, it fit into a messenger bag, so I was able to easily take it to studio sessions. The HR-16's interface was one of the best. Its only display was a two line LCD screen, and all of its functions had dedicated buttons on the front of the machine. To build up a new drum line, you selected a pattern slot, entered recording mode, and played in a beat either in real time or beat-by-beat. The unit held up to 100 patterns, and you could string together several patterns into up to a 100 song files. Today, I use the [Hydrogen](http://hydrogen-music.org/hcms/) software drum machine. The concept is basically the same: enter a rhythm into the active pattern, and then build a song of patterns. It's simple, intuitive, and it makes you feel like a rock 'n roller in no time. The great thing about Hydrogen is that it isn't limited to a single chip of 49 16-bit sounds. You can build your own drumkits with your own sounds. This means that anything you want to make a rhythm out of, you can record, and then sequence within Hydrogen. Amazingly, it's not even that hard. ## Anatomy of a kit A Hydrogen drumkit is actually just ``.tar`` using a ``.h2drumkit`` as an extension. $ file ./mydrumkit.h2drumkit mydrumkit.h2drumkit: POSIX tar archive (GNU) Contained within the TAR archive are the sounds that you want to use as your drumkit and an XML file describing the drumkit to Hydrogen. This looks a little something like this: <instrument> <id>0Kick drum1false110false10001100035kick.flac0110 mydrumkit </name> <author> Seth </author> <info> This is my first drumkit. It contains sounds released under the CC-0 license. </info> <license> CC-0 </license> <instrumentList> This is entered once, and only once, per kit, at the top of your file. For each sound file, assuming one sound file represents one instrument, an ``instrument`` block is required. The basic instrument block starts with this: <instrument> <id>0Kick drum1false110false10001100035kick.flac0110 </drumkit_info> That's all the XML you need to know! ## 3. Create a tar archive The final step in this process is to wrap your sounds and XML in an archive. If you haven't already, place your sound files and your ``drumkit.xml`` file into a dedicated directory. Assume the directory is called ``mydrumkit`` (although in real life, I do hope you come up with something more creative). Run the ``tar`` command: $ tar cvf mydrumkit.tar mydrumkit And then rename your TAR archive so Hydrogen recognises it: $ mv mydrumkit.tar mydrumkit.h2drumkit You're done! That's all there is to it. You've just made your very own custom kit. ## Loading your kit To use your drumkit in Hydrogen, you must import it. To import a drumkit, open Hydrogen and click on the **Instruments** menu and select **Import Library**. ![](menu-hyrdrogen-import.jpg) In the **Sound Library Import** window, click the **Local file** tab. Click the **Browse** button on the right. Select your drumkit file to load it. The import process takes only a second, so don't be surprised if it seems to happen too quickly. To use your kit, right-click on your drumkit in the **Sound Library** tab of the Hydrogen window and select **Load**. ![](load.jpg) If you already had data entered into a Hydrogen pattern, your data will still be there after switching kits. If you followed GM, your sequence should sound basically the same, just played on a different drum kit! ## Automation A few years ago, me and a friend created 99 Hydrogen drum kits over the course of a few weeks. Organising over a thousand sound files was something we had to do by hand (and ear), but the last thing we wanted to do after all that work was generate 99 ``drumkit.xml`` files manually. Instead, I wrote a simple Python script to do the repetitive stuff for us. The script is called ``genhydro``, and its sole purpose is to generate a ``drumkit.xml`` file from a directory full of FLAC files, and create an archive of the directory. You can find the script over at https://gitlab.com/genhydro/genhydro. Feel free to use it if you don't want to generate the XML by hand. ## Benefitting from the hard work of others Hydrogen has a strong and creative community. You can download drumkits from other users from the **Import Library** window. Additionally, you can download my 99 drumkits from http://slackermedia.info/sprints/multimediaSprint_v2/99_hydrogenDrumkits.tar Now go make some great beats!