4 Ann Hell Ex Machina - Music Software
5 Copyright (C) 2003/2008 Angel Ortega <angel@triptico.com>
7 compiler.y - Scripting language YACC parser
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 http://www.triptico.com
40 void yyerror(const char *s
);
42 /* injecting code functions (defined in compiler.l) */
43 int push_code
(const char *code
);
44 int push_code_from_file
(const char *file
);
50 double cur_time
= 0.0;
52 /* end time (longest time seen) */
53 double end_time
= 0.0;
59 static double staccato
;
60 static sample_t volume_from
;
61 static sample_t volume_to
;
64 /* parser debugging */
66 #define DEBUGF if(verbose >= 2)printf
76 static struct block
*blocks
= NULL
;
77 static int n_blocks
= 0;
86 static struct group
*groups
= NULL
;
87 static int n_groups
= 0;
88 static int groups_size
= 0;
96 static struct mark
*marks
= NULL
;
97 static int n_marks
= 0;
107 static struct arp
*arps
= NULL
;
108 static int n_arps
= 0;
109 static int arps_size
= 0;
111 static double arp_delay
;
112 static int arp_transpose
;
113 static sample_t arp_volume
;
114 static int arp_track_off
;
116 int compiler_error
= 0;
120 /* alterations for each note */
124 unsigned int block_seed
= 0;
125 unsigned int volume_seed
= 0;
127 /* solo track (-1, no solo) */
133 unsigned int ah_rnd
(unsigned int *seed
)
134 /* special randomizer */
136 *seed
= (*seed
* 58321) + 11113;
142 void c_err
(const char *e1
, const char *e2
, const char *e3
)
143 /* reports an error from the compiler */
154 printf
(" in line %d\n", yyline
);
160 static void forward
(double step
)
161 /* moves forward current time */
166 /* quantizations could be done here */
170 static sample_t volume
(void)
174 if
(volume_from
== volume_to
)
177 unsigned int r
= ah_rnd
(&volume_seed
) %
1000;
179 f
= volume_from
+ (volume_to
- volume_from
) *
180 (((sample_t
) r
) / 1000.0);
189 static int find_block
(const char *name
)
194 for
(n
= 0; n
< n_blocks
; n
++) {
195 if
(strcmp
(name
, blocks
[n
].name
) == 0)
203 static int set_block
(const char *name
, char *block
)
204 /* defines a block */
211 /* if block already exists, free it */
212 if
((n
= find_block
(name
)) >= 0) {
215 /* free all subblocks */
216 for
(n
= 0; n
< b
->n_sblocks
; n
++)
219 /* free the subblock array */
223 GROW
(blocks
, n_blocks
, struct block
);
224 b
= &blocks
[n_blocks
++];
226 b
->name
= strdup
(name
);
233 /* now split in subblocks (delimited by : ) */
236 while
((stop
= strchr
(start
, ':')) != NULL
) {
240 /* add the subblock */
241 GROW
(b
->sblocks
, b
->n_sblocks
, char *);
242 b
->sblocks
[b
->n_sblocks
++] = strdup
(start
);
247 /* no more separators? store the rest */
248 GROW
(b
->sblocks
, b
->n_sblocks
, char *);
249 b
->sblocks
[b
->n_sblocks
++] = strdup
(start
);
251 /* the original block is no longer needed */
258 static void insert_block
(const char *name
)
259 /* inserts a block */
263 if
((n
= find_block
(name
)) >= 0) {
268 /* get one of them, randomly */
269 n
= ah_rnd
(&block_seed
) % b
->n_sblocks
;
271 push_code
(strdup
(b
->sblocks
[n
]));
274 c_err
("block-not-found", name
, NULL
);
278 static int insert_file
(const char *filename
)
280 if
(!push_code_from_file
(filename
)) {
281 c_err
("script-not-found", filename
, NULL
);
291 static int push_group
(void)
292 /* starts a new group of notes */
296 if
(n_groups
== groups_size
) {
297 GROW
(groups
, groups_size
, struct group
);
301 g
= &groups
[n_groups
++];
311 static int next_group_part
(void)
317 c_err
("missing-start-of-group", NULL
, NULL
);
321 g
= &groups
[n_groups
- 1];
323 /* store maximum frame */
324 if
(g
->max
< cur_time
)
327 /* add glissando delay */
331 cur_time
= g
->start
+ g
->gliss
;
337 static int pop_group
(void)
338 /* finishes a group, moving the frame to the end of the longer part */
341 c_err
("missing-start-of-group", NULL
, NULL
);
347 /* if other parts of group were longer than the last one,
348 move pointer there */
349 if
(groups
[n_groups
].max
> cur_time
)
350 cur_time
= groups
[n_groups
].max
;
358 static int seek_mark
(const char *name
)
359 /* seeks a mark by name; returns its offset or -1 */
363 for
(n
= 0; n
< n_marks
; n
++)
364 if
(strcmp
(marks
[n
].name
, name
) == 0)
371 static void add_mark
(const char *name
)
372 /* creates a new mark */
376 if
((n
= seek_mark
(name
)) == -1) {
378 GROW
(marks
, n
, struct mark
);
379 marks
[n
].name
= strdup
(name
);
382 marks
[n
].time
= cur_time
;
386 static void find_mark
(const char *name
, int set
)
387 /* finds a mark by name, optionally moving time cursor there */
391 if
((n
= seek_mark
(name
)) != -1) {
393 if
(cur_time
> marks
[n
].time
) {
394 /* if mark is not END, fail */
395 if
(strcmp
(name
, "END") != 0)
396 c_err
("mark-overpassed", name
, NULL
);
399 cur_time
= marks
[n
].time
;
401 else if
(cur_time
!= marks
[n
].time
)
402 c_err
("mark-mismatch", name
, NULL
);
407 c_err
("mark-not-found", name
, NULL
);
413 static void arp_default
(void)
414 /* resets arpeggiator values to the default ones */
423 static void add_arp
(void)
424 /* adds an arpeggiator note */
428 /* if the note is exactly the same, do nothing */
429 if
(arp_delay
== 0.0 && arp_transpose
== 0 &&
430 arp_volume
== 1.0 && arp_track_off
== 0)
433 if
(n_arps
== arps_size
) {
434 GROW
(arps
, arps_size
, struct arp
);
440 a
->delay
= arp_delay
;
441 a
->transpose
= arp_transpose
;
442 a
->volume
= arp_volume
;
443 a
->track_off
= arp_track_off
;
450 static void set_alteration
(const char *altstr
)
451 /* sets the alterations from altstr */
453 int n
, steps
[] = { 2, 0, 2, 0, 1, 2, 0, 2, 0, 2, 0, 1 };
455 /* reset alterations */
456 for
(n
= 0; n
< 12; n
++)
459 /* changed according the altstr spec */
460 for
(n
= 0; *altstr
!= '\0' && n
< 12; altstr
++) {
471 /* move to next natural note */
479 static struct song_ev
*add_song_ev
(song_ev_type type
)
483 r
= add_event
(&song
, &n_song_ev
);
488 r
->event_id
= n_song_ev
- 1;
494 static void add_note_event
(int note
)
495 /* adds a note event */
501 /* sum the alteration */
502 if
((n
= note %
12) < 0)
505 note
+= alterations
[n
];
507 /* calculate the note */
508 np
= note
+ transpose
+ (octave
* 12);
510 /* is note out of range? */
511 if
(np
< 0 || np
> 127) {
512 c_err
("note-out-of-range", NULL
, NULL
);
516 e
= add_song_ev
(SONG_EV_NOTE
);
519 e
->len
= length
* staccato
;
522 /* add arpeggiator repetitions */
523 for
(n
= 0; n
< n_arps
; n
++) {
525 e
= add_song_ev
(SONG_EV_NOTE
);
527 e
->time
= cur_time
+ arps
[n
].delay
;
528 e
->trk_id
= track
+ arps
[n
].track_off
;
529 e
->value
= np
+ arps
[n
].transpose
;
530 e
->len
= length
* staccato
;
531 e
->vol
= volume
() * arps
[n
].volume
;
536 static void add_back_event
(void)
538 struct song_ev
*e
= add_song_ev
(SONG_EV_BACK
);
544 static void add_tempo_event
(int trk_id
, double tempo
)
546 struct song_ev
*e
= add_song_ev
(SONG_EV_TEMPO
);
553 static void add_meter_event
(int trk_id
, int num
, int den
)
555 struct song_ev
*e
= add_song_ev
(SONG_EV_METER
);
562 static void add_measure_event
(void)
564 struct song_ev
*e
= add_song_ev
(SONG_EV_MEASURE
);
571 static void add_ss_sustain_event
(double sustain
)
573 struct song_ev
*e
= add_song_ev
(SONG_EV_SS_SUSTAIN
);
579 static void add_ss_attack_event
(double attack
)
581 struct song_ev
*e
= add_song_ev
(SONG_EV_SS_ATTACK
);
587 static void add_ss_vibrato_event
(double depth
, double freq
)
589 struct song_ev
*e
= add_song_ev
(SONG_EV_SS_VIBRATO
);
596 static void add_ss_portamento_event
(double portamento
)
598 struct song_ev
*e
= add_song_ev
(SONG_EV_SS_PORTAMENTO
);
600 e
->amount
= portamento
;
604 static void add_ss_channel_event
(int channel
, sample_t vol
)
606 struct song_ev
*e
= add_song_ev
(SONG_EV_SS_CHANNEL
);
608 e
->channel
= channel
;
613 static void add_ss_wav_event
(const char *wav_file
, int base
, int min
,
614 int max
, double loop_start
, double loop_end
,
615 int first_channel
, int skip_channels
)
617 struct song_ev
*e
= add_song_ev
(SONG_EV_SS_WAV
);
623 e
->start
= loop_start
;
625 e
->channel
= first_channel
;
626 e
->skip_channels
= skip_channels
;
630 static void add_ss_pat_event
(const char *pat_file
)
632 struct song_ev
*e
= add_song_ev
(SONG_EV_SS_PAT
);
638 static void add_ss_sf2_event
(const char *sf2_file
, const char *insname
)
640 struct song_ev
*e
= add_song_ev
(SONG_EV_SS_SF2
);
647 static void add_ss_eff_event
(int type
, int channel
, double size
,
648 sample_t gain
, double depth
, double freq
,
649 double phase
, sample_t initial
,
652 struct song_ev
*e
= add_song_ev
(type
);
654 e
->channel
= channel
;
660 e
->initial
= initial
;
665 static void add_ss_pitch_stretch
(int note
, double len
, sample_t vol
)
667 struct song_ev
*e
= add_song_ev
(SONG_EV_SS_PITCH_STRETCH
);
675 static void add_ss_print_wave_tempo
(int note
, double len
)
677 struct song_ev
*e
= add_song_ev
(SONG_EV_SS_PRINT_WAVE_TEMPO
);
684 static void add_ss_master_volume
(sample_t vol
)
686 struct song_ev
*e
= add_song_ev
(SONG_EV_SS_MASTER_VOLUME
);
693 static void add_midi_channel_event
(int channel
)
695 struct song_ev
*e
= add_song_ev
(SONG_EV_MIDI_CHANNEL
);
697 e
->channel
= channel
- 1;
701 static void add_midi_program_event
(int program
)
703 struct song_ev
*e
= add_song_ev
(SONG_EV_MIDI_PROGRAM
);
709 static void add_song_info_event
(const char *author
, const char *name
)
711 struct song_ev
*e
= add_song_ev
(SONG_EV_SONG_INFO
);
718 static void init_track
(void)
719 /* sets the default values for a new track */
723 /* is there an end time? test if this is longer */
724 if
(cur_time
> end_time
) {
733 volume_from
= volume_to
= 0.75;
737 /* groups should not cross track boundaries */
740 /* reset arpeggiator */
744 /* is there a START mark? if so, move there */
745 if
((n
= seek_mark
("START")) != -1)
746 cur_time
= marks
[n
].time
;
748 /* reset alterations */
749 for
(n
= 0; n
< 12; n
++)
761 %token
<i
> P_INTEGER S_INTEGER
762 %token
<d
> P_REAL S_REAL
763 %token
<i
> NOTE_P NOTE_T3 NOTE_T5
764 %token
<p
> NEW_MARK GOTO_MARK ASSERT_MARK
766 %token
<p
> BLOCK BLK_ASSIGN BLK_INSERT FILE_INSERT
770 %token
<p
> LIBPATH_ADD
773 %token
<i
> XC_ABSNOTE
776 %token SS_SEP SS_WAV SS_LOOP_WAV SS_PAT SS_SF2
777 %token SS_SUSTAIN SS_ATTACK SS_VIBRATO SS_PORTAMENTO SS_CHANNEL SS_VOL SS_MASTER_VOL
779 %token SS_EFF_DELAY SS_EFF_ECHO SS_EFF_COMB SS_EFF_ALLPASS SS_EFF_FLANGER
780 %token SS_EFF_WOBBLE SS_EFF_SQWOBBLE SS_EFF_HFWOBBLE
781 %token SS_EFF_FADER SS_EFF_REVERB
782 %token SS_EFF_FOLDBACK SS_EFF_ATAN SS_EFF_DISTORT SS_EFF_OVERDRIVE
785 %token SS_PITCH_STRETCH SS_TIME_STRETCH SS_PRINT_WAVE_TEMPO
789 %token MIDI_CHANNEL MIDI_PROGRAM MIDI_GENERIC
791 %type
<i
> integer note note_pitch rest back
792 %type
<d
> real p_number number note_length
794 %type
<d
> arp_list arp_note
823 /* absolute octave */
827 /* relative octave */
831 /* absolute volume */
832 volume_from
= volume_to
= $2;
835 /* absolute volume */
836 volume_from
= volume_to
= $2;
839 /* relative volume */
843 |
'v' P_REAL
',' P_REAL
{
844 /* absolute volume ranges */
862 /* group delimiter */
875 /* measure mark event */
900 add_tempo_event
(-1, $2);
902 |
'M' P_INTEGER
'/' P_INTEGER
{
903 /* meter (time signature) setting */
904 add_meter_event
(-1, $2, $4);
907 /* alteration string */
911 | BLOCK
'*' P_INTEGER
{
915 /* store the block as <TMP> */
916 set_block
("<TMP>", $1);
918 for
(n
= 0;n
< $3;n
++)
919 insert_block
("<TMP>");
934 /* add library path */
945 P_INTEGER
{ $$
= $1; }
946 | S_INTEGER
{ $$
= $1; }
951 | S_REAL
{ $$
= $1; }
955 P_INTEGER
{ $$
= (double) $1; }
956 | P_REAL
{ $$
= $1; }
960 integer
{ $$
= (double) $1; }
965 note_pitch
{ $$
= $1; }
966 | note note_length
{ $$
= $1; length
=$2; }
967 | note
'~' number
{ $$
= $1; DEBUGF
("imm volume: %lf\n", $3); }
972 | note_pitch
'&' { $$
= $1 - 1; }
973 | note_pitch
'#' { $$
= $1 + 1; }
974 | note_pitch
'\'' { $$
= $1 + 12; }
975 | note_pitch
',' { $$
= $1 - 12; }
979 P_INTEGER
{ $$
= 1 / (double) $1; }
980 | note_length NOTE_T3
{ $$
= $1 * 2.0 / 3.0; }
981 | note_length NOTE_T5
{ $$
= $1 * 4.0 / 5.0; }
982 | note_length
'*' p_number
{ $$
= $1 * $3; }
983 | note_length
'.' { $$
= $1 * 1.5; }
989 /* rest with length */
997 /* back with length */
1004 /* empty arpeggiator */
1008 |
'x' arp_list
{ ; }
1013 /* first arpeggiator note */
1017 | arp_list
',' arp_note
{
1018 /* rest of arpeggiator notes */
1025 /* arpeggiator delay */
1028 | arp_note
'~' number
{
1029 /* arpeggiator volume */
1032 | arp_note S_INTEGER
{
1033 /* arpeggiator transpose */
1036 | arp_note
'/' P_INTEGER
{
1037 /* arpeggiator track offset */
1040 | arp_note NOTE_T3
{
1044 | arp_note NOTE_T5
{
1051 P_INTEGER
{ $$
= $1; }
1052 | XC_ABSNOTE
{ $$
= $1; }
1056 SS_WAV XC_STR xc_absnote
{
1057 /* load .wav file with just one note */
1058 add_ss_wav_event
($2, $3, $3, $3, -1.0, -1.0, 0, 0);
1060 | SS_WAV XC_STR xc_absnote xc_absnote xc_absnote
{
1061 /* load .wav file */
1062 add_ss_wav_event
($2, $3, $4, $5, -1.0, -1.0, 0, 0);
1064 | SS_WAV XC_STR xc_absnote xc_absnote xc_absnote number number
{
1065 /* load .wav file, with loop boundaries */
1066 add_ss_wav_event
($2, $3, $4, $5, $6, $7, 0, 0);
1068 | SS_WAV XC_STR xc_absnote xc_absnote xc_absnote number number number number
{
1069 /* load .wav file, with loop boundaries,
1070 first channel and skip channels */
1071 add_ss_wav_event
($2, $3, $4, $5, $6, $7, $8, $9);
1074 /* load .pat file */
1075 add_ss_pat_event
($2);
1078 /* list instruments in .sf2 file */
1079 add_ss_sf2_event
($2, NULL
);
1081 | SS_SF2 XC_STR XC_STR
{
1082 /* load instrument from .sf2 file */
1083 add_ss_sf2_event
($2, $3);
1086 | SS_SUSTAIN XC_MSECS
{
1088 add_ss_sustain_event
($2);
1090 | SS_ATTACK XC_MSECS
{
1092 add_ss_attack_event
($2);
1094 | SS_VIBRATO XC_MSECS number
{
1096 add_ss_vibrato_event
($2, $3);
1098 | SS_PORTAMENTO number
{
1099 /* sets portamento */
1100 add_ss_portamento_event
($2);
1102 | SS_CHANNEL integer number
{
1103 /* sets volume for a channel */
1104 add_ss_channel_event
($2, $3);
1106 | SS_VOL number number
{
1107 /* set vol for 2 channels */
1108 add_ss_channel_event
(0, $2);
1109 add_ss_channel_event
(1, $3);
1111 | SS_VOL number number number
{
1112 /* set vol for 3 channels */
1113 add_ss_channel_event
(0, $2);
1114 add_ss_channel_event
(1, $3);
1115 add_ss_channel_event
(2, $4);
1117 | SS_VOL number number number number
{
1118 /* set vol for 4 channels */
1119 add_ss_channel_event
(0, $2);
1120 add_ss_channel_event
(1, $3);
1121 add_ss_channel_event
(2, $4);
1122 add_ss_channel_event
(3, $5);
1124 | SS_VOL number number number number number number
{
1125 /* set vol for 6 channels */
1126 add_ss_channel_event
(0, $2);
1127 add_ss_channel_event
(1, $3);
1128 add_ss_channel_event
(2, $4);
1129 add_ss_channel_event
(3, $5);
1130 add_ss_channel_event
(4, $6);
1131 add_ss_channel_event
(5, $7);
1133 | SS_EFF_DELAY integer XC_MSECS
{
1135 add_ss_eff_event
(SONG_EV_SS_EFF_DELAY
,
1136 $2, $3, 0, 0, 0, 0, 0, 0);
1139 | SS_EFF_ECHO integer XC_MSECS number
{
1141 add_ss_eff_event
(SONG_EV_SS_EFF_ECHO
,
1142 $2, $3, $4, 0, 0, 0, 0, 0);
1145 | SS_EFF_COMB integer XC_MSECS number
{
1147 add_ss_eff_event
(SONG_EV_SS_EFF_COMB
,
1148 $2, $3, $4, 0, 0, 0, 0, 0);
1151 | SS_EFF_ALLPASS integer XC_MSECS number
{
1152 /* allpass effect */
1153 add_ss_eff_event
(SONG_EV_SS_EFF_ALLPASS
,
1154 $2, $3, $4, 0, 0, 0, 0, 0);
1157 | SS_EFF_FLANGER integer XC_MSECS number XC_MSECS number number
{
1158 /* flanger effect */
1159 add_ss_eff_event
(SONG_EV_SS_EFF_FLANGER
,
1160 $2, $3, $4, $5, $6, $7, 0, 0);
1163 | SS_EFF_WOBBLE integer number number
{
1165 add_ss_eff_event
(SONG_EV_SS_EFF_WOBBLE
,
1166 $2, 0, 0.8, 0, $3, $4, 0, 0);
1169 | SS_EFF_WOBBLE integer number number number
{
1170 /* wobble effect, with gain */
1171 add_ss_eff_event
(SONG_EV_SS_EFF_WOBBLE
,
1172 $2, 0, $5, 0, $3, $4, 0, 0);
1175 | SS_EFF_SQWOBBLE integer number number
{
1176 /* square wobble effect */
1177 add_ss_eff_event
(SONG_EV_SS_EFF_SQWOBBLE
,
1178 $2, 0, 0, 0, $3, $4, 0, 0);
1181 | SS_EFF_HFWOBBLE integer number number
{
1182 /* half wobble effect */
1183 add_ss_eff_event
(SONG_EV_SS_EFF_HFWOBBLE
,
1184 $2, 0, 0, 0, $3, $4, 0, 0);
1187 | SS_EFF_FADER integer XC_MSECS number number
{
1189 add_ss_eff_event
(SONG_EV_SS_EFF_FADER
,
1190 $2, $3, 0, 0, 0, 0, $4, $5);
1193 | SS_EFF_REVERB integer
{
1195 add_ss_eff_event
(SONG_EV_SS_EFF_REVERB
,
1196 $2, 0, 0, 0, 0, 0, 0, 0);
1199 | SS_EFF_FOLDBACK integer number
{
1200 /* foldback distortion effect */
1201 add_ss_eff_event
(SONG_EV_SS_EFF_FOLDBACK
,
1202 $2, 0, $3, 0, 0, 0, 0, 0);
1204 | SS_EFF_ATAN integer number
{
1205 /* atan distortion effect */
1206 add_ss_eff_event
(SONG_EV_SS_EFF_ATAN
,
1207 $2, 0, $3, 0, 0, 0, 0, 0);
1209 | SS_EFF_DISTORT integer number
{
1210 /* distort distortion effect */
1211 add_ss_eff_event
(SONG_EV_SS_EFF_DISTORT
,
1212 $2, 0, $3, 0, 0, 0, 0, 0);
1214 | SS_EFF_OVERDRIVE integer number
{
1215 /* overdrive distortion effect */
1216 add_ss_eff_event
(SONG_EV_SS_EFF_OVERDRIVE
,
1217 $2, 0, $3, 0, 0, 0, 0, 0);
1220 | SS_EFF_OFF integer
{
1222 add_ss_eff_event
(SONG_EV_SS_EFF_OFF
,
1223 $2, 0, 0, 0, 0, 0, 0, 0);
1226 | SS_PITCH_STRETCH xc_absnote number number
{
1227 /* pitch stretch note */
1228 add_ss_pitch_stretch
($2, $3, $4);
1233 | SS_PRINT_WAVE_TEMPO xc_absnote number
{
1234 /* print tempo from wave */
1235 add_ss_print_wave_tempo
($2, $3);
1238 | SS_MASTER_VOL number
{
1239 /* set master volume */
1240 add_ss_master_volume
($2);
1243 | SONG_INFO XC_STR XC_STR
{
1245 add_song_info_event
($2, $3);
1248 | MIDI_CHANNEL integer
{
1250 add_midi_channel_event
($2);
1253 | MIDI_PROGRAM integer
{
1255 add_midi_program_event
($2);
1261 void yyerror(const char *s
)
1263 c_err
(s
, NULL
, NULL
);
1267 #define set_block_d(n,b) set_block(n,strdup(b))
1269 static void compile_startup
(void)
1275 /* default settings */
1276 add_tempo_event
(-2, 120.0);
1277 add_meter_event
(-2, 4, 4);
1280 /* standard tonalities */
1281 set_block_d
("CM", "A");
1282 set_block_d
("Am", "$CM");
1283 set_block_d
("C#M", "A#######");
1284 set_block_d
("A#m", "$C#M");
1285 set_block_d
("DM", "A#--#---");
1286 set_block_d
("Bm", "$DM");
1287 set_block_d
("E&M", "A--&--&&");
1288 set_block_d
("Cm", "$E&M");
1289 set_block_d
("EM", "A##-##--");
1290 set_block_d
("C#m", "$EM");
1291 set_block_d
("FM", "A------&");
1292 set_block_d
("Dm", "$FM");
1293 set_block_d
("F#M", "A######-");
1294 set_block_d
("D#m", "$F#M");
1295 set_block_d
("GM", "A---#---");
1296 set_block_d
("Em", "$GM");
1297 set_block_d
("A&M", "A-&&--&&");
1298 set_block_d
("Fm", "$A&M");
1299 set_block_d
("AM", "A#--##--");
1300 set_block_d
("F#m", "$AM");
1301 set_block_d
("B&M", "A--&---&");
1302 set_block_d
("Gm", "$B&M");
1303 set_block_d
("BM", "A##-###-");
1304 set_block_d
("G#m", "$BM");
1308 static int do_parse
(void)
1310 int r
= yyparse() + compiler_error
;
1312 if
(solo_track
!= -1)
1313 mute_tracks
(-solo_track
);
1319 int compile_ahs_string
(const char *code
)
1323 push_code
(strdup
(code
));
1329 int compile_ahs
(const char *file
)
1333 if
(insert_file
(file
))