Is it possible to add "hidden" track using AlphaTex? #1568
-
I'm generating some basslines using AlphaTex. When they played I'd like to put a chord progression underneath them, but the chords are not really relevant to show as tabs, so I would like to keep the chord-tabs invisible. So in a simplified way, is it possible to do something like this, and if so, what are the right APIs? const api = new AlphaTabApi(dom, config)
const basslineTex = `...`
const guitarChordTex = `...`
api.tex(basslineTex)
api.tex(guitarChordTex, 'invisible') // Question is how?
api.render() // Render only the bassline
buttonDom.addEventListener('click', () => api.playPause()) // Play guitar part too Thanks for any info! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes this is possible the data model holding the song information can have many tracks and they will be played all (unless muted explicitly through APIs). And separately you can tell alphaTab which tracks to render. With the
In your case you would do simply const api = new AlphaTabApi(dom, config)
const basslineTex = `\\track "Bass Line" 1.1 2.1 3.1 4.1`
const guitarChordTex = `\\track "Guitar Line" 1.1 2.1 3.1 4.1`
api.tex(basslineTex + " " + guitarChordTex, [ 0 ] )
// After 10 secs switch to guitar (just for demo)
setTimeout(() => {
api.renderScore(api.score, [ 1 ]);
}, 10000); |
Beta Was this translation helpful? Give feedback.
Yes this is possible the data model holding the song information can have many tracks and they will be played all (unless muted explicitly through APIs). And separately you can tell alphaTab which tracks to render.
With the
tex
method you set the overall song with all tracks.In your case you would do simply