GUIDOLib  1.7.7
Guido Engine Internal Documentation
GuidoDefs.h
1 #ifndef GuidoDefs_H
2 #define GuidoDefs_H
3 
4 /*
5  GUIDO Library
6  Copyright (C) 2002 Holger Hoos, Juergen Kilian, Kai Renz
7  Copyright (C) 2003, 2004 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 
19 #include "MusicalSymbols.h"
20 #include "GUIDOTypes.h"
21 
22 const float LSPACE = 50; // Distance between two lines of staff (a dent).
23 
24 // This means: 1 Halfspace is 3pt
25 // unit of kVirtualToCm: cm/virtual. For LSPACE==32 follows
26 // 0,006614583333333 cm/virtual pixel,
27 // that means one system has a height of 0,8 cm
28 // pt * hspace * inch * cm
29 // units: -----------------------------
30 // virtual * hspace * inch * pt
31 
32 //const float kVirtualToCm = (float)(3.0/ double(LSPACE) * 2.0 / 72.27 * 2.54);
33 // Multiply a value by kVirtualToCm to convert it from virtual units to centimeters.
34 // Divide by kVirtualToCm to convert from centimeters to virtual units.
35 
36 const float kVirtualToCm = (float)((3.0 * 2.0 * 2.54) / (LSPACE * 72.27)); // Was UNCONST
37 const float kCmToVirtual = (float)1.0 / kVirtualToCm; // Was INVCONST
38 
39 const float kVirtualToInch = kVirtualToCm / (float)2.54;
40 const float kInchToVirtual = (float)1.0 / kVirtualToInch;
41 
42 const float kPxToVirtual = (float)72.0 * kVirtualToInch;
43 const float kVirtualToPx = (float)1.0 / kPxToVirtual;
44 
45 //const int MINSPACING = 0;
46 const int NUMNOTES = 12;
47 
48 // For the stem ...
49 const float STEMLENGTH = float(3.5 * LSPACE);
50 const float STRAIGHTFLAG = float(0.5 * LSPACE);
51 
52 // define the default SCONST for some elements
53 const float SCONST_BAR = 7.0f;
54 const float SCONST_CLEF = 100.0f;
55 const float SCONST_DEFAULT = 20.0f;
56 const float SCONST_GLUESTART = 50.0f;
57 const float SCONST_GLUENOSTART = 7.0f;
58 const float SCONST_KEY = 100.0f;
59 const float SCONST_INTENS = 100.0f;
60 const float SCONST_METER = 100.0f;
61 
62 const float kLineThick = LSPACE * 0.08f;
63 
64 // Default format of Guido Score Page, in centimeters.
65 // sx and sy define the default size. (the size value includes margins)
66 // ml, mt, mr, mb define the default left, top, right and bottom margins.
67 
68 const float DF_SX = 21.0f;
69 const float DF_SY = 29.7f;
70 const float DF_ML = 2.0f;
71 const float DF_MT = 2.0f;
72 const float DF_MR = 2.0f;
73 const float DF_MB = 2.0f;
74 
75 // - The layout settings default values
76 const float kSettingDefaultSystemDistance = float(1.5 * LSPACE);
77 const int kSettingDefaultSystemDistrib = 1; // 1=auto, 2=always, 3=never
78 const float kSettingDefaultDistribLimit = float(0.25); // % of the height of the page
79 const float kSettingDefaultForce = float(750.0);
80 const float kSettingDefaultSpring = float(1.1);
81 const bool kSettingDefaultNeighborhood = 0;
82 const bool kSettingDefaultOptimalPageFill = 1;
83 const bool kSettingDefaultResizePage2Music = 1;
84 const float kSettingDefaultProportionalRendering = 0;
85 const bool kSettingDefaultCheckLyricsCollisions = false;
86 
87 // - Notes *must* stay in this order. Several algorithms rely on it
88 enum
89 {
90  EMPTY,
91  REST,
92  NOTE_C,
93  NOTE_D,
94  NOTE_E,
95  NOTE_F,
96  NOTE_G,
97  NOTE_A,
98  NOTE_H,
99  NOTE_CIS, // "IS" notes must stay contiguous
100  NOTE_DIS,
101  NOTE_FIS,
102  NOTE_GIS,
103  NOTE_AIS
104 };
105 
106 
107 #endif
108 

Guido Project Copyright © 2019 Grame-CNCM