forked from CoderLine/alphaTab
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for full-bar rests (CoderLine#503)
- Loading branch information
1 parent
dee694d
commit 65f6d93
Showing
7 changed files
with
222 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 3.1 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd"> | ||
<score-partwise version="3.1"> | ||
<work> | ||
<work-title>Title</work-title> | ||
</work> | ||
<identification> | ||
<creator type="composer">Composer</creator> | ||
<encoding> | ||
<software>MuseScore 3.5.0</software> | ||
<encoding-date>2021-01-07</encoding-date> | ||
<supports element="accidental" type="yes"/> | ||
<supports element="beam" type="yes"/> | ||
<supports element="print" attribute="new-page" type="yes" value="yes"/> | ||
<supports element="print" attribute="new-system" type="yes" value="yes"/> | ||
<supports element="stem" type="yes"/> | ||
</encoding> | ||
</identification> | ||
<defaults> | ||
<scaling> | ||
<millimeters>7.05556</millimeters> | ||
<tenths>40</tenths> | ||
</scaling> | ||
<page-layout> | ||
<page-height>1683.36</page-height> | ||
<page-width>1190.88</page-width> | ||
<page-margins type="even"> | ||
<left-margin>56.6929</left-margin> | ||
<right-margin>56.6929</right-margin> | ||
<top-margin>56.6929</top-margin> | ||
<bottom-margin>113.386</bottom-margin> | ||
</page-margins> | ||
<page-margins type="odd"> | ||
<left-margin>56.6929</left-margin> | ||
<right-margin>56.6929</right-margin> | ||
<top-margin>56.6929</top-margin> | ||
<bottom-margin>113.386</bottom-margin> | ||
</page-margins> | ||
</page-layout> | ||
<word-font font-family="FreeSerif" font-size="10"/> | ||
<lyric-font font-family="FreeSerif" font-size="11"/> | ||
</defaults> | ||
<credit page="1"> | ||
<credit-words default-x="595.44" default-y="1626.67" justify="center" valign="top" font-size="24">Title</credit-words> | ||
</credit> | ||
<credit page="1"> | ||
<credit-words default-x="1134.19" default-y="1526.67" justify="right" valign="bottom" font-size="12">Composer</credit-words> | ||
</credit> | ||
<part-list> | ||
<score-part id="P1"> | ||
<part-name>Piano</part-name> | ||
<part-abbreviation>Pno.</part-abbreviation> | ||
<score-instrument id="P1-I1"> | ||
<instrument-name>Piano</instrument-name> | ||
</score-instrument> | ||
<midi-device id="P1-I1" port="1"></midi-device> | ||
<midi-instrument id="P1-I1"> | ||
<midi-channel>1</midi-channel> | ||
<midi-program>1</midi-program> | ||
<volume>78.7402</volume> | ||
<pan>0</pan> | ||
</midi-instrument> | ||
</score-part> | ||
</part-list> | ||
<part id="P1"> | ||
<measure number="1" width="179.49"> | ||
<print> | ||
<system-layout> | ||
<system-margins> | ||
<left-margin>0.00</left-margin> | ||
<right-margin>650.76</right-margin> | ||
</system-margins> | ||
<top-system-distance>170.00</top-system-distance> | ||
</system-layout> | ||
</print> | ||
<attributes> | ||
<divisions>1</divisions> | ||
<key> | ||
<fifths>0</fifths> | ||
</key> | ||
<time> | ||
<beats>2</beats> | ||
<beat-type>4</beat-type> | ||
</time> | ||
<clef> | ||
<sign>G</sign> | ||
<line>2</line> | ||
</clef> | ||
</attributes> | ||
<note> | ||
<rest measure="yes"/> | ||
<duration>2</duration> | ||
<voice>1</voice> | ||
</note> | ||
</measure> | ||
<measure number="2" width="123.62"> | ||
<note> | ||
<rest measure="yes"/> | ||
<duration>2</duration> | ||
<voice>1</voice> | ||
</note> | ||
</measure> | ||
<measure number="3" width="123.62"> | ||
<note> | ||
<rest measure="yes"/> | ||
<duration>2</duration> | ||
<voice>1</voice> | ||
</note> | ||
<barline location="right"> | ||
<bar-style>light-heavy</bar-style> | ||
</barline> | ||
</measure> | ||
</part> | ||
</score-partwise> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { MusicXmlImporterTestHelper } from '@test/importer/MusicXmlImporterTestHelper'; | ||
import { Score } from '@src/model/Score'; | ||
|
||
describe('MusicXmlImporterTests', () => { | ||
it('track-volume', async () => { | ||
let score: Score = await MusicXmlImporterTestHelper.testReferenceFile( | ||
'test-data/musicxml3/track-volume-balance.musicxml' | ||
); | ||
|
||
expect(score.tracks[0].playbackInfo.volume).toBe(16); | ||
expect(score.tracks[1].playbackInfo.volume).toBe(12); | ||
expect(score.tracks[2].playbackInfo.volume).toBe(8); | ||
expect(score.tracks[3].playbackInfo.volume).toBe(4); | ||
expect(score.tracks[4].playbackInfo.volume).toBe(0); | ||
}); | ||
|
||
it('track-balance', async () => { | ||
let score: Score = await MusicXmlImporterTestHelper.testReferenceFile( | ||
'test-data/musicxml3/track-volume-balance.musicxml' | ||
); | ||
|
||
expect(score.tracks[0].playbackInfo.balance).toBe(0); | ||
expect(score.tracks[1].playbackInfo.balance).toBe(4); | ||
expect(score.tracks[2].playbackInfo.balance).toBe(8); | ||
expect(score.tracks[3].playbackInfo.balance).toBe(12); | ||
expect(score.tracks[4].playbackInfo.balance).toBe(16); | ||
}); | ||
|
||
|
||
it('full-bar-rest', async () => { | ||
let score: Score = await MusicXmlImporterTestHelper.testReferenceFile( | ||
'test-data/musicxml3/full-bar-rest.musicxml' | ||
); | ||
|
||
expect(score.tracks[0].staves[0].bars[0].voices[0].beats[0].isFullBarRest).toBeTrue(); | ||
expect(score.tracks[0].staves[0].bars[1].voices[0].beats[0].isFullBarRest).toBeTrue(); | ||
expect(score.tracks[0].staves[0].bars[2].voices[0].beats[0].isFullBarRest).toBeTrue(); | ||
}); | ||
}); |
Oops, something went wrong.