-
Notifications
You must be signed in to change notification settings - Fork 3
/
abc.h
163 lines (156 loc) · 2.57 KB
/
abc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/* abc.h - header file shared by abc2midi, abc2abc and yaps */
/* Copyright James Allwright 2000 */
/* may be copied under the terms of the GNU public license */
typedef enum {
ABC2MIDI,
ABC2ABC,
YAPS,
ABCMATCH} programname;
typedef enum {
TIMESIG_NORMAL,
TIMESIG_FREE_METER,
TIMESIG_COMMON,
TIMESIG_CUT,
TIMESIG_COMPLEX
} timesig_type_t;
typedef struct timesig_details {
timesig_type_t type;
int num;
int denom;
int complex_values[8];
int num_values;
} timesig_details_t;
/* define types of abc object */
typedef enum {
/* types of bar sign */
SINGLE_BAR,
DOUBLE_BAR,
DOTTED_BAR,
BAR_REP,
REP_BAR,
PLAY_ON_REP,
REP1,
REP2,
/* BAR1 = SINGLE_BAR + REP1 */
/* REP_BAR2 = REP_BAR + REP2 */
BAR1,
REP_BAR2,
DOUBLE_REP,
THICK_THIN,
THIN_THICK,
/* other things */
PART,
TEMPO,
TIME,
KEY,
REST,
TUPLE,
/* CHORD replaced by CHORDON and CHORDOFF */
NOTE,
NONOTE,
OLDTIE,
TEXT,
SLUR_ON,
SLUR_OFF,
TIE,
CLOSE_TIE,
TITLE,
CHANNEL,
TRANSPOSE,
RTRANSPOSE,
GTRANSPOSE,
GRACEON,
GRACEOFF,
SETGRACE,
SETC,
SETTRIM,
EXPAND,
GCHORD,
GCHORDON,
GCHORDOFF,
VOICE,
CHORDON,
CHORDOFF,
CHORDOFFEX,
DRUMON,
DRUMOFF,
DRONEON,
DRONEOFF,
SLUR_TIE,
TNOTE,
/* broken rhythm */
LT,
GT,
DYNAMIC,
LINENUM,
MUSICLINE,
MUSICSTOP,
WORDLINE,
WORDSTOP,
WORDEXTEND,
INSTRUCTION,
NOBEAM,
CHORDNOTE,
CLEF,
PRINTLINE,
NEWPAGE,
LEFT_TEXT,
CENTRE_TEXT,
VSKIP,
COPYRIGHT,
COMPOSER,
ARPEGGIO,
SPLITVOICE,
META,
PEDAL_ON,
PEDAL_OFF,
EFFECT
} featuretype;
/* note decorations */
#define DECSIZE 13
extern char decorations[];
#define STACCATO 0
#define TENUTO 1
#define LOUD 2
#define ROLL 3
#define FERMATA 4
#define ORNAMENT 5
#define TRILL 6
#define BOWUP 7
#define BOWDOWN 8
#define BREATH 9
#define CODA 10
#define UPPERMORDENT 11
#define SEGNO 12
/* The vstring routines provide a simple way to handle */
/* arbitrary length strings */
struct vstring {
int len;
int limit;
char* st;
};
#ifndef KANDR
/* vstring routines */
extern void initvstring(struct vstring* s);
extern void extendvstring(struct vstring* s);
extern void addch(char ch, struct vstring* s);
extern void addtext(char* text, struct vstring* s);
extern void clearvstring(struct vstring* s);
extern void freevstring(struct vstring* s);
/* error-handling routines */
extern void event_error(char *s);
extern void event_fatal_error(char *s);
extern void event_warning(char *s);
#else
/* vstring routines */
extern void initvstring();
extern void extendvstring();
extern void addch();
extern void addtext();
extern void clearvstring();
extern void freevstring();
/* error-handling routines */
extern void event_error();
extern void event_fatal_error();
extern void event_warning();
#endif