diff options
-rw-r--r-- | BUG10/BUG10.csd | 150 | ||||
-rw-r--r-- | BUG10/bid.udo | 511 | ||||
-rw-r--r-- | BUG10/bid_source.udo | 144 | ||||
-rw-r--r-- | BUG10/bussing.udo | 62 | ||||
-rw-r--r-- | BUG10/instruments.udo | 239 | ||||
-rw-r--r-- | BUG10/txt_tools.udo | 82 | ||||
-rw-r--r-- | BUG10/wavetables.udo | 16 | ||||
-rw-r--r-- | BUG3/BUG3.csd | 4 | ||||
-rw-r--r-- | BUG4/BUG4.csd | 5 | ||||
-rw-r--r-- | BUG4/bid.udo | 2 | ||||
-rw-r--r-- | BUG4/instruments.udo | 6 | ||||
-rw-r--r-- | BUG5/BUG5.csd | 28 | ||||
-rw-r--r-- | BUG5/bid_source.udo | 113 | ||||
-rw-r--r-- | BUG5/instruments.udo | 5 | ||||
-rw-r--r-- | BUG6/BUG6.csd | 147 | ||||
-rw-r--r-- | BUG6/bid.udo | 150 | ||||
-rw-r--r-- | BUG6/bid_source.udo | 158 | ||||
-rw-r--r-- | BUG6/bussing.udo | 17 | ||||
-rw-r--r-- | BUG6/instruments.udo | 14 | ||||
-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 | ||||
-rw-r--r-- | BUG8/BUG8.csd | 8 | ||||
-rw-r--r-- | BUG9/BUG9.csd | 101 | ||||
-rw-r--r-- | BUG9/ass | 0 | ||||
-rw-r--r-- | BUG9/bid.udo | 157 | ||||
-rw-r--r-- | BUG9/bid_source.udo | 238 | ||||
-rw-r--r-- | BUG9/instruments.udo | 191 | ||||
-rw-r--r-- | README.md | 19 |
30 files changed, 2372 insertions, 469 deletions
diff --git a/BUG10/BUG10.csd b/BUG10/BUG10.csd new file mode 100644 index 0000000..45d9314 --- /dev/null +++ b/BUG10/BUG10.csd @@ -0,0 +1,150 @@ +<CsoundSynthesizer> +<CsOptions> +-odac +-m0 +</CsOptions> +<CsInstruments> +/* + Debugger - Unfixed Bugs : BUG #10 + + http://git.1bpm.net/csd-unfixedbugs1/about/ + + By Richard Knight 2023, 2024 + 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 + aL, aR bus_read "delay1" + ifreq1 = (gibid_tempo / 60) / 4 + kfdbkL = abs(oscil(0.8, 1.67)) + kfdbkR = abs(oscil(0.8, 1.67)) + + atimeL = abs(oscil(0.2, ifreq1)) + 0.3 + atimeR = abs(oscil(0.2, ifreq1)) + 0.3 + + aLdlr delayr 1 + aLdel deltapi atimeL + aLdel butterhp aLdel, 130 + delayw aL + (aLdel * kfdbkL) + + aRdlr delayr 1 + aRdel deltapi atimeR + aRdel butterhp aRdel, 130 + delayw aR + (aRdel * kfdbkR) + + aLdel *= 1-gkpump + aRdel *= 1-gkpump + bus_mix("master", aLdel, aRdel) +endin + +instr global_delay2 + aL, aR bus_read "delay2" + aLdlr delayr 0.2 + kdeltime = abs(oscil(0.02, 0.04)) + 0.01 + aLdel deltapi kdeltime + 0.002 + delayw aL + (aLdel * 0.7) + aRdlr delayr 0.2 + aRdel deltapi kdeltime + 0.001 + delayw aR + (aRdel * 0.7) + ;aLdel *= 1-gkpump + ;aRdel *= 1-gkpump + bus_mix("master", aLdel, aRdel) +endin + +instr global_delay3 + aL, aR bus_read "delay3" + ifreq1 = (gibid_tempo / 60) / 8 + kfdbkL = abs(oscil(0.8, 1.63)) + kfdbkR = abs(oscil(0.8, 1.67)) + + atimeL = abs(oscil(0.2, ifreq1)) + 0.01 + atimeR = abs(oscil(0.2, ifreq1)) + 0.01 + + aLdlr delayr 1 + aLdel deltapi atimeL + aLdel butterhp aLdel, 130 + delayw aL + (aLdel * kfdbkL) + + aRdlr delayr 1 + aRdel deltapi atimeR + aRdel butterhp aRdel, 130 + delayw aR + (aRdel * kfdbkR) + + aLdel *= 1-gkpump + aRdel *= 1-gkpump + 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 + + aL limit aL*0.5, -1, 1 + aR limit aR*0.5, -1, 1 + outs aL*gkmastergain*igain, aR*gkmastergain*igain +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") + 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 + schedule "global_delay3", 0, p3 + gksection bid_seq_all isection +endin + + +</CsInstruments> +<CsScore> +i"parseandrun" 0 1 +</CsScore> +</CsoundSynthesizer>
\ No newline at end of file diff --git a/BUG10/bid.udo b/BUG10/bid.udo new file mode 100644 index 0000000..3c96bdc --- /dev/null +++ b/BUG10/bid.udo @@ -0,0 +1,511 @@ +#ifndef UDO_BID +#define UDO_BID ## +/* + Debugger - Unfixed Bugs : BUG #10 + + Bug Infested Directive file parser v1.2 and tools + + Designed to create a reusable loop based score format in the Unfixed Bugs project and beyond. +*/ + + +#define BID_VERSION #1.2# + +#include "txt_tools.udo" + +; globals +gibid_tempo init -1 ; beats per minute +gibid_beattime init -1 ; time of one beat in second +gibid_maxsection init -1 ; max number of sections +gibid_chordfn init -1 ; current chord ftable +gkbid_chordlength init -1 ; current chord length + +; BID internals +gibid_sectionlengths ftgen 0, 0, -64, -7, 0 ; section lengths +gibid_sections[][] init 64, 64 ; section pointers to data +gibid_sectiondata[][] init 99, 6 ; section data, ftables contained + +gibid_chordgroups[][] init 16, 12 ; chord groups, pointers to sectionchords by section +gibid_sectionchords[] init 16 ; ftables of section chords + +gibid_currentchordnum = 0 ; current chord number +gibid_lastchordgroup = -1 ; last chord group +gibid_lastsection = -1 ; last section + +gSbid_sequenced[] init 1 ; internal tracking of sequenced elements +gibid_sequenceinit init 1 ; internal tracking of sequenced init +gibid_swingtime init -1 ; swing time calculated from percent + +/* + Get BID instrument index, creating new reference if specified. + Internal use only. + + index _bid_gettextindex Sname, [iaddifnotexists = -1] + + index BID instrument index + + Sname name to look up or create + iaddifnotexists 1=create , default=fatal if not exists +*/ +opcode _bid_gettextindex, i, Sj + Sname, iaddifnotexists xin + ifinalindex = -1 + index = 0 + while (index < lenarray(gSbid_sequenced)) do + if (strcmp(gSbid_sequenced[index], Sname) == 0) then + ifinalindex = index + igoto complete + endif + index += 1 + od + + if (iaddifnotexists == 1) then + if (gibid_sequenceinit == 1) then + gibid_sequenceinit = 0 + SequencedNew[] fillarray Sname + ifinalindex = 0 + else + SequencedNew[] init lenarray(gSbid_sequenced) + 1 + index = 0 + while (index < lenarray(gSbid_sequenced)) do + SequencedNew[index] = gSbid_sequenced[index] + index += 1 + od + SequencedNew[index] = Sname + ifinalindex = index + endif + gSbid_sequenced = SequencedNew + igoto complete + else + tt_notify_fatal(sprintf("Sequenced index for '%s' not found", Sname)) + endif + +complete: + xout ifinalindex +endop + + + +/* + Parse a row of comma-separated numerical values of either patterns or chords. + Internal use only. + + inum _bid_parserowitems Sline, ix1, ix2, imode + + inum number of elements found parsed + + Sline input line + ix1 array dimension 1 index + ix2 array dimension 2 index + imode 0=count elements; 1=write patterns; 2=write chords +*/ +opcode _bid_parserowitems, i, Siii + Sline, ix1, ix2, imode xin + inum = 0 + while (strlen(Sline) > 0) do + icomma = strindex(Sline, ",") + Stemp = strsub(Sline, 0, icomma) + icomma = (icomma == -1) ? 0 : icomma + Sline = strsub(Sline, icomma + 1) + if (imode == 1) then + tabw_i strtod(Stemp), inum, gibid_sectiondata[ix1][ix2] + elseif (imode == 2) then + tabw_i strtod(Stemp), inum, gibid_chordgroups[ix1][ix2] + endif + inum += 1 + od + xout inum +endop + + + +/* + Get a parameter for the specified pattern position. + ipos and idataindex are provided as p4 and p5 to instruments scheduled by bid_seq, + hence can typically used as bid_getparameter(p4, p5, iparameter) + + idata bid_getparameter ipos, idataindex, iparameter + + idata the resulting value + + ipos position in pattern + idataindex section specific data index; pointer to ftable + iparameter parameter index as in BID file; defaults include 0=on/off, 1=duration, 2=amp, 3=chance + +*/ +opcode bid_getparameter, i, iii + ipos, idataindex, iparameter xin + xout tab_i(ipos, gibid_sectiondata[idataindex][iparameter]) +endop + + +/* + Get a section length in beats + + klength bid_getsectionlength ksection + + klength length in beats + + ksection section to look up +*/ +opcode bid_getsectionlength, k, k + ksection xin + xout tab:k(ksection, gibid_sectionlengths) +endop + +/* + Parse a row of comma-separated values to either section patterns or chord storage. + Scans row, assigns ftable of appropriate length and then fills ftable. + Internal use only. + + _bid_parserow Sline, ix1, ix2, imode + + Sline line to parse + ix1 array dimension 1 index of target storage + ix2 array dimension 2 index of target storage + imode 1=section patterns, 2=chords +*/ +opcode _bid_parserow, 0, Siii + Sline, ix1, ix2, imode xin + isize = _bid_parserowitems(Sline, ix1, ix2, 0) + if (imode == 1) then + gibid_sectiondata[ix1][ix2] ftgen 0, 0, -isize, -7, 0 + elseif (imode == 2) then + gibid_chordgroups[ix1][ix2] ftgen 0, 0, -isize, -7, 0 + endif + isize = _bid_parserowitems(Sline, ix1, ix2, imode) +endop + + + +/* + Parse a line from a BID string + Internal use only. + + idataout[] _bid_parseline Sline, idatain[] + + idataout[] state data + + Sline line to parse + idatain[] state data + +*/ +opcode _bid_parseline, i[], Si[] + Sline, idata[] xin + iparameter = idata[0] + isection = idata[1] + ichordnum = idata[2] + isectiondataindex = idata[3] + imode = idata[4] + + if (strlen(Sline) > 0) then + Sfirstchar = strsub(Sline, 0, 1) + + ; comment + if (strcmp(Sfirstchar, ";") == 0) then + ; no action + + ; version check + elseif (strcmp(Sfirstchar, "v") == 0) then + imode = 0 + iversion = strtod(strsub(Sline, 2)) + if (iversion != $BID_VERSION) then + tt_notify(sprintf("Incompatible BID file version: got %.2f , expected %.2f", iversion, $BID_VERSION)) + exitnow + endif + + ; section header + elseif (strcmp(Sfirstchar, "s") == 0) then + imode = 1 + icomma = strindex(Sline, ",") + isectionnum = strtod(strsub(Sline, 2, icomma)) + Sub = strsub(Sline, icomma+1) + icomma = strindex(Sub, ",") + isectionlength = strtod(strsub(Sub, 0, icomma)) + ichordgroup = strtod(strsub(Sub, icomma+1)) + gibid_sectionchords[isectionnum] = ichordgroup + tabw_i isectionlength, isectionnum, gibid_sectionlengths + + ; tempo + elseif (strcmp(Sfirstchar, "b") == 0) then + imode = -1 + icomma = strindex(Sline, ",") + gibid_tempo = strtod(strsub(Sline, 2, icomma)) + gibid_beattime = 60 / gibid_tempo + iswingpercent = strtod(strsub(Sline, icomma+1)) + gibid_swingtime = ((gibid_beattime/4)/100) * iswingpercent + + ; chord group header + elseif (strcmp(Sfirstchar, "c") == 0) then + imode = 3 + ichordgroup = strtod(strsub(Sline, 2)) + ichordnum = 0 + + ; pattern header + elseif (strcmp(Sfirstchar, "i") == 0) then + imode = 4 + iparameter = 0 + + icomma = strindex(Sline, ",") + instrindex = _bid_gettextindex(strsub(Sline, 2, icomma), 1) + Sub = strsub(Sline, icomma+1) + icomma2 = strindex(Sub, ",") + isection = strtod(strsub(Sub, 0, icomma2)) + if (isection > gibid_maxsection) then + gibid_maxsection = isection + endif + if (icomma2 != -1) then ; repeat or null section + irepeatsection = strtod(strsub(Sub, icomma2+1)) + if (irepeatsection == -1) then + inewsection = -1 + else + inewsection = gibid_sections[irepeatsection][instrindex] + endif + gibid_sections[isection][instrindex] = inewsection + else + isectiondataindex += 1 + gibid_sections[isection][instrindex] = isectiondataindex + endif + + ; chord row + elseif (imode == 3) then + _bid_parserow(Sline, ichordgroup, ichordnum, 2) + ichordnum += 1 + + ; pattern row + elseif (imode == 4) then + _bid_parserow(Sline, isectiondataindex, iparameter, 1) + iparameter += 1 + endif + endif + idata[0] = iparameter + idata[1] = isection + idata[2] = ichordnum + idata[3] = isectiondataindex + idata[4] = imode + xout idata +endop + + +/* + Parse a Bug Infested Directive Format string to global arrays, ftables and variables. + Handles patterns, tempo, chord groups and sections etc accordingly. + + bid_loadtext Sfile, [imode = 0] + + Stext directive data as string to parse +*/ +opcode bid_loadtext, 0, S + Stext xin + idata[] fillarray -1, -1, -1, -1, -1 +read: + index = strindex(Stext, "\n") + if (index != -1) then + Sline = strsub(Stext, 0, index) + Stext = strsub(Stext, index + 1) + idata[] _bid_parseline Sline, idata + + igoto read + else + igoto complete + endif + +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. + Requires readfi support which is not available on all platforms. Platforms that do not support that + should set NOFILEIO. + + bid_loadfile Sfile + + Sfile directive file to parse +*/ +opcode bid_loadfile, 0, S + Sfile xin +#ifdef NOFILEIO + tt_notify_fatal("Attempting to use parsefile when NOFILEIO is set") +#else + if (filevalid(Sfile) == 0) then + tt_notify(sprintf("Directive file cannot be found: '%s'", Sfile)) + exitnow + endif + idata[] fillarray -1, -1, -1, -1, -1 +read: + Sline, ilinenum readfi Sfile + Sline = tt_stripnewline(Sline) + + idata[] _bid_parseline Sline, idata + + if (ilinenum != -1) igoto read +#endif +endop + + + +/* + Set the current chord given a section + p4 the section number + p5 0=start at beginning, 1=increment chord index +*/ +instr bid_setcurrentchord + isection = p4 + ichordincrement = p5 + if (isection > gibid_maxsection) then + turnoff + endif + + ichordgroup = gibid_sectionchords[isection] + if (ichordgroup != gibid_lastchordgroup || isection != gibid_lastsection) then + gibid_currentchordnum = 0 + gibid_lastchordgroup = ichordgroup + gibid_lastsection = isection + elseif (ichordincrement == 1) then + if (gibid_currentchordnum + 1 < lenarray(gibid_chordgroups, 2) - 1) then + if (gibid_chordgroups[ichordgroup][gibid_currentchordnum + 1] == 0) then + gibid_currentchordnum = 0 + else + gibid_currentchordnum += 1 + endif + else + gibid_currentchordnum = 0 + endif + else + gibid_currentchordnum = 0 + endif + + ifn = gibid_chordgroups[ichordgroup][gibid_currentchordnum] + + if (ifn > 0) then + gkbid_chordlength = tab:k(0, ifn) + gibid_chordfn = ifn + endif + + if (timeinstk() > 2) then + turnoff + endif +endin + + +#end + diff --git a/BUG10/bid_source.udo b/BUG10/bid_source.udo new file mode 100644 index 0000000..5eb5768 --- /dev/null +++ b/BUG10/bid_source.udo @@ -0,0 +1,144 @@ +/* + Debugger - Unfixed Bugs : BUG #10 + + Bug Infested Directives source + Provided as a string due to readfi not being available on all platforms. + Used with bid_loadtext (whereas a separate file would be used with bid_loadfile and requires readfi support) +*/ + +SBID = {{ +; Bug Infested Directives : Debugger - Unfixed Bugs : BUG #10 +v 1.2 + +; tempo, swing percent +b 131, 33 + +; chord groups +c 1 + 4, 59, 63, 65, 69, 71, 72, 75, 77, 79, 82 + 4, 59, 63, 65, 69, 71, 72, 75, 77, 79, 82 + +c 2 + 4, 71, 72, 75, 77 + +; sections: section number, length, chordgroup +s 1, 64, 1 +s 2, 64, 1 +s 3, 8, 2 +s 4, 56, 1 +s 5, 32, 2 + + + +i hat1, 1 +; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - + 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, 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, 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 +i hat1, 2, 1 +i hat1, 3, 1 +i hat1, 4, 1 +i hat1, 5, 1 + + +i hat2, 1, -1 +i hat2, 2 +; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - + 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, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1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,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.3 + 1, 0,.8, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0,.8, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1,.6 + 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,.2 +i kick, 4, 1 +i kick, 5 +; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 + .4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.3 + 1, 1,.4, 1, 1, 1,.4, 1, 1, 1,.4, 1, 1, 1,.4, 1, 1, 1,.4, 1, 1, 1,.4, 1, 1, 1,.4, 1, 1, 1,.4, 1 + 1, 1,.4, 1, 1, 1,.4, 1, 1, 1,.4, 1, 1, 1,.4, 1, 1, 1,.4, 1, 1, 1,.4, 1, 1, 1,.4, 1, 1, 1,.4, 1 + + +}} diff --git a/BUG10/bussing.udo b/BUG10/bussing.udo new file mode 100644 index 0000000..78755ce --- /dev/null +++ b/BUG10/bussing.udo @@ -0,0 +1,62 @@ +#ifndef UDO_BUSSING +#define UDO_BUSSING ## + + +/* + Get the stereo L and R names for a singular bus name + + SnameL, SnameR bus_name Sbus + + SnameL left bus identifier + SnameR right bus identifier + + Sbus bus name +*/ +opcode bus_name, SS, S + Sbus xin + xout sprintf("%sL", Sbus), sprintf("%sR", Sbus) +endop + + +/* + Mix to a stereo bus + + bus_mix Sbus, aL, aR + + Sbus bus name + aL left channel + aR right channel +*/ +opcode bus_mix, 0, Saa + Sbus, aL, aR xin + SbusL, SbusR bus_name Sbus + chnmix aL, SbusL + chnmix aR, SbusR +endop + + + +/* + Read from a stereo bus, and then clear the bus + + aL, aR bus_read Sbus + + aL left channel + aR right channel + + Sbus bus name +*/ +opcode bus_read, aa, S + Sbus xin + SbusL, SbusR bus_name Sbus + aL chnget SbusL + aR chnget SbusR + chnclear SbusL + chnclear SbusR + xout aL, aR +endop + + + + +#end diff --git a/BUG10/instruments.udo b/BUG10/instruments.udo new file mode 100644 index 0000000..6e08099 --- /dev/null +++ b/BUG10/instruments.udo @@ -0,0 +1,239 @@ +#ifndef UDO_INSTRUMENTS +#define UDO_INSTRUMENTS ## +/* + Debugger - Unfixed Bugs : BUG #4 + + Sound generators + Names should correspond to those used in BID file, prepended with play_ +*/ + + +#include "wavetables.udo" +#include "bussing.udo" +#include "bid.udo" + +instr play_bass1 + + iamp = bid_getparameter(p4, p5, 2) * random(0.4, 1) + ifreqmode = bid_getparameter(p4, p5, 4) + + if (ifreqmode != 0) then + ifreq = cpsmidinn(table(ifreqmode, gibid_chordfn) - 24) + else + ifreq = cpsmidinn(table(1, gibid_chordfn) - 24) + endif + kindex1 line 4, p3, 1 + kindex2 line 5, p3, 1 + kamp linseg 1, p3*0.9, 1, p3*0.1, 0 + aL foscil iamp, ifreq, 8, 1.5, kindex1, gifnSine + aR foscil iamp, ifreq, 8, 1.5, kindex2, gifnSine + aL *= kamp * 0.75 + aR *= kamp * 0.75 + bus_mix("master", aL, aR) +endin + + +instr play_melb1 + ifreq = cpsmidinn(table(1, gibid_chordfn)) * 1 + p3 = 0.03 + kindex1 line random(1, 4), p3, random(1, 5) + kindex2 line random(1, 4), p3, random(1, 5) + kamp linseg 0, p3*0.5, 1, p3*0.4, 1, p3*0.1, 0 + aL foscil 1, ifreq, 2, random(1, 4), kindex1, gifnSine + aR foscil 1, ifreq, 2, random(1, 4), kindex2, gifnSine + aL *= kamp * 0.2 + aR *= kamp * 0.2 + bus_mix("master", aL, aR) +endin + + +instr play_hat1 + iamp = bid_getparameter(p4, p5, 2) * 0.9 + p3 = 0.1 + kfreq line 600, p3, 400 + aenv expsega .1, .0005, 1, p3 - .0005, .01 + asqr1 oscil 1, kfreq, gifnSquare, -1 + asqr2 oscil 1, kfreq*1.4471, gifnSaw, -1 + asqr3 oscil 1, kfreq*1.6170, gifnSaw, -1 + asqr4 oscil 1, kfreq*1.9265, gifnSaw, -1 + asqr5 oscil 1, kfreq*2.5028, gifnSine, -1 + asqr6 oscil 1, kfreq*2.6637, gifnSaw, -1 + a808 sum asqr1, asqr2, asqr3, asqr4, asqr5, asqr6 + a808 butterhp a808, 4270 + a808 butterhp a808, 4270 + aout = a808 * aenv * iamp + bus_mix("master", aout, aout) +endin + +instr play_hat2 + iamp = bid_getparameter(p4, p5, 2) + p3 = 0.12 + idel1 = random(0.005, 0.01) + idel2 = random(0.005, 0.01) + xtratim(max(idel1, idel2)) + + kfreq line 200, p3, 100 + aenv expsega .1, .0005, 1, p3 - .0005, .01 + asqr1 oscil 1, kfreq, gifnSquare, -1 + asqr2 oscil 1, kfreq*1.4471, gifnSine, -1 + asqr3 oscil 1, kfreq*1.5170, gifnSquare, -1 + asqr4 oscil 1, kfreq*1.7265, gifnSquare, -1 + asqr5 oscil 1, kfreq*2.2028, gifnSaw, -1 + asqr6 oscil 1, kfreq*2.4637, gifnSaw, -1 + a808 sum asqr1, asqr2, asqr3, asqr4, asqr5, asqr6 + a808 butterhp a808, 3270 + a808 butterhp a808, 3270 + aout = a808 * aenv * iamp * 1.5 + aL delay aout, idel1 + aR delay aout, idel2 + bus_mix("master", aL, aR) +endin + + +instr play_clap + iamp = bid_getparameter(p4, p5, 2) * random(0.4, 1) * 0.8 + aL noise 1, 0.6 + aR noise 1, 0.7 + aL butterbp aL, random(1000, 1500), random(800, 1200) + aR butterbp aR, random(1000, 1500), random(800, 1200) + aL taninv aL*2 + aR taninv aR*2 + + kamp linseg 2, p3*0.1, 0, p3*0.1, 2, p3*0.1, 0, p3*0.1, 1.5, p3*0.1, 0, p3*0.1, 1, p3*0.4, 0 + aL *= kamp * iamp * 4 + aR *= kamp * iamp * 4 + bus_mix("master", aL, aR) + +endin + + +instr play_kick ; 808 style kick + iamp = bid_getparameter(p4, p5, 2) + + idist = 0.4 ;= (i(gksection) == 1) ? 0.55 : 0.35 + xtratim 0.1 + krelease release + ktune init 0 + kmul transeg 0.2, p3*0.5, -15, 0.01, p3*0.5, 0, 0 + kbend transeg 0.5, 1.2, -4, 0, 1, 0, 0 + asig gbuzz 0.5, 50*octave(ktune)*semitone(kbend), 20, 1, kmul, gifnCosine + aenv transeg 1, p3-0.004, -6, 0 + gkpump = k(aenv) + aatt linseg 0, 0.004, 1 + asig = asig*aenv*aatt + aenv linseg 1, 0.07, 0 + acps expsega 400, 0.07, 0.001, 1, 0.001 + aimp oscili aenv, acps*octave(ktune*0.25) + amix = ((asig*0.7)+(aimp*0.35))*2*iamp + gkpump = min(rms(amix) * 7, 1) + aout1 pareq amix, 100, 0.01, 0.7 + aout1 distort aout1, idist, gifnSine + aout1 pareq aout1, 50, 2, 0.4 + ;aout1 pareq aout1, 190, 0.7, 0.6 + aout1 pareq aout1, 4900, 2, 0.7 + aout1 *= 2 + bus_mix("master", aout1, aout1) +endin + +instr play_kick2 + iamp = bid_getparameter(p4, p5, 2) + xtratim 0.1 + krelease release + ktune init 1 + ifn = gibid_chordgroups[1][1] ; gibid_chordfn + ifreq = cpsmidinn(tab_i(1, ifn) - 18) * 0.1 + kmul transeg 0.2, p3*0.5, -15, 0.01, p3*0.5, 0, 0 + kbend transeg 0.5, 1.2, -4, 0, 1, 0, 0 + asig gbuzz 0.5, ifreq, 20, 1, kmul, gifnCosine + aenv transeg 1, p3-0.004, -6, 0 + aatt linseg 0, 0.004, 1 + asig = asig*aenv*aatt + aenv linseg 1, 0.07, 0 + acps expsega 400, 0.07, 0.001, 1, 0.001 + aimp oscili aenv, acps*octave(ktune*0.25) + amix = ((asig*0.7)+(aimp*0.35))*2*iamp + aout1 pareq amix, 100, 0.01, 0.6 + aout1 distort aout1, 0.6, gifnSquare + aout1 pareq aout1, 100, 0.8, 0.3 + aout1 butterhp aout1, 30 + aout1 *= 3.6 + ;aout1 *= 1-gkpump + bus_mix("master", aout1, aout1) +endin + + +instr play_shaker + iamp = bid_getparameter(p4, p5, 2) + p3 = 0.02 + kamp line 1, p3, 0 + aL shaker 1, 2000, 8, 0.499, 2, 0 + aR shaker 1, 2000, 8, 0.499, 2, 0 + aL *= kamp * iamp * 3 + aR *= kamp * iamp * 3 + bus_mix("master", aL, aR) + bus_mix("delay3", aL*0.25, aR*0.25) +endin + + + + +;glitch sampler vars +giglitchsamples = 44100 +giglitchbufferL ftgen 0, 0, giglitchsamples, 7, 0 +giglitchbufferR ftgen 0, 0, giglitchsamples, 7, 0 +instr play_glitchread + iamp = bid_getparameter(p4, p5, 2) + ifreq = cpsmidinn(tab_i(random(1, ftlen(gibid_chordfn) - 1), gibid_chordfn)) + ilen = ((1/(ifreq))*sr)*pow(2, round(random(0, 4))) + istart random 0, giglitchsamples-ilen + awindex phasor giglitchsamples / ilen + aL table awindex*giglitchsamples, giglitchbufferL + aR table awindex*giglitchsamples, giglitchbufferR + aL butterhp aL, 350 + aR butterhp aR, 350 + aL *= 0.4 * iamp + aR *= 0.4 * iamp + if (random(0, 1) > 0.7) then + if (random(0, 1) > 0.5) then + bus_mix("delay1", aL, aR) + else + bus_mix("delay2", aL, aR) + endif + endif + bus_mix("master", aL, aR) +endin + +instr play_snare + icps0 = 110 + iamp = bid_getparameter(p4, p5, 2) + p3 = 0.3 + icps1 = 4.0 * icps0 + kcps port icps0, 0.007, icps1 + kcpsx = kcps * 1.5 + + kfmd port 0.0, 0.01, 0.7 + aenv1 expon 1.0, 0.03, 0.5 + kenv2 port 1.0, 0.008, 0.0 + aenv2 interp kenv2 + aenv3 expon 1.0, 0.025, 0.5 + + a_ oscili 1.0, kcps + a1 oscili 1.0, kcps * (1.0 + a_*kfmd) + a_ oscili 1.0, kcpsx + a2 oscili 1.0, kcpsx * (1.0 + a_*kfmd) + + a3 unirand 4.0 + a3 = a3 - 1.0 + a3 butterbp a3, 3200, 1500 + a3 = a3 * aenv2 + + a0 = a1 + a2*aenv3 + a3*1.0 + a0 = a0 * aenv1 + a0 butterhp a0, 210 + aout = a0 * iamp * 1.4 + bus_mix("master", aout, aout) + +endin + + +#end diff --git a/BUG10/txt_tools.udo b/BUG10/txt_tools.udo new file mode 100644 index 0000000..eb0cc86 --- /dev/null +++ b/BUG10/txt_tools.udo @@ -0,0 +1,82 @@ +#ifndef UDO_TXTTOOLS +#define UDO_TXTTOOLS ## +/* + Debugger - Unfixed Bugs : BUG #3 + + Text tools +*/ + + +/* + Print a notification prepended with a line of asterisks + + tt_notify Stext + + Stext text to print +*/ +opcode tt_notify, 0, S + Stext xin + Snew = "\n" + iwidth = 60 + index = 0 + while (index < iwidth) do + Snew = strcat(Snew, "*"); + index += 1 + od + prints strcat(strcat(Snew, "\n"), strcat(Stext, "\n\n")) +endop + + + +/* + Print a notification prepended with a line of asterisks and exit + + tt_notify Stext + + Stext text to print +*/ +opcode tt_notify_fatal, 0, S + Stext xin + tt_notify(Stext) + exitnow +endop + + +/* + Return a number of seconds as HH:MM:SS format + + Stime tt_parsetime iseconds + + iseconds seconds to parse + + Stime formatted time + +*/ +opcode tt_parsetime, S, i + input xin + ihours = floor(input / 3600) + iminutes = floor((input - (ihours * 3600)) / 60) + iseconds = input - (ihours * 3600) - (iminutes * 60) + xout sprintf("%02d:%02d:%05.2f", ihours, iminutes, iseconds) +endop + + +/* + Strip newline from end of line: built-in opcode has some problems + + Soutput tt_stripnewline Sinput + + Soutput processed without newline at end if existent + + Sinput line to process +*/ +opcode tt_stripnewline, S, S + Sline xin + index = strindex(Sline, "\n") + if (index != -1) then + Sline = strsub(Sline, 0, index) + endif + xout Sline +endop + +#end diff --git a/BUG10/wavetables.udo b/BUG10/wavetables.udo new file mode 100644 index 0000000..e81f075 --- /dev/null +++ b/BUG10/wavetables.udo @@ -0,0 +1,16 @@ +#ifndef UDO_WAVETABLES +#define UDO_WAVETABLES ## +/* + Debugger - Unfixed Bugs : BUG #3 + + General waveforms +*/ + +ipoints = 16384 +gifnCosine ftgen 0, 0, ipoints, 9, 1, 1, 90 +gifnSine ftgen 0, 0, ipoints, 10, 1 +gifnSquare ftgen 0, 0, ipoints, 10, 1, 0, 0.3, 0, 0.2, 0, 0.14, 0, .111 +gifnSaw ftgen 0, 0, ipoints, 10, 0, .2, 0, .4, 0, .6, 0, .8, 0, 1, 0, .8, 0, .6, 0, .4, 0, .2 + +#end + diff --git a/BUG3/BUG3.csd b/BUG3/BUG3.csd index 2902a67..5df9708 100644 --- a/BUG3/BUG3.csd +++ b/BUG3/BUG3.csd @@ -16,7 +16,7 @@ sr = 44100 ksmps = 100 nchnls = 2 -0dbfs = 1 +0dbfs = 1.1 seed 0 #define NOFILEIO ## ; file IO with readfi not supported on all platforms: disables bid_loadfile @@ -165,7 +165,7 @@ instr sequencer endif ; sequence BID elements accordingly - bid_seq "chord1", kpos, ksection + ;bid_seq "chord1", kpos, ksection bid_seq "chord2", kpos, ksection bid_seq "chord3", kpos, ksection bid_seq "bass", kpos, ksection diff --git a/BUG4/BUG4.csd b/BUG4/BUG4.csd index 59d2e50..243b946 100644 --- a/BUG4/BUG4.csd +++ b/BUG4/BUG4.csd @@ -18,7 +18,7 @@ sr = 44100 ksmps = 100 nchnls = 2 -0dbfs = 1 +0dbfs = 1.1 seed 0 #define NOFILEIO ## ; file IO with readfi not supported on all platforms: disables bid_loadfile @@ -114,7 +114,8 @@ gitimetrack times instr notify_change isection = p4 itime times - if (isection == -1) then + + if ((isection >= gibid_maxsection) || isection == -1) then tt_notify(sprintf"Complete, runtime: %s", tt_parsetime(itime))) exitnow else diff --git a/BUG4/bid.udo b/BUG4/bid.udo index a5eea11..61891b3 100644 --- a/BUG4/bid.udo +++ b/BUG4/bid.udo @@ -1,7 +1,7 @@ #ifndef UDO_BID #define UDO_BID ## /* - Debugger - Unfixed Bugs : BUG #4 + Debugger - Unfixed Bugs : BUG #3 Bug Infested Directive file parser v1 and tools diff --git a/BUG4/instruments.udo b/BUG4/instruments.udo index 4656d1a..9b50db5 100644 --- a/BUG4/instruments.udo +++ b/BUG4/instruments.udo @@ -497,10 +497,10 @@ instr play_glitchread ilen = ((1/(ifreq))*sr)*pow(2, round(random(0, 4))) istart random 0, giglitchsamples-ilen awindex phasor giglitchsamples / ilen - aL table awindex*giglitchsamples, giglitchbufferL - aR table awindex*giglitchsamples, giglitchbufferR + aL table (awindex*giglitchsamples)+istart, giglitchbufferL + aR table (awindex*giglitchsamples)+istart, giglitchbufferR aL butterhp aL, 350 - aR butterhp aL, 350 + aR butterhp aR, 350 aL *= 0.2 * iamp aR *= 0.2 * iamp if (random(0, 1) > 0.7) then diff --git a/BUG5/BUG5.csd b/BUG5/BUG5.csd index 7d45739..7f298e7 100644 --- a/BUG5/BUG5.csd +++ b/BUG5/BUG5.csd @@ -9,28 +9,28 @@ http://git.1bpm.net/csd-unfixedbugs1/about/ - By Richard Knight 2022 + By Richard Knight 2022, 2023 http://1bpm.net q@1bpm.net */ sr = 44100 -ksmps = 10 +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 ;#define CPUSAVER ## ; improve CPU performance by degrading aesthetic performance -gkmastergain init 1 ; master gain -gkpump = 0 ; kick ducking control +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 "bid.udo" ; Bug Infested Directive tools and parsing #include "instruments.udo" ; sound generators #include "txt_tools.udo" ; text tools @@ -68,12 +68,21 @@ endin instr global_master igain = 1 aL, aR bus_read "master" - itime6 = tab_i(1, gibid_sectionlengths)*gibid_beattime + itime6 = tab_i(5, gibid_sectionlengths)*gibid_beattime + itime8 = tab_i(7, gibid_sectionlengths)*gibid_beattime + itime10 = tab_i(9, gibid_sectionlengths)*gibid_beattime if (gksection == 6) then khpf linseg 5, itime6*0.5, 10, itime6*0.3, 100, itime6*0.2, 500 klpf linseg 22050, itime6*0.5, 22050, itime6*0.3, 10000, itime6*0.2, 1000 aL butterhp butterlp(aL, klpf), khpf aR butterhp butterlp(aR, klpf), khpf + elseif (gksection == 8) then + khpf linseg 5, itime6*0.5, 5, itime6*0.2, 100, itime6*0.2, 500, itime6*0.2, 2000 + aL butterhp aL, khpf + aR butterhp aL, khpf + elseif (gksection == 10) then + ksnarevol linseg 0, itime10*0.5, 0.2, itime10*0.5, 1 + chnset ksnarevol, "snarevol" endif aL limit aL*0.5, -1, 1 @@ -154,15 +163,12 @@ instr sequencer else kposchord = 0 event "i", "bid_setcurrentchord", 0, 1, ksection, 1 - endif - - + endif endif endin </CsInstruments> <CsScore> i"parseandrun" 0 1 - </CsScore> </CsoundSynthesizer>
\ No newline at end of file diff --git a/BUG5/bid_source.udo b/BUG5/bid_source.udo index 7052e2e..b63ec38 100644 --- a/BUG5/bid_source.udo +++ b/BUG5/bid_source.udo @@ -45,6 +45,13 @@ s 4, 8, 3 s 5, 32, 2 s 6, 32, 2 s 7, 32, 1 +s 8, 32, 1 +s 9, 32, 2 +s 10, 32, 2 +s 11, 64, 1 +s 12, 64, 1 +s 13, 64, 1 +s 14, 32, 1 @@ -66,7 +73,13 @@ i stringchord, 7 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,.6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,.6, 1, 1, 1, 1, 1, 1, 1, 1 1,.6, 1,.6, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,.8, 0,.7, 1,.6, 1, 1, 1, 1, 1, 1 - +i stringchord, 8, 7 +i stringchord, 9, -1 +i stringchord, 10, -1 +i stringchord, 11, -1 +i strinchord, 12, 7 +i stringchord, 13, -1 +i stringchord, 14, -1 i chord1, 1, -1 i chord1, 2 @@ -80,6 +93,13 @@ i chord1, 4, 2 i chord1, 5, 2 i chord1, 6, 2 i chord1, 7, -1 +i chord1, 8, -1 +i chord1, 9, 2 +i chord1, 10, 2 +i chord1, 11, 2 +i chord1, 12, 3 +i chord1, 13, -1 +i chord1, 14, -1 i clap, 1, -1 @@ -104,6 +124,18 @@ i clap, 7 0, 0, 0, 0,.1, 0, 0, 0, 0, 0, 0, 0,.1, 0, 0, 0, 0, 0, 0, 0,.1, 1, 0, 0, 0, 0, 0, 0,.2, 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 +i clap, 8, 7 +i clap, 9, -1 +i clap, 10 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 + 0, 0, 0, 0,.1, 0, 0, 0, 0, 0, 0, 0,.1, 0, 0, 0, 0, 0, 0, 0,.1, 1, 0, 0, 0, 0, 0, 0,.2, 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 +i clap, 11, 2 +i clap, 12, 2 +i clap, 13, 2 +i clap, 14, 2 + i snare, 1 ; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - @@ -127,6 +159,18 @@ i snare, 7 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, 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 +i snare, 8, 7 +i snare, 9, -1 +i snare, 10 + 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, 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 +i snare, 11, 2 +i snare, 12, 3 +i snare, 13, -1 +i snare, 14, -1 + i hat1, 1 ; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - @@ -150,6 +194,14 @@ i hat1, 7 .1,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,.1,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, 0, 0 + 2,.5,.3,.5,.5,.5,.3,.5,.5,.5,.3,.5,.5,.5,.3,.5,.5,.5,.3,.5,.5,.5,.3,.5,.5,.5,.3,.5,.5,.5,.3,.5 + 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 +i bass, 10, 9 +i bass, 11, 2 +i bass, 12, 4 +i bass, 13, -1 +i bass, 14, -1 i kick, 1 ; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - @@ -283,4 +379,11 @@ i kick, 4 i kick, 5, 1 i kick, 6, 1 i kick, 7, 1 +i kick, 8, 1 +i kick, 9, -1 +i kick, 10, -1 +i kick, 11, 1 +i kick, 12, 1 +i kick, 13, 1 +i kick, 14, 1 }} diff --git a/BUG5/instruments.udo b/BUG5/instruments.udo index 356d775..eaa4be5 100644 --- a/BUG5/instruments.udo +++ b/BUG5/instruments.udo @@ -131,6 +131,11 @@ instr play_snare a0 = a0 * aenv1 a0 butterhp a0, 210 aout = a0*iamp + + isection = i(gksection) + if (isection == 10) then + aout *= chnget:k("snarevol") + endif bus_mix("master", aout, aout) endin diff --git a/BUG6/BUG6.csd b/BUG6/BUG6.csd index 394959b..c9cbea4 100644 --- a/BUG6/BUG6.csd +++ b/BUG6/BUG6.csd @@ -9,27 +9,27 @@ http://git.1bpm.net/csd-unfixedbugs1/about/ - By Richard Knight 2021 + By Richard Knight 2021, 2023, 2024 http://1bpm.net q@1bpm.net */ sr = 44100 -ksmps = 10 +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 +#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 +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 "bid.udo" ; Bug Infested Directive tools and parsing #include "instruments.udo" ; sound generators #include "txt_tools.udo" ; text tools @@ -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 + </CsInstruments> <CsScore> i"parseandrun" 0 1 diff --git a/BUG6/bid.udo b/BUG6/bid.udo index 17e9be2..05f5372 100644 --- a/BUG6/bid.udo +++ b/BUG6/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,123 @@ 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/BUG6/bid_source.udo b/BUG6/bid_source.udo index 76d508a..05b9fff 100644 --- a/BUG6/bid_source.udo +++ b/BUG6/bid_source.udo @@ -1,5 +1,5 @@ /* - Debugger - Unfixed Bugs : BUG #4 + Debugger - Unfixed Bugs : BUG #6 Bug Infested Directives source Provided as a string due to readfi not being available on all platforms. @@ -7,8 +7,8 @@ */ SBID = {{ -; Bug Infested Directives : Debugger - Unfixed Bugs : BUG #4 -v 1.1 +; Bug Infested Directives : Debugger - Unfixed Bugs : BUG #6 +v 1.2 ; tempo, swing percent b 128, 40 @@ -25,8 +25,16 @@ c 2 s 1, 64, 1 s 2, 64, 1 s 3, 8, 2 -s 4, 56, 1 -s 5, 32, 2 +s 4, 52, 1 +s 5, 4, 2 +s 6, 64, 1 +s 7, 60, 1 +s 8, 4, 2 +s 9, 64, 1 +s 10, 28, 1 +s 11, 4, 2 +s 12, 32, 1 +s 13, 1, 1 i glitchread, 1, -1 i glitchread, 2, -1 @@ -38,6 +46,14 @@ i glitchread, 4 1, 1, 1, 1, 1,.9, 1,.8, 1, 1, 1,.9, 1,.8,.6, 1, 1, 1, 1, 1, 1,.9, 1,.8, 1, 1, 1,.9, 1,.8, 1, 1 1, 1, 1,.8, 1,.8, 1,.8, 1,.8, 1,.8, 1,.8,.3, 1, 1, 1, 1,.8, 1,.8, 1,.8, 1,.8, 1,.8, 1,.8, 1, 1 i glitchread, 5, -1 +i glitchread, 6, 4 +i glitchread, 7, -1 +i glitchread, 8, 4 +i glitchread, 9, -1 +i glitchread, 10, 4 +i glitchread, 11, 4 +i glitchread, 12, 4 +i glitchread, 13, -1 i 303, 1, -1 @@ -55,6 +71,19 @@ i 303, 5 .1,.1,.1,.3,.1,.1,.1,.3,.1,.1,.1,.3,.1,.1,.1,.3,.1,.1,.1,.3,.1,.1,.1,.3,.1,.1,.1,.3,.1,.1,.3,.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 +i 303, 6 +; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - + 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1 + .1,.1,.1,.3,.1,.1,.1,.3,.1,.1,.1,.3,.1,.1,.1,.3,.1,.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 1, 1 + i clap, 1, -1 i clap, 2 @@ -104,6 +161,19 @@ i clap, 3 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 i clap, 4, 2 i clap, 5, 3 +i clap, 6 +; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - + 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 + 0, 0, 0, 0,.1, 0, 0,.1, 0, 0, 0, 0,.1, 0, 0, 0, 0,.1, 0, 0,.1, 1, 0, 0, 0, 0, 0, 0,.1, 0, 0, 1 + 1, 1, 1, 1, 1, 1, 1,.6, 1, 1, 1, 1, 1, 1, 1, 1, 1,.6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1,.4, 1, 1, 1, 1, 1, 1, 1, 1, 1,.4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +i clap, 7, 6 +i clap, 8, -1 +i clap, 9, 6 +i clap, 10, 6 +i clap, 11, -1 +i clap, 12, -1 +i clap, 13, -1 i snare, 1 @@ -121,6 +191,19 @@ i snare, 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,.3, 1, 1,.3,.3, 1, 1, 1, 1, 1, 1, 1, 1, 1,.3, 1,.3, 1,.3,.3,.3 i snare, 4, 1 i snare, 5, 3 +i snare, 6, -1 +i snare, 7, 1 +i snare, 8 +; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + .1,.1,.1,.1,.1,.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.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.4,.3 + 1, 0,.8, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0,.8, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0,.7,.6 + 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,.4,.2 +i kick, 7, 6 +i kick, 8, -1 +i kick, 9, 1 +i kick, 10, 1 +i kick, 11, -1 +i kick, 12, 1 +i kick, 13, -1 + i kick2, 1 ; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - @@ -196,4 +334,12 @@ i kick2, 2, 1 i kick2, 3, 1 i kick2, 4, 1 i kick2, 5, 1 +i kick2, 6, -1 +i kick2, 7, 1 +i kick2, 8, -1 +i kick2, 9, 1 +i kick2, 10, 1 +i kick2, 11, -1 +i kick2, 12, -1 +i kick2, 13, -1 }} diff --git a/BUG6/bussing.udo b/BUG6/bussing.udo index 78755ce..56ea46a 100644 --- a/BUG6/bussing.udo +++ b/BUG6/bussing.udo @@ -36,6 +36,7 @@ endop + /* Read from a stereo bus, and then clear the bus @@ -57,6 +58,22 @@ opcode bus_read, aa, S endop +/* + Set to a stereo bus + + bus_set Sbus, aL, aR + + Sbus bus name + aL left channel + aR right channel +*/ +opcode bus_set, 0, Saa + Sbus, aL, aR xin + SbusL, SbusR bus_name Sbus + chnset aL, SbusL + chnset aR, SbusR +endop + #end diff --git a/BUG6/instruments.udo b/BUG6/instruments.udo index 0dd7734..0b91a1e 100644 --- a/BUG6/instruments.udo +++ b/BUG6/instruments.udo @@ -78,10 +78,10 @@ endin instr play_blip iamp = bid_getparameter(p4, p5, 2) - inote1 = table(p4+3, gibid_chordfn, 0, 0, 1) +12 - inote2 = table(p4+5, gibid_chordfn, 0, 0, 1) +12 - a1 oscil 1, cpsmidinn(inote1) - a2 oscil 1, cpsmidinn(inote2) + inote1 = table(p4+3, gibid_chordfn, 0, 0, 1) + 12 + inote2 = table(p4+5, gibid_chordfn, 0, 0, 1) + 12 + a1 oscil 1.2, cpsmidinn(inote1) + a2 oscil 1.2, cpsmidinn(inote2) kamp linseg 1, p3*0.2, 0, p3*0.8, 0 aL = a1 * kamp aR = a2 * kamp @@ -160,7 +160,8 @@ instr play_hat2 aout = a808 * aenv * iamp * 1.1 aL delay aout, idel1 aR delay aout, idel2 - if (i(gksection) == 1 && random(0, 1) > 0.7) then + isection = i(gksection) + if ((isection == 1 || isection == 9) && random(0, 1) > 0.7) then bus_mix("delay2", aL*0.4, aR*0.4) endif bus_mix("master", aL, aR) @@ -281,7 +282,7 @@ instr play_snare aenv1 expon 1.0, 0.03, 0.5 kenv2 port 1.0, 0.008, 0.0 aenv2 interp kenv2 - aenv3 expon 1.0, 0.025, 0.5 + aenv3 expon 1.0, 0.025, 0.5 a_ oscili 1.0, kcps a1 oscili 1.0, kcps * (1.0 + a_*kfmd) @@ -322,7 +323,6 @@ opcode chordinstrument, 0, Sii endop - /* Housey organ, internal use */ 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 diff --git a/BUG8/BUG8.csd b/BUG8/BUG8.csd index 5f27a86..573f329 100644 --- a/BUG8/BUG8.csd +++ b/BUG8/BUG8.csd @@ -13,7 +13,7 @@ seed 0 giampfn init -1 gifreqfn init -1 -gifftsize = 1024 +gifftsize = 4096 opcode SCReverb, aa, aakkjpo @@ -265,7 +265,7 @@ instr 1 endif endif - event_i "i", "clickmaker", 0, 1 + event_i "i", "clickmaker", 0, 1000 kmetro2 metro 3 if (ktime > 5 && kmetro2 == 1 && random:k(0, 1) > 0.95) then @@ -294,8 +294,8 @@ instr 1 a1L = ay a1R = ay ;a1L, a1R SCReverb ay, ay, 0.9, 10000 - aL = a1L + a2L - aR = a1R + a2R + aL = a2L ;+ a1L + aR = a2R ;+ a1R outs aL, aR endin diff --git a/BUG9/BUG9.csd b/BUG9/BUG9.csd index f320921..196d0cd 100644 --- a/BUG9/BUG9.csd +++ b/BUG9/BUG9.csd @@ -5,11 +5,11 @@ </CsOptions> <CsInstruments> /* - Debugger - Unfixed Bugs : BUG #8 + Debugger - Unfixed Bugs : BUG #9 http://git.1bpm.net/csd-unfixedbugs1/about/ - By Richard Knight 2021 + By Richard Knight 2022, 2024 http://1bpm.net q@1bpm.net @@ -18,20 +18,13 @@ sr = 44100 ksmps = 100 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 - -#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 /* @@ -42,27 +35,7 @@ instr global_master aL, aR bus_read "master" 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 + outs aL * igain, aR * igain endin @@ -70,73 +43,25 @@ endin Parse BID file and run the sequencer */ instr parseandrun - tt_notify("Parsing events") + tt_notify "Parsing events" #include "bid_source.udo" bid_loadtext(SBID) - tt_notify("Running sequencer") - event_i "i", "sequencer", 0, 3600 + tt_notify "Running sequencer" + schedule "sequencer", 0, 3600 turnoff endin - -/* - Sequence BID elements -*/ instr sequencer - isection = 1 - event_i "i", "bid_setcurrentchord", 0, 1, isection, 0 - event_i "i", "global_master", 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", "notify_change", p3, 1, -1 - turnoff - endif - - ; sequence BID elements - bid_seq "kick", kpos, ksection - bid_seq "clap", kpos, ksection - bid_seq "hat1", kpos, ksection - bid_seq "hat2", kpos, ksection - bid_seq "bass", kpos, ksection - bid_seq "mel1", kpos, ksection - bid_seq "mel2", 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 - 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 - + isection = 2 + schedule "bid_setcurrentchord", 0, 1, isection, 0 + schedule "global_master", 0, p3 + gksection bid_seq_all isection +endin - endif -endin </CsInstruments> <CsScore> diff --git a/BUG9/ass b/BUG9/ass deleted file mode 100644 index e69de29..0000000 --- a/BUG9/ass +++ /dev/null diff --git a/BUG9/bid.udo b/BUG9/bid.udo index 17e9be2..a31a603 100644 --- a/BUG9/bid.udo +++ b/BUG9/bid.udo @@ -1,7 +1,7 @@ #ifndef UDO_BID #define UDO_BID ## /* - Debugger - Unfixed Bugs : BUG #5 + Debugger - Unfixed Bugs : BUG #9 Bug Infested Directive file parser v1 and tools @@ -9,7 +9,7 @@ */ -#define BID_VERSION #1.1# +#define BID_VERSION #1.3# #include "txt_tools.udo" @@ -23,7 +23,7 @@ gkbid_chordlength init -1 ; current chord length ; BID internals gibid_sectionlengths ftgen 0, 0, -64, -7, 0 ; section lengths gibid_sections[][] init 64, 64 ; section pointers to data -gibid_sectiondata[][] init 99, 6 ; section data, ftables contained +gibid_sectiondata[][] init 99, 8 ; section data, ftables contained gibid_chordgroups[][] init 16, 12 ; chord groups, pointers to sectionchords by section gibid_sectionchords[] init 16 ; ftables of section chords @@ -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. @@ -192,8 +161,8 @@ endop _bid_parserow Sline, ix1, ix2, imode Sline line to parse - ix1 array dimension 1 index of target storage - ix2 array dimension 2 index of target storage + ix1 array dimension 1 index of target storage + ix2 array dimension 2 index of target storage imode 1=section patterns, 2=chords */ opcode _bid_parserow, 0, Siii @@ -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/BUG9/bid_source.udo b/BUG9/bid_source.udo index 205939b..bf5f7cb 100644 --- a/BUG9/bid_source.udo +++ b/BUG9/bid_source.udo @@ -1,5 +1,5 @@ /* - Debugger - Unfixed Bugs : BUG #8 + Debugger - Unfixed Bugs : BUG #9 Bug Infested Directives source Provided as a string due to readfi not being available on all platforms. @@ -7,8 +7,8 @@ */ SBID = {{ -; Bug Infested Directives : Debugger - Unfixed Bugs : BUG #4 -v 1.1 +; Bug Infested Directives : Debugger - Unfixed Bugs : BUG #9 +v 1.3 ; tempo, swing percent b 121, 42 @@ -17,11 +17,23 @@ b 121, 42 c 1 4, 60, 65, 67, 75, 77 4, 63, 65, 66, 71, 72 - +c 2 + 4, 60, 65, 67, 75, 77 + 4, 63, 65, 66, 71, 72 + 4, 61, 66, 68, 73, 76 +c 3 + 8, 60, 65, 67, 75, 77 + 8, 63, 65, 66, 71, 72 + 8, 63, 65, 67, 75, 77 + 8, 63, 65, 67, 77, 79, 82 ; sections: section number, length, chordgroup s 1, 64, 1 - +s 2, 8, 1 +s 3, 60, 3 +s 4, 4, 1 +s 5, 4, 1 +s 6, 64, 1 ; patterns: trig , dur, amp, chance @@ -32,6 +44,15 @@ i clap, 1 0, 0, 0, 0,.2, 0, 0, 0, 0, 0, 0, 0,.2, 0, 0,.2, 0, 0, 0, 0,.2, 1, 0, 0, 0, 0, 0, 0,.2, 0, 0, 1 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,.9, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +i clap,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1 }} diff --git a/BUG9/instruments.udo b/BUG9/instruments.udo index 198d196..14399ae 100644 --- a/BUG9/instruments.udo +++ b/BUG9/instruments.udo @@ -14,21 +14,36 @@ instr play_bass - iamp = bid_getparameter(p4, p5, 2) - ifreq = cpsmidinn(table(1, gibid_chordfn, 0, 0, 1) - 48) - k1 linseg 2.1, p3*0.2, 2, p3*0.8, 2 - k2 line 10, p3, 0 + iamp = bid_getparameter(p4, p5, 2) + imode = bid_getparameter(p4, p5, 4) + if (imode == 0) then + ifreq = cpsmidinn(table(1, gibid_chordfn, 0, 0, 1) - 48) + k1 linseg 2.1, p3*0.2, 2, p3*0.8, 2 + k2 line 10, p3, 0 + else + ifreq = cpsmidinn(table(random(1, 4), gibid_chordfn, 0, 0, 1) - 48) + if (ifreq < 20) then + ifreq *= 2 + endif + k1 init round(random(1, 2)) + k2 init random(2, 4) + endif kamp linseg 1, p3*0.1, 0.6, p3*0.9, 0 aL foscil 1, ifreq, 4, k1, k2, gifnSine aR foscil 1, ifreq, 3.9, k1, k2, gifnSine aL pareq aL*1.3, 200, 0.3, 0.7 aR pareq aR*1.3, 200, 0.3, 0.7 + + if (imode == 0) then + aL butterlp aL, 150 + aR butterlp aR, 150 + endif bus_mix("master", aL*kamp*iamp, aR*kamp*iamp) endin instr play_mel1 - iamp = bid_getparameter(p4, p5, 2) - ifreq = cpsmidinn(table(random(1, 4), gibid_chordfn, 0, 0, 1) + 12) + iamp = bid_getparameter(p4, p5, 2) * 1.5 + ifreq = cpsmidinn(table(random(1, 4), gibid_chordfn, 0, 0, 1)) kamp init 1 aL wgbowedbar 1, ifreq, 0.5, 0.2, 0.995 aR wgbowedbar 1, ifreq, 0.3, 0.5, 0.995 @@ -37,7 +52,7 @@ endin instr play_mel2 iamp = bid_getparameter(p4, p5, 2) - ifreq = cpsmidinn(table(random(1, 4), gibid_chordfn, 0, 0, 1) - 12) + ifreq = cpsmidinn(table(random(1, 4), gibid_chordfn, 0, 0, 1) - 24) k1 linseg 1.1, p3*0.2, 2, p3*0.8, 2 k2 line 1, p3, 6 kamp linseg 1, p3*0.1, 0.6, p3*0.9, 0 @@ -48,19 +63,60 @@ instr play_mel2 bus_mix("master", aL*kamp*iamp, aR*kamp*iamp) endin + +instr play_shaker + iamp = bid_getparameter(p4, p5, 2) * 0.5 + p3 = 0.04 + kamp linseg iamp, p3, 0 + aL shaker kamp, random(4000, 4500), 4, 0.999, 4 + aR shaker kamp, random(4000, 4500), 4, 0.999, 4 + bus_mix("master", aL, aR) +endin + + +/* + tb303 style synth +*/ +instr play_303 + iamp = bid_getparameter(p4, p5, 2) + inote1 = tab_i(random(1, ftlen(gibid_chordfn) - 3), gibid_chordfn) + ifrq1 = random(200, 600) + kamp linseg 1, p3*0.9, 1, p3*0.1, 0 + ifreq1 = cpsmidinn(inote1) + kcps init ifreq1 + kffrq init ifrq1 + a1 phasor kcps ; oscillator + a1 = 1 - 2 * a1 + + a1x butterbp a1, kffrq, kcps * 1.0 ; filters + a1x = a1x * (2 + kffrq / kcps) ; correct amplitude + a1 = a1x + a1 * 0.25 ; 0.5 + a1 butterlp a1, kffrq + + a1 = taninv(a1 * 4 * iamp) ; distortion ; 2.5 + + keqf limit kffrq * 4, 10, sr * 0.48 ; EQ frequency + a1 pareq a1 * 0.4, keqf, 4.0, 1.0, 2 + a1 butterhp a1, 70 + a1 = a1 * kamp * 0.62 + aL, aR pan2 a1, random(0.2, 0.8) + bus_mix("master", aL, aR) +endin + + /* clap */ gifnClap ftgen 0, 0, 1024, 7, 1, 128, 0, 1, 0.9, 128, 0, 1, 0.8, 128, 0, 1, 0.7, 128, 0, 1, 0.5, 256, 0.1, 256, 0 instr play_clap - iamp = bid_getparameter(p4, p5, 2) - p3 = 0.25 + iamp = bid_getparameter(p4, p5, 2) * 1.3 + p3 = (p3 <= 0.2) ? 0.07 : p3 kbetaL line 0.9, p3, 0.01 kbetaR line 0.8, p3, 0.01 aL noise 1, kbetaL aR noise 1, kbetaR - kfreqL line 700+random(-100, 100), p3, 2500+random(-100, 100) - kfreqR line 700+random(-100, 100), p3, 2500+random(-100, 100) + kfreqL line 1100+random(-100, 100), p3, 2500+random(-100, 100) + kfreqR line 1100+random(-100, 100), p3, 2500+random(-100, 100) apt oscil 1, line(50, p3, 2000) apt2 oscil 1, line(500, p3, 20) @@ -106,7 +162,7 @@ instr play_hat1 idel = random(0.001, 0.02) xtratim idel p3 = random(0.01, 0.04) - ifreq = 200 + ifreq = 300 aenv expsega .1, .0005, 1, p3 - .0005, .01 asqr1 oscil 1, ifreq, gifnSaw, -1 asqr2 oscil 1, ifreq*1.4471, gifnSquare, -1 @@ -137,10 +193,14 @@ endin instr play_hat2 iamp = bid_getparameter(p4, p5, 2) + imode = bid_getparameter(p4, p5, 4) idel1 = random(0.005, 0.02) idel2 = random(0.005, 0.02) xtratim(max:i(idel1, idel2)) kfreq = abs(oscil(50, 10)) + 800 + if (imode == 1) then + kfreq linseg 100, p3, 1000 + endif aenv expsega .1, .0005, 1, p3 - .0005, .01 asqr1 oscil 1, kfreq, gifnSquare, -1 asqr2 oscil 1, kfreq*1.4471, gifnSquare, -1 @@ -158,6 +218,109 @@ instr play_hat2 endin +instr play_chord1_note + inote = p4 + iplaymode = p5 + iamp = 0.4 + ivibdepthL = 0.01 + ivibdepthR = ivibdepthL + if (iplaymode = 1) then + klpf linseg 20, p3*0.5, 500, p3*0.5, 6000 + ic1 = 8 + elseif (iplaymode == 2) then + p3 = random(0.7, 2) + klpf linseg 20, p3*0.5, 6000, p3*0.5, 12000 + ivibdepthL = random(5, 10) + ivibdepthR = random(5, 10) + iamp *= 0.17 + ic1 = random(0.1, 2) + else + ic1 = random(4, 10) + klpf linseg 11000, p3, 200 + endif + kamp linseg 1, p3*0.9, 1, p3*0.1, 0 + + aL fmrhode kamp * iamp, cpsmidinn(inote), ic1 + random(-1, 1), 0.4, ivibdepthL, 3, gifnSine, gifnSine, gifnSine, gifnSine, gifnSine + aR fmrhode kamp * iamp, cpsmidinn(inote), ic1 + random(-1, 1), 0.4, ivibdepthR, 6, gifnSine, gifnSine, gifnSine, gifnSine, gifnSine + + aL butterhp aL, 450 + aL butterlp aL, klpf + aR butterhp aR, 450 + aR butterlp aR, klpf + + bus_mix("master", aL, aR) +endin + +instr play_chord1 + iamp = bid_getparameter(p4, p5, 2) + ichordgroup = bid_getparameter(p4, p5, 4) + ichordnum = bid_getparameter(p4, p5, 5) + iplaymode = bid_getparameter(p4, p5, 6) + ifn = gibid_chordgroups[ichordgroup][ichordnum] + index = 0 + while (index < ftlen(ifn)) do + schedule("play_chord1_note", 0, p3, tab_i(index, ifn), iplaymode) + index += 1 + od + turnoff +endin + + + +instr play_chord2_note + inote = p4 + kamp linseg 1, p3*0.9, 1, p3*0.1, 0 + iamp = 0.4 + aL fmbell kamp * iamp, cpsmidinn(inote), 1, 1, 0.01, 3, gifnSine, gifnSine, gifnSine, gifnSine, gifnSine + aR fmbell kamp * iamp, cpsmidinn(inote), 1.1, 1, 0.01, 6, gifnSine, gifnSine, gifnSine, gifnSine, gifnSine + klpf linseg 14000, p3, 200 + + aL butterhp aL, 450 + aL butterlp aL, klpf + aR butterhp aR, 450 + aR butterlp aR, klpf + + bus_mix("master", aL, aR) +endin + +instr play_chord2 + iamp = bid_getparameter(p4, p5, 2) + ichordgroup = bid_getparameter(p4, p5, 4) + ichordnum = bid_getparameter(p4, p5, 5) + ifn = gibid_chordgroups[ichordgroup][ichordnum] + index = 0 + while (index < ftlen(ifn)) do + schedule("play_chord2_note", 0, p3, tab_i(index, ifn)) + index += 1 + od + turnoff +endin + + + +instr play_chord3_note + inote = p4 + iamp = p5 + klfo lfo random(5, 10), random(0.1, 0.4) + a1 oscil 0.15 * iamp, cpsmidinn(inote) + klfo + a1 butterhp a1, 450 + kamp linseg 1, p3*0.8, 1, p3*0.1, 0 + a1 *= kamp + aL, aR pan2 a1, random(0, 1) + + bus_mix("master", aL, aR) +endin + +instr play_chord3 + iamp = bid_getparameter(p4, p5, 2) + ifn = gibid_chordfn + index = 0 + while (index < ftlen(ifn)) do + schedule("play_chord3_note", 0, p3, tab_i(index, ifn), iamp) + index += 1 + od + turnoff +endin /* @@ -166,10 +329,10 @@ endin instr play_kick iamp = bid_getparameter(p4, p5, 2) aout1 wgbowedbar 1, 60, 0.9, 0.1, 0.1 - aout1 distort aout1, 0.25, gifnSquare + aout1 distort aout1, 0.45, gifnSquare aout1 pareq aout1, 130, 0.3, 0.6 aout1 pareq aout1, 9000, 5, 0.6 - aout1 *= 0.8 + aout1 *= 1.3 bus_mix("master", aout1, aout1) endin @@ -16,20 +16,29 @@ This is the first completed work in the series and uses preset arrays defining t A relatively simple composition of clicks and bleeps stochastically computed at initialisation time. ### BUG3 (2021) -Significant work has been done on contructing a custom arrangment format for interpretation: the Bug Infested Directives (BID) format. This allows for reusable loop-based sequencing beyond the regular capabilities of the Csound score format. Also notably, a sample of a 909 hi-hat has been converted to a Csound instrument using FFT analysis, resulting in a large number of enveloped oscillators. This hi-hat instrument is too computationally heavy to be consistently run in realtime, so is recorded to memory before playback begins. The arrangement is computed during realtime playback. +Significant work has been done on contructing a custom arrangement format for interpretation: the Bug Infested Directives (BID) format. This allows for reusable loop-based sequencing beyond the regular capabilities of the Csound score format. Also notably, a sample of a 909 hi-hat has been converted to a Csound instrument using FFT analysis, resulting in a large number of enveloped oscillators. This hi-hat instrument is too computationally heavy to be consistently run in realtime, so is recorded to memory before playback begins. The arrangement is computed during realtime playback. The original BID file is provided as text (bid\_source.txt), but not all platforms support the readfi opcode as required by bid\_loadfile, hence it has been encapsulated in a string within bid_source.udo , and bid\_loadtext is used instead. If readfi is supported and bid\_loadfile is to be used, NOFILEIO should be unset. ### BUG4 (2021) -Utilises the BID loop arrangement format created in BUG3 and computed during realtime playback. Designed to be a lightly glitchy, relatively downtempo minimal techno type piece. +Utilises the BID loop arrangement format created in BUG3 and computed during realtime playback. Microhouse type track. -### BUG5 (2021) : Not Complete +### BUG5 (2021-2022) +Further usage of the BID loop arrangement format. Atmospheric house kind of vibe. + +### BUG6 (2021-2024) +A hard techno style sort of thing influenced by Surgeon, Richie Hawtin etc. + +### BUG7 (2022-2024) : Not Complete +In progress. + +### BUG8 (2022-2024) : Not Complete In progress. -### BUG6 (2021) : Not Complete +### BUG9 (2022-2024) : Not Complete In progress. -### BUG7 (2021) : Not Complete +### BUG10 (2022-2024) : Not Complete In progress. ## Credits |