diff options
Diffstat (limited to 'BUG7')
-rw-r--r-- | BUG7/BUG7.csd | 48 | ||||
-rw-r--r-- | BUG7/basis.csd | 62 | ||||
-rw-r--r-- | BUG7/bid.udo | 149 | ||||
-rw-r--r-- | BUG7/bid_source.udo | 15 |
4 files changed, 138 insertions, 136 deletions
diff --git a/BUG7/BUG7.csd b/BUG7/BUG7.csd index 9e52133..98be65b 100644 --- a/BUG7/BUG7.csd +++ b/BUG7/BUG7.csd @@ -29,9 +29,8 @@ gksection init -1 #include "wavetables.udo" ; general waveforms #include "bussing.udo" ; global audio bussing -#include "bid.udo" ; Bug Infested Directive tools and parsing +#include "bid.udo" ; Bug Infested Directive tools and parsing #include "instruments.udo" ; sound generators -#include "txt_tools.udo" ; text tools #include "src_vox.udo" #include "oprepare.udo" ; offline preparation system @@ -123,25 +122,6 @@ instr global_master endin -/* - Print notification of performance time since last notification - or if isection is -1, print completion notification -*/ -gitimetrack times -instr notify_change - isection = p4 - itime times - if (isection == -1) then - tt_notify(sprintf"Complete, runtime: %s", tt_parsetime(itime))) - exitnow - else - isectiontime = itime - gitimetrack - tt_notify(sprintf("%s : section %d complete in %s", tt_parsetime(itime), isection, tt_parsetime(isectiontime))) - gitimetrack = itime - endif - turnoff -endin - /* Initialise the performance: run offline preparation and then call parseandrun @@ -162,18 +142,28 @@ instr parseandrun bid_loadtext(SBID) tt_notify("Running sequencer") - event_i "i", "sequencer", 0, 3600 + schedule "sequencer", 0, 3600 turnoff endin -instr endfade - exitnow -endin - - instr sequencer isection = 1 + + schedule "bid_setcurrentchord", 0, 1, isection, 0 + schedule "global_master", 0, p3 + schedule "global_delay1", 0, p3 + schedule "global_delay2", 0, p3 + gksection bid_seq_all isection + + if (isection == 1) then + schedule "play_stringchord", 0, tab_i(1, gibid_sectionlengths)*gibid_beattime, 1, 1 + endif +endin + +/* +instr sequencer_old + isection = 1 event_i "i", "bid_setcurrentchord", 0, 1, isection, 0 event_i "i", "global_master", 0, p3 event_i "i", "global_delay1", 0, p3 @@ -214,7 +204,7 @@ instr sequencer if (kposabs+1 < ksection16ths) then kposabs += 1 else - event "i","notify_change", 0, 1, ksection + event "i", "notify_change", 0, 1, ksection ;event "i", "play_crash", 0, gibid_beattime*4 ksection += 1 kposchord = 0 @@ -233,8 +223,8 @@ instr sequencer endif - endin +*/ </CsInstruments> <CsScore> diff --git a/BUG7/basis.csd b/BUG7/basis.csd deleted file mode 100644 index ff5b2c5..0000000 --- a/BUG7/basis.csd +++ /dev/null @@ -1,62 +0,0 @@ -<CsoundSynthesizer> -<CsOptions> --odac -</CsOptions> -<CsInstruments> -sr = 44100 -kr = 4410 -nchnls = 2 -0dbfs = 1 -seed 0 -gifnSine = 1 - -instr rim - icps = p4 ;1000 - acps expon icps, 0.0025, icps * 0.5 - acps = acps + icps - iamp = 0.1 - a1a phasor acps, 0 - a1b phasor acps, random(0, 1) - afmenv expon 1.0, 0.02, 0.4 - a1 = (a1a-a1b)*random(1, 10)*afmenv - acps = acps*(1.0+a1) - a0 oscil3 1.0, acps - aenv expon 1.0, 0.005, 0.5 - a0 limit 4.0*a0*aenv, -1.0, 1.0 - a0 butterhp a0, 230 - aL, aR pan2 a0*iamp, random(0.3, 0.8) - outs aL, aR -endin - -instr play_rim - if (random:k(0, 1) > 0.3) then - event "i", "play_rim", 0, 0.4, 3000 - endif - if (random:k(0, 1) > 0.3) then - event "i", "play_rim", 0, 0.4, 1000 - endif - if (random:k(0, 1) > 0.3) then - event "i", "play_rim", 0, 0.4, 2000 - endif - if (random:k(0, 1) > 0.3) then - event "i", "play_rim", 0, 0.4, 500 - endif - if (random:k(0, 1) > 0.3) then - event "i", "play_rim", 0, 0.4, 2500 - endif - if (random:k(0, 1) > 0.3) then - event "i", "play_rim", 0, 0.4, 3500 - endif -endin - - -</CsInstruments> -<CsScore> -i1 0 100 -f1 0 16384 10 1 ; Sine -f2 0 16384 10 1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 .111 ; Sawtooth -f3 0 16384 10 1 0 0.3 0 0.2 0 0.14 0 .111 ; Square -f4 0 16384 10 1 1 1 1 0.7 0.5 0.3 0.1 ; Pulse - -</CsScore> -</CsoundSynthesizer>
\ No newline at end of file diff --git a/BUG7/bid.udo b/BUG7/bid.udo index 17e9be2..60d6aa0 100644 --- a/BUG7/bid.udo +++ b/BUG7/bid.udo @@ -9,7 +9,7 @@ */ -#define BID_VERSION #1.1# +#define BID_VERSION #1.2# #include "txt_tools.udo" @@ -118,37 +118,6 @@ opcode _bid_parserowitems, i, Siii endop -/* - Read BID data for specified element and trigger accordingly. - - bid_seq Splayer, kposition, ksection - - Splayer name of BID element - kposition position in pattern provided by master sequencer - ksection section in composition provided by master sequencer - -*/ -opcode bid_seq, 0, Skk - Splayer, kpos, ksection xin - Sinstrument = sprintf("play_%s", Splayer) - instrindex = _bid_gettextindex(Splayer) - kdata = gibid_sections[ksection][instrindex] - - if (kdata != -1) then ; null section - kon = tablekt:k(kpos, gibid_sectiondata[kdata][0]) - - if (kon == 1) then - kchance = tablekt:k(kpos, gibid_sectiondata[kdata][3]) - if (random:k(0, 1) < kchance) then - ktime = (kpos % 2 == 0) ? 0 : gibid_swingtime - kdur = tablekt:k(kpos, gibid_sectiondata[kdata][1]) * gibid_beattime - ;kamp = tablekt:k(kpos, gisectiondata[kdata][2]) - event "i", Sinstrument, ktime, kdur, kpos, kdata - endif - endif - endif -endop - /* Get a parameter for the specified pattern position. @@ -345,6 +314,122 @@ complete: endop + +/* + Read BID data for specified element and trigger accordingly. + + bid_seq Splayer, kposition, ksection + + Splayer name of BID element + kposition position in pattern provided by master sequencer + ksection section in composition provided by master sequencer + +*/ +opcode bid_seq, 0, Skk + Splayer, kpos, ksection xin + Sinstrument = sprintf("play_%s", Splayer) + instrindex = _bid_gettextindex(Splayer) + kdata = gibid_sections[ksection][instrindex] + + if (kdata != -1) then ; null section + kon = tablekt:k(kpos, gibid_sectiondata[kdata][0]) + + if (kon == 1) then + kchance = tablekt:k(kpos, gibid_sectiondata[kdata][3]) + if (random:k(0, 1) < kchance) then + ktime = (kpos % 2 == 0) ? 0 : gibid_swingtime + kdur = tablekt:k(kpos, gibid_sectiondata[kdata][1]) * gibid_beattime + ;kamp = tablekt:k(kpos, gisectiondata[kdata][2]) + event "i", Sinstrument, ktime, kdur, kpos, kdata + endif + endif + endif +endop + + +instr _bid_exit + exitnow +endin + +/* + Print notification of performance time since last notification + or if isection is -1, print completion notification +*/ +gibid_timetrack times +instr bid_notify_change + isection = p4 + itime times + if (isection == -1) then + tt_notify(sprintf"Complete, runtime: %s", tt_parsetime(itime))) + exitnow + else + isectiontime = itime - gibid_timetrack + tt_notify(sprintf("%s : section %d complete in %s", tt_parsetime(itime), isection, tt_parsetime(isectiontime))) + gibid_timetrack = itime + endif + turnoff +endin + + +opcode bid_seq_all, k, oo + istartsection, index xin + ksection init istartsection + kpos init 0 + kposabs init 0 + kposchord init 0 + imaxinstruments = lenarray(gSbid_sequenced) + + kmetro metro (gibid_tempo / 60) * 4 + if (kmetro == 1) then + if (ksection > gibid_maxsection) then + schedulek("bid_notify_change", 0, 1, -1) + endif + + kindex = 0 + while (kindex < imaxinstruments) do + kdata = gibid_sections[ksection][kindex] + if (kdata != -1) then ; null section + kon = tablekt:k(kpos, gibid_sectiondata[kdata][0]) + + if (kon == 1) then + kchance = tablekt:k(kpos, gibid_sectiondata[kdata][3]) + if (random:k(0, 1) < kchance) then + ktime = (kpos % 2 == 0) ? 0 : gibid_swingtime + kdur = tablekt:k(kpos, gibid_sectiondata[kdata][1]) * gibid_beattime + ;kamp = tablekt:k(kpos, gisectiondata[kdata][2]) + schedulek(sprintfk("play_%s", gSbid_sequenced[kindex]), ktime, kdur, kpos, kdata) + endif + endif + endif + kindex += 1 + od + + kpos = (kpos < 31) ? kpos + 1 : 0 + ksection16ths = bid_getsectionlength(ksection) * 4 + + if (kposabs + 1 < ksection16ths) then + kposabs += 1 + else + schedulek("bid_notify_change", 0, 1, ksection) + ksection += 1 + kposchord = 0 + kpos = 0 + kposabs = 0 + schedulek("bid_setcurrentchord", 0, 1, ksection, 1) + endif + + if (kposchord + 1 < gkbid_chordlength * 4) then + kposchord += 1 + else + kposchord = 0 + schedulek("bid_setcurrentchord", 0, 1, ksection, 1) + endif + endif + xout ksection +endop + + + /* Parse a Bug Infested Directive Format string to global arrays, ftables and variables. Handles patterns, tempo, chord groups and sections etc accordingly. diff --git a/BUG7/bid_source.udo b/BUG7/bid_source.udo index e122649..32db3e5 100644 --- a/BUG7/bid_source.udo +++ b/BUG7/bid_source.udo @@ -1,5 +1,5 @@ /* - Debugger - Unfixed Bugs : BUG #4 + Debugger - Unfixed Bugs : BUG #7 Bug Infested Directives source Provided as a string due to readfi not being available on all platforms. @@ -8,7 +8,7 @@ SBID = {{ ; Bug Infested Directives : Debugger - Unfixed Bugs : BUG #7 -v 1.1 +v 1.2 ; tempo, swing percent b 121, 27 @@ -26,17 +26,6 @@ s 2, 4, 1 s 3, 64, 1 -i glitchread, 1, -1 -i glitchread, 2, -1 -i glitchread, 3 -; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - - 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 - .3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3,.3 - - - i 3031, 1 ; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 |