Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
dfd7493
refactor(model): represent written pitches as SpelledPitch
Danielku15 Nov 8, 2026
4a2f934
feat(model): keep the written spelling of tuning strings
Danielku15 Nov 8, 2026
269e938
feat(alphatex): keep the spelling of tunings as written
Danielku15 Nov 8, 2026
3e5b12a
feat(importer): read the tuning spelling from MusicXML
Danielku15 Nov 8, 2026
2bb7853
feat(render): draw the accidentals of tunings as music symbols
Danielku15 Nov 8, 2026
e43586c
docs: document sharp and flat tunings
Danielku15 Nov 8, 2026
ce9eb30
fix(platform): add runtime members used by the tuning spelling
Danielku15 Nov 8, 2026
bfd6afa
feat(importer): read and write the sharp or flat tuning display of Gu…
Danielku15 Nov 8, 2026
fd6f13e
docs: document the sharp and flat tunings of Guitar Pro
Danielku15 Nov 8, 2026
32a4cd0
test(render): add the reviewed tuning accidental references
Danielku15 Nov 8, 2026
ae2379a
test(render): add the reviewed Guitar Pro tuning alteration references
Danielku15 Nov 8, 2026
a5c6324
fix(serializer): support arrays of immutable JSON values
Danielku15 Nov 8, 2026
691249c
refactor(model): store tunings as written pitches
Danielku15 Nov 8, 2026
3e1e55c
docs: document the tuning pitches
Danielku15 Nov 8, 2026
3179a68
test(render): compare both color references in one run
Danielku15 Nov 8, 2026
5863d2a
build: update alphaSkia to 4.0.157
Danielku15 Nov 8, 2026
393f598
test(render): update the references for alphaSkia 4
Danielku15 Nov 8, 2026
111a39c
test(render): update the reviewed tuning accidental references
Danielku15 Nov 8, 2026
b703410
test(render): render all test texts with registered fonts
Danielku15 Nov 8, 2026
6de4a9c
test(render): update the references for the added test fonts
Danielku15 Nov 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
93 changes: 93 additions & 0 deletions packages/alphatab/font/noto-sans-math/OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2022 The Noto Project Authors (https://github.com/notofonts/math)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.
92 changes: 92 additions & 0 deletions packages/alphatab/font/noto-sans-sc/OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
This Font Software is licensed under the SIL Open Font License,
Version 1.1.

This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL

-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font
creation efforts of academic and linguistic communities, and to
provide a free and open framework in which fonts may be shared and
improved in partnership with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply to
any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software
components as distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to,
deleting, or substituting -- in part or in whole -- any of the
components of the Original Version, by changing formats or by porting
the Font Software to a new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed,
modify, redistribute, and sell modified and unmodified copies of the
Font Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components, in
Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the
corresponding Copyright Holder. This restriction only applies to the
primary font name as presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created using
the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
6 changes: 3 additions & 3 deletions packages/alphatab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@
},
"devDependencies": {
"@biomejs/biome": "^2.6.4",
"@coderline/alphaskia": "^3.5.147",
"@coderline/alphaskia-linux": "^3.5.147",
"@coderline/alphaskia-windows": "^3.5.147",
"@coderline/alphaskia": "^4.0.157",
"@coderline/alphaskia-linux": "^4.0.157",
"@coderline/alphaskia-windows": "^4.0.157",
"@types/node": "^26.6.6",
"opentype.js": "^2.0.0",
"rimraf": "^6.1.3",
Expand Down
8 changes: 7 additions & 1 deletion packages/alphatab/scripts/Serializer.read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,13 @@ function propertyRead(serializable: TypeSchema, prop: TypeProperty, importer: Im
if (!itemType.isOwnType || itemType.isEnumType) {
return `${field} = ${readValueExpr(type, 'r')};`;
}
const add = jsonAddMethod(prop) ?? `${prop.name}.push`;
if (itemType.isJsonImmutable) {
importer(itemType.typeAsString, itemType.modulePath);
const read = `const items: ${itemType.typeAsString}[] = [];\nr.readArray(rr => {\nitems.push(${itemType.typeAsString}.fromJson(rr.readValue())!);\n});\n${field} = items;`;
return isNullableOrOptional(type) ? `if (!r.isNullish()) {\n${read}\n} else {\n${field} = null;\n}` : read;
}
// the item callback is a closure in which the null check of the field does not narrow
const add = jsonAddMethod(prop) ?? `${prop.name}${isNullableOrOptional(type) ? '!' : ''}.push`;
const read = `${field} = [];\nr.readArray(rr => {\nconst i = ${constructExpr(itemType, importer)};\n${childRead(itemType, 'i', 'rr', ctx, importer)}\nobj.${add}(i);\n});`;
return isNullableOrOptional(type) ? `if (!r.isNullish()) {\n${read}\n}` : read;
}
Expand Down
8 changes: 8 additions & 0 deletions packages/alphatab/scripts/Serializer.write.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ function propertyWrite(serializable: TypeSchema, prop: TypeProperty, id: number,
}
if (type.isArray) {
const itemType = type.arrayItemType!;
if (itemType.isJsonImmutable) {
importer(itemType.typeAsString, itemType.modulePath);
return nullGuard(
type,
field,
`w.arrayField(${id}, ${field}!.length);\nfor (const i of ${field}!) {\nw.writeValue(${itemType.typeAsString}.toJson(i));\n}\nw.endArray();`
);
}
if (itemType.isOwnType && !itemType.isEnumType) {
const itemSerializer = `${itemType.typeAsString}Serializer`;
importer(itemSerializer, findSerializerModule(itemType));
Expand Down
2 changes: 2 additions & 0 deletions packages/alphatab/scripts/SerializerFillEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ function immutableValue(type: TypeWithNullableInfo, importer: Importer): string
switch (type.typeAsString) {
case 'Color':
return 'new Color(1, 2, 3, 4)';
case 'SpelledPitch':
return 'new SpelledPitch(3, 1, 4)';
case 'Font':
importer('FontStyle', type.modulePath);
importer('FontWeight', type.modulePath);
Expand Down
4 changes: 2 additions & 2 deletions packages/alphatab/src/exporter/AlphaTexExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import type { Beat } from '@coderline/alphatab/model/Beat';
import type { Note } from '@coderline/alphatab/model/Note';
import { PercussionMapper } from '@coderline/alphatab/model/PercussionMapper';
import type { Score } from '@coderline/alphatab/model/Score';
import { SpelledPitch } from '@coderline/alphatab/model/SpelledPitch';
import type { Staff } from '@coderline/alphatab/model/Staff';
import type { Track } from '@coderline/alphatab/model/Track';
import { Tuning } from '@coderline/alphatab/model/Tuning';
import { Settings } from '@coderline/alphatab/Settings';

/**
Expand Down Expand Up @@ -677,7 +677,7 @@ export class AlphaTexExporter extends ScoreExporter {
} else if (data.isPiano) {
note.noteValue = {
nodeType: AlphaTexNodeType.Ident,
text: Tuning.getTextForTuning(data.realValueWithoutHarmonic, true)
text: SpelledPitch.formatValue(data.realValueWithoutHarmonic, true, true)
} as AlphaTexIdentifier;
} else if (data.isStringed) {
note.noteValue = {
Expand Down
Loading
Loading