-odac -m0 /* Debugger - Unfixed Bugs : BUG #7 http://git.1bpm.net/csd-unfixedbugs1/about/ By Richard Knight 2021 http://1bpm.net q@1bpm.net */ sr = 44100 ksmps = 10 nchnls = 2 0dbfs = 1 seed 0 #define NOFILEIO ## ; file IO with readfi not supported on all platforms: disables bid_loadfile gkmastergain init 1 ; master gain gkpump = 0 ; kick ducking control gksection init -1 #include "wavetables.udo" ; general waveforms #include "bussing.udo" ; global audio bussing #include "bid.udo" ; Bug Infested Directive tools and parsing #include "instruments.udo" ; sound generators #include "txt_tools.udo" ; text tools instr global_delay1 itm = gibid_beattime aL, aR bus_read "delay1" aL multitap aL, itm/2, random(0.1, 0.5), itm/4, random(0.1, 0.5), itm*2, random(0.1, 0.5) aR multitap aL, itm, random(0.1, 0.5), itm*3, random(0.1, 0.5), itm/8, random(0.1, 0.5) bus_mix("master", aL*0.8, aR*0.8) endin /* Master audio output */ instr global_master igain = 1 aL, aR bus_read "master" itime1 = tab_i(1, gibid_sectionlengths)*gibid_beattime aclapL, aclapR bus_read "clap" acofferL, acofferR bus_read "coffer" akickL, akickR bus_read "kick" ahat1L, ahat1R bus_read "hat1" arimL, arimR bus_read "rim" kclapamp init 0 kcofferamp init 0 if (gksection == 1) then kclapamp linseg 0, itime1*0.6, 1, itime1*0.4, 1 kcofferamp line 0, itime1, 1 krevamp linseg 1, itime1*0.1, 0, itime1*0.9, 0 arL, arR freeverb aL*2, aR*2, 0.9, 0.9 ir = 512 fL pvsanal arL, ir, ir/4, ir, 1 fR pvsanal arR, ir, ir/4, ir, 1 kshift = line(1000, itime1*0.1, 0) kshifto = abs(oscil(100, 10)) f1L pvshift fL, kshift+kshifto, 300 f1R pvshift fR, kshift+kshifto, 300 arL pvsynth f1L arR pvsynth f1R aL = (krevamp*arL) + ((1-krevamp)*aL) aR = (krevamp*arR) + ((1-krevamp)*aR) endif aL += (aclapL * kclapamp) + (acofferL * kcofferamp) + (akickL * kclapamp) + (ahat1L * kcofferamp) + (arimL * kcofferamp) aR += (aclapR * kclapamp) + (acofferR * kcofferamp) + (akickR * kclapamp) + (ahat1R * kcofferamp) + (arimR * kcofferamp) aL limit aL*0.5, -1, 1 aR limit aR*0.5, -1, 1 outs aL*gkmastergain*igain, aR*gkmastergain*igain 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 /* Parse BID file and run the sequencer */ instr parseandrun tt_notify("Parsing events") #include "bid_source.udo" bid_loadtext(SBID) tt_notify("Running sequencer") event_i "i", "sequencer", 0, 3600 turnoff endin instr endfade exitnow endin instr sequencer 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 kmetro metro (gibid_tempo / 60) * 4 kpos init 0 kposabs init 0 ksection init isection kposchord init 0 gksection = ksection if (kmetro == 1) then if (ksection > gibid_maxsection) then ;event "i", "endfade", 0, gibid_beattime*8 event "i", "notify_change", p3, 1, -1 turnoff endif bid_seq "kick", kpos, ksection bid_seq "koffer", kpos, ksection bid_seq "clap", kpos, ksection bid_seq "hat1", kpos, ksection bid_seq "3031", kpos, ksection bid_seq "3032", kpos, ksection ;bid_seq "hat2", kpos, ksection bid_seq "rim", kpos, ksection kpos = (kpos < 31) ? kpos + 1 : 0 ksection16ths = bid_getsectionlength(ksection) * 4 if (kposabs+1 < ksection16ths) then kposabs += 1 else event "i", "notify_change", 0, 1, ksection ;event "i", "play_crash", 0, gibid_beattime*4 ksection += 1 kposchord = 0 kpos = 0 kposabs = 0 event "i", "bid_setcurrentchord", 0, 1, ksection, 1 endif if (kposchord+1 < gkbid_chordlength*4) then kposchord += 1 else kposchord = 0 event "i", "bid_setcurrentchord", 0, 1, ksection, 1 endif endif endin i"parseandrun" 0 1