Send note on + off with single button press?

3 posts / 0 new
Last post
danpow
danpow's picture
Send note on + off with single button press?

Hi,
The BC Manager is extensive, yet I am having trouble getting a button to send a note on when pressed, and the corresponding note off when released.
It seems the advanced output would allow me to do this with some (hex?) data input. Is this correct? Is it possible to program this function using the gui instead? If not could one of you clever people provide an example of the required function please? The table input for the advanced section is intimidating me!
on a similar note - excuse the pun - I am struggling to have a button run in 'momentary' mode. I can hack it so it sends a 127 on both on and off toggle state, but the button illuminates like a toggle still, not like a true momentary switch, ie only on press.
Thanks in advance,
Dan

Mark van den Berg
Mark van den Berg's picture

First of all: can't you simply use a "standard output" definition, with Type = Note and Mode = Toggle Off?
This will lead to a Note On message with the specified Velocity when you press the button, and a Note On message with velocity 0 when you release it.

For a "custom output" version of this, you could define the following parameters on the "Custom output" tab:
Output = $90 $3C val (this is note 60 (C4) on MIDI channel 1)
Value 1 = 0 (the Note On velocity when the button is released)
Value 2 = 1-127 (the Note On velocity when the button is pressed)
Mode = Up/down
So in this case you would again get a Note On message with velocity 0 upon button release.

However, to generate a Note Off message upon button release, you'll need a more complicated definition.
For instance:
Output = ifp $90 $3C val ifn $80 $3C $00
Value 1 = 0 (actually any value lower than Value 2 will do, since Value 1 is never actually sent here)
Value 2 = 1-127 (the Note On velocity when the button is pressed)
Mode = Up/down
To explain: in any Output definition, bytes after ifp are sent upon a positive change, bytes after ifn upon a negative change, and in this case these changes coincide with pressing and releasing the button respectively because of our assignments to Value 1 and Value 2.
Consequently, pressing the button yields a Note On message with Value 2 as velocity (via val), and releasing the button yields a Note Off message: $80 $3C $00. Obviously you're free to choose any Note Off velocity you like here.
In fact, you could even define the Note On velocity as a fixed value, e.g.:
Output = ifp $90 $3C $64 ifn $80 $3C $00
So in this case Value 2 is irrelevant too, except that it must be higher than Value 1 to generate the intended triggering pattern.

Hope this helps,
Mark.

Mark van den Berg
Mark van den Berg's picture

As to your question about 'momentary' mode: I'm afraid I don't understand your exact problem. So maybe you could take a look at section 15.9 of BCMI (BC MIDI Implementation.pdf): this explains in detail the B-Control's behavior concerning press-release stages.

Mark.