From de29afe4f86ecc092a436420f218e9a26567dd56 Mon Sep 17 00:00:00 2001 From: angel Date: Mon, 28 Aug 2006 13:14:33 +0000 Subject: [PATCH] The track in the arpeggiator is relative instead of absolute (Closes: #1119). git-svn-id: file:///home/angel/tmp/svn-triptico/ahxm/trunk@923 c87de0a0-a11c-0410-a1e5-866214bc28b2 --- RELEASE_NOTES | 3 ++- TODO | 4 ++-- compiler.y | 20 ++++++++++---------- doc/ahs_overview_i.txt | 5 +++-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index a8be5ce..df461a7 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -9,7 +9,8 @@ Ann Hell Ex Machina Release Notes defined channels and not clipped to 2). Other output devices are still silently clipped to 2 and the rest of channels dropped. * The arpeggiator subcommand @ (track) has been changed to /, as it was - confusing the parser. + confusing the parser. Also, the track is relative instead of absolute + (now it means a track offset), so it can be reused. * Midiin has been fixed, as it was severely broken (no initializations). * OSS's fragment changed so that real-time applications (as midiin) work again. This seems to be necessary when using ALSA's OSS emulation. diff --git a/TODO b/TODO index 31de811..c632bd6 100644 --- a/TODO +++ b/TODO @@ -71,8 +71,6 @@ Pending Enhancements * 1117: The output driver initialization should return the number of channels currently usable. This way, the output engine can remap all channels to the existing ones. - * 1119: Change the track subcommand in the arpeggiator to be a track - offset instead of being an absolute one. Closed ------ @@ -292,5 +290,7 @@ Closed to existing ones (Sat, 19 Aug 2006 19:49:39 +0200). * 1118: If no volume is set in a song, no channel is generated (Sun, 20 Aug 2006 14:30:32 +0200). + * 1119: Change the track subcommand in the arpeggiator to be a track + offset instead of being an absolute one (Mon, 28 Aug 2006 15:14:03 +0200). Email bugs to angel@triptico.com diff --git a/compiler.y b/compiler.y index 7e96b3c..718cfb8 100644 --- a/compiler.y +++ b/compiler.y @@ -102,7 +102,7 @@ struct arp double delay; int transpose; float volume; - int track; + int track_off; }; static struct arp * arps = NULL; @@ -112,7 +112,7 @@ static int arps_size = 0; static double arp_delay; static int arp_transpose; static float arp_volume; -static int arp_track; +static int arp_track_off; int compiler_error = 0; @@ -403,7 +403,7 @@ static void arp_default(void) arp_delay = 0.0; arp_transpose = 0; arp_volume = 1.0; - arp_track = track; + arp_track_off = 0; } @@ -414,7 +414,7 @@ static void add_arp(void) /* if the note is exactly the same, do nothing */ if(arp_delay == 0.0 && arp_transpose == 0 && - arp_volume == 1.0 && arp_track == track) + arp_volume == 1.0 && arp_track_off == 0) return; if(n_arps == arps_size) @@ -428,7 +428,7 @@ static void add_arp(void) a->delay = arp_delay; a->transpose = arp_transpose; a->volume = arp_volume; - a->track = arp_track; + a->track_off = arp_track_off; n_arps++; arp_default(); @@ -467,7 +467,7 @@ static void add_note_event(int note) /* add arpeggiator repetitions */ for(n = 0;n < n_arps;n++) { - e.note.trk_id = arps[n].track; + e.note.trk_id = track + arps[n].track_off; e.note.note = np + arps[n].transpose; e.note.vol = volume * arps[n].volume; @@ -942,16 +942,16 @@ arp_note: arp_transpose = $2; } | arp_note '/' P_INTEGER { - /* arpeggiator track */ - arp_track = $3; + /* arpeggiator track offset */ + arp_track_off = $3; } | arp_note NOTE_T3 { /* HACK: /3 */ - arp_track = 3; + arp_track_off = 3; } | arp_note NOTE_T5 { /* HACK: /5 */ - arp_track = 5; + arp_track_off = 5; } ; diff --git a/doc/ahs_overview_i.txt b/doc/ahs_overview_i.txt index 2ab68a0..33575fa 100644 --- a/doc/ahs_overview_i.txt +++ b/doc/ahs_overview_i.txt @@ -261,8 +261,8 @@ Transpose, if specified, is a signed number of semitones to transpose the original note. If no transpose is specified, the pitch of the repeated note will be the same as the original. -Track, if specified, is a / followed by a track number, meaning the note -will be inserted in that track (and not in the current one). +Track, if specified, is a / followed by a track offset, meaning the note +will be inserted that tracks after current one (and not in the current one). An x command with no repetition specifications effectively disables the arpeggiator. @@ -272,6 +272,7 @@ Examples: x4~0.6 // repeats each note a quarter later at 60% of vol. x4~0.6,2~0.4 // the same, but another repetition later at 40% x8-1,4-2,8*3-3 // 3 chromatic repetitions after each eighth + x8-1,4-2,8*3-3/2 // the same, last note is inserted 2 tracks after x // disable arpeggiator Marks -- 2.11.4.GIT