|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.frinika.sequencer.FrinikaSequencer
public class FrinikaSequencer
The purpose of the Frinika sequencer implementation is to solve the following issues of the current implementation in Sun J2SE5.0: - Smooth looping - Don't skip notes / events on the first tick when starting to play - Able to insert / remove events from the sequence while playing (not same as recording) - Better abilities for song position monitoring NOTE: The Frinika sequencer is not a complete implementation of the Java sequencer. Its primary goals is to solve the needs of Frinika, and the implementation subset is thereafter. To be able to insert and remove events while playing the sequence has to be reorganized from a vector, to a hashtable structure. In the default sequencer pointers to the next midi event to be played is based on the vector index. When inserting or removing notes before the current index the sequencer pointer will break. By using a hashtable with keyword tick and value set to an array of events occuring at that tick, one is able to lookup notes to be played for a given tick position - thus not vulnerable to changes in the ordering of events. The skipping of notes on the start tick, is caused by a bug in the binary search routine of the default sequencer. This binary search is searching for the first event to play after the given starttick. By using the mentioned hashtable above, this is not an issue anymore. Issues with smooth looping is suspected though not verified, to be caused by chasing of controller values when resetting the loop. The symptom is that the longer out in the song you are, the loop gap is longer and longer.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface javax.sound.midi.Sequencer |
|---|
javax.sound.midi.Sequencer.SyncMode |
| Nested classes/interfaces inherited from interface javax.sound.midi.MidiDevice |
|---|
javax.sound.midi.MidiDevice.Info |
| Field Summary |
|---|
| Fields inherited from interface javax.sound.midi.Sequencer |
|---|
LOOP_CONTINUOUSLY |
| Constructor Summary | |
|---|---|
FrinikaSequencer()
|
|
| Method Summary | |
|---|---|
int[] |
addControllerEventListener(javax.sound.midi.ControllerEventListener listener,
int[] controllers)
|
boolean |
addMetaEventListener(javax.sound.midi.MetaEventListener listener)
|
void |
addMidiMessageListener(MidiMessageListener l)
|
void |
addMidiOutDevice(javax.sound.midi.MidiDevice midiDevice)
Register a MidiOutDevice to this sequencer. |
void |
addSequencerListener(SequencerListener sequencerListener)
|
void |
addSongPositionListener(SongPositionListener songPositionListener)
Add a song position listener to the sequencer. |
void |
addTempoChangeListener(TempoChangeListener listener)
Add a tempo change listener to the sequencer. |
void |
close()
|
void |
deployTake(int[] takeNumbers)
Deploy one of the takes from the last recording to recording lanes |
javax.sound.midi.MidiDevice.Info |
getDeviceInfo()
|
int |
getLoopCount()
|
long |
getLoopEndPoint()
|
long |
getLoopStartPoint()
|
javax.sound.midi.Sequencer.SyncMode |
getMasterSyncMode()
|
javax.sound.midi.Sequencer.SyncMode[] |
getMasterSyncModes()
|
int |
getMaxReceivers()
|
int |
getMaxTransmitters()
|
long |
getMicrosecondLength()
|
long |
getMicrosecondPosition()
|
java.util.Collection<MidiMessageListener> |
getMidiMessageListeners()
|
int |
getNumberOfTakes()
Get number of takes from the last recording |
MidiPlayOptions |
getPlayOptions(FrinikaTrackWrapper track)
|
boolean |
getRealtime()
Returns whether to play in realtime or if rendering (e.g. |
long |
getRealTimeTickPosition()
PJL added for Recording Manager |
javax.sound.midi.Receiver |
getReceiver()
|
java.util.List<javax.sound.midi.Receiver> |
getReceivers()
|
java.util.Vector<MultiEvent> |
getRecordingTake(int takeNo)
Return the MultiEvents of a recording take |
javax.sound.midi.Sequence |
getSequence()
|
javax.sound.midi.Sequencer.SyncMode |
getSlaveSyncMode()
|
javax.sound.midi.Sequencer.SyncMode[] |
getSlaveSyncModes()
|
java.util.Collection<FrinikaTrackWrapper> |
getSoloFrinikaTrackWrappers()
|
float |
getTempoFactor()
|
float |
getTempoInBPM()
|
float |
getTempoInMPQ()
|
long |
getTickLength()
|
long |
getTickPosition()
|
long |
getTicksLooped()
|
boolean |
getTrackMute(int track)
|
boolean |
getTrackSolo(int track)
|
javax.sound.midi.Transmitter |
getTransmitter()
|
java.util.List<javax.sound.midi.Transmitter> |
getTransmitters()
|
boolean |
isOpen()
|
boolean |
isRecording()
|
boolean |
isRecording(RecordableLane lane)
|
boolean |
isRunning()
|
boolean |
isSolo(RecordableLane lane)
|
java.util.List<javax.sound.midi.MidiDevice> |
listMidiOutDevices()
|
void |
nonRealtimeNextTick()
If the player is not in realtime mode you can manually trigger the next tick here |
void |
notifySongPositionListeners()
|
void |
open()
|
void |
panic()
Send noteOff and reset all controllers to zero |
void |
recordDisable(RecordableLane lane)
|
void |
recordDisable(javax.sound.midi.Track track)
Deprecated. Use recordEnable on MidiLane instead |
void |
recordEnable(RecordableLane lane)
|
void |
recordEnable(javax.sound.midi.Track track,
int channel)
Deprecated. Use recordEnable on MidiLane instead |
int[] |
removeControllerEventListener(javax.sound.midi.ControllerEventListener listener,
int[] controllers)
|
void |
removeMetaEventListener(javax.sound.midi.MetaEventListener listener)
|
void |
removeMidiMessageListener(MidiMessageListener l)
|
void |
removeMidiOutDevice(javax.sound.midi.MidiDevice midiDevice)
Deregister a midi out device from this sequencer. |
void |
removeSequencerListener(SequencerListener sequencerListener)
|
void |
removeSongPositionListener(SongPositionListener songPositionListener)
Remove a song position listener from the sequencer |
void |
removeTempoChangeListener(TempoChangeListener listener)
Remove a tempo change position listener from the sequencer |
void |
sendMidiMessage(javax.sound.midi.MidiMessage msg,
FrinikaTrackWrapper trackWrapper)
Manually send a midi message using the channel/device settings of a FrinikaTrackWrapper This is also used by wavexport |
void |
setLoopCount(int count)
|
void |
setLoopEndPoint(long tick)
|
void |
setLoopEndPointInBeats(double d)
|
void |
setLoopStartPoint(long tick)
|
void |
setLoopStartPointInBeats(double d)
|
void |
setMasterSyncMode(javax.sound.midi.Sequencer.SyncMode sync)
|
void |
setMicrosecondPosition(long microseconds)
|
void |
setPlayerPriority(int prio)
set priority of the player |
void |
setPlayOptions(FrinikaTrackWrapper track,
MidiPlayOptions opt)
|
void |
setRealtime(boolean realtime)
Set whether to play in realtime or if rendering (e.g. |
void |
setRecordingTakeDialog(RecordingDialog dialog)
|
void |
setSequence(java.io.InputStream stream)
|
void |
setSequence(javax.sound.midi.Sequence sequence)
|
void |
setSlaveSyncMode(javax.sound.midi.Sequencer.SyncMode sync)
|
void |
setSolo(MidiLane lane,
boolean solo)
|
void |
setTempoFactor(float factor)
|
void |
setTempoInBPM(float bpm)
|
void |
setTempoInMPQ(float mpq)
|
void |
setTempoList(TempoList tl)
set the tempolist |
void |
setTickPosition(long tick)
|
void |
setTrackMute(int track,
boolean mute)
|
void |
setTrackSolo(int track,
boolean solo)
|
void |
start()
|
void |
startRecording()
|
void |
stop()
|
void |
stopRecording()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FrinikaSequencer()
| Method Detail |
|---|
public long getRealTimeTickPosition()
public void setLoopEndPointInBeats(double d)
public void setLoopStartPointInBeats(double d)
public void setSequence(javax.sound.midi.Sequence sequence)
throws javax.sound.midi.InvalidMidiDataException
setSequence in interface javax.sound.midi.Sequencerjavax.sound.midi.InvalidMidiDataException
public void setSequence(java.io.InputStream stream)
throws java.io.IOException,
javax.sound.midi.InvalidMidiDataException
setSequence in interface javax.sound.midi.Sequencerjava.io.IOException
javax.sound.midi.InvalidMidiDataExceptionpublic javax.sound.midi.Sequence getSequence()
getSequence in interface javax.sound.midi.Sequencerpublic void start()
start in interface javax.sound.midi.Sequencerpublic void stop()
stop in interface javax.sound.midi.Sequencerpublic boolean isRunning()
isRunning in interface javax.sound.midi.Sequencerpublic int getNumberOfTakes()
public void deployTake(int[] takeNumbers)
takeNo - - the take to deploypublic java.util.Vector<MultiEvent> getRecordingTake(int takeNo)
takeNo -
public void startRecording()
startRecording in interface javax.sound.midi.Sequencerpublic void stopRecording()
stopRecording in interface javax.sound.midi.Sequencerpublic boolean isRecording()
isRecording in interface javax.sound.midi.Sequencer
public void recordEnable(javax.sound.midi.Track track,
int channel)
recordEnable in interface javax.sound.midi.Sequencerpublic void recordEnable(RecordableLane lane)
public void recordDisable(javax.sound.midi.Track track)
recordDisable in interface javax.sound.midi.Sequencerpublic boolean isRecording(RecordableLane lane)
public void recordDisable(RecordableLane lane)
public float getTempoInBPM()
getTempoInBPM in interface javax.sound.midi.Sequencerpublic void setTempoInBPM(float bpm)
setTempoInBPM in interface javax.sound.midi.Sequencerpublic float getTempoInMPQ()
getTempoInMPQ in interface javax.sound.midi.Sequencerpublic void setTempoInMPQ(float mpq)
setTempoInMPQ in interface javax.sound.midi.Sequencerpublic void setTempoFactor(float factor)
setTempoFactor in interface javax.sound.midi.Sequencerpublic float getTempoFactor()
getTempoFactor in interface javax.sound.midi.Sequencerpublic long getTickLength()
getTickLength in interface javax.sound.midi.Sequencerpublic long getTicksLooped()
public long getTickPosition()
getTickPosition in interface javax.sound.midi.Sequencerpublic void setTickPosition(long tick)
setTickPosition in interface javax.sound.midi.Sequencerpublic long getMicrosecondLength()
getMicrosecondLength in interface javax.sound.midi.Sequencerpublic long getMicrosecondPosition()
getMicrosecondPosition in interface javax.sound.midi.MidiDevicegetMicrosecondPosition in interface javax.sound.midi.Sequencerpublic void setMicrosecondPosition(long microseconds)
setMicrosecondPosition in interface javax.sound.midi.Sequencerpublic void setMasterSyncMode(javax.sound.midi.Sequencer.SyncMode sync)
setMasterSyncMode in interface javax.sound.midi.Sequencerpublic javax.sound.midi.Sequencer.SyncMode getMasterSyncMode()
getMasterSyncMode in interface javax.sound.midi.Sequencerpublic javax.sound.midi.Sequencer.SyncMode[] getMasterSyncModes()
getMasterSyncModes in interface javax.sound.midi.Sequencerpublic void setSlaveSyncMode(javax.sound.midi.Sequencer.SyncMode sync)
setSlaveSyncMode in interface javax.sound.midi.Sequencerpublic javax.sound.midi.Sequencer.SyncMode getSlaveSyncMode()
getSlaveSyncMode in interface javax.sound.midi.Sequencerpublic javax.sound.midi.Sequencer.SyncMode[] getSlaveSyncModes()
getSlaveSyncModes in interface javax.sound.midi.Sequencer
public void setTrackMute(int track,
boolean mute)
setTrackMute in interface javax.sound.midi.Sequencerpublic boolean getTrackMute(int track)
getTrackMute in interface javax.sound.midi.Sequencer
public void setTrackSolo(int track,
boolean solo)
setTrackSolo in interface javax.sound.midi.Sequencerpublic boolean getTrackSolo(int track)
getTrackSolo in interface javax.sound.midi.Sequencerpublic boolean addMetaEventListener(javax.sound.midi.MetaEventListener listener)
addMetaEventListener in interface javax.sound.midi.Sequencerpublic void removeMetaEventListener(javax.sound.midi.MetaEventListener listener)
removeMetaEventListener in interface javax.sound.midi.Sequencer
public int[] addControllerEventListener(javax.sound.midi.ControllerEventListener listener,
int[] controllers)
addControllerEventListener in interface javax.sound.midi.Sequencer
public int[] removeControllerEventListener(javax.sound.midi.ControllerEventListener listener,
int[] controllers)
removeControllerEventListener in interface javax.sound.midi.Sequencerpublic void setLoopStartPoint(long tick)
setLoopStartPoint in interface javax.sound.midi.Sequencerpublic long getLoopStartPoint()
getLoopStartPoint in interface javax.sound.midi.Sequencerpublic void setLoopEndPoint(long tick)
setLoopEndPoint in interface javax.sound.midi.Sequencerpublic long getLoopEndPoint()
getLoopEndPoint in interface javax.sound.midi.Sequencerpublic void setLoopCount(int count)
setLoopCount in interface javax.sound.midi.Sequencerpublic int getLoopCount()
getLoopCount in interface javax.sound.midi.Sequencerpublic javax.sound.midi.MidiDevice.Info getDeviceInfo()
getDeviceInfo in interface javax.sound.midi.MidiDevice
public void open()
throws javax.sound.midi.MidiUnavailableException
open in interface javax.sound.midi.MidiDevicejavax.sound.midi.MidiUnavailableExceptionpublic void close()
close in interface javax.sound.midi.MidiDevicepublic boolean isOpen()
isOpen in interface javax.sound.midi.MidiDevicepublic int getMaxReceivers()
getMaxReceivers in interface javax.sound.midi.MidiDevicepublic int getMaxTransmitters()
getMaxTransmitters in interface javax.sound.midi.MidiDevice
public javax.sound.midi.Receiver getReceiver()
throws javax.sound.midi.MidiUnavailableException
getReceiver in interface javax.sound.midi.MidiDevicejavax.sound.midi.MidiUnavailableExceptionpublic java.util.List<javax.sound.midi.Receiver> getReceivers()
getReceivers in interface javax.sound.midi.MidiDevice
public javax.sound.midi.Transmitter getTransmitter()
throws javax.sound.midi.MidiUnavailableException
getTransmitter in interface javax.sound.midi.MidiDevicejavax.sound.midi.MidiUnavailableExceptionpublic java.util.List<javax.sound.midi.Transmitter> getTransmitters()
getTransmitters in interface javax.sound.midi.MidiDevice
public void addMidiOutDevice(javax.sound.midi.MidiDevice midiDevice)
throws javax.sound.midi.MidiUnavailableException
midiDevice -
javax.sound.midi.MidiUnavailableExceptionpublic void removeMidiOutDevice(javax.sound.midi.MidiDevice midiDevice)
midiDevice - public java.util.List<javax.sound.midi.MidiDevice> listMidiOutDevices()
public void addSequencerListener(SequencerListener sequencerListener)
public void removeSequencerListener(SequencerListener sequencerListener)
public void addSongPositionListener(SongPositionListener songPositionListener)
songPositionListener - public void removeSongPositionListener(SongPositionListener songPositionListener)
songPositionListener - public final void notifySongPositionListeners()
public void addTempoChangeListener(TempoChangeListener listener)
listener - public void removeTempoChangeListener(TempoChangeListener listener)
listener - public java.util.Collection<FrinikaTrackWrapper> getSoloFrinikaTrackWrappers()
public void setSolo(MidiLane lane,
boolean solo)
public void setRecordingTakeDialog(RecordingDialog dialog)
public void panic()
public boolean isSolo(RecordableLane lane)
public MidiPlayOptions getPlayOptions(FrinikaTrackWrapper track)
public void setPlayOptions(FrinikaTrackWrapper track,
MidiPlayOptions opt)
public void addMidiMessageListener(MidiMessageListener l)
public void removeMidiMessageListener(MidiMessageListener l)
public void sendMidiMessage(javax.sound.midi.MidiMessage msg,
FrinikaTrackWrapper trackWrapper)
throws javax.sound.midi.InvalidMidiDataException,
javax.sound.midi.MidiUnavailableException
msg - trackWrapper -
javax.sound.midi.InvalidMidiDataException
javax.sound.midi.MidiUnavailableExceptionpublic void setRealtime(boolean realtime)
realtime - public boolean getRealtime()
public void nonRealtimeNextTick()
public void setTempoList(TempoList tl)
tl - public void setPlayerPriority(int prio)
public java.util.Collection<MidiMessageListener> getMidiMessageListeners()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||