Skip to content

playNote() and playBeat() issues #758

@stereokai

Description

@stereokai

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior


1. Short notes are not being synthesized to their full length using playNote()

playNote on any note on the first beat works fine. However:

When calling playnote() for any any quarter note or shorter, on any beat after the first beat, Alphatab tries to play the note (playback is logged), but either no sound is heard, or the note is truncated. The result depends on the value (duration) of the first beat. When the notes are truncated, this is logged:

AlphaTab][AlphaSynth] Position changed: (time: 5.333333333333333/2000.0000000000002, tick: 11/3840, Active Voices: 1

It's important to note, this doesn't happen at all with playBeat.


2. Calling playNote() or playBeat() before the playback has ended breaks the synthesizer

When calling playNote() or playBeat() again (one time is enough) before the playback has ended, it causes the synthesizer to play some combined note or harmonic indefinitely. Alphatab logs thousands of this kind of message:

[AlphaTab][AlphaSynth] Position changed: (time: 623.9999999999998/2000, tick: 1199/3840, Active Voices: 0

Expected Behavior

  1. Short notes will play using playNote() to their full duration irregardless of their position in the tab.
  2. Alphatab should throttle calls to playNote() or playBeat() based on the respective beat duration.

Link to jsFiddle, CodePen, Project

No response

Found in Version

1.3-alpha

Platform

Web

Environment

- **OS**: OSX Big Sur 11.6.2
- **Browser**: Chrome 98

Anything else?

No response

Metadata

Metadata

Assignees

Labels

area-playerRelated to the audio playback engine.platform-allAffects all platformsstate-acceptedThis is a valid topic to work on.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions