Class MidiProcessor.NoteMapping
- java.lang.Object
-
- com.github.noahr_atc.midisplitter.MidiProcessor.NoteMapping
-
- Enclosing class:
- MidiProcessor
protected static class MidiProcessor.NoteMapping extends Object
Represents an entry in aMidiProcessor
's note translation map.
Note: The Java implementation of MIDI usesint
to represent all MIDI values, however they should still reflect the 7/4 bit values specified in the MIDI standard.
Note 2: MIDI note velocity is not stored because the velocity of the NOTE-OFF message is always 0 and thus won't match the NOTE-ON.- Since:
- 2020-03-08
- See Also:
- Summary of MIDI Messages
-
-
Constructor Summary
Constructors Constructor Description NoteMapping()
Constructs aNoteMapping
with the channel and note set to 0.NoteMapping(int channel, int noteNumber)
Constructs aNoteMapping
verbosely using the provided information.
-
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
Determines whether or not an object is equal to thisNoteMapping
.int
getChannel()
Retrieves the MIDI channel of the note contained in this mapping entry.int
getNoteNumber()
Retrieves the MIDI number for the note/key contained in this mapping entry.int
hashCode()
Calculates the hash code of this NoteMapping.void
setChannel(int channel)
Assigns the MIDI channel of the note contained in this mapping entry.void
setNoteNumber(int noteNumber)
Assigns the MIDI number for the note/key contained in this mapping entry.
-
-
-
Constructor Detail
-
NoteMapping
public NoteMapping()
Constructs aNoteMapping
with the channel and note set to 0.
-
NoteMapping
public NoteMapping(int channel, int noteNumber)
Constructs aNoteMapping
verbosely using the provided information.- Parameters:
channel
- the note's channelnoteNumber
- the MIDI key/note that the message concerns
-
-
Method Detail
-
equals
public boolean equals(Object o)
Determines whether or not an object is equal to thisNoteMapping
.
-
hashCode
public int hashCode()
Calculates the hash code of this NoteMapping.
-
getChannel
public int getChannel()
Retrieves the MIDI channel of the note contained in this mapping entry.- Returns:
- the 4-bit number of the MIDI channel
-
setChannel
public void setChannel(int channel)
Assigns the MIDI channel of the note contained in this mapping entry.- Parameters:
channel
- the 4-bit number of the MIDI channel to set
-
getNoteNumber
public int getNoteNumber()
Retrieves the MIDI number for the note/key contained in this mapping entry.- Returns:
- the 7-bit MIDI number of the note
-
setNoteNumber
public void setNoteNumber(int noteNumber)
Assigns the MIDI number for the note/key contained in this mapping entry.- Parameters:
noteNumber
- the 7-bit MIDI number of the note to set
-
-