# Hydrogen handleiding

### Antonio Piraino

### Alessandro Cominu

### Thijs van Severen

### Sebastian Moors

Samenvatting

Hydrogen is a software synthesizer which can be used alone, emulating a drum machine based on patterns, or via an external MIDI keyboard/sequencer software. Hydrogen compiles on Linux/x86 and Mac OS X, although the latter is still experimental, so ask in the developers mailing list for further details.

Lijst van figuren

1.1. The General Tab
1.2. The Audio System Tab
1.3. The MIDI System Tab
1.4. The Appearance Tab
1.5. The Audio Engine tab
2.1. The Main Toolbar
2.2. The Song Editor
2.3. Pattern Editor in Drum mode
2.4. Pattern Editor Controls
2.5. Pattern Editor in Piano mode
2.6. The Mixer
2.7. Select an Effect
3.1. The Pattern Editor
3.2. Inserting Notes in a Pattern
3.3. The Mixer

## Hoofdstuk 1. Inleiding

## 1. Downloaden

You can download Hydrogen from http://www.hydrogen-music.org. On the 'Downloads' page you can find several binaries (installers) for Linux, Mac and Windows. (note that some versions may not be available for Windows and Mac)

If you want to compile Hydrogen yourself (see Paragraaf 2), you can download the latest source files directly from our subversion server with:

    $ svn co http://svn.assembla.com/svn/hydrogen/trunk

A certain release can be fetched with:

    $ svn co http://svn.assembla.com/svn/hydrogen/tags/0.9.5

Compiling Hydrogen depends on the following libraries:

- qt (>= 4.0) at http://www.trolltech.com

- libsndfile at http://www.mega-nerd.com/libsndfile/

- ALSA (>= 1.x) at http://www.alsa-project.com (only if you wish to use ALSA as audio driver)

- Jack Audio Connection Kit (>= 0.80) at http://jackaudio.org/ (only if you wish to use Jack as audio driver)

- PortAudio at http://www.portaudio.com (only if you wish to use PortAudio as audio driver)

- Flac at http://flac.sf.net (only if you wish to use flac samples)

- ladspa at http://ladspa.org (only if you wish to use ladspa effects)

- liblrdf at http://liblrdf.sf.net (only if you wish to use lrdf to categorise effects)

- lash at http://lash.nongnu.org (only if you wish to use lash)

Please install them with your distribution's package manager. If you're running a debian-based system, you can install the libraries with:

    $ apt-get install libqt4-dev g++ libasound2-dev \
            libjack-dev liblrdf0-dev libflac++-dev libtar-dev libsndfile1-dev \
            liblash-dev libportaudio-dev libportmidi-dev

## 2. Compileren

Depending on the branch you are compiling you will need to use Scons or Cmake. Check the INSTALL.txt and the README.txt files for more info (located in the top level dir once you downloaded the sources).

### 2.1. Using scons

Decompress the tarball or go to the directory where the subversion copy was checked out:

    $ cd hydrogen-*
              $ scons
              $ su -c "scons install"

Before compiling, check for additional options with:

    $ scons --help

If you want to use features which are not enabled by default (for instance PortAudio), you can enable them with:

    $ scons portaudio=1

Namely, if you get some error while running Hydrogen and you want to report it remember to configure hydrogen with:

    $ scons debug=1

To clean up compiled code:

    $ scons -c

### 2.2. Using cmake

Compiling with cmake can be done easily by using the make_helper script. Decompress the tarball or go to the directory where the subversion copy was checked out and run the make_helper script without any arguments to display the help :

    $ cd hydrogen-*
              $ ./make_helper

The help is now displayed (and is self-explanatory) :

    $ used builder : cmake
              $ usage ./make_helper [cmds list]
              $ cmds may be
              $    r or rm     =
    > all built, temp and cache files
              $    c or clean  =
    > remove cache files
              $    m or make   =
    > launch the build process
              $    d or doc    =
    > build html documentation
              $    h or help   =
    > show the build options
              $    x or exec   =
    > execute hydrogen

## 3. Preferences

First of all you should make sure that the audio engine is configured properly. The preferences dialog can be accessed via the tools menu (tools -> preferences).

### 3.1. The General tab

On the "General" tab (Figuur 1.1) you can choose to automatically reopen the last used song and/or playlist. This can save you the trouble of having to reopen the song you are working on every time you open Hydrogen. Auto loading the playlist can come in handy when you are using Hydrogen live.

If you want to use Lash to manage your Jack connections you should enable it here so Hydrogen allows interaction with Lash.

The Beat Counter drift compensation and start offset allow you to compensate for system latency when you are using the Beat Counter function (see Paragraaf 3.1)

The Max number of bars in a song can be set here (currently limited to 800) and if you want to use rubberband for sample time-streching you need to enter the path where rubberband is installed on you system here.

Figuur 1.1. The General Tab

### 3.2. The Audio System tab

From the "Audio System" tab (Figuur 1.2) it is possible to modify the audio driver being used (OSS, Jack, ALSA, PortAudio) with its buffer and sampling rate (unless you are using JACK, in this case the audio driver configuration should happen before starting the JACK server).

We can set some features of Hydrogen like "Create per-instrument outputs" this will create 1 output per instrument that you can connect to any other Jack enabled application. This can be useful if you want to add effects to a single instrument with jack-rack for example. "Connect to Default Output Pair" connects the output to the default ports: uncheck this if you want to connect the JACK output to other ports without having to disconnect them first.

Also keep an eye on the value of "Polyphony": depending on your CPU you may want to change the max simultaneous notes in order to prevent hydrogen from overrunning the audio driver.

Figuur 1.2. The Audio System Tab

The following drivers are available:

- jackd: The Jack driver is a professional audio server which permits very low lag and exchanges with other audio software. We strongly recommend using this driver to have the best out of Hydrogen. JACK server will start automatically if not already running.

- ALSA: the widely adopted Linux standard audio drivers

- OSS: The Oss audio driver uses /dev/dsp and it's based on the OSS interface which is supported by the vast majority of sound cards available for Linux; this said, the use of this audio driver blocks /dev/dsp until Hydrogen is closed i.e. unusable by any other software. Use it as last resort.

- PortAudio: an open-source multi platform audio driver

- CoreAudio: a driver for Mac OS X (experimental)

### 3.3. The Midi System tab

The "Midi System" tab (Figuur 1.3) contains all MIDI settings. Here you can choose the MIDI driver, input, and channel(s) that Hydrogen should respond to. You can also define midi bindings: link a midi note/message to an action. To do this simply press the red 'REC' button left of the 'binding' action line. A popup will inform you that Hydrogen is waiting for your input. Press/hit/turn the key/pad/knob on your midi keyboard (or controller) that you want to link to this action. The popup will close and the Event Param value will now show the midi note value of the key you pressed. Once this is done you can select an Action from the action drop-down list. Note that some actions (like SELECT_NEXT_PATTERN) also require an Action Param that references the pattern you want to select with this midi action.

Figuur 1.3. The MIDI System Tab

### 3.4. The Appearance tab

The "Appearance" tab (Figuur 1.4) let's you modify Hydrogen look and feel (font settings and interface style). Also the VU meters fall-off speed of the Mixer Window can be changed here.

Figuur 1.4. The Appearance Tab

### 3.5. The Audio Engine tab (debug only)

The "Audio Engine" tab (Figuur 1.5) is a window that shows various stats about Hydrogen and the audio driver. In case JACK is used, buffer and sampling rate should be set before starting Hydrogen (JACK automatically starts when an application tries to connect).

Note that the Audio Engine tab is only available if Hydrogen was complied with debug support.

Figuur 1.5. The Audio Engine tab

## Hoofdstuk 2. Using Hydrogen

## 1. Used Filetypes

Before working with Hydrogen, please familiarize with these filetypes:

- *.h2pattern: XML file describing a single pattern. Patterns are group of beats and are managed in the pattern editor.

- *.h2song: XML file describing the whole song (or sequence). Songs are group of patterns with their properties and are manager using the song editor

- *.h2playlist: XML file describing a playlist. A Playlist is a (ordered) group of songs.

- *.h2drumkit: a compressed and archived folder containing all sound samples composing a drumkit and a description XML file. Drumkits are basically group of sound samples.

## 2. Main menu

Projects: this menu offers file related functions.

- New - Create a new song

- Show Info - Set general properties of the song such as name, author, license and generic notes

- Open - Open a song

- Open Demo - Open a demo song (demo songs are stored in $INSTALLPATH/share/hydrogen/data/demo_songs)

- Open recent - Open a menu showing last used songs

- Save - Save changes to current song

- Save as - Save current song specifying a name (default path: $HOME/.hydrogen/data/songs)

- Open pattern - Open a saved pattern belonging to the current drumkit

- Export pattern as - Saves a pattern. It will be stored in $HOME/.hydrogen/data/patterns/drumkit_name

- Export MIDI file - Export current song in MIDI format

- Export song - Export current song in WAV format

- Quit - Quit Hydrogen

Instruments: this menu offers instruments and drumkit (sound libraries) functions.

- Add instrument - Add a new instrument to your current drumkit

- Clear all - Delete all instruments from the current drumkit

- Save library - Saves all instruments settings (and their sound samples) in $HOME/.hydrogen/data/library_name

- Export library - Compress all instruments samples and settings in a drumkit in $HOME/.hydrogen/data/library_name

- Import library - Imports another drumkit from the local filesystem or download it from a remote location through an XML feed. The XML file that should be provided is NOT RSS compliant (see Hydrogen website for an example). To load another drumkit in your current working session of Hydrogen, read Paragraaf 7.

Tools: opens the mixer, the director, the playlist editor, the instrument rack and the general preferences window.

- Playlist editor - A tool to manage playlists.

- Director - Open the director window.

- Mixer - Open the mixer window.

- Instrument rack - Open the instrument rack panel.

- Preferences - Open the main preferences window. Read Paragraaf 3 on how to configure Hydrogen.

Debug: tools mainly for debugging and monitoring Hydrogen (only available when compiled with debug support !).

- Show audio engine info - Open a monitor with various stats

- debug action - Insert debug commands.

- Print Objects - Print on stdout current objects map.

Info

- User manual - Open a window with this manual :)

- About - The usual window with license information, acknowledgements, etc.

## 3. De hoofd werkbalk

Before analyzing the two main frames of Hydrogen, let's take a quick look at the main toolbar and its components:

- Pilot the song using the start, stop, pause, etc. buttons

- Choose between "pattern" or "song" mode: in "pattern" mode only the currently selected pattern will play, while in "song" mode all patterns inserted will be played.

- An advanced tap tempo function: choose note length and how many notes to wait before recalculating BPM, then click the comma key repeatedly until the 'R' letter will appear and the BPM will be updated. (see Paragraaf 3.1)

- Manually set BPM

- Manage JACK transport

- Open the mixer and the instrument rack panels

Figuur 2.1. The Main Toolbar

- Main controls to start [Hotkey = Spacebar], stop, record, fast forward, rewind, loop a song or a pattern.

- Set Pattern/Song Mode. When Song mode is selected Hydrogen will play the complete song. This is the sequence of patterns you have created in the Song Editor (see Paragraaf 4). When Pattern mode is selected Hydrogen will play the pattern that is currently selected, and thus displayed in the Pattern Editor (see Paragraaf 5).

- Set measure type and Beat Counter (see Paragraaf 3.1).

- Als je het tempo van een nummer wil aanpassen klik je op de + of - knop. Om de metronoom aan of uit te schakelen kan je het onderste knopje gebruiken.

- Shows CPU load and MIDI events. The CPU bargraph gives you an indication of the CPU load. The MIDI led lights up every time Hydrogen receives a midi message.

- Click J. TRANS to enable Jack transport. If the J. MASTER button is pressed Hydrogen will work as 'master', else it will act as 'slave' to another 'master' program (e.g. Ardour). This applet is only available if Jack Audio Driver is selected.

### 3.1. Tap Tempo and BeatCounter

It is possible to change tempo at any time using the tap-tempo and BeatCounter features of Hydrogen. You can change these while playing or while the song is stopped. To change the tempo, hit the , (comma) key in tempo for the number of beats in the measure. After the correct number of beats are met, the tempo will change to the average tempo that you tapped in. If you continue to tap, these new taps will become a part of a rolling average. If you tap accidentally, or if you wait too long between taps, the tap tempo counter will start over.

The Tap Tempo is a part of the BeatCounter, which is essentially a Tap Tempo on steroids. By default the BeatCounter display is not visible. To see the BeatCounter widget click the upright button (BC) between Song/Pattern mode selector and the BPM-widget. Or, it can be shown by pressing the comma key (,).

The tempo that you tap will be considered even beats of the beat type. The beat type can be set to 1/8 (for eight-note beats), 1/4 (for quarter-note beats), 1/2 (for half-note beats), and 1/1 (for whole-note beats). To change the beat type use the left arrow buttons. To change the number of beats that are counted, use the right arrow button. You can set from 2 to 16 beats. (I.e. if you set the beat to 6, you will have to tap 6 times before the new tempo is computed and set.) When the display shows an R, it means that the BeatCounter is ready to start from 0. Every time you tap with the comma key, it will show the number of taps that you have entered (1, 2, 3...).

The button in the bottom right-hand controls the auto-start feature, and it toggles between S and P. When it shows P for (Play), the song will set the new tempo and automatically start to play after you tap the right number of beats (if it's not already playing, of course). This way, if you have the BeatCounter set up for 4/4, you can tap 1-2-3-4, and start playing on the next beat. When it shows S (for Set BPM), the auto-start is disabled.

For example: Suppose you have a live band, Hydrogen, and a softsynth that is controlled by Seq24)... and you want them all to start at the same time. Set the beat type to 1/4 and the number of beats to 4. Enable auto-start (button shows P). Count off the band 1-2-3-4 (while tapping the comma key) — and everyone starts on 1.

Another example: Same situation, but the song doesn't require Hydrogen or synths until some point later. During that time, a human (e.g. guitar player) will be setting the tempo. On the measure before Hydrogen is supposed to play, tap the comma key 1-2-3-4 with the beat... and you're in on the next beat (at the right tempo).

If you are using the JACK Transport, the BeatCounter continues to work. If another program is the JACK Transport Master, Hydrogen will respond to tempo change events from that application. Note that in this situation, Hydrogen is supposed to be a slave, so some of the BeatCounter features will be disabled or will not work properly. If Hydrogen is the JACK Transport Master, tempo changes from Hydrogen will be reflected in those programs (if they support it).

Some of the settings to adjust the BeatCounter's latency compensation, are located on the General tab of the Preferences Dialog (see Paragraaf 3.1 ). Here you will finde two spinboxes:

- Beat counter drift compensation in 1/10ms — adjust to compensate for latency between the keyboard and the program.

- Beat counter start offset in ms — adjust the time between the BeatCounter's last input stroke and when the song starts playing (if auto-start is activated).

Note that these can be set to positive (+) or negative (-) values. In order to find useful values for these, you will need to take some time to play with it. Also, you may want different values depending on the speed of your hardware, audio devices, drivers, etc. Using the BeatCounter effectively requires practice.

## 4. De Opname editor

The "Song Editor" (Figuur 2.2) gives an overview of the whole timeline of the song (e.g. intro, verse, bridge, chorus and so on); each blue colored square on this panel is a complete bar as shown in the underlying "Pattern Editor" panel. Here we have complete freedom to add, remove or move patterns in any order we prefer. We can also copy and paste patterns: use left mouse button to highlight an area and drag it around. Dragging with CTRL key pressed copies the patterns.

The Song Editor comes with 7 buttons:

- Completely delete all patterns (asks for confirmation!).

- Create a new pattern (and asks for a name).

- Move currently selected pattern up or down.

- Enable selecting patterns for copy & paste (Select Mode).

- Enable Draw Mode.

- Switch from "Single pattern mode" to "Stacked pattern mode" and back..

XXX

Figuur 2.2. The Song Editor

## 5. De Patroon Editor

The "Pattern Editor" lets us create or modify the pattern (bar) which is currently selected. You can add/remove notes, and tune a number of per-note properties like velocity and pan. The Pattern Editor can be used in 2 modes : 'Drum' mode or 'Piano' mode. You can switch between these modes by clicking the Drum/Piano button (located on the top-right of the Pattern Editor)

First let's take a look at the (classic) 'Drum' mode :

Figuur 2.3. Pattern Editor in Drum mode

### 5.1. Pattern Editor Controls

The top part of the pattern editor contains a number of controls :

Figuur 2.4. Pattern Editor Controls

From left to right :

- SIZE : lets you choose the size of the pattern (the number of bars)

- RES : this is the current grid resolution (4 through 64)

  Remember this constraint concerning the grid: if you are working with a resolution of 16 you can't go back to 8 and remove a 16th note. On the other hand if you are working with a resolution of 8 and you try to insert a note in the middle of two bars (looking for a 16 bars precision), notes will be placed in the previous or in the following 8th bar. This constraint can be removed if you disable the whole grid resolution (choose "off" from the grid resolution LCD control). Now you'll be able to place notes wherever you prefer.

- HEAR : when enabled Hydrogen will play the sample as it's being added to the pattern.

- QUANT : enables/disables quantization. When enabled the beats inserted will automatically respect the grid resolution currently applied.

- Drumset / Instrument : when set to Drumset the keys on your midi keyboard will map to the instruments in your sound library as described in the instrument mapping table below. If you set it to Instrument the keys of your midi keyboard will trigger the instrument that is currently selected. The pitch of the instrument will follow the key you press on your keyboard. This feature is mainly used for non-drum instruments. An example : if you use a sample of a piano for one of your instruments, you will be able to 'play' that piano instrument using your keyboard just like you are playing a piano synth.

- Note Length / Note off : these are 2 different ways to define the duration of a note. See Paragraaf 5.3 for usage.

- Drum/Piano : switch Pattern Editor between Drum and Piano mode. (see below)

### 5.2. Pattern Editor Drumkit

The section on the left shows you what drumkit/library is currently selected (GMkit by default) and below that you can see the instruments that are part of this kit.

Each instrument has its own set of features that are accessible by right-clicking the instrument. From the context menu that pops up you can select

- Clear notes : to remove all notes for this instrument in this pattern.

- Fill notes : this allows you to fill up the pattern with notes for the selected instrument. Depending on the choice you make (fill all, fill 1/2, fill 1/4 ...) notes will be placed at all, 1/2, 1/4, etc of the note positions that are allowed by the grid setting. So be careful not to mix up the 'musical' 1/2-note and the 'fill 1/2' note.

- Randomize velocity : automatically apply a pseudo-random velocity to each note of that instrument in the pattern. The more velocity you set on the instrument, the more hydrogen will hit “hard” on that instrument when played.

- Delete Instrument : well, deletes the instrument ;-)

The small red and green buttons right of the instrument names are the “mute” (red) and “solo” (green) buttons.

The order of the instruments can be rearranged by simply dragging an instrument up/down in the list and dropping it on a new position within the drumkit/library. Doing so will not change anything to the sequence you have created for that instrument, nor will it change anything to the song or pattern you are working on. It will however, have an impact on the MIDI note mapping : in the table below you can find the link between the instrument position, the MIDI note and the qwerty keyboard keys.

Important Notes :

The name of the instrument depends on the drumkit that is loaded. This list below refers to the GMkit that is loaded by default.

Keep in mind that it is the position of the instrument (within the loaded drumkit) that is linked to a MIDI-note/keyboard-key and not the name of the instrument.

Here's a quick reference of the above bindings for your convenience.

### 5.3. Pattern Editor Sequence area

This is where it all happens, this is where you can make music :-)

In this area you can see your selected pattern and add notes for any instrument. The simplest way to create a pattern is by adding notes using your mouse (and the 'Fill/Clear notes' function described above). Where you can add notes depends on the used pattern size and resolution.

If you are using Hydrogen as a pure 'drum' you just want Hydrogen to 'hit' the instrument wherever there's a 'dot' in the pattern. If you are using Hydrogen as an 'instrument', the length of the note becomes very important. There are 2 ways to define the length of a note : in 'Note Length' mode you can add a note by left-cliking, and you can 'stretch' that note by right-click-dragging it. This will change the dot into a rectangle that represents the duration of that note. In 'Note Off' mode you can also add a note by left-clicking, but a right-click will now add a blue dot that represents the end of that note.

(Figure above, from left >right : a 'normal' note, a note in 'note length' mode, a note in 'note off' mode)

So far we have only used the mouse to create a pattern, but you can also record your beats by clicking the Record button (see Paragraaf 2) and simply playing your pattern on your MIDI drum or your pc keyboard (see instrument mapping above). This is probably a more musical way of creating a pattern, but it's up to you to decide what works best for you. (Also see Hoofdstuk 3 for a basic walk-through of how the pattern editor works)

### 5.4. Pattern Editor Note Properties

Clicking on an instrument or adding/removing a note next to it will select this instrument. Once an instrument is selected the note properties for this instrument will be shown in the form of vertical lines in the bottom window. The lines represent the value for the selected property of each note of the selected instrument. You can select another note-property from the note property drop-down list (located bottom-left). There are 4 note properties available :

- Velocity : how hard the note is played (the volume of the note)

  Note that the color of the note-dot and the vertical bar will change according to the velocity value you have defined. A light shade of gray means a low velocity (low volume) and the higher you set the velocity the darker the color will be, turning red when you reach the point of clipping.

- Pan : with this parameter you can define the stereo image of the note (how loud it will be in the left/right output)

- Lead/Lag : Lead and Lag allows a slight note lead or lag in respect of the actual beat. The range is ca. 5 ticks which equals around ca. 10 ms at a tempo of 120bpm. Changing the lead/lag can make a huge difference to the way your pattern sounds and feels. It's a groove thing ;-)

- Notekey : if you select this note parameter the area where you can modify the parameter will change into a 'piano keyboard'

  The striped black and white area represents a piano keyboard and in the gray area you can choose the octave. By placing a dot on the octave scale and a dot on the 'keyboard' you can choose any note.

### 5.5. Pattern Editor Piano mode

Drum mode (see Figuur 2.3) focuses on using Hydrogen as a drum machine. If you are using Hydrogen as an instrument there is a big chance that the Piano mode is for you. It gives you a complete 'piano keyboard' so you can easily put down your tunes.

You can compare the Piano mode to the Note properties Notekey (described above), only here you have a complete piano keyboard, so you dont have to select the octave first.

Figuur 2.5. Pattern Editor in Piano mode

## 6. Mixer

Figuur 2.6. The Mixer

The Mixer frame (Figuur 2.6) is useful for tuning a global or single volume of the current drumkit. It shows the current peak (click on to disable, useful on old CPUs) and let you set the maximum peak allowed (tune with the fader knob of the instrument), lets you modify attributes like pan, play solo , mute or test play only that instrument ; selecting in the Pattern Editor an instrument causes a blue LED to light on (near the play button). Near the global volume knob, you can set 3 global effect such a swing (shifts a few notes back or forward not randomly), timing (modify timings of the notes) and humanize effect (random velocity editing).

In addition to all this you can set up to 4 special LADSPA effects for each instrument switching the button. See next section for a detailed overview.

## 7. Sound Library (Drumkit Manager)

The Sound Library saves you time in managing your drum kits, favorite patterns, and favorite songs. When making new songs and drum kits, the Sound Library makes it easier for you to reuse and mix the instruments and patterns from other kits and songs.

### 7.1. System Drumkits

This lists the drumkits that were installed by your system administrator. It was determined by the compile-time prefix. On Unix-like operating systems, this is usually `/usr/share/hydrogen/data/drumkits`, or possibly `/usr/local/share/hydrogen/data/drumkits`. These kits are available to all users on the system, and users are usually not able to add to them.

To load a drumkit from here, right-click the drumkit and select Load. This will replace your current drumkit with the one that you selected. To load a single instrument from that kit, left-click the plus to the left of the drumkit's name to show all the instruments. With your left mouse button, click and drag the instrument into your current kit. The instrument will be added to the drumkit that you currently have loaded.

### 7.2. User Drumkits

These are your own drum kits that you can manage yourself. They are usually stored in `$HOME/.hydrogen/data/drumkits`. When you are creating a new drumkit, you can save it here by selecting Instruments → Save library.

Loading drumkits and instruments to use is the same as for the System Drumkits (see Paragraaf 7.1).

### 7.3. Patterns in the Sound Library

Before you save your favorite patterns to the sound library, be sure to edit it's properties by right-clicking and selecting Properties. There, you can give the pattern a title and a category. You can use one of the categories already provided, or create your own categories by simply typing in a category name. The category name is important, because the patterns will be filed by category in the Sound Library.

You can save your favorite patterns in the sound library by right clicking the title of the pattern in the song editor, and selecting Save Pattern. It will appear in the Sound Library underneath Patterns and the category that you assigned to the pattern.

### 7.4. Songs in the Sound Library

To save songs in the Sound Library, put them in your data directory underneath the `songs` folder (usually `$HOME/data/songs`. To remove them, remove the file from that folder.

## 8. Drumkits and Instrument Editing

Creating a new drumkit with Hydrogen is done with the Instrument Editor. Using the instrument editor you can load samples, set envelope parameters, set the gain, and a few other advanced features like mute groups, low-pass resonance filter, and pitch randomization.

Instead of creating your own drumkit, you can also use or download existing drumkits using the Paragraaf 7.

### 8.1. Concepts

The synthesizer in Hydrogen is a sample-based synthesizer. A sample is a piece of pre-recorded audio (usually between .1 sec and 3 sec). To play a note, the sample is simply played back at the right time. There's a few concepts and terms that you should understand when you are putting together a drumkit. (See Glossary for more detailed explanations.)

Sampling Synthesizer Terms

Sample

  A short recording of a sound, typically between .1 and 3.0 seconds long.

Gain

  Volume adjustment.

Velocity

  How hard you hit a note.

ADSR Envelope Generator

  An Attack/Decay/Sustain/Release envelope generator. After you trigger a note, Hydrogen will attack the note by increasing its volume from 0 to the full velocity of the note. After reaching full velocity, it will decay the note by lowering the volume until it reaches the sustain level. When the note is released, Hydrogen reduces the volume from the sustain level back down to 0.

Attack

  The amount of time to go from 0 to full velocity.

Decay

  The amount of time to go from full velocity to the sustain volume.

Sustain

  The level (how loud) to hold the note between the sustain and the release. It is a percentage of the velocity. It does not depend on time.

Release

  The amount of time to go from the sustain volume back down to 0.

Typical samples that are used in Hydrogen are: the sound of a single drum hit, the sound of a single cymbal hit, the sound of a single cowbell hit. Whenever you put a note in the pattern (or play a note using MIDI), Hydrogen will play whatever sound you have loaded. So, to put together a drum kit you need to gather short recordings of the bass drum, each tom, each cymbal, the high hat open, the high hat closed, the snare drum (snare on), the snare drum (snare off), rim shots, etc.

However, there are no rules about what a sample can be. It's not uncommon to use Hydrogen to trigger non-drum sounds like: audio clips of people talking, a clip from a song, sound effects, audio clips from movies, and famous people speaking. Be creative!

### 8.2. Creating a New Drumkit

To start a brand new drum kit, select Instruments → Clear All . This will give you a bank of 32 blank instruments. To delete instruments, right-click on on each instrument and select Delete Instrument. To add more instruments, select Instruments → Add instrument .

Select an instrument to start editing it. This is done by left-clicking on the name of the instrument in the instrument list (at the left). You will notice that the name of the instrument in the Instrument Editor matches the one that you clicked.

After you have your drum kit working the way you want, select Instruments → Save library . It will ask you for the name of the kit to save. If you wish to overwrite an existing kit, you will need to type in the same name as the kit that you want to replace.

Drumkits are automatically stored in the `data` directory (i.e. `$HOME/data/drumkits`).

To export a drumkit (for sharing with others), it must first be loaded into your Sound Library. Then, select Instruments → Export library from the menu. Select the drum kit that you wish to export, and give it a file name to save it to.

### 8.3. Creating an Instrument and Layers

For each instrument in a drum kit, you can load several samples and set different synthesizer parameters. This section will step you through how to create a new instrument and load the samples.

To begin creating an instrument, select Instruments → Add instrument. This will give you a blank instrument to start from.

Now, you need two samples. Any .WAV or .FLAC file will do. Hydrogen provides several in the `data/drumkits` directory.

In the instrument editor, click on Layers. You can layer several samples into the instrument. Which one is played depends on the velocity of the incoming note. Click Load Layer and point the Audio File Browser to your sample. Note that the Audio File Browser will allow you to preview the sample before you load it. It will also allow you to load more than one sample at a time. But for now, only load one.

After you load the sample, you'll see that there is now a 1 at the top, and the topmost rectangle has turned light blue. To load a second sample, click the slot just below it, and then click Load Layer to bring in another sample.

After bringing in both samples, you'll probably notice that only the first sample is being played whenever you trigger the instrument. This is because you need to set the velocity ranges for the layers. Move your mouse to the sides of the light blue rectangles and you see that you get a left-right drag cursor. Now drag the sample to the left or right (like a curtain). You will now see Layer 2 appear.

The velocity setting for the layer is 0-velocity on the left, and full velocity on the right. Set up Layer 1 to sound for soft notes, and Layer 2 to sound for hard notes. (I.e. Layer 1 on the left and Layer 2 on the right.)

Now, in the pattern area, set up a simple pattern that plays this instrument. Adjust the velocity settings on each note so that you can get the different samples to sound. Now set the pattern to loop and notice how your different samples are getting triggered. (To learn about editing a pattern, see Paragraaf 5)

For each layer, you can set the Gain and the Pitch. The pitch also has a Fine adjustment.

Use the Gain adjustment to control how loud the sample will play. This is necessary because it's extremely difficult to get a set of samples that all sound at about the same volume. By adjusting here, the samples that were recorded too quietly can be turned up to match your loud samples (that had to be turned down).

### Waarschuwing

It is very easy to set the Gain too high, causing your sample to clip. Remember to test the gain with full-velocity notes. If you clip your signal here, it will only get worse as Hydrogen processes it.

The pitch of the sample can be modified with the pitch controls. The Pitch knob adjust the pitch in musical half-steps. (So, -12 is down 1 octave). The pitch on the right adjusts the pitch ±50 cents. (One half-step is 100 cents.)

### Opmerking

The pitch is adjusted by playing the sample back faster or slower. This is called the Dopplar Effect. So, if you have a 1-second sample that you turn down -12 (1 octave), you sample will only last for .5-seconds.

### 8.4. Instrument Parameters

In the instrument editor, click on the General button. Here you can adjust several parameters that are for the whole instrument (not for each layer). The parameters that you can adjust are:

- Envelope parameters: Attack, Decay, Sustain, Release. (See Envelope Generator)

- Gain: The overall volume of the instrument.

- Mute Group: Which mute group this instrument is a member of (see Mute Group).

- Filter Parameters: Bypass, Cutoff, Resonance.

- Random Pitch

It's important that you understand Paragraaf 8.1 in order to continue on.

#### 8.4.1. Envelope Parameters

When the instrument is triggered, its volume is run through an ADSR Envelope. The parameters operate as follows:

- Attack — the amount of time that the volume of the sample goes from 0 to the full velocity of the note. If the value is 0, the sample will play immediately at full velocity. If the value is 1.0, the sample volume will use the maximum time available for the attack parameter. [1]

- Decay — the amount of time for the volume of the sample to go from full velocity down to the sustain volume. If the value is 0, the sample will immediately skip from the attack volume to the sustain volume. If the value is 1.0, the sample volume will use the maximum time available for the decay parameter.[1]

- Sustain — the volume to play the note after the decay phase is over, and until the note is released. If set to 0, the note will be silent. If set to 1.0, the note will play at full velocity.

- Release — the time to fade out the note from the sustain volume back down to 0 (silent). If set to 0, the note will fade out in the minimum amount of time (about 5 ms). If set to 1, it will fade out for the maximum time available.[1]

If the sample is shorter than the times that you specify, the sample will end, regardless of which phase of the ADSR it is in. If the note is sustained, it does not draw out the note while you are holding it. It only holds the gain (volume) parameter during that time.

#### 8.4.2. Gain and Mute Group

The gain sets the overall volume for the sample. This gain is applied after the gain that you set for the layer, and before the gain that is set for the mixer. If the Gain is 0, the instrument will be silent. If the gain is 1.0 the volume of the samples will not be adjusted (i.e. 0 dB). If the gain is set higher, the samples will be amplified.

### Waarschuwing

It is very easy to set the Gain too high, causing your sample to clip. Remember to test the gain with full-velocity notes. If you clip your signal here, it will only get worse as Hydrogen processes it.

Hydrogen provides more mute groups than you know what to do with (over 256). A mute group is a grouping of instruments that are mutually exclusive — only one instrument may be playing at any time. If one is playing and another instrument in the group is triggered, it will immediately silence (mute) and start playing the other instrument. This is useful, especially, for instruments like hi-hats where the open sound and the closed sound are different instruments.

If the mute group is set to Off, then the instrument is not part of any mute grouping. If the mute group is set to any number, then that is the group that the instrument is a part of. To set other instruments into the same grouping, set their mute group parameter to the same number. (For example, to group all the high-hat instruments, you can set all their mute group parameters to 1. To have a snare drum mute group, set their mute group parameters to 2.)

#### 8.4.3. Filter and Random Pitch

The filter is a low-pass resonance filter. If you don't wish to use is, click the BYPass button so that it's red. If it's not red, then the filter is active. The cutoff parameter adjusts the cutoff frequency for the filter. The resonance parameter adjusts how much to resonate the cutoff frequency. If the resonance is set to 0, then the filter is just a simple low-pass filter.

### Opmerking

The cutoff frequency of the filter varies with the sample rate of your audio card. The range of the knob (0 to 1.0) is optimized for a 48,000 kHz sample rate.

The random pitch parameter allows you to randomly vary the pitch of the sample every time it is triggered. The value is set between 0 and 1.0. The pitch change is fairly small: ±2 half-steps × value. Using this sparingly can help your sequences to sound more like a real drummer.

### 8.5. Tips on Editing Instruments

With all of the different parameters available to tweak, it can be difficult to set up something that sounds nice when you're done. Here's a few tips on setting up an instrument:

Turn down the gain. Every time you have a gain knob (i.e. an amplifier), this is called a gain stage. With every gain stage you have, it's easy to overdrive your signal — which means the signal gets distorted by clipping. In addition, if you have two samples that, by themselves, peg your meters — what do you think happens when you combine them? That's right, you overdrive the signal again.

If things sound bad and distorted, start by turning down the gain setting on the layer... especially if it's larger than 1.0. Then turn down the instrument gain. Then any gain on a LADSPA effect. Then the fader on the mixer. Then the master output fader.

Test samples at full velocity. Your sample will be played louder if the velocity is higher. So, if you set everything to sound nice and full with velocity at 0.7, what will happen when you get a full velocity of 1.0? (Hint: clipping.)

Try to use samples that are -6 dB max. Visually, this means samples that peak at only 1/2 of full scale. Otherwise, turn your layer gain to about .5.

Remove all DC offsets from the sample. In a sample editor, there is usually a line down the center of your sample's waveform. This is the zero-line. The beginning of your sample should be on this line. The end of your sample should also be on this line. However, if your signal is a little above or a little below this line, you will hear a click at the beginning and the end of your sample whenever it is played. If your sample editor doesn't provide any tools to fix a DC Offset problem, you can eliminate the noise by putting a slight fade-in/out at the ends of your sample.

The ADSR will not be longer than your sample. If you have a short sample, it doesn't matter how long you set the attack and delay — the sample will stop playing at the end.

Things change with the sample rate. If you have a really nice setup with all your parameters painstakenly tweaked... things will change if you change the sample rate of your audio card. Many of Hydrogens internal settings and parameters are done based on how many samples go by, and not on how many seconds go by. The sort of things that change are: anything time-base (like attack and release) and anything frequency based (like the cutoff frequency).

## 9. LADSPA plugins

Hydrogen can also add effects to sounds using any LADSPA plugin library. You need to have installed the LADSPA sources (available from http://www.ladspa.org) and while this will give a rough idea of how it works you should really have a taste of the real thing installing one or more plugin libraries, it's as simple as a scons && scons install. Here are a few places to download plugin libraries:

- SWH-Plugins available at http://plugin.org.uk. Note that before compiling these plugins you need the FFTW tarball from http://www.fftw.org.

- CMT available at http://www.ladspa.org.

- TAP available at http://tap-plugins.sf.net.

### Plugins Kill

A LADSPA plugin is compiled, executable code. It is capable of hanging, crashing, freezing, screeching, overflowing buffers, and even phoning home. If you start having issues with Hydrogen, disable your plugins and see if things improve. Some plugins are not designed for real-time use, and some are just plain better than others.

Once you have installed a few plugins open a song you'd like add an effect to and select an instrument that has a few beats in the pattern. In the Mixer click on and select one of the four available effect line Click on the Edit button ( ), than on “Select the FX”: this will bring up another window (Figuur 2.7) that lets you choose an effect amongst those installed, they are alphabetically sorted and categorized. Once you're done, adjust the level from the mixer and start playing. Each round knob in the FX part controls the level of its effect. If you want to quickly enable/disable the effect click the Bypass ( ) button.

Figuur 2.7. Select an Effect

[1] The attack, decay, and release parameters are all set by the number of audio samples. This means that the time changes depending on the sample rate of your sound card. The max time for each of them is 100,000 audio samples (typ. 2.27 sec at 44.1 kHz).

## Hoofdstuk 3. Een nieuw liedje

## 1. "Song" mode en "Pattern" mode

XXX

Hydrogen has 2 main modes: "Pattern" mode and "Song" mode (refer to Paragraaf 3 for the buttons to activate). When "Pattern" mode is activated the current pattern is continuously repeated. This mode is very well suited to tweak your pattern untill it's just right, since the pattern you are working on is constantly repeated. This way you can immediately hear the changes you have made. In "Song" mode the whole song is played. This is useful when putting together the patterns, to create the structure of the song.

## 2. Een nieuw patroon

We'll start from an empty song with an empty pattern, as created by default: "pattern" mode should be selected now. It is also possible to change name of the pattern. Now let's click on the “Play” button and while the pattern is playing let's add notes in the grid of the Song Editor (Figuur 3.1) simply left_mouse_clicking on it: adjust grid resolution and BPM speed if needed. Remember some constraints of the grid: if you are working with a resolution of 16 you can't go back to 8 and remove a 16th note; same thing happens if you are working with a resolution of 8 and you try to insert a note in the middle of two bars (looking for a 16 bars precision): they will be placed on the previous or on the following 8th bar (unless you choose “off” from the Grid Resolution LCD, in this case you're free to place notes wherever you prefer). Be sure to select the correct pattern in the Song Editor before adding notes in the Pattern Editor!

Figuur 3.1. The Pattern Editor

## 3. Een nieuw spoor

Once patterns are created (Figuur 3.2), we can copy/paste/delete them simply dragging with the mouse (activate the select mode for the Song Editor and keep pressed left mouse button to select those you want to move or copy).

Figuur 3.2. Inserting Notes in a Pattern

## 4. Aanpassen via de mixer

Natuurlijk kunnen we ook het Mixer venster gebruiken tijdens het maken of afspelen van patronen

The Mixer frame (Figuur 3.3) is made of 32 independent tracks, each of these is binded to an instrument, plus a "Master Output" line to adjust general output volume and a "FX" button to set effects. Every line features 3 buttons ( ), pan adjust ( ), current maximum peak, volume fader and name of the track. Clicking on will play the selected instrument, cutting the others. The "Mute" button , simply mute that instrument. The maximum peak indicates the maximum volume reached from the instrument; the peak must be in a range of 0.0 and 1.0 (in Figuur 3.3 you can see a few volumes too loud), otherwise it will get distorted producing a weird sound (especially with OSS audio driver), in this case it's better to set volume down; keep an eye on each vu-meter.

Figuur 3.3. The Mixer

## Hoofdstuk 4. Shortcut lists

- [CTRL + N] = New Project

- [CTRL + O] = Opname openen

- [CTRL + D] = Open Demo

- [CTRL + S] = Opname opslaan

- [CTRL + SHIFT + S] = Save File as

- [CTRL + P] = Export Pattern as

- [CTRL + M] = Export MIDI file

- [CTRL + E] = Export Song

- [CTRL + Q] = Quit Hydrogen

- [ALT + B] = Show Director window

- [ALT + M] = Show Mixer window

- [ALT + I] = Show Instrument rack

- [ALT + P] = Show Preferences window

- [CTRL + ?] = Show manual

- [Backspace] = Liedje of patroon herstarten vanaf het begin.

- [spacebar] = Play / Pause

- [,] (comma key) = Tap tempo (beatcounter)

## Glossary

This is a glossary of general terms encountered when using Hydrogen, synthesizers, drums, or samplers. The definitions in the text are simplified, but the definitions here are more general and have more explanation. For example, the text of the manual would have you believe that an ADSR is the only kind of envelope generator, and could only ever control the volume. While it's simple for new users, it's not quite right.

ADSR

  A type of envelope generator that allows you to control the Attack, Decay, Sustain, and Release parameters. Generally, the parameters are proportional to the velocity.

  In Hydrogen, the ADSR envelope generator only controls the volume (attenuation).

  Read more about this in the Wikipedia Article ADSR Envelope

  Zie ook Envelope Generator, Attack, Decay, Sustain, Release.

Attack

  This is the first phase of an ADSR envelope, and is the amount of time to turn the parameter up from 0 to full velocity after triggering the note.

  Zie ook ADSR.

Attenuation

  In filters and mixers, this the amount that a signal is reduced (volume).

  Zie ook Roll-off.

Band-Pass Filter

  A filter that preserves a certain band of frequencies, and attenuates (silences) all others. This is often done by combining a high-pass and a low-pass filter.

  Zie ook Filter, High-Pass Filter, Low-Pass Filter.

Clipping

  A phenomenon that happens to a signal when the signal is too large for whatever is receiving it. The peaks of the signal (which are normally smooth curves) get cut off straight at the max volume (clipped). This distorts the sound and is usually undesirable.

  An example of clipping is when you play music louder than your speaker can handle. Parts of the music sound harsh and fuzzy.

Cutoff Frequency

  On high-pass and low-pass filters, this is the frequency that divides between those that pass, and those that are attenuated (silenced). In a high-pass resonance filter, or a low-pass resonance filter, the cutoff is also the frequency zone that gets boosted.

  For example, if you have a low-pass filter and you set the cutoff frequency high (i.e. 20kHz)... the filter will not affect the sound. All the audible frequencies will pass through undisturbed. As you lower the cutoff frequency to something like 40 Hz (the low string on a bass guitar), it sounds like someone is putting a blanket over the speaker. The higher frequencies are being attenuated above 30 Hz.

  Zie ook Filter, High-Pass Filter, Low-Pass Filter, Resonance Filter.

Decay

  After reaching full velocity from the attack, this is the amount of time to turn the parameter down from full velocity to the sustain level.

  Zie ook ADSR.

Envelope Generator

  A way to control (change) a parameter over time as a response to triggering, holding, and releasing a note.

  Did your eyes just glaze over? Let's try again:

  Imagine that you're playing a note on the keyboard and you have your other hand on a knob (volume, filter cutoff, etc.). As you play the note, you twist the knob (often up, then down... or down, then up). You do the same thing on each note. That's what an envelope generator does. See also ADSR

Fader

  A slider control used to adjust the attenuation (volume) in a mixer. Faders always have an "audio" taper, which means that the attenuation amount changes on an exponential scale.

Filter

  A device that changes a sound by attenuating specific frequencies. A tone knob is an example of a simple, low-pass filter.

  Zie ook Band-Pass Filter, High-Pass Filter, Low-Pass Filter, Resonance Filter.

Gain

  In an amplifier, this adjust how much (or how little) a signal is amplified (volume). A higher gain value is a louder signal.

High-Pass Filter

  A filter that attenuates (silences) low frequencies, but allows high frequencies to pass through.

  Zie ook Filter, Cutoff Frequency.

Instrument

  In Hydrogen, an instrument is a single noise-maker (like a bass drum kick, or a tom).

Layer

  In an instrument you can load several different samples (each one called a layer), and have a different sample play depending on the velocity of the note. Only one sample at a time will play.

  Suppose you have a sample of a floor tom being struck softly. If you simply play the sample louder — it will not sound the same as a real tom that has been struck very hard. If you wish to mimic this in your instrument, you can load one sample for soft playing, and a different sample for loud playing.

  Zie ook Instrument.

Low-Pass Filter

  A filter that attenuates (silences) high frequencies, but allows low frequencies to pass through.

  Zie ook Filter, Cutoff Frequency.

Mute

  To make no noise. A setting on an instrument that prevents any audio output.

Mute Group

  A group of instruments (samples) that should mute (stop playing) immediately after another instrument in the group is triggered.

  This is typically used in hi-hats, where there's a different instrument (sample) for when the hi-hat is open or closed. With a real hi-hat, the sound of the open hi-hat will stop as soon as you close it. However, if you use two samples — the open sound will continue even after you have triggered the closed sound. By placing both instruments in the same mute group (group #1, for example)... triggering closed sound will immediately stop the open sound (and vice versa).

Octave

  A span of frequencies where the top-most frequency is exactly twice the frequency of the bottom frequency.

  For example, the range 20 Hz to 40 Hz is an octave. So is 120 Hz to 240 Hz, and 575 Hz to 1150 Hz. While the frequency differences are very different (20 Hz, 120 Hz, and 575 Hz, respectively), to the human ear they sound like the same distance.

Release

  After the note is released, this is the amount of time to reduce the parameter from the sustain level to 0.

  Zie ook ADSR.

Resonance

  When referring to a resonance filter, this is the parameter that determines how much of a boost (gain) to give the frequencies at the cutoff.

  Zie ook Resonance Filter.

Resonance Filter

  A filter that gives a large boost to a very narrow range of frequencies. Typically it will be part of a high-pass or a low-pass filter, where the boosted frequencies are centered on the cut-off frequency.

  Zie ook Filter, Cutoff Frequency, Resonance.

Roll-off

  This is the amount that frequencies are attenuated (suppressed) as the frequency changes (typically measured in dB/octave).

  For example, in a low-pass filter the frequencies below the cutoff frequency are not attenuated (they pass-through with the same volume). Same with the cutoff frequency. As you go above the cutoff frequency, the frequencies that are near the cutoff frequency are not attenuated very much at all. However, the frequencies that are much higher than the cutoff are attenuated (suppressed) a lot. This is usually approximated by a straight line (on a log scale) and measured in in dB of attenuation per octave of frequency.

  Zie ook Attenuation, Filter.

Sample

  A short recording of a sound, typically between .1 and 3.0 seconds long.

Sustain

  The level to hold the parameter after finishing the decay time. This level will be maintained until the not is released.

  Zie ook ADSR.

Velocity

  How hard you hit a note.

  MIDI devices are required to send this information along with the note. Synthesizers use this information to adjust several parameters on the sample (typically the volume). In Hydrogen, it is only used to adjust how loud the sample is played back.