Class: ScrollPlayer

music21.streamInteraction. ScrollPlayer

new ScrollPlayer(s, c)

Object for adding scrolling while playing.

Parameters:
Name Type Description
s music21.stream.Stream
  • Stream
c canvas
  • canvas
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 this.canvas

lastTimeout Int

a numerical reference to a timeout object created by setTimeout

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 'click' event for the stream, switching it to Stop. this saves it for restoring later.

Source:

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#scrollScoreStart via
music21.stream.Stream#renderScrollableCanvas. Will change.

Source:

<static> ScrollPlayer#stopPlaying(event)

Called when the ScrollPlayer should stop playing

Parameters:
Name Type Argument Description
event DOMEvent <optional>
Source:
Music21j, Copyright © 2013-2016 Michael Scott Cuthbert and cuthbertLab.
Documentation generated by JSDoc 3.4.3 on Wed Jul 26th 2017 using the DocStrap template.