@@ -109,8 +109,9 @@ interface MakeAccidentalsParams {
109109 * to just get the parts (NON-recursive)
110110 * @property {StreamIterator } measures - (readonly) a filter on the
111111 * Stream to just get the measures (NON-recursive)
112- * @property {number } tempo - tempo in beats per minute (will become more
113- * sophisticated later, but for now the whole stream has one tempo
112+ * @property {number } tempo - tempo in QuarterLengths per minute -- this is a legacy behavior
113+ * and eventually only MetronomeMarks measured in Beats per minute should be used.
114+ * This property will always remain in QL per minute for backwards compatibility.
114115 * @property {boolean } autoBeam - whether the notes should be beamed automatically
115116 * or not (will be moved to `renderOptions` soon)
116117 * @property {int } [staffLines=5] - number of staff lines
@@ -2377,7 +2378,7 @@ export class Stream<ElementType extends base.Music21Object = base.Music21Object>
23772378 *
23782379 * `options` can be an object containing:
23792380 * - instrument: {@link `music`21.instrument.Instrument} object (default, `this.instrument`)
2380- * - tempo: number (default, `this.tempo`)
2381+ * - tempo: number (default, `this.tempo`) -- should be in BPM but apparently in QL per minute!
23812382 */
23822383 playStream ( options : PlayStreamParams = { } ) : this {
23832384 const params : PlayStreamParams = {
@@ -2404,7 +2405,7 @@ export class Stream<ElementType extends base.Music21Object = base.Music21Object>
24042405 if ( currentNoteIndex <= lastNoteIndex && ! this . _stopPlaying ) {
24052406 const el = elements [ currentNoteIndex ] ;
24062407 let nextNote : ElementType ;
2407- let playDuration : number ;
2408+ let playDuration : number ; // this is in QLs not BPM
24082409 if ( currentNoteIndex < lastNoteIndex ) {
24092410 nextNote = elements [ currentNoteIndex + 1 ] ;
24102411 playDuration = thisFlat . elementOffset ( nextNote ) - thisFlat . elementOffset ( el ) ;
@@ -2784,10 +2785,15 @@ export class Stream<ElementType extends base.Music21Object = base.Music21Object>
27842785 // TODO: on music21p percussion clef defines no lowest line, but does in music21j...
27852786 const lowestLine : number = ( thisClef !== undefined ) ? thisClef . lowestLine : 31 ;
27862787
2788+ // TODO: in Vexflow 5 (also fix numLines below)
2789+ // const lineSpacing: number = storedVexflowStave.options.spacingBetweenLinesPx;
2790+ // const linesAboveStaff: number = storedVexflowStave.options.spaceAboveStaffLn;
27872791 const lineSpacing : number = storedVexflowStave . options . spacing_between_lines_px ;
27882792 const linesAboveStaff : number = storedVexflowStave . options . space_above_staff_ln ;
2789-
2793+
27902794 const notesFromTop = yPxScaled * 2 / lineSpacing ;
2795+
2796+ // TODO: in VexFlow 5...it's .options.numLines
27912797 const notesAboveLowestLine
27922798 = ( storedVexflowStave . options . num_lines - 1 + linesAboveStaff ) * 2
27932799 - notesFromTop ;
0 commit comments