com.softsynth.jmsl.midi
Class MidiNoteRecorder

java.lang.Object
  extended by com.softsynth.jmsl.MusicJob
      extended by com.softsynth.jmsl.MusicShape
          extended by 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

Field Summary
 
Fields inherited from class com.softsynth.jmsl.MusicJob
repeatCount
 
Constructor Summary
MidiNoteRecorder()
           
 
Method Summary
 void handleChannelAftertouch(double timeStamp, int channel, int pressure)
          does nothing
 void handleControlChange(double timeStamp, int channel, int id, int value)
          does nothing
 void handleNoteOff(double timeStamp, int channel, int pitch, int velocity)
          If record flag is set, add time, pitch and velocity=0 to shape
 void handleNoteOn(double timeStamp, int channel, int pitch, int velocity)
          If record flag is set, add time, pitch and velocity to shape
 void handlePitchBend(double timeStamp, int channel, int lsb, int msb)
          does nothing
 void handlePolyphonicAftertouch(double timeStamp, int channel, int pitch, int pressure)
          does nothing
 void handleProgramChange(double timeStamp, int channel, int program)
          does nothing
 void handleSysEx(double timeStamp, byte[] data)
          does nothing
 void setThru(boolean f)
          Set Midi thru emulation.
 void startRecording(double startTime)
          clear old notes and set flag to ready recording
 void stopRecording(double stopTime)
          Set startDelay and differentiate note ON/OFFs.
 
Methods inherited from class com.softsynth.jmsl.MusicShape
add, add, add, add, add, add, add, add, add, add, add, add, add, calcDimStats, calcStats, clipValDim, clone, convertTimeBaseDim, copyDataFrom, copyDataFrom, copyDimensionNameSpace, differentiate, dimension, dimensionNames, dumpSource, dumpSource, dumpSource, fill, finishAll, get, get, getData, getDefault, getDefaultArray, getDefaultArray, getDimension, getDimensionName, getDimName, getHighLimit, getInt, getLowLimit, getMax, getMean, getMin, getNumberOfNames, getSum, insert, integrate, internalRepeat, invert, isConstrainedToLimits, isSafeOrdering, load, main, prefab, prefab, print, printDim, printDimNames, printStats, qa, randomize, readBinaryHMSLShape, remove, remove, reverse, save, scale, scramble, set, set, set, set, setClipped, setConstrainedToLimits, setDefault, setDimensionName, setDimName, setDimName, setLimits, setSafeOrdering, sort, sort, sort, sort, start, statsCalculated, stop, sumSet, sumSet, swap, toString, translate, transpose, usesStandardInvariants, useStandardDimensionNameSpace, useStandardInvariants
 
Methods inherited from class com.softsynth.jmsl.MusicJob
add, addPlayLurker, addRepeatPlayable, addStartPlayable, addStopPlayable, advanceCurrentTime, contains, elements, finish, getChild, getChildren, getCurrentTime, getDataTranslator, getDuration, getInstrument, getName, getParent, getPlayLurkers, getRepeatCount, getRepeatPause, getRepeats, getStartDelay, getStartPause, getStartTime, getStopDelay, getTimeStretch, getTransposition, halt, indexOf, insert, isRunning, launch, launch, play, play, printHierarchy, printHierarchy, remove, removeAll, removeAllPlayLurkers, removeAllRepeatPlayables, removeAllStartPlayables, removeAllStopPlayables, removePlayLurker, removeRepeatPlayable, removeStartPlayable, removeStopPlayable, repeat, run, setCurrentTime, setDataTranslator, setDuration, setInstrument, setName, setParent, setRepeatPause, setRepeats, setStartDelay, setStartPause, setStartTime, setStopDelay, setTimeStretch, setTransposition, size, timeStretch, transposition, waitForDone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MidiNoteRecorder

public MidiNoteRecorder()
Method Detail

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