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
4 changes: 2 additions & 2 deletions packages/alphatab/src/importer/Gp3To5Importer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,9 @@ export class Gp3To5Importer extends ScoreImporter {
}

/**
* Guitar Pro 3-6 changes to a bass clef if any string tuning is below B2;
* Guitar Pro 3-6 changes to a bass clef if any string tuning is below B1
*/
private static readonly _bassClefTuningThreshold = ModelUtils.parseTuning('B2')!.realValue;
private static readonly _bassClefTuningThreshold = ModelUtils.parseTuning('B1')!.realValue;

public readTrack(): void {
const newTrack: Track = new Track();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/alphatab/test/importer/Gp5Importer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ describe('Gp5ImporterTest', () => {

it('tuning-bass-clef', async () => {
const score = (await GpImporterTestHelper.prepareImporterWithFile('guitarpro5/bass-tuning.gp5')).readScore();
expect(score.tracks[0].staves[0].bars[0].clef).to.equal(Clef.F4);
expect(score.tracks[0].staves[0].bars[0].clef).to.equal(Clef.G2);
expect(score.tracks[1].staves[0].bars[0].clef).to.equal(Clef.F4);
expect(score.tracks[2].staves[0].bars[0].clef).to.equal(Clef.F4);
expect(score.tracks[3].staves[0].bars[0].clef).to.equal(Clef.F4);
Expand Down
16 changes: 16 additions & 0 deletions packages/alphatab/test/visualTests/features/MusicNotation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { NotationElement } from '@coderline/alphatab/NotationSettings';
import { Settings } from '@coderline/alphatab/Settings';
import { StaveProfile } from '@coderline/alphatab/StaveProfile';
import { ScoreLoader } from '@coderline/alphatab/importer/ScoreLoader';
import { TestPlatform } from 'test/TestPlatform';
import { VisualTestHelper, VisualTestOptions, VisualTestRun } from 'test/visualTests/VisualTestHelper';

describe('MusicNotationTests', () => {
Expand All @@ -21,6 +22,21 @@ describe('MusicNotationTests', () => {
await VisualTestHelper.runVisualTest('music-notation/clefs.gp', settings);
});

it('clefs-gp5', async () => {
const score = ScoreLoader.loadScoreFromBytes(
await TestPlatform.loadFile('test-data/guitarpro5/bass-tuning.gp5')
);
const settings: Settings = new Settings();
settings.display.layoutMode = LayoutMode.Page;

const referenceFileName = 'test-data/visual-tests/music-notation/clefs-gp5.png';

const o = new VisualTestOptions(score, [new VisualTestRun(-1, referenceFileName)], settings);
o.tracks = score.tracks.map(t => t.index);

await VisualTestHelper.runVisualTestFull(o);
});

it('key-signatures-mixed', async () => {
const settings: Settings = new Settings();
settings.display.staveProfile = StaveProfile.Score;
Expand Down
Loading