1 | /*
|
---|
2 | =============================================================================
|
---|
3 | score.h -- score storage definitions
|
---|
4 | Version 31 -- 1988-10-17 -- D.N. Lynx Crowe
|
---|
5 | =============================================================================
|
---|
6 | */
|
---|
7 |
|
---|
8 | #pragma once
|
---|
9 |
|
---|
10 | #include "stdint.h"
|
---|
11 |
|
---|
12 | #define MAX_SE 32768L /* number of longs for score storage */
|
---|
13 |
|
---|
14 | #define N_SCORES 20 /* number of scores */
|
---|
15 | #define N_SECTS 20 /* number of sections per score */
|
---|
16 | #define NNEVTS 32 /* number of note entry events */
|
---|
17 |
|
---|
18 | struct nevent { /* note event entry list structure */
|
---|
19 |
|
---|
20 | struct nevent *nxt;
|
---|
21 | int16_t group;
|
---|
22 | int16_t note;
|
---|
23 | };
|
---|
24 |
|
---|
25 | struct s_time {
|
---|
26 |
|
---|
27 | int16_t sflags;
|
---|
28 | int8_t smpte[10];
|
---|
29 | };
|
---|
30 |
|
---|
31 | /* |
---|
32 |
|
---|
33 | */
|
---|
34 |
|
---|
35 | /* score list structures */
|
---|
36 |
|
---|
37 | struct s_entry { /* event entry structure */
|
---|
38 |
|
---|
39 | int32_t e_time; /* time, in frames */
|
---|
40 | int8_t e_size; /* size of entry, in longs */
|
---|
41 | int8_t e_type; /* type of entry */
|
---|
42 | int8_t e_data1; /* 1st 8 bits of data */
|
---|
43 | int8_t e_data2; /* 2nd 8 bits of data */
|
---|
44 |
|
---|
45 | struct s_entry *e_bak, /* backward pointer */
|
---|
46 | *e_fwd, /* forward pointer */
|
---|
47 |
|
---|
48 | *e_dn, /* down pointer or 4 bytes of data */
|
---|
49 | *e_up, /* up pointer or 4 bytes of data */
|
---|
50 |
|
---|
51 | *e_lft, /* left pointer or 4 bytes of data */
|
---|
52 | *e_rgt; /* right pointer or 4 bytes of data */
|
---|
53 | };
|
---|
54 |
|
---|
55 | struct n_entry { /* note entry structure */
|
---|
56 |
|
---|
57 | int32_t e_time; /* time, in frames */
|
---|
58 | int8_t e_size; /* size of entry, in longs */
|
---|
59 | int8_t e_type; /* type of entry */
|
---|
60 | int8_t e_note; /* note number */
|
---|
61 | int8_t e_group; /* group */
|
---|
62 |
|
---|
63 | struct s_entry *e_bak, /* backward pointer */
|
---|
64 | *e_fwd; /* forward pointer */
|
---|
65 |
|
---|
66 | int16_t e_vel; /* velocity */
|
---|
67 | int16_t e_data4;
|
---|
68 | };
|
---|
69 |
|
---|
70 | /* |
---|
71 |
|
---|
72 | */
|
---|
73 |
|
---|
74 | /* constant definitions */
|
---|
75 |
|
---|
76 | #define E_NULL ((struct s_entry *)0L)
|
---|
77 |
|
---|
78 | #define E_SIZE1 5 /* event size 1 -- 5 longs -- 20 bytes */
|
---|
79 | #define E_SIZE2 6 /* event size 2 -- 6 longs -- 24 bytes */
|
---|
80 | #define E_SIZE3 8 /* event size 3 -- 8 longs -- 32 bytes */
|
---|
81 |
|
---|
82 | #define TO_BAK 240 /* offset from current time to left edge */
|
---|
83 | #define TO_FWD 258 /* offset from current time to right edge */
|
---|
84 |
|
---|
85 | #define D_BAK 1 /* display backward */
|
---|
86 | #define D_FWD 0 /* display forward */
|
---|
87 |
|
---|
88 | #define GS_DSBL 0 /* group status: off */
|
---|
89 | #define GS_ENBL 1 /* group status: on */
|
---|
90 |
|
---|
91 | /* |
---|
92 |
|
---|
93 | */
|
---|
94 |
|
---|
95 | /* event types (number in comment field is event size) */
|
---|
96 |
|
---|
97 | #define EV_NULL 0 /* 1 - null event */
|
---|
98 | #define EV_SCORE 1 /* 1 - score begin */
|
---|
99 | #define EV_SBGN 2 /* 2 - section begin */
|
---|
100 | #define EV_SEND 3 /* 2 - section end */
|
---|
101 | #define EV_INST 4 /* 2 - instrument change */
|
---|
102 | #define EV_NBEG 5 /* 1 - note begin */
|
---|
103 | #define EV_NEND 6 /* 1 - note end */
|
---|
104 | #define EV_STOP 7 /* 1 - stop */
|
---|
105 | #define EV_INTP 8 /* 2 - interpolate */
|
---|
106 | #define EV_TMPO 9 /* 2 - tempo */
|
---|
107 | #define EV_TUNE 10 /* 2 - tuning */
|
---|
108 | #define EV_GRP 11 /* 2 - group status */
|
---|
109 | #define EV_LOCN 12 /* 2 - location */
|
---|
110 | #define EV_DYN 13 /* 2 - dynamics */
|
---|
111 | #define EV_ANVL 14 /* 2 - analog value */
|
---|
112 | #define EV_ANRS 15 /* 2 - analog resolution */
|
---|
113 | #define EV_ASGN 16 /* 2 - I/O assign */
|
---|
114 | #define EV_TRNS 17 /* 3 - transposition */
|
---|
115 | #define EV_REPT 18 /* 1 - repeat */
|
---|
116 | #define EV_PNCH 19 /* 1 - punch in/out */
|
---|
117 | #define EV_PRES 20 /* 1 - polyphonic pressure */
|
---|
118 | #define EV_FINI 21 /* 1 - score end */
|
---|
119 | #define EV_CPRS 22 /* 1 - channel pressure */
|
---|
120 | #define EV_BAR 23 /* 1 - bar marker */
|
---|
121 | #define EV_NEXT 24 /* 1 - next score */
|
---|
122 |
|
---|
123 | #define N_ETYPES 25 /* number of event types (1 + last type code) */
|
---|
124 |
|
---|
125 | /* |
---|
126 |
|
---|
127 | */
|
---|
128 |
|
---|
129 | /* event header types */
|
---|
130 |
|
---|
131 | #define EH_INST 0 /* instrument change */
|
---|
132 | #define EH_GRP 1 /* group status */
|
---|
133 | #define EH_LOCN 2 /* location */
|
---|
134 | #define EH_DYN 3 /* dynamics */
|
---|
135 | #define EH_ANRS 4 /* analog resolution */
|
---|
136 | #define EH_TRNS 5 /* transposition */
|
---|
137 | #define EH_INTP 6 /* interpolate */
|
---|
138 | #define EH_TMPO 7 /* tempo */
|
---|
139 | #define EH_TUNE 8 /* tuning */
|
---|
140 | #define EH_ASGN 9 /* I/O assign */
|
---|
141 | #define EH_SBGN 10 /* section begin */
|
---|
142 | #define EH_SEND 11 /* section end */
|
---|
143 |
|
---|
144 | #define N_TYPES 12 /* number of event header types */
|
---|