|
|||||
FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Derived from the SoundBuilder class, this class builds and plays a rhythm based sound. This avoids the problem of building a chromatic string since rhythm is basically atonal.
Field Summary | |
---|---|
ArrayList |
instrumentNames
|
Logger |
log
|
MessageReceiver |
messageReceiver
|
Constructor Summary | |
RhythmSoundBuilder()
|
Method Summary | |
---|---|
String |
buildLayerString(int layerNumber, int count, String instrumentName)
if count = 1, then 1 note every 16 beats if count = 2 then 1 note every 8 beats if count = 3 then 1 note every 5ish beats if count = 4 then 1 note every 4 beats so, numBeatsBetween = MEASURE_BEATS / count |
void |
buildMainBeat(Rhythm rhythm)
creates a background beat so that user hears something even if no other notes are created |
void |
doRhythmSubstitution(Rhythm rhythm)
This is the primary smarts of the system, creating rhythm patterns from the instrument counts. |
void |
run()
Build the music string to send to JFugue |
void |
setMessageReceiver(MessageReceiver mr)
Used by Spring DI to inject the MessageReceiver; this is primarily so that this class can access the instrument definitions known by the receiver |
Constructor Detail |
---|
public RhythmSoundBuilder()
Method Detail |
---|
String buildLayerString(int layerNumber, int count, String instrumentName)
void buildMainBeat(Rhythm rhythm)
void doRhythmSubstitution(Rhythm rhythm)
public void run()
public void setMessageReceiver(MessageReceiver mr)