Overview | Package | Class
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.log4jfugue
Class SoundBuilder

One of the two primary threads of the system, this class builds and plays the actual music strings.

:
  TODO Should use JFugue's numeric note duration style in buildTempoString

author:
  btarbox

Field Summary
`SimpleDataGetter` | `dataGetter`
`Logger` | `log`
`Music` | `music`
`Player` | `player`
`def` | `synth`

Constructor Summary
`SoundBuilder()`

Method Summary
`String` | `buildMusicString(String allVoices)`
`String` | `buildTempoString(Integer voiceNumber, Integer count)` Not sure yet how to write this.
`String` | `buildVoiceString(String instrumentName, Integer voiceNumber, Integer count)` Build a string formatted as JFugue needs it.
`void` | `run()` Build the music string to send to JFugue.
`void` | `setDataGetter(SimpleDataGetter dg)`
`void` | `setMusic(Music music)` likely set by spring
`void` | `setPlayer(Player player)` set by spring

Constructor Detail

### SoundBuilder

    public SoundBuilder()

Method Detail

### buildMusicString

    String buildMusicString(String allVoices)

### buildTempoString

    String buildTempoString(Integer voiceNumber, Integer count)

  Not sure yet how to write this. If we have count=4 we want 4 quarter notes. If we have count=12 we want 12 12th notes.
  param:
    count
  return:

### buildVoiceString

    String buildVoiceString(String instrumentName, Integer voiceNumber, Integer count)

  Build a string formatted as JFugue needs it.
  param:
    instrumentName
  param:
    voiceNumber
  param:
    count
  return:

### run

    public void run()

  Build the music string to send to JFugue. On each iteration it swaps the accumulator indexes, then starts converting the music counts into music strings. Once the music strings are built they are sent to JFugue. The JFugue call blocks for the duration of the play, which is the only delay in the main for-ever loop of this method.

### setDataGetter

    public void setDataGetter(SimpleDataGetter dg)

### setMusic

    public void setMusic(Music music)

  likely set by spring
  param:
    music

### setPlayer

    public void setPlayer(Player player)

  set by spring
  param:
    player