Class MidiProcessor.NoteMapping

  • Enclosing class:
    MidiProcessor

    protected static class MidiProcessor.NoteMapping
    extends Object
    Represents an entry in a MidiProcessor's note translation map.

    Note: The Java implementation of MIDI uses int 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 a NoteMapping with the channel and note set to 0.
      NoteMapping​(int channel, int noteNumber)
      Constructs a NoteMapping 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 this NoteMapping.
      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 a NoteMapping with the channel and note set to 0.
      • NoteMapping

        public NoteMapping​(int channel,
                           int noteNumber)
        Constructs a NoteMapping verbosely using the provided information.
        Parameters:
        channel - the note's channel
        noteNumber - 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 this NoteMapping.
        Overrides:
        equals in class Object
        Parameters:
        o - the object to compare
        Returns:
        true if o is equal to this NoteMapping, otherwise false
      • hashCode

        public int hashCode()
        Calculates the hash code of this NoteMapping.
        Overrides:
        hashCode in class Object
        Returns:
        the hash code
      • 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