MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / tex

Method tex

packages/alphatab/src/AlphaTabApiBase.ts:862–872  ·  view source on GitHub ↗

* Tells alphaTab to render the given alphaTex. * @param tex The alphaTex code to render. * @param tracks If set, the given tracks will be rendered, otherwise the first track only will be rendered. * @category Methods - Core * @since 0.9.4 * * @example * JavaScript

(tex: string, tracks?: number[])

Source from the content-addressed store, hash-verified

860 * ```
861 */
862 public tex(tex: string, tracks?: number[]): void {
863 try {
864 const parser = new AlphaTexImporter();
865 parser.logErrors = true;
866 parser.initFromString(tex, this.settings);
867 const score: Score = parser.readScore();
868 this.renderScore(score, tracks);
869 } catch (e) {
870 this.onError(e as Error);
871 }
872 }
873
874 /**
875 * Triggers a load of the soundfont from the given data.

Callers

nothing calls this directly

Calls 4

initFromStringMethod · 0.95
readScoreMethod · 0.95
renderScoreMethod · 0.95
onErrorMethod · 0.95

Tested by

no test coverage detected