Skip to content

Commit

Permalink
Merge commit '0994aaf8eafa2a655bd3e0605540577c7dd51c37' into hotfix/0…
Browse files Browse the repository at this point in the history
….6.8

* commit '0994aaf8eafa2a655bd3e0605540577c7dd51c37':
  change log
  files moved to regression tests
  gmn update
  remove useless staff tags
  getOrder is now kDontMove (fix issue grame-cncm#96)
  useless include removed
  optimize tellPosition for fingering (empty first call)
  improve multi staff slurs
  • Loading branch information
arshiacont committed Feb 26, 2020
2 parents 256261e + 0994aaf commit 8de4de0
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 60 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ GUIDO Engine history
- fix incorrect tuplets on chords (issue #103)
- fix incorrect tremolo on chords preceded by a grace note (issue #108)
- fix incorrect incorrect slur position (issue #94)
- fix missing clef and signatures due to staff tag (part of issue #96)

----------------------------------------------------------------
version 1.6.7
Expand Down
4 changes: 2 additions & 2 deletions gmn-examples/chord/chords.gmn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
[
\barFormat<"system"> \title<"Leaf"> \staff<1> \clef<"g2"> \key<-2> \meter<"4/4">
\barFormat<"system"> \title<"Leaf"> \clef<"g2"> \key<-2> \meter<"4/4">
\t<"Cm7", 13> ({e&1*1, g1})
\t<"F7", 13> ({d1*1, f1})
\t<"BbM7", 13> ({d1*1, f1, a1})
Expand Down Expand Up @@ -46,7 +46,7 @@
\t<"G7#9", 15> ({e1*1, g#1, b1})
],
[
\staff<2> \clef<"f4"> \key<-2> \meter<"4/4">
\clef<"f4"> \key<-2> \meter<"4/4">
{f0*1, b&0} {e&0*1, a0} {g0*1, c1} {g0*1, c1}
{a0*1, d1} {f#0/2, c1} {f#0/2, c1} {g0*1, c1} {f0/2, b0} {f0/2, b0}
\repeatEnd
Expand Down
19 changes: 0 additions & 19 deletions open-issues/g-issue96.gmn

This file was deleted.

25 changes: 25 additions & 0 deletions regression-tests/issues/g-issue96.gmn
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(*
Issue #96
Cross Staff Beaming Part 3
upper staff notes are not included in the beaming
in addition, clef, meter and time signature are not displayed
when the rest is commented (likely because the first note is not on the staff)
*)

{
[
\staff<1>
\clef<"g2"> \key<-5> \meter<"C">
\staff<2> \stemsUp
\slurBegin:1<curve="down">
\beam (a&0/16 \staff<1> e&1/16 g&/16 \staff<2> g&0/16 \slurEnd:1)
\slurBegin:1<curve="down">
\beam(a&/16 \staff<1> d&1/16 f/16 \staff<2> f0/16 \slurEnd:1)
\slurBegin:1<curve="down">
\beam(a&/16 \staff<1> d&1/16 f/16 \staff<2> f0/16 \slurEnd:1 )
\slurBegin:1<curve="down">
\beam(a&/16 \staff<1> d&1/16 f/16 \staff<2> f0/16 \slurEnd:1 )
\staff<1> \bar
],
[ \staff<2> \clef<"f4"> \key<-5> {a&-2/1, a&-1/1} \bar ]
}
58 changes: 29 additions & 29 deletions open-issues/issue59.gmn → regression-tests/issues/issue59.gmn
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
[
\title<"Test file (flags issue)">
\unit<"mm">\tempo<"tempo [1/4] = 203 | Eb major", dy=15>\pageFormat<"215.9, 279.4, 10, 20, 10, 20">
\barFormat<style="system">
]
,
[
\staff<1> \clef<""> \meter<"4/4", autoMeasuresNum="on"> _/1 _]
,
[
\staff<2> \clef<""> \meter<"4/4", autoMeasuresNum="on"> _/1 _]
,
[
\staff<3> \clef<"c0"> \meter<"4/4", autoMeasuresNum="on"> _/1 _]
,
[
\staff<4> \clef<""> \meter<"4/4", autoMeasuresNum="on"> _/1 _]
,
[
\staff<5> \clef<""> \meter<"4/4", autoMeasuresNum="on"> _/1 _]
,
[
\staff<6> \clef<""> \meter<"4/4", autoMeasuresNum="on"> _/1 _]
,
[
\beamsOff
{\staff<6> d2/16, \staff<5> d2, \staff<4> a1,\staff<3> c1, \staff<3> a1}
]
{
[
\title<"Test file (flags issue)">
\unit<"mm">\tempo<"tempo [1/4] = 203 | Eb major", dy=15>\pageFormat<"215.9, 279.4, 10, 20, 10, 20">
\barFormat<style="system">
]
,
[
\staff<1> \clef<""> \meter<"4/4", autoMeasuresNum="on"> _/1 _]
,
[
\staff<2> \clef<""> \meter<"4/4", autoMeasuresNum="on"> _/1 _]
,
[
\staff<3> \clef<"c0"> \meter<"4/4", autoMeasuresNum="on"> _/1 _]
,
[
\staff<4> \clef<""> \meter<"4/4", autoMeasuresNum="on"> _/1 _]
,
[
\staff<5> \clef<""> \meter<"4/4", autoMeasuresNum="on"> _/1 _]
,
[
\staff<6> \clef<""> \meter<"4/4", autoMeasuresNum="on"> _/1 _]
,
[
%\beamsOff
{\staff<6> d2/16, \staff<5> d2, \staff<4> a1,\staff<3> c1, \staff<3> a1}
]
}
2 changes: 1 addition & 1 deletion src/engine/abstract/ARStaff.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ARStaff : public ARMTParameter
virtual ARMusicalObject * Copy() const { return new ARStaff(this); }
virtual bool IsStateTag() const { return true; }

virtual int getOrder() const { return kStaffOrder; }
virtual int getOrder() const { return kDontMove; }
virtual const char* getParamsStr() const { return kARStaffParams; };
virtual const char* getTagName() const { return "ARStaff"; };
virtual std::string getGMNName() const { return "\\staff"; };
Expand Down
9 changes: 6 additions & 3 deletions src/engine/graphic/GRFingering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ void GRFingering::OnDraw( VGDevice & hdc ) const
// -----------------------------------------------------------------------------
void GRFingering::tellPosition(GObject * caller, const NVPoint & inPosition)
{
GRSingleNote * note = dynamic_cast<GRSingleNote *>(caller);
}

// -----------------------------------------------------------------------------
void GRFingering::tellPositionEnd(GRSingleNote * note, const NVPoint & inPosition)
{
// GRSingleNote * note = dynamic_cast<GRSingleNote *>(caller);
if( note == 0 ) {
mDraw = false;
return;
}

//cerr << "GRFingering::tellPosition " << endl;

const GRStaff * staff = note->getGRStaff();
if( staff == 0 ) return;

Expand Down
3 changes: 2 additions & 1 deletion src/engine/graphic/GRFingering.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class GRFingering : public GRText
virtual void tellPosition( GObject * caller, const NVPoint & inPosition );
virtual void OnDraw( VGDevice & hdc ) const;
virtual GRFingering * isGRFingering() { return this; }


void tellPositionEnd( GRSingleNote * caller, const NVPoint & inPosition );
const ARFingering * getARFingering() const;
};

Expand Down
6 changes: 6 additions & 0 deletions src/engine/graphic/GRSlur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ void GRSlur::automaticControlPoints( const GRBowingContext * context, const ARBo
if( upward ) extremeY = (startY < endY ) ? startY : endY;
else extremeY = (startY > endY ) ? startY : endY;

float refyStaff = context->staff->getPosition().y;

// - Find the best slopes for the left and right segments of the triangle, such
// that no object is above them (or below, if the bow goes downward).
GuidoPos pos = mAssociated->GetHeadPosition();
Expand All @@ -293,6 +295,10 @@ void GRSlur::automaticControlPoints( const GRBowingContext * context, const ARBo
x1 = elBox.left;
x2 = elBox.right;
y = upward ? elBox.top : elBox.bottom;

const GRStaff* staff = el->getGRStaff();
float offset = staff ? staff->getPosition().y : refyStaff;
y += offset - refyStaff;

// - Ignore it, if it's outside the start/end range.
// this also avoid divisions by zero.
Expand Down
1 change: 0 additions & 1 deletion src/engine/graphic/GRStaffManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "ARMusic.h"
#include "ARMusicalTag.h"
#include "ARMusicalVoice.h"
#include "ARStaff.h"
#include "ARPageFormat.h"
#include "ARSystemFormat.h"
#include "ARAuto.h"
Expand Down
8 changes: 4 additions & 4 deletions src/engine/graphic/GRSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include "ARSystemFormat.h"
#include "ARMusicalVoice.h" // for template instanciation
#include "ARMusic.h"
#include "ARStaff.h"
#include "TagParameterFloat.h"
#include "TagParameterString.h"
#include "TagParameterInt.h"
Expand All @@ -52,6 +51,7 @@
#include "GRBar.h"
#include "GRBeam.h"
#include "GRBowing.h"
#include "GRFingering.h"
#include "GRGlue.h"
#include "GRKey.h"
#include "GRMusic.h"
Expand Down Expand Up @@ -102,9 +102,9 @@ void GRFixVisitor::visitStart (GRSingleNote* note)
if (assoc) {
GuidoPos pos = assoc->GetHeadPosition();
while(pos) {
GRNotationElement * el = assoc->GetNext(pos);
if (el->isGRFingering())
el->tellPosition (note, note->getPosition());
GRFingering * el = assoc->GetNext(pos)->isGRFingering();
if (el)
el->tellPositionEnd (note, note->getPosition());
}
}
}
Expand Down

0 comments on commit 8de4de0

Please sign in to comment.