new ScrollPlayer(s, c)
Object for adding scrolling while playing.
Parameters:
| Name | Type | Description |
|---|---|---|
s |
music21.stream.Stream |
|
c |
canvas |
|
- Source:
Properties:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
pixelMapper |
music21.streamInteraction.PixelMapper | an object that can map current pixel to notes and vice versa. |
||
tempo |
number |
<optional> |
s.tempo | |
lastX |
number | last X value |
||
lastNoteIndex |
Int | index of last note played |
||
barDOM |
SVGDOMObject | DOM object representing the scrolling bar |
||
svgDOM |
SVGDOMObject | DOM object holding the scrolling bar (overlaid on top of canvas) |
||
canvasParent |
DOMObject | the parent DOM object for |
||
lastTimeout |
Int | a numerical reference to a timeout object created by |
||
startTime |
number | the time in ms when the scrolling started |
||
previousSystemIndex |
Int |
<optional> |
0 | the last systemIndex being scrolled |
eachSystemHeight |
number |
<optional> |
120 | currently all systems need to have the same height. |
timingMS |
Int |
<optional> |
50 | amount of time between polls to scroll |
savedRenderOptionClick |
function | starting ScrollPlayer overrides the |
Methods
-
<static> ScrollPlayer#createScrollBar() → {SVGDOMObject}
-
Create the scrollbar (barDOM), the svg to place it in (svgDOM)
and append it over the stream.Sets as a consequence:
- this.barDOM
- this.svgDOM
- this.eachSystemHeight
- this.canvasParent
- Source:
Returns:
scroll bar
- Type
- SVGDOMObject
-
<static> ScrollPlayer#startPlaying()
-
start playing! Create a scroll bar and start scrolling
(set this to an event on stream, or something...)
currently called from
music21.stream.Stream#scrollScoreStartviamusic21.stream.Stream#renderScrollableCanvas. Will change.- Source:
-
<static> ScrollPlayer#stopPlaying(event)
-
Called when the ScrollPlayer should stop playing
Parameters:
Name Type Argument Description eventDOMEvent <optional>
- Source: