Skip to Content

continuous, realistic hi-hat control for edrum with CC pedal, plus cymbal choke

6 replies [Last post]
Joined: 12/22/2012


I wrote a script to improve the Hydrogen hi-hat feeling.

It can seamlessly switch from closed to open hihat (and vice-versa), supports cymbals choke (both the ride, crash and via the hi-hat pedal), and slightly improves the dynamics range.

example here:


To use it, you will need:

  • an edrum (I used a Roland TD9)
  • several (at least 3) hi-hat samples from closed to open, i used those plus some closed hihats from other sets
  • mididings (sudo apt-get install mididings)
  • this script: (if you have less or more than 7 hi-hat samples like I did, you'd better modify "hihats_pedal_range" in this script to make it match your number of samples)
  • in Hydrogen, setup your kit like this:
    • first sample from the top: footclick (will be note 36)
    • sample #2: completely closed hihat (will be note 37)
    • sample #3: slightly less closed hihat (will be note 38)
    • ... and so on...
    • then, all the other instruments (it is crucial that all the hihats are consecutive, and my script expects to find the first on note #37)
  • in Hydrogen, disable all mute groups (they don't sound great for this purpose), disable "ignore note-off", and make it listen to channel 9 if it's not already so (channel 10 does not seem to be good for noteoffs, maybe it's faulty in mididings, i don't know)
  • in your edrum: use channel 9, set footclick to note #36, hihat to note #37 (both open and closed if you have both), and hihat pedal to CC#04 (it's called "foot(4)" on mine)

launch script ("mididings -f <script>"), route your midi data into mididings, then from mididings to hydrogen (or another sequencer, maybe for recording, if you like), start banging on your edrum, you should be good to go.


For those interested, on my todolist I have:

  • to find better *closed* hihat samples... I have found way too many too-much-open hihat sounds :(
  • a better way to stop the open hihat, maybe using aftertouch and lowering the volume gracefully... but i don't know if hydrogen handles this

Hope this helps somebody, I've found this kind of features asked many times with very few solutions. I think the drum modules tend to work in very different ways (some send "polyphonic aftertouch" for cymbal choking, other... who knows) but this should be sortable with few modifications to the script.

Let me know if you like this (or not).


thijs's picture
Joined: 04/20/2010

wow sounds great !

is everything you hear in the video Hydrogen generated ?

and what is the 'red bar' we can see on your screen ?

great work!

Joined: 12/22/2012

Thank you! Yes, all the audio comes from Hydrogen.

On my screen you can see qtractor, which I'm using for recording hydrogen :P

thijs's picture
Joined: 04/20/2010

i think this is something that should get integrated into Hydrogen.  the HH script i mean, not qtractor ;-)

Joined: 12/22/2012

now, that would be absolutely great O_O I don't think there are any free (as in beer) realistic drum machines / edrum modules.

code-side, there are a few things my td9 can generate that hydrogen doesn't understand, like the hihat pedal CC signal, the footsplash, and aftertouch for cymbal choking (... and also arbitrary dynamics curves can be helpful). I used noteoffs for choking, which means my midi sequencer does almost never receive noteoffs, which means I have 50-measures long notes in my score. So far it hasn't gone crazy but proper noteoffing wouldn't be bad.

Right now I'm also using qtractor for midi recording ... which I'm not sure if is capable of recording CC and aftertouch ... so maybe Hydrogen could output a "polished" midi signal on its midi-out ... or become capable of recording a whole song (right now it does only record patterns, right?)

samples-side, I had a really hard time finding the closed HH samples, samples for the HH bow, and samples for snare & tom rims ... all of which should be multilayered, they sound a lot better. Maybe I could release a drumkit when I've finished digging ...

wolke's picture
Joined: 03/30/2010


midi note_off messages are implemented. simple uncheck "ignore midi note off messages" in preferences midi tab.  if you trigger a note it is possible to stop the sound by sending a corresponding note_off message. here you can adjust the release time with the instrument adsr settings. this make it possible to become an realistic instrument release in conjunction with note_off messages. also this release settings become important if you work with mute groups.

and it is possible to record more than one pattern at once. see my screenshot.

simple switch to song mode and mark via right clicking and mouse move in time line an record punch in out section. important. each pattern in this song must be an other. like the example in my sceenshot. than press record and play button to start record.

Joined: 12/22/2012

Hi wolke, thank you for your input.

midi note-offs: that's something I wanted to use but my Roland TD9 did not generate them the right way. When you struck a trigger the edrum will play a note_on and a note_off immediately (say, 50ms) after, this will just not sound right. For cymbal choking the Td9 will send a polyphonic aftertouch signal with velocity 0 (which is ignored by hydrogen iirc). So what I did in mididings is to completely ignore the edrum's noteoffs (they are meaningless anyway) and remap the polyphonic aftertouch to noteoffs.

I then added a control to send a noteoff after some time (e.g. 4 seconds since the last noteon for that note) because I was afraid that never-ending notes would drive my sequencer crazy. (Yes this part is not the one i'm most proud of)

ADSR settings: this sounds like something I should try for more realistic cymbal choking, I will dig into it, thanks

mute groups: I tried to use them but the result wasn't great. The problem is that, the way I did this, I have different notes for the same cymbal (like in, various hh with different openness). When you play just one long note repeatedly (say, the open hi-hat) the sounds stack on each other and they are good. If you close a little bit the hh, and play it, all of a sudden the previous hi-hats stop, and it will play just the new, half-open hi-hat, which does not sound right.

Also, I tried to use the foot click note to stop the open hi-hat, but this didn't work well too because sometimes the edrum does not send the foot-click note, for example if you close it very slowly or you don't close it completely (but maybe up to 99.9999% closed). In the end I decided to stop the open hi-hat when the pedal is more than 80% closed, this sounds better, although not perfect.

Recording: I didn't know of this, thank you. It just seems less of a trouble to record MIDI with qtractor and have all together along with other midi and audio, but if the MIDI code gets more complicated (CC#, aftertouch..) and qtractor fails to record it, I will definitely keep this into account


Unrelated question: I tried to put together a drum kit specifically for edrums, with the hi-hat at various openness, two- and three-zones cymbals and drums, rimshots, etc. How does one propose a drum kit for the hydrogen library....?