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

## org.log4jfugue
Class Music

This is the central repository of knowledge about the system. It contains the accumulators of located search string counts, which are used by both the message receiver and the sound builder classes

author:
  btarbox

Field Summary
`int` | `MAX_MIDI_VOICES`
`Integer` | `buildIndex`
`def` | `counts`
`HashMap` | `instrumentIndexes`
`def` | `instruments`
`Logger` | `log`

Constructor Summary
`Music()`

Method Summary
`Integer` | `getBuildIndex()` get the accumulator index, should be zero or one
`int` | `getInstrumentIndex(String name)`
`InstrumentVoice` | `getInstrumentVoice(int voiceNumber)` Get a full instrument definition given the instrument number
`int` | `getPlayCount(int voiceNumber)` get the count for a particular instrument out of the right accumulator
`Integer` | `getPlayIndex()`
`void` | `incrementInstrumentCount(String instrumentName)` Used by the Message Receiver, this is the way to increment the count of an instrument when its associated search string is found
`void` | `setProperties(Properties messages)` Used by Spring DI this accepts the set of properties that define the search strings and associated instruments
`void` | `swapIndex()` Used by the Sound Builder when it is time to start building the next music string.

Constructor Detail

### Music

    public Music()

Method Detail

### getBuildIndex

    Integer getBuildIndex()

  get the accumulator index, should be zero or one
  return:

### getInstrumentIndex

    public int getInstrumentIndex(String name)

### getInstrumentVoice

    public InstrumentVoice getInstrumentVoice(int voiceNumber)

  Get a full instrument definition given the instrument number
  param:
    voiceNumber
  return:

### getPlayCount

    public int getPlayCount(int voiceNumber)

  get the count for a particular instrument out of the right accumulator
  param:
    voiceNumber
  return:

### getPlayIndex

    Integer getPlayIndex()

### incrementInstrumentCount

    public void incrementInstrumentCount(String instrumentName)

  Used by the Message Receiver, this is the way to increment the count of an instrument when its associated search string is found
  param:
    instrumentName

### setProperties

    public void setProperties(Properties messages)

  Used by Spring DI this accepts the set of properties that define the search strings and associated instruments
  param:
    messages

### swapIndex

    public void swapIndex()

  Used by the Sound Builder when it is time to start building the next music string. This switches the accumulators so that one is left stable for the sound builder while the next iteration of counts can be started