Class PlaybackSettings
Property change events are fired when settings are modified.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Stringstatic Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFired each time a parameter that can impact music generation is modified .static final String -
Method Summary
Modifier and TypeMethodDescriptionintaddClickTrack(Sequence sequence, SongContext context) Add a click track using the current settings.longaddPrecountClickTrack(Sequence sequence, SongContext context) Add a precount click track to the sequence for the specified song.voidvoidaddPropertyChangeListener(String propName, PropertyChangeListener l) intGet the key transposition applied to chord symbols shown in the UI.intgetClickChannel(MidiMix midiMix) The actual Midi channel to be used with he specified MidiMix.intintGet the precount mode.intgetClickPrecountNbBars(TimeSignature ts, int tempo) Get the number of precount bars.intintstatic PlaybackSettingsintintThe preferred click channel.booleanTrue if playing backing track should be automatically updated in real-time when song changes.booleanbooleanvoidvoidremovePropertyChangeListener(String propName, PropertyChangeListener l) voidsetAutoUpdateEnabled(boolean b) Set if playing backing track should be automatically updated in real-time when song changes.voidsetChordSymbolsDisplayTransposition(int transposition) Set the key transposition applied to chord symbols shown in the UI.voidsetClickPitchHigh(int pitch) voidsetClickPitchLow(int pitch) voidsetClickPrecountEnabled(boolean b) voidSet the precount mode.voidsetClickVelocityHigh(int v) voidsetClickVelocityLow(int v) voidsetLoopCount(int loopCount) Set the loop count of the playback.voidsetPlaybackClickEnabled(boolean b) Enable the click during playback.voidsetPreferredClickChannel(int channel)
-
Field Details
-
CLICK_TRACK_NAME
-
PRECOUNT_CLICK_TRACK_NAME
-
PROP_LOOPCOUNT
- See Also:
-
PROP_CHORD_SYMBOLS_DISPLAY_TRANSPOSITION
- See Also:
-
PROP_CLICK_PITCH_HIGH
- See Also:
-
PROP_CLICK_PITCH_LOW
- See Also:
-
PROP_CLICK_VELOCITY_HIGH
- See Also:
-
PROP_CLICK_VELOCITY_LOW
- See Also:
-
PROP_CLICK_PREFERRED_CHANNEL
- See Also:
-
PROP_CLICK_PRECOUNT_ENABLED
- See Also:
-
PROP_CLICK_PRECOUNT_MODE
- See Also:
-
PROP_PLAYBACK_CLICK_ENABLED
- See Also:
-
PROP_AUTO_UPDATE_ENABLED
- See Also:
-
PROP_MUSIC_GENERATION
Fired each time a parameter that can impact music generation is modified .OldValue=the property name that triggered the musical change, newValue=optional data
- See Also:
-
-
Method Details
-
getInstance
-
getLoopCount
public int getLoopCount() -
setLoopCount
public void setLoopCount(int loopCount) Set the loop count of the playback.- Parameters:
loopCount- If 0, play the song once (no loop). Use Sequencer.LOOP_CONTINUOUSLY for endless loop.
-
getChordSymbolsDisplayTransposition
public int getChordSymbolsDisplayTransposition()Get the key transposition applied to chord symbols shown in the UI.- Returns:
- [0, 12) Default is 0.
-
setChordSymbolsDisplayTransposition
public void setChordSymbolsDisplayTransposition(int transposition) Set the key transposition applied to chord symbols shown in the UI.Ex: if transposition=2, chord=B7 will be shown as C#7.
- Parameters:
transposition- int in range [0, 12)
-
setAutoUpdateEnabled
public void setAutoUpdateEnabled(boolean b) Set if playing backing track should be automatically updated in real-time when song changes.- Parameters:
b-
-
isAutoUpdateEnabled
public boolean isAutoUpdateEnabled()True if playing backing track should be automatically updated in real-time when song changes.- Returns:
-
setPlaybackClickEnabled
public void setPlaybackClickEnabled(boolean b) Enable the click during playback.- Parameters:
b-
-
isPlaybackClickEnabled
public boolean isPlaybackClickEnabled() -
setClickPrecountEnabled
public void setClickPrecountEnabled(boolean b) - Parameters:
b- If true a click precount is used before playing the song.
-
isClickPrecountEnabled
public boolean isClickPrecountEnabled() -
setClickPrecountMode
Set the precount mode.- Parameters:
mode-
-
getClickPrecountMode
-
getClickPrecountNbBars
Get the number of precount bars.The parameters are only used if precount mode is set to AUTO.
Example in AUTO mode: a very fast tempo song will use 2 bars, a 4/4 will use 1 bar up to mid-range tempo etc.- Parameters:
ts- Ignored if precount mode is not AUTO.tempo- Ignored if precount mode is not AUTO.- Returns:
- Can be 1 or 2 bars.
-
setPreferredClickChannel
public void setPreferredClickChannel(int channel) - Parameters:
channel-
-
getPreferredClickChannel
public int getPreferredClickChannel()The preferred click channel.- Returns:
-
getClickChannel
The actual Midi channel to be used with he specified MidiMix.If in the midiMix channel=getPreferredClickChannel() is used and is not a drums/percussion instrument, return the Midi channel MidiConst.CHANNEL_DRUMS. Otherwise return getPreferredClickChannel().
- Parameters:
midiMix-- Returns:
-
setClickPitchHigh
public void setClickPitchHigh(int pitch) - Parameters:
pitch- value must be [35-81] (GM1 drum map)
-
getClickPitchHigh
public int getClickPitchHigh() -
setClickPitchLow
public void setClickPitchLow(int pitch) - Parameters:
pitch- value must be [35-81] (GM1 drum map)
-
getClickPitchLow
public int getClickPitchLow() -
setClickVelocityHigh
public void setClickVelocityHigh(int v) -
getClickVelocityHigh
public int getClickVelocityHigh() -
setClickVelocityLow
public void setClickVelocityLow(int v) -
getClickVelocityLow
public int getClickVelocityLow() -
addClickTrack
Add a click track using the current settings.- Parameters:
sequence- The sequence for which we add the control track.context-- Returns:
- the index of the track in the sequence.
-
addPrecountClickTrack
Add a precount click track to the sequence for the specified song.Except for the cases below, all existing sequence MidiEvents are shifted 1 or 2 bars later in order to leave room for the precount bars.
The following initial events (at tick 0) are not moved:
- Meta track name
- Meta time signature
- Meta tempo
- Meta copyright
- Parameters:
sequence- The sequence for which we add the precount click track. Resolution must be MidiConst.PPQ.context-- Returns:
- The tick position of the start of the song.
-
addPropertyChangeListener
-
addPropertyChangeListener
-
removePropertyChangeListener
-
removePropertyChangeListener
-