Package org.jjazz.testplayerservice.spi
Interface TestPlayer
public interface TestPlayer
A service to hear a few test notes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TestPlayer
Get the first TestPlayer instance available in the global lookup.void
playTestNotes
(int channel, int fixPitch, int transpose, Runnable endAction) Send a short sequence of Midi notes on specified channel.void
playTestNotes
(Phrase phrase, Runnable endAction) Play the test notes from specified phrase.
-
Method Details
-
getDefault
Get the first TestPlayer instance available in the global lookup.- Returns:
- Can't be null
-
playTestNotes
void playTestNotes(int channel, int fixPitch, int transpose, Runnable endAction) throws MusicGenerationException Send a short sequence of Midi notes on specified channel.If fixPitch < 0 then fixPitch is ignored: play a series of notes starting at 60+transpose. If fixPitch>=0 then play a series of notes with same pitch=fixPitch.
- Parameters:
channel
-fixPitch
- -1 means not used.transpose
- Transposition value in semi-tons to be added to test notes. Ignored if fixPitch>=0.endAction
- Called when playback is over. Can be null.- Throws:
MusicGenerationException
- If a problem occurred.
-
playTestNotes
Play the test notes from specified phrase.- Parameters:
phrase
-endAction
- Called when sequence is over. Can be null.- Throws:
MusicGenerationException
- If a problem occurred.
-