Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -843,11 +843,11 @@ export class AlphaTex1LanguageDefinitions {
]);
public static readonly noteProperties = AlphaTex1LanguageDefinitions._props([
['nh', null],
['ah', [[[[106], 1]]]],
['th', [[[[106], 1]]]],
['ph', [[[[106], 1]]]],
['sh', [[[[106], 1]]]],
['fh', [[[[106], 1]]]],
['ah', [[[[106], 3]]]],
['th', [[[[106], 3]]]],
['ph', [[[[106], 3]]]],
['sh', [[[[106], 3]]]],
['fh', [[[[106], 3]]]],
['v', null],
['vw', null],
['sl', null],
Expand Down
18 changes: 18 additions & 0 deletions packages/alphatab/test/importer/AlphaTexImporter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,24 @@ describe('AlphaTexImporterTest', () => {
testExportRoundtrip(score);
});

it('harmonic-values-fractional', () => {
const score = parseTex(`
2.3{ah 2.4} 2.3{th 2.7} 2.3{ph 3.5} 2.3{sh 8.5} 2.3{fh 2.4}
`);
const beats = score.tracks[0].staves[0].bars[0].voices[0].beats;
expect(beats[0].notes[0].harmonicType).toBe(HarmonicType.Artificial);
expect(beats[0].notes[0].harmonicValue).toBe(2.4);
expect(beats[1].notes[0].harmonicType).toBe(HarmonicType.Tap);
expect(beats[1].notes[0].harmonicValue).toBe(2.7);
expect(beats[2].notes[0].harmonicType).toBe(HarmonicType.Pinch);
expect(beats[2].notes[0].harmonicValue).toBe(3.5);
expect(beats[3].notes[0].harmonicType).toBe(HarmonicType.Semi);
expect(beats[3].notes[0].harmonicValue).toBe(8.5);
expect(beats[4].notes[0].harmonicType).toBe(HarmonicType.Feedback);
expect(beats[4].notes[0].harmonicValue).toBe(2.4);
testExportRoundtrip(score);
});

it('time-signature-commons', () => {
const score = parseTex(`
\\ts common
Expand Down
2 changes: 1 addition & 1 deletion packages/alphatex/src/properties/note/ah.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const ah: PropertyDefinition = {
shortDescription: 'The harmonic value',
longDescription: harmonicValueDocs,
type: alphaTab.importer.alphaTex.AlphaTexNodeType.Number,
parseMode: alphaTab.importer.alphaTex.ArgumentListParseTypesMode.Optional
parseMode: alphaTab.importer.alphaTex.ArgumentListParseTypesMode.OptionalAsFloat
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/alphatex/src/properties/note/fh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const fh: PropertyDefinition = {
shortDescription: 'The harmonic value',
longDescription: harmonicValueDocs,
type: alphaTab.importer.alphaTex.AlphaTexNodeType.Number,
parseMode: alphaTab.importer.alphaTex.ArgumentListParseTypesMode.Optional
parseMode: alphaTab.importer.alphaTex.ArgumentListParseTypesMode.OptionalAsFloat
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/alphatex/src/properties/note/ph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ph: PropertyDefinition = {
shortDescription: 'The harmonic value',
longDescription: harmonicValueDocs,
type: alphaTab.importer.alphaTex.AlphaTexNodeType.Number,
parseMode: alphaTab.importer.alphaTex.ArgumentListParseTypesMode.Optional
parseMode: alphaTab.importer.alphaTex.ArgumentListParseTypesMode.OptionalAsFloat
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/alphatex/src/properties/note/sh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const sh: PropertyDefinition = {
shortDescription: 'The harmonic value',
longDescription: harmonicValueDocs,
type: alphaTab.importer.alphaTex.AlphaTexNodeType.Number,
parseMode: alphaTab.importer.alphaTex.ArgumentListParseTypesMode.Optional
parseMode: alphaTab.importer.alphaTex.ArgumentListParseTypesMode.OptionalAsFloat
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/alphatex/src/properties/note/th.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const th: PropertyDefinition = {
shortDescription: 'The harmonic value',
longDescription: harmonicValueDocs,
type: alphaTab.importer.alphaTex.AlphaTexNodeType.Number,
parseMode: alphaTab.importer.alphaTex.ArgumentListParseTypesMode.Optional
parseMode: alphaTab.importer.alphaTex.ArgumentListParseTypesMode.OptionalAsFloat
}
]
}
Expand Down
Loading