HrButton midi aware button widget.


Inherits from: Object : SCViewHolder


HrButton inherits all the functionality of the standard Button but is midi aware (can do midi learn).


Midi Learn:


Make sure your midi gear is connected, when the button is in focus, press the L key on your keyboard (focus ring will turn to blue meaning "in midi learn mode"), and press a note on your midi controller. Press L again to approve midi learn. The button stores two midi parameters, one for "note on" and one for "note off". So if you do a note on and off while in midi learn mode, it will learn both. If you only want note on, you should confirm learn before sending the noteoff message from your midi gear.


To clear the midi learn data, press L and then 0 (zero).


See also: Button HrSlider


Creation / Class Methods


*new (parent, bounds)

parent - The parent view.

bounds - An instance of Rect, or a Point indicating width@height.

(

w = Window.new.front;

a = HrButton(w, Rect(20, 60, 150, 20)).states_([["1"], ["2"]]);

a.action = { a.value.postln };

)


Accessing Instance and Class Variables

boundOnMidiArgs_(arg1)

boundOnMidiArgs

NoteOnResponder [src, chan, num] arguments as an array for the "note on" message that this widget is bound to. Populated automatically after midi learn operation.

Default value is nil.

boundOffMidiArgs_(arg1)

boundOffMidiArgs

NoteOffResponder [src, chan, num] arguments as an array for the "note off" message that this widget is bound to. Populated automatically after midi learn operation.

Default value is nil.

For the rest of the standard Button methods, consult to the Button help.