Class MIDIAddress
java.lang.Object
io.github.roboblazers7617.buttonbox.midi.MIDIAddress
- All Implemented Interfaces:
Address<Double>,DoubleAddress
An
DoubleAddress that sends and recieves data over MIDI.-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intMIDI channel to communicate on.final intMIDI command to use.final intData1 to use (note number, CC number, etc).final MIDIDeviceMIDIDevice to communicate with. -
Constructor Summary
ConstructorsConstructorDescriptionMIDIAddress(MIDIDevice midiDevice, int command, int channel, int data1) Creates a new MIDIAddress with the specified command, channel, and data1. -
Method Summary
Modifier and TypeMethodDescriptionintGets the address's channel.intGets the address's command.intgetData1()Gets the address's data1 value.Gets feedback from the address.Gets the changes to the feedback from the address since the last call to this method.Gets changes to the feedback from the address, and clears the queue of changes.Gets feedback from the address.voidSends data to the address.voidsendRaw(int data) Sends raw data to the address.voidsetFeedbackRaw(int feedback) Sets the feedback for the address.
-
Field Details
-
midiDevice
MIDIDevice to communicate with. -
command
public final int commandMIDI command to use.- See Also:
-
channel
public final int channelMIDI channel to communicate on. -
data1
public final int data1Data1 to use (note number, CC number, etc).
-
-
Constructor Details
-
MIDIAddress
Creates a new MIDIAddress with the specified command, channel, and data1.- Parameters:
midiDevice- MIDIDevice to use.command- MIDI command to use.channel- MIDI channel to use.data1- Data1 to use (note number, CC number, etc.).
-
-
Method Details
-
getCommand
public int getCommand()Gets the address's command.- Returns:
- MIDI command number.
-
getChannel
public int getChannel()Gets the address's channel.- Returns:
- MIDI channel number.
-
getData1
public int getData1()Gets the address's data1 value.- Returns:
- Data1 value.
-
send
Description copied from interface:DoubleAddressSends data to the address.- Specified by:
sendin interfaceAddress<Double>- Specified by:
sendin interfaceDoubleAddress- Parameters:
data- Double between 0 and 1 to send.
-
sendRaw
public void sendRaw(int data) Sends raw data to the address.- Parameters:
data- Integer between 0 and 127 to send.
-
getFeedback
Description copied from interface:DoubleAddressGets feedback from the address.- Specified by:
getFeedbackin interfaceAddress<Double>- Specified by:
getFeedbackin interfaceDoubleAddress- Returns:
- Double between 0 and 1 containing control feedback. Empty if no feedback has been recieved.
-
getFeedbackRaw
Gets feedback from the address.- Returns:
- Integer between 0 and 127 containing control feedback. Empty if no feedback has been recieved.
-
setFeedbackRaw
public void setFeedbackRaw(int feedback) Sets the feedback for the address. Not intended to be called outside of theMIDIRouterclass.- Parameters:
feedback- The feedback value to set [0-127].
-
getFeedbackQueue
Description copied from interface:DoubleAddressGets the changes to the feedback from the address since the last call to this method.- Specified by:
getFeedbackQueuein interfaceAddress<Double>- Specified by:
getFeedbackQueuein interfaceDoubleAddress- Returns:
- Doubles between 0 and 1 containing control feedback changes, ordered from least to most recent. Empty if no feedback has been recieved.
-
getFeedbackQueueRaw
Gets changes to the feedback from the address, and clears the queue of changes.- Returns:
- Integers between 0 and 127 containing control feedback changes, ordered from least to most recent.
-