GUIDOLib  1.7.7
Guido Engine Internal Documentation
ARTrill.h
1 #ifndef ARTrill_H
2 #define ARTrill_H
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2002 Holger Hoos, Juergen Kilian, Kai Renz
7  Copyright (C) 2002-2017 Grame
8 
9  This Source Code Form is subject to the terms of the Mozilla Public
10  License, v. 2.0. If a copy of the MPL was not distributed with this
11  file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 
13  Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
14  research@grame.fr
15 
16 */
17 
18 #include "ARMTParameter.h"
19 #include "ARPositionTag.h"
20 #include "ARMusicalVoice.h"
21 
22 class ARKey;
23 
24 #define kNoAccidental -9999.f
25 
26 
27 /*@mkdoc
28 
29 @group:Ornaments
30 
31 @tagname:\mordent
32 @tagalias:\mord
33 @tagtype:R
34 @tagnotation:a mordent
35 @tagdesc
36 @tagend
37 
38 @params:
39 @param:note:string:a note, part of the ornament:*none*:true
40 @param:type:string:prall, prallprall, inverted or prallinverted:prall:true
41 @param:detune:float:note tuning (for microtonality):0.0:true
42 @param:accidental:string:cautionary or force:*none*:true
43 @param:adx:unit:accidental displacement (if any):0hs:true
44 @param:ady:unit:accidental displacement (if any):0hs:true
45 @param:position:string:above, below:above:true
46 @paramdesc
47 - **note** is intended to indicate accidentals, the note itself is not displayed but the possible accidental does.
48 - **detune** is applied to the **note** parameter and works similarly as [\alter](../Accidentals#alter)
49 - **accidental** is intended is intended to control how the accidental is displayed
50 
51 See the [Ornaments](@EXAMPLES/ornaments/) example.<br />
52 See the [Bach](@EXAMPLES/bach/) example.<br />
53 See the [Sonata](@EXAMPLES/cpebach/) example.
54 @paramend
55 
56 
57 @tagname:\trill
58 @tagalias:\trillBegin \trillEnd
59 @tagtype:R
60 @tagnotation:a trill ornament
61 @tagdesc
62 @tagend
63 
64 @params:
65 @param:note:string:a note, part of the ornament:*none*:true
66 @param:detune:float:note tuning (for microtonality):0.0:true
67 @param:accidental:string:cautionary or force:*none*:true
68 @param:adx:unit:accidental displacement (if any):0hs:true
69 @param:ady:unit:accidental displacement (if any):0hs:true
70 @param:begin:boolean:for trill continuations:on:true
71 @param:tr:boolean:show/hide the leading "tr" string:true:true
72 @param:wavy:boolean:show/hide the wavy line:true:true
73 @param:position:string:above, below:above:true
74 @paramdesc
75 - **begin** is intended for trill continutation. When false, the trill continues the preceding one (if any). It allows to write new trills with changing accidentals without breaking it.
76 - **tr** show or hide the leading "tr" string
77 
78 other parameters have the same effect as for [\mordent](#mordent)
79 
80 See the [Ornaments](@EXAMPLES/ornaments/) example.<br />
81 See the [Sonata](@EXAMPLES/cpebach/) example.
82 @paramend
83 
84 
85 
86 @tagname:\turn
87 @tagalias:
88 @tagtype:R
89 @tagnotation:a turn ornament
90 @tagdesc
91 @tagend
92 
93 @params:
94 @param:note:string:a note, part of the ornament:*none*:true
95 @param:type:string:inverted, invertedb or regular:regular:true
96 @param:detune:float:note tuning (for microtonality):0.0:true
97 @param:accidental:string:cautionary or force:*none*:true
98 @param:adx:unit:accidental displacement (if any):0hs:true
99 @param:ady:unit:accidental displacement (if any):0hs:true
100 @param:position:string:above, below:above:true
101 @paramdesc
102 - **invertedb** displays as a regular turn with a bar.
103 
104 The parameters have the same effect as for [\mordent](#mordent)
105 
106 See the [Ornaments](@EXAMPLES/ornaments/) example.<br />
107 See the [Sonata](@EXAMPLES/cpebach/) example.
108 @paramend
109 
110 
111 */
112 
115 class ARTrill : public ARMTParameter, public ARPositionTag
116 {
117  public:
120  enum POS { BELOW, /*ONNOTE,*/ ABOVE, AUTO };
121  enum { kUndefined, kOn, kOff };
122 
123  ARTrill(ORNAMENT typ, const ARKey* currentKey);
124  ARTrill(int pid, const ARTrill * copy);
125  virtual ~ARTrill() {}
126 
127  virtual void setTagParameters (const TagParameterMap& params);
128  virtual bool MatchEndTag(const char * s);
129  virtual ARMusicalObject * Copy() const;
130 
131  virtual const char* getParamsStr() const { return kARTrillParams; };
132  virtual const char* getTagName() const { return "ARTrill"; };
133  virtual std::string getGMNName() const;
134 
136  void setCautionary(bool showAcc) { fCautionaryAccidental = showAcc;}
137 
138  ORNAMENT getOrnament() const { return fTrillType; }
139  TYPE getType() const { return fType; }
140  float getAccidental() const { return fAccidental; }
141  bool getCautionary() const { return fCautionaryAccidental;}
142  float getadx() const { return fAdx; }
143  float getady() const { return fAdy;}
144  bool getStatus() const { return fBegin; }
145  bool getShowTR() const { return fShowTR;}
146  bool getShowWavyLine() const { return fShowWavyLine;}
147  POS getTrillPos()const { return fTrillPosition; }
148  const std::string& getTrilledNote() const { return fTrilledNote;}
149 
150  void setContinue() { fBegin = false; }
151 
152  protected:
153  float getAccidental (const std::string& note, const ARKey* key) const;
155  float fAccidental = 0.f; // the accidental value to be displayed expressed as a float to cope with microtones
156  // 1 is a half tone
158  std::string fTrilledNote;
163  bool fShowTR;
166  float fAdx;
167  float fAdy;
168  bool fBegin;
169 };
170 
171 #endif
ARTrill::fAdy
float fAdy
Definition: ARTrill.h:167
ARTrill::getTrillPos
POS getTrillPos() const
Definition: ARTrill.h:147
ARTrill::getadx
float getadx() const
Definition: ARTrill.h:142
ARTrill::kInverted
Definition: ARTrill.h:119
ARTrill
not yet documented
Definition: ARTrill.h:115
ARTrill::TYPE
TYPE
Definition: ARTrill.h:119
ARTrill::kPrall
Definition: ARTrill.h:119
ARTrill::fForceAccidental
bool fForceAccidental
Definition: ARTrill.h:162
ARTrill::fType
TYPE fType
Definition: ARTrill.h:160
ARTrill::getStatus
bool getStatus() const
Definition: ARTrill.h:144
ARTrill::setTagParameters
virtual void setTagParameters(const TagParameterMap &params)
ARTrill::getType
TYPE getType() const
Definition: ARTrill.h:139
ARTrill::fCautionaryAccidental
bool fCautionaryAccidental
Definition: ARTrill.h:161
ARTrill::getOrnament
ORNAMENT getOrnament() const
Definition: ARTrill.h:138
ARTrill::fChordType
ARMusicalVoice::CHORD_TYPE fChordType
Definition: ARTrill.h:154
ARTrill::setCautionary
void setCautionary(bool showAcc)
Definition: ARTrill.h:136
ARTrill::getParamsStr
virtual const char * getParamsStr() const
Definition: ARTrill.h:131
ARTrill::fAccidental
float fAccidental
Definition: ARTrill.h:155
ARTrill::getTagName
virtual const char * getTagName() const
Definition: ARTrill.h:132
ARTrill::ARTrill
ARTrill(ORNAMENT typ, const ARKey *currentKey)
ARTrill::fShowWavyLine
bool fShowWavyLine
Definition: ARTrill.h:164
ARKey
Key signature.
Definition: ARKey.h:54
ARTrill::getGMNName
virtual std::string getGMNName() const
ARTrill::kOff
Definition: ARTrill.h:121
ARMTParameter
not yet documented
Definition: ARMTParameter.h:24
ARTrill::setContinue
void setContinue()
Definition: ARTrill.h:150
ARTrill::getAccidental
float getAccidental() const
Definition: ARTrill.h:140
ARTrill::fShowTR
bool fShowTR
Definition: ARTrill.h:163
ARTrill::getCautionary
bool getCautionary() const
Definition: ARTrill.h:141
ARTrill::kPrallPrall
Definition: ARTrill.h:119
ARTrill::getShowTR
bool getShowTR() const
Definition: ARTrill.h:145
ARMusicalVoice::CHORD_TYPE
CHORD_TYPE
Definition: ARMusicalVoice.h:82
ARTrill::ABOVE
Definition: ARTrill.h:120
ARTrill::fTrillPosition
POS fTrillPosition
Definition: ARTrill.h:165
ARTrill::kInvertedBar
Definition: ARTrill.h:119
ARTrill::fTrillType
ORNAMENT fTrillType
Definition: ARTrill.h:159
ARTrill::kUndefined
Definition: ARTrill.h:121
ARTrill::fBegin
bool fBegin
Definition: ARTrill.h:168
ARTrill::kOn
Definition: ARTrill.h:121
ARTrill::setTrillPos
void setTrillPos(POS pos)
Definition: ARTrill.h:135
ARTrill::ORNAMENT
ORNAMENT
Definition: ARTrill.h:118
ARTrill::TRILL
Definition: ARTrill.h:118
ARTrill::getShowWavyLine
bool getShowWavyLine() const
Definition: ARTrill.h:146
ARTrill::Copy
virtual ARMusicalObject * Copy() const
ARTrill::POS
POS
Definition: ARTrill.h:120
ARTrill::fCurrentKey
const ARKey * fCurrentKey
Definition: ARTrill.h:157
ARTrill::kPrallInverted
Definition: ARTrill.h:119
ARTrill::AUTO
Definition: ARTrill.h:120
ARTrill::getady
float getady() const
Definition: ARTrill.h:143
ARPositionTag::pos
GuidoPos pos
Definition: ARPositionTag.h:73
ARTrill::fTrilledNote
std::string fTrilledNote
Definition: ARTrill.h:158
ARPositionTag
The base class for all range tags.
Definition: ARPositionTag.h:26
ARTrill::BELOW
Definition: ARTrill.h:120
ARTrill::MORD
Definition: ARTrill.h:118
ARTrill::MatchEndTag
virtual bool MatchEndTag(const char *s)
TagParameterMap
A list of tag parameters represented as a map.
Definition: TagParameterMap.h:31
ARTrill::fAdx
float fAdx
Definition: ARTrill.h:166
ARMusicalObject
The base class for all AR objects. It contains all musical information : duration and time position.
Definition: ARMusicalObject.h:33
ARTrill::getTrilledNote
const std::string & getTrilledNote() const
Definition: ARTrill.h:148
ARTrill::TURN
Definition: ARTrill.h:118
ARTrill::~ARTrill
virtual ~ARTrill()
Definition: ARTrill.h:125

Guido Project Copyright © 2019 Grame-CNCM