From 0f09f0882ed87bea9ff3e745c73f5d4743854fbb Mon Sep 17 00:00:00 2001 From: Richard Date: Fri, 28 Feb 2025 02:08:19 +0000 Subject: added bug6 --- BUG6/BUG6.csd | 139 +++++++++++++++++----------------------------------------- 1 file changed, 40 insertions(+), 99 deletions(-) (limited to 'BUG6/BUG6.csd') diff --git a/BUG6/BUG6.csd b/BUG6/BUG6.csd index 076d5f2..c9cbea4 100644 --- a/BUG6/BUG6.csd +++ b/BUG6/BUG6.csd @@ -9,7 +9,7 @@ http://git.1bpm.net/csd-unfixedbugs1/about/ - By Richard Knight 2021 + By Richard Knight 2021, 2023, 2024 http://1bpm.net q@1bpm.net @@ -18,14 +18,14 @@ sr = 44100 ksmps = 64 nchnls = 2 -0dbfs = 1 +0dbfs = 1.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 +gksection init 1 #include "wavetables.udo" ; general waveforms #include "bussing.udo" ; global audio bussing @@ -95,19 +95,13 @@ instr global_delay3 bus_mix("master", aLdel, aRdel) endin -/* - Master audio output -*/ -instr global_master - igain = 1 - aL, aR bus_read "master" - awindex phasor giglitchsamples/sr - tablew aL, awindex*giglitchsamples, giglitchbufferL - tablew aR, awindex*giglitchsamples, giglitchbufferR - - if (gksection == 1) then - ilen = tab_i(1, gibid_sectionlengths) * gibid_beattime +instr section_bus + isection = p4 + ilen = p3 + aL, aR bus_read "section_bus_send" + + if (isection == 1) then khpf linseg 0, ilen*0.5, 0, ilen*0.3, 100, ilen*0.1, 200, ilen*0.1, 900 knoiseamp linseg 0, ilen*0.8, 0.04, ilen*0.1, 0.1, ilen*0.1, 0.6 anL = noise(0.5, 0.2) @@ -119,8 +113,7 @@ instr global_master aR += resony(anR, kfreq*4, 8, 24, 4) * 0.01 * knoiseamp aL butterhp aL, khpf aR butterhp aR, khpf - elseif (gksection == 3) then - ilen = tab_i(3, gibid_sectionlengths) * gibid_beattime + elseif (isection == 3 || isection == 8 || isection == 12) then anL = noise(0.5, 0.5) anR = noise(0.5, 0.5) knoiseamp linseg 0, ilen*0.7, 0.1, ilen*0.1, 0.2, ilen*0.2, 0.9 @@ -129,34 +122,37 @@ instr global_master kfreq linseg ifreq1, ilen*0.8, ifreq1, ilen*0.2, ifreq2 aL += resony(anL, kfreq*4, 3, 24, 4) * 0.005 * knoiseamp aR += resony(anR, kfreq*4, 3, 24, 4) * 0.005 * knoiseamp - bus_mix("delay1", aL*knoiseamp*0.5, aR*knoiseamp*0.5) + bus_mix("delay1", aL*knoiseamp*0.3, aR*knoiseamp*0.3) khpf expseg 1, ilen*0.4, 300, ilen*0.4, 600, ilen*0.1, 20, ilen*0.1, 20 aL butterhp aL, khpf aR butterhp aR, khpf endif - aL limit aL*0.5, -1, 1 - aR limit aR*0.5, -1, 1 - outs aL*gkmastergain*igain, aR*gkmastergain*igain -endin + bus_set("section_bus_return", aL, aR) +endin /* - Print notification of performance time since last notification - or if isection is -1, print completion notification + Master audio output */ -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 +instr global_master + igain = 1 + aL, aR bus_read "master" + + awindex phasor giglitchsamples/sr + tablew aL, awindex*giglitchsamples, giglitchbufferL + tablew aR, awindex*giglitchsamples, giglitchbufferR + + if (changed:k(gksection) == 1) then + schedulek("section_bus", 0, tab:k(gksection, gibid_sectionlengths) * gibid_beattime, gksection) endif - turnoff + + bus_set("section_bus_send", aL, aR) + aL, aR bus_read "section_bus_return" + + + aL limit aL*0.5, -1, 1 + aR limit aR*0.5, -1, 1 + outs aL*gkmastergain*igain, aR*gkmastergain*igain endin @@ -170,77 +166,22 @@ 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 - event_i "i", "bid_setcurrentchord", 0, 1, isection, 0 - event_i "i", "global_master", 0, p3 - event_i "i", "global_delay1", 0, p3 - event_i "i", "global_delay2", 0, p3 - event_i "i", "global_delay3", 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 "kick2", kpos, ksection - bid_seq "clap", kpos, ksection - bid_seq "303", kpos, ksection - bid_seq "hat1", kpos, ksection - bid_seq "snare", kpos, ksection - bid_seq "hat2", kpos, ksection - bid_seq "303b", kpos, ksection - bid_seq "glitchread", kpos, ksection - bid_seq "blip", kpos, ksection - bid_seq "shaker", 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 - + schedule "bid_setcurrentchord", 0, 1, isection, 0 + schedule "global_master", 0, p3 + schedule "global_delay1", 0, p3 + schedule "global_delay2", 0, p3 + schedule "global_delay3", 0, p3 + gksection bid_seq_all isection endin + i"parseandrun" 0 1 -- cgit v1.2.3