Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play individual notes #187

Closed
garthholmes opened this issue Jul 4, 2018 · 6 comments · Fixed by #428
Closed

Play individual notes #187

garthholmes opened this issue Jul 4, 2018 · 6 comments · Fixed by #428
Assignees
Labels
state-accepted This is a valid topic to work on. type-feature 💡
Milestone

Comments

@garthholmes
Copy link

AlphaTab looks great but I was wondering if there is a way to select individual notes for playback.

The future feature proposals seem very ambitious but the fact that all the basics are covered in a substantive way is steering me towards this particular library but I'd like people who can't read notation to be able to interact with the score rather than DAW functions.

All the best

@Danielku15
Copy link
Member

Thanks for the comprehensive question but please try to use the issue template when possible. It gives clearer impression on what you're using and your goals.

It is still a bit unclear what you mean with "playing individual notes" l. Do you want to play really each individual note (head) like navigating through them with arrow keys and play them. (new feature)

Or do you rather want to define a time range that cam be selected by the user should be played without exceeding the range. (aleady available)

@garthholmes
Copy link
Author

Hello,

Thanks for the reply and my apologies for using the wrong facility to submit was is essentially a feature request.

Yes, I would like to be able to click on the Noteheads and use arrow keys.

Time ranges of course would be nice, and would be a feature that would probably make this library very popular if it isn't already but I am already intrigued by the whole concept.

Cheers and thank you

@Danielku15 Danielku15 self-assigned this Jul 28, 2018
@Danielku15 Danielku15 added type-feature 💡 state-accepted This is a valid topic to work on. labels Jul 28, 2018
@Danielku15 Danielku15 added this to the 1.x milestone Jul 28, 2018
@Danielku15
Copy link
Member

This feature will likely need 2 extensions.

  1. A new option that will provide further rendering details like note heads in the BoundsLookup
  2. AlphaSynth needs to be able to directly generate and play a given note.

@Danielku15
Copy link
Member

I added an option today which allows access to the individual note positions. It currently tracks the note heads on the standard notation and the note number on the track.

First you need to activate the feature either via data attribute:

<div id="alphaTab" data-include-note-bounds="true"></div>

or via option:

$('#alphaTab').alphaTab({
  includeNoteBounds: true
});	

With this option active, you can ask for the note at a given position on the bounds:

var x,y; // relative to the canvas element. 
var beat = boundsLookup.GetBeatAtPos(x,y);
if(beat == null) {
   // nothing clicked
}
else {
    var note = boundsLookup.GetNoteAtPos(beat, x, y); // start searching relative to beat. 
    if(note == null) {
        // beat clicked but no note
    }
    else {
        // note clicked.
    }
} 

This does not yet directly allow an easy navigation with arrow keys but the neccessary information would be there.

@Danielku15 Danielku15 removed this from the 1.x milestone May 7, 2020
@Danielku15 Danielku15 added this to the 1.1 milestone Jul 21, 2020
@Danielku15
Copy link
Member

Feature details: alphaTab should provide a mechanism to play an individual beat of a single track on-demand via an API call. This API call only has an effect if the song is currently not playing.

This feature is meant for editors or lesson-applications which want to play some beats on demand.

@Danielku15
Copy link
Member

New APIs for playing individual beats and notes are available in 1.1.0-alpha.55

https://www.alphatab.net/docs/reference/api/playbeat/
https://www.alphatab.net/docs/reference/api/playnote/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state-accepted This is a valid topic to work on. type-feature 💡
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants