Hi Thomas,

On Fri, 12 Mar 2010, Thomas Orgis wrote:

>> If you want to do a mapping inside of hydrogen, do it in midi_input.cpp.
>> Look at line 143 for the takes CC message handling. You may also want to
>> introduce a std::map or something for the NoteOn messages in
>> MidiInput::handleNoteOnMessage.
>
> That looks really useful... I think what I want is just a 
> bit of added magic on line 201:
>
>                       int nInstrument = nNote - 36;
>
> depending on some lookup table in MidiInput, that is 
> modified when CC messages come in, or I really just skip 
> the CC part and set the mapping on note on/off of the 
> hihat pedal. As long as there is no real hihat controller 
> with more levels of openness, this mode would be more 
> useful, even.
>
> I don't see much difficulty in adding this in the source, 
> perhaps adding config file settings, too ... it might be 
[snip]

If I understand this correctly... then a simple way to 
implement this in Hydrogen would be:

   * Implement some variable that maintains state
     (e.g. an enum with OPEN and CLOSED).  We'll
     call it pedal_state.  The variable needs to
     be accessible to the MidiInput class.

   * The MidiInput class would need to handle
     CC#4, changing pedal_state state as it gets
     MIDI data.

   * When Hydrogen gets a MIDI Note On for Notes
     42 (Closed Hi-Hat), or 46 (Open Hi-Hat), it
     needs to re-direct them both based on the
     current value of pedal_state.  (Redirect
     to #42 if CLOSED, #46 if OPEN.)

   * This will ONLY work for a GM-compliant drum
     kit.  For anything else, this is just wrong
     or you'll need to find a way to configure it.
     Hydrogen currently does not have an sort of
     metadata to determine if a kit is GM.

An experimental idea:

   * When the state changes from OPEN to CLOSED,
     generate a note #44 with a low velocity
     to mimic the sound of the cymbols coming
     together.

Note:  The standard CC#4 is a generic "foot pedal" 
controller.  That is, it's intended to be used for generic 
expression pedals.  This controller is not dedicated for 
hi-hats... so make sure that you can disable this 
functionality.

Thanks,
Gabriel


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to