Skip to content

Commit

Permalink
fix for pitch split + regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Jan 22, 2013
1 parent 2404564 commit 3d55d86
Show file tree
Hide file tree
Showing 7 changed files with 462 additions and 3 deletions.
6 changes: 4 additions & 2 deletions libmscore/score.cpp
Expand Up @@ -2243,7 +2243,7 @@ bool Score::appendScore(Score* score)

void Score::splitStaff(int staffIdx, int splitPoint)
{
qDebug("split staff %d point %d\n", staffIdx, splitPoint);
qDebug("split staff %d point %d", staffIdx, splitPoint);

//
// create second staff
Expand All @@ -2266,7 +2266,9 @@ void Score::splitStaff(int staffIdx, int splitPoint)
clef->setParent(seg);
undoAddElement(clef);

undoChangeBarLineSpan(s, p->nstaves(), 0, staff(staffIdx+p->nstaves())->lines()-1);
int n = p->nstaves();
Staff* nstaff = staff(staffIdx + n - 1);
undoChangeBarLineSpan(s, n, 0, nstaff->lines() - 1);
adjustBracketsIns(staffIdx+1, staffIdx+2);
undoChangeKeySig(ns, 0, s->key(0));

Expand Down
2 changes: 1 addition & 1 deletion mtest/libmscore/CMakeLists.txt
Expand Up @@ -12,7 +12,7 @@
#=============================================================================

subdirs(
hairpin note compat link measure beam split join
hairpin note compat link measure beam split join pitchsplit
timesig layout element midi dynamic plugins copypaste
)

Expand Down
17 changes: 17 additions & 0 deletions mtest/libmscore/pitchsplit/CMakeLists.txt
@@ -0,0 +1,17 @@
#=============================================================================
# MuseScore
# Music Composition & Notation
# $Id:$
#
# Copyright (C) 2011 Werner Schweer
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation and appearing in
# the file LICENSE.GPL
#=============================================================================

set(TARGET tst_pitchsplit)

include(${PROJECT_SOURCE_DIR}/mtest/cmake.inc)

200 changes: 200 additions & 0 deletions mtest/libmscore/pitchsplit/pitchsplit1-ref.mscx
@@ -0,0 +1,200 @@
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="1.24">
<Score>
<LayerTag id="0" tag="default"></LayerTag>
<currentLayer>0</currentLayer>
<Division>480</Division>
<Style>
<page-layout>
<page-height>1683.78</page-height>
<page-width>1190.55</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>
<Spatium>1.76389</Spatium>
</Style>
<showInvisible>1</showInvisible>
<showUnprintable>1</showUnprintable>
<showFrames>1</showFrames>
<showMargins>0</showMargins>
<metaTag name="Platform">X11</metaTag>
<metaTag name="copyright"></metaTag>
<metaTag name="movementNumber"></metaTag>
<metaTag name="movementTitle"></metaTag>
<metaTag name="source"></metaTag>
<metaTag name="workNumber"></metaTag>
<metaTag name="workTitle">Test</metaTag>
<PageList>
<Page>
<System>
</System>
<System>
</System>
</Page>
</PageList>
<Part>
<Staff id="1">
<type>0</type>
<bracket type="-1" span="0"/>
<barLineSpan from="0" to="4">2</barLineSpan>
</Staff>
<Staff id="2">
<type>0</type>
</Staff>
<trackName>Voice</trackName>
<Instrument>
<trackName>Voice</trackName>
<minPitchP>36</minPitchP>
<maxPitchP>94</maxPitchP>
<minPitchA>40</minPitchA>
<maxPitchA>79</maxPitchA>
<Articulation>
<velocity>100</velocity>
<gateTime>100</gateTime>
</Articulation>
<Articulation name="staccato">
<velocity>100</velocity>
<gateTime>85</gateTime>
</Articulation>
<Articulation name="tenuto">
<velocity>100</velocity>
<gateTime>100</gateTime>
</Articulation>
<Articulation name="sforzato">
<velocity>120</velocity>
<gateTime>100</gateTime>
</Articulation>
<Channel>
</Channel>
</Instrument>
</Part>
<Staff id="1">
<VBox>
<height>10</height>
<Text>
<style>Title</style>
<text>Test</text>
</Text>
<Text>
<style>Subtitle</style>
<text>Copy-Paste</text>
</Text>
</VBox>
<Measure number="1">
<Clef>
<concertClefType>G</concertClefType>
<transposingClefType>G</transposingClefType>
</Clef>
<TimeSig>
<sigN>4</sigN>
<sigD>4</sigD>
<showCourtesySig>1</showCourtesySig>
</TimeSig>
<Rest>
<durationType>measure</durationType>
<duration z="4" n="4"/>
</Rest>
</Measure>
<Measure number="2">
<Chord>
<durationType>quarter</durationType>
<Note>
<pitch>60</pitch>
<tpc>14</tpc>
</Note>
</Chord>
<Rest>
<durationType>quarter</durationType>
</Rest>
<Chord>
<durationType>quarter</durationType>
<Note>
<pitch>71</pitch>
<tpc>19</tpc>
</Note>
</Chord>
<Rest>
<durationType>quarter</durationType>
</Rest>
<BarLine>
<subtype>normal</subtype>
<span>2</span>
</BarLine>
</Measure>
<Measure number="3">
<Rest>
<durationType>measure</durationType>
<duration z="4" n="4"/>
</Rest>
<BarLine>
<subtype>normal</subtype>
<span>2</span>
</BarLine>
</Measure>
<Measure number="4">
<Rest>
<durationType>measure</durationType>
<duration z="4" n="4"/>
</Rest>
<BarLine>
<subtype>end</subtype>
<span>2</span>
</BarLine>
</Measure>
</Staff>
<Staff id="2">
<Measure number="1">
<Clef>
<concertClefType>G</concertClefType>
<transposingClefType>F</transposingClefType>
</Clef>
<TimeSig>
<sigN>4</sigN>
<sigD>4</sigD>
<showCourtesySig>1</showCourtesySig>
</TimeSig>
<Rest>
<durationType>measure</durationType>
<duration z="4" n="4"/>
</Rest>
</Measure>
<Measure number="2">
<Rest>
<durationType>quarter</durationType>
</Rest>
<Chord>
<durationType>quarter</durationType>
<Note>
<pitch>57</pitch>
<tpc>17</tpc>
</Note>
</Chord>
<Rest>
<durationType>half</durationType>
</Rest>
</Measure>
<Measure number="3">
<Rest>
<durationType>measure</durationType>
<duration z="4" n="4"/>
</Rest>
</Measure>
<Measure number="4">
<Rest>
<durationType>measure</durationType>
<duration z="4" n="4"/>
</Rest>
</Measure>
</Staff>
</Score>
</museScore>

0 comments on commit 3d55d86

Please sign in to comment.