Package com.softsynth.jmsl.midi
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
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
Constructors Constructor Description MidiNoteRecorder()
-
Method Summary
Modifier and Type Method Description void
handleChannelAftertouch(double timeStamp, int channel, int pressure)
does nothingvoid
handleControlChange(double timeStamp, int channel, int id, int value)
does nothingvoid
handleNoteOff(double timeStamp, int channel, int pitch, int velocity)
If record flag is set, add time, pitch and velocity=0 to shapevoid
handleNoteOn(double timeStamp, int channel, int pitch, int velocity)
If record flag is set, add time, pitch and velocity to shapevoid
handlePitchBend(double timeStamp, int channel, int lsb, int msb)
does nothingvoid
handlePolyphonicAftertouch(double timeStamp, int channel, int pitch, int pressure)
does nothingvoid
handleProgramChange(double timeStamp, int channel, int program)
does nothingvoid
handleSysEx(double timeStamp, byte[] data)
does nothingvoid
setThru(boolean f)
Set Midi thru emulation.void
startRecording(double startTime)
clear old notes and set flag to ready recordingvoid
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, isClippingEnabled, isConstrainedToLimits, isSafeOrdering, load, main, prefab, prefab, print, printDim, printDimNames, printStats, qa, randomize, readBinaryHMSLShape, remove, remove, reverse, save, scale, scramble, set, set, set, set, setClipped, setClippingEnabled, 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, getRepeatPlayables, getRepeats, getStartDelay, getStartPause, getStartPlayables, getStartTime, getStopDelay, getStopPlayables, 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 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 interfaceMidiListener
-
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 interfaceMidiListener
-
handlePolyphonicAftertouch
public void handlePolyphonicAftertouch(double timeStamp, int channel, int pitch, int pressure)does nothing- Specified by:
handlePolyphonicAftertouch
in interfaceMidiListener
-
handleControlChange
public void handleControlChange(double timeStamp, int channel, int id, int value)does nothing- Specified by:
handleControlChange
in interfaceMidiListener
-
handleProgramChange
public void handleProgramChange(double timeStamp, int channel, int program)does nothing- Specified by:
handleProgramChange
in interfaceMidiListener
-
handleChannelAftertouch
public void handleChannelAftertouch(double timeStamp, int channel, int pressure)does nothing- Specified by:
handleChannelAftertouch
in interfaceMidiListener
-
handlePitchBend
public void handlePitchBend(double timeStamp, int channel, int lsb, int msb)does nothing- Specified by:
handlePitchBend
in interfaceMidiListener
-
handleSysEx
public void handleSysEx(double timeStamp, byte[] data)does nothing- Specified by:
handleSysEx
in interfaceMidiListener
-