Constructor
(private) new Player(duration, data, pitchMapper, sounder, visualCallback)
Parameters:
Name | Type | Description |
---|---|---|
duration |
integer | the length of the rendering in milliseconds |
data |
DataWrapper | the underlying data (wrapped in interface) |
pitchMapper |
PitchMapper | maps data to pitches |
sounder |
Sounder | the sounder object |
visualCallback |
VisualCallback | the callback function that highlights the current datum |
Methods
_pause()
Temporarily pause the rendering of the chart.
This inherently keeps the sound going at the frequency it was at when
the pause was triggered.
_play()
Resets play state and sets up a recurring function to update the sound
(and, optionally, visual callback) at an interval dependant on the
number of data.
_playLoop()
Update state and set _playOne() to run regularly, to render the sound
(and optional visual cursor movement).
_playOne()
This is where the sound is actually played. If a visual callback was
specified, this also coordinates the visual highlighting of the current
datum as the playback occurs.
playPause()
Main entry point; manages state.