Class PTITuningFilter

java.lang.Object
eu.bandm.music.midi.Filter
eu.bandm.music.midi.PTITuningFilter
All Implemented Interfaces:
AutoCloseable, Receiver, Transmitter

public class PTITuningFilter extends Filter
Adds a micro-tuning command to every passing NOTE ON message. Considers (a) the current factor "R", as described in the documentation of TI tuning, and (b) the tonality of the currently played example. This tonality is fixed and encoded in the "Playable" object.
  • Field Details

  • Constructor Details

    • PTITuningFilter

      PTITuningFilter(@Opt @Opt Playable p, double r)
      Only constructor. Sets initial values, which can be altered later.
      Parameters:
      p - can be zero on construction only.
  • Method Details

    • getRatio

      public double getRatio()
      Return the currently valid R-value.
    • setRatio

      public void setRatio(double r)
      Change the currently valid R-value.
      Parameters:
      r - between 0.0 and 1.0, inclusive.
    • setPlayable

      public void setPlayable(Playable p)
      Change the data to play. This is filename and tonality, but only tonality is considered in this class.
    • update

      protected void update()
      Fill the local cache table according to the pre-selected tonality and r-value and send the pitch bend messages iff channels are currently sounding.
    • send

      public void send(MidiMessage msg, long timeStamp)
      Filter function: Receive a message and send it to the drain. (The latter is achieved by propagating to the super class.) If it its a
      invalid reference
      NOTE_ON
      , then send an immediately following pitch bend on the same channel, to adjust the sounding pitch from equally tempered to TiTuning(R), by calling bend(int, long).
      Specified by:
      send in interface Receiver
      Overrides:
      send in class Filter
    • getModel

      BoundedRangeModel getModel(int resolution)
      Return a model which can be linked to some GUI widget.