org.log4jfugue
Class RhythmSoundBuilder

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.

author:
btarbox

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

RhythmSoundBuilder

public RhythmSoundBuilder()


Method Detail

buildLayerString

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
param:
layerNumber
param:
count
return:


buildMainBeat

void buildMainBeat(Rhythm rhythm)
creates a background beat so that user hears something even if no other notes are created
param:
rhythm


doRhythmSubstitution

void doRhythmSubstitution(Rhythm rhythm)
This is the primary smarts of the system, creating rhythm patterns from the instrument counts. AND ITS WRONG! NEED TO GET INSTRUMENT NAMES AND VOICE NUMBERS FROM Music class
param:
rhythm


run

public void run()
Build the music string to send to JFugue


setMessageReceiver

public 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
param:
mr