Hardware Reference
In-Depth Information
Through the process, on every loop, it reads the digital state of the pedals, and feeds
that into the debouncing mechanism, yielding a result (biased toward the actual
state).
If the current state is different from the “previously read” state, then we have a change;
if the “current state” is “down,” then the pedal was just pressed, and we need to send
a “note on” event; otherwise, a “note off” event should be sent.
Which note is sent is based on an offset. The MIDI mechanism contains a reference
to a “current octave” and a “current transposition” setting; the actual note used is
determined by multiplying the octave by 12, then adding the transposition value.
Therefore, if the current octave is three, and the transposition setting is one (meaning
that the farthest left pedal is now C# and not C, an offset of one half-step), and the
third pedal is depressed, the actual note is calculated through the use of the pedal,
plus the octave offset, plus the transposition. The pedals start at zero, so the pedal
number is two:
2 + 3*12 + 1 = 39
This actually yielded a bug in the initial demonstration of the Alcyone. If the transpo-
sition settings were changed while a note was being played, the “note off” event would
be for the wrong note! The reason should be fairly apparent.
Assume the “note on” event is for note 39 (as in the calculation above). Now let us set
the transposition to zero (i.e., reset it). Now, when the pedal is released, the “note off”
value is calculated… at 38, instead of 39.
The “note off” event thus doesn't correspond to the “note on” event, and therefore a
receiver doesn't actually get the correct signal to release the note.
This is corrected by the use of another data element, the “last note sent by this pedal.”
Thus, note off events take the note value from this dataset, rather than recalculating
the note value when the pedal is released.
Thus, the pedal press/release cycle follows this process:
1. Physically depress pedal (poor, sad pedal).
2. Calculate MIDI note by offset of pedal + 12*octave + transposition.
3. Store MIDI note in an internal array, index based on the offset of the pedal.
4. Send MIDI on.
5. Physically release the pedal.
6. Send MIDI off based on the note in the internal array.
Search WWH ::




Custom Search