Skip to content

How to specify the loop playback of sections in Alphtab #1126

Answered by Danielku15
hhly asked this question in Q&A
Discussion options

You must be logged in to vote

First find the MasterBars from the Song which indicate the start and end of the range you want to repeat (https://alphatab.net/docs/reference/score).

With the masterBars known you can do something like this:

function setRepeat(api, startMasterBarIndex, endMasterBarIndex) {
    // 1. get master bars from indices
    // https://alphatab.net/docs/reference/score
    const startMasterBar = api.score.masterBars[startMasterBarIndex];
    const endMasterBar = api.score.masterBars[endMasterBarIndex];
    
    // 2. get real playback positions of the masterbars
    // https://alphatab.net/docs/reference/api/tickcache
    const tickCache = api.tickCache;
    const startMasterBarTick = tickCache.get…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hhly
Comment options

Answer selected by Danielku15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants