From 3475a2cfc2ac583ea67e5fa048fbab1c3c192895 Mon Sep 17 00:00:00 2001 From: angel Date: Sun, 29 May 2005 08:35:03 +0000 Subject: [PATCH] The 'off' directive has been added, to set to off the effect chain on a channel. git-svn-id: file:///home/angel/tmp/svn-triptico/ahxm/trunk@601 c87de0a0-a11c-0410-a1e5-866214bc28b2 --- compiler.l | 1 + compiler.y | 10 ++++++++-- song.h | 1 + ss_song.c | 6 ++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/compiler.l b/compiler.l index 478247c..ff8a7f4 100644 --- a/compiler.l +++ b/compiler.l @@ -232,6 +232,7 @@ WSPACE [ \t]+ square_wobble { return(SS_EFF_SQWOBBLE); } fader { return(SS_EFF_FADER); } reverb { return(SS_EFF_REVERB); } +off { return(SS_EFF_OFF); } midi_channel { return(MIDI_CHANNEL); } midi_program { return(MIDI_PROGRAM); } diff --git a/compiler.y b/compiler.y index af656f8..2290ac7 100644 --- a/compiler.y +++ b/compiler.y @@ -575,8 +575,8 @@ static void _init_track(void) %token XC_MSECS XC_ABSNOTE %token SS_SEP SS_WAV SS_LOOP_WAV SS_PAT SS_SUSTAIN -%token SS_EFF_DELAY SS_EFF_ECHO SS_EFF_COMB SS_EFF_ALLPASS -%token SS_EFF_FLANGER SS_EFF_WOBBLE SS_EFF_SQWOBBLE SS_EFF_FADER SS_EFF_REVERB +%token SS_EFF_DELAY SS_EFF_ECHO SS_EFF_COMB SS_EFF_ALLPASS SS_EFF_FLANGER +%token SS_EFF_WOBBLE SS_EFF_SQWOBBLE SS_EFF_FADER SS_EFF_REVERB SS_EFF_OFF %token MIDI_CHANNEL MIDI_PROGRAM MIDI_GENERIC @@ -875,6 +875,12 @@ xc_cmd: $2, 0, 0, 0, 0, 0, 0, 0); } + | SS_EFF_OFF integer { + /* off effect */ + _add_ss_eff_event(SONG_EV_SS_EFF_OFF, + $2, 0, 0, 0, 0, 0, 0, 0); + } + | MIDI_CHANNEL integer { /* midi channel */ add_midi_channel_event($2); diff --git a/song.h b/song.h index 08fd1f6..9e580d6 100644 --- a/song.h +++ b/song.h @@ -43,6 +43,7 @@ typedef enum SONG_EV_SS_EFF_SQWOBBLE, SONG_EV_SS_EFF_FADER, SONG_EV_SS_EFF_REVERB, + SONG_EV_SS_EFF_OFF, SONG_EV_MIDI_CHANNEL, SONG_EV_MIDI_PROGRAM, diff --git a/ss_song.c b/ss_song.c index 038fb9e..8557faf 100644 --- a/ss_song.c +++ b/ss_song.c @@ -339,6 +339,7 @@ static int ss_song_convert_events(void) case SONG_EV_SS_EFF_SQWOBBLE: case SONG_EV_SS_EFF_FADER: case SONG_EV_SS_EFF_REVERB: + case SONG_EV_SS_EFF_OFF: sse.ss_eff.channel=e->ss_eff.channel; sse.ss_eff.size=e->ss_eff.size; @@ -522,6 +523,11 @@ int ss_song_render(void) ss_eff_reverb(&i->effs[e->ss_eff.channel]); break; + case SONG_EV_SS_EFF_OFF: + + ss_eff_off(&i->effs[e->ss_eff.channel]); + break; + case SONG_EV_END: go=0; -- 2.11.4.GIT