Class MidiNoteRecorder

java.lang.Object
com.softsynth.jmsl.MusicJob
com.softsynth.jmsl.MusicShape
com.softsynth.jmsl.midi.MidiNoteRecorder
All Implemented Interfaces:
Composable, DimensionNameSpace, MidiListener, Playable, java.lang.Cloneable, java.lang.Runnable

public class MidiNoteRecorder
extends MusicShape
implements MidiListener
MusicShape that logs Midi noteon's to a 3 dimensional MusicShape (timestamp, note, vel)
NoteOff's are logged at noteOn's with vel 0 See MidiParser
Author:
Nick Didkovsky and Phil Burk
  • Constructor Details

    • MidiNoteRecorder

      public MidiNoteRecorder()
  • Method Details

    • startRecording

      public void startRecording​(double startTime)
      clear old notes and set flag to ready recording
    • stopRecording

      public void stopRecording​(double stopTime)
      Set startDelay and differentiate note ON/OFFs. Set flag to ignore incoming MIDI.
    • setThru

      public void setThru​(boolean f)
      Set Midi thru emulation. Noteon's are sent to JMSL.midi if true
    • handleNoteOn

      public void handleNoteOn​(double timeStamp, int channel, int pitch, int velocity)
      If record flag is set, add time, pitch and velocity to shape
      Specified by:
      handleNoteOn in interface MidiListener
    • handleNoteOff

      public void handleNoteOff​(double timeStamp, int channel, int pitch, int velocity)
      If record flag is set, add time, pitch and velocity=0 to shape
      Specified by:
      handleNoteOff in interface MidiListener
    • handlePolyphonicAftertouch

      public void handlePolyphonicAftertouch​(double timeStamp, int channel, int pitch, int pressure)
      does nothing
      Specified by:
      handlePolyphonicAftertouch in interface MidiListener
    • handleControlChange

      public void handleControlChange​(double timeStamp, int channel, int id, int value)
      does nothing
      Specified by:
      handleControlChange in interface MidiListener
    • handleProgramChange

      public void handleProgramChange​(double timeStamp, int channel, int program)
      does nothing
      Specified by:
      handleProgramChange in interface MidiListener
    • handleChannelAftertouch

      public void handleChannelAftertouch​(double timeStamp, int channel, int pressure)
      does nothing
      Specified by:
      handleChannelAftertouch in interface MidiListener
    • handlePitchBend

      public void handlePitchBend​(double timeStamp, int channel, int lsb, int msb)
      does nothing
      Specified by:
      handlePitchBend in interface MidiListener
    • handleSysEx

      public void handleSysEx​(double timeStamp, byte[] data)
      does nothing
      Specified by:
      handleSysEx in interface MidiListener