* 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[])
| 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. |
nothing calls this directly
no test coverage detected