From 44d3d5ece0a53d5316a2ccc9898b79992d81fef7 Mon Sep 17 00:00:00 2001 From: Richard Date: Sat, 22 Jan 2022 22:27:01 +0000 Subject: update --- BID-rework/BUG5.csd | 154 ---------------- BID-rework/bid.udo | 431 --------------------------------------------- BID-rework/bid_source.udo | 135 -------------- BID-rework/bussing.udo | 62 ------- BID-rework/instruments.udo | 312 -------------------------------- BID-rework/txt_tools.udo | 82 --------- BID-rework/wavetables.udo | 16 -- BUG1/BUG1.csd | 36 ++-- BUG5/BUG5.csd | 11 ++ BUG5/bid_source.udo | 157 ++++++++++++++++- BUG5/instruments.udo | 52 +++++- BUG6/BUG6.csd | 5 +- BUG6/bid_source.udo | 40 ++++- BUG6/instruments.udo | 2 +- BUG7/BUG7.csd | 85 +++++++-- BUG7/bid_source.udo | 79 +++++++-- BUG7/instruments.udo | 163 ++++++++++++++++- BUG7/oprepare.udo | 92 ++++++++++ BUG7/src_vox.udo | 11 ++ BUG7/vox.het | 301 +++++++++++++++++++++++++++++++ BUG8/BUG8.csd | 313 ++++++++++++++++++++++++++++++++ BUG8/wavetables.udo | 16 ++ BUG9/BUG9.csd | 145 +++++++++++++++ BUG9/bid.udo | 425 ++++++++++++++++++++++++++++++++++++++++++++ BUG9/bid_source.udo | 84 +++++++++ BUG9/bussing.udo | 67 +++++++ BUG9/instruments.udo | 179 +++++++++++++++++++ BUG9/txt_tools.udo | 82 +++++++++ BUG9/wavetables.udo | 16 ++ 29 files changed, 2290 insertions(+), 1263 deletions(-) delete mode 100644 BID-rework/BUG5.csd delete mode 100644 BID-rework/bid.udo delete mode 100644 BID-rework/bid_source.udo delete mode 100644 BID-rework/bussing.udo delete mode 100644 BID-rework/instruments.udo delete mode 100644 BID-rework/txt_tools.udo delete mode 100644 BID-rework/wavetables.udo create mode 100644 BUG7/oprepare.udo create mode 100644 BUG7/src_vox.udo create mode 100644 BUG7/vox.het create mode 100644 BUG8/BUG8.csd create mode 100644 BUG8/wavetables.udo create mode 100644 BUG9/BUG9.csd create mode 100644 BUG9/bid.udo create mode 100644 BUG9/bid_source.udo create mode 100644 BUG9/bussing.udo create mode 100644 BUG9/instruments.udo create mode 100644 BUG9/txt_tools.udo create mode 100644 BUG9/wavetables.udo diff --git a/BID-rework/BUG5.csd b/BID-rework/BUG5.csd deleted file mode 100644 index 4f05983..0000000 --- a/BID-rework/BUG5.csd +++ /dev/null @@ -1,154 +0,0 @@ - - --odac - - -/* - Debugger - Unfixed Bugs : BUG #5 - - http://git.1bpm.net/csd-unfixedbugs1/about/ - - By Richard Knight 2022 - 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" - aL *= abs(oscil(1, 1)) - aR *= abs(oscil(1, 1)) - aLdlr delayr 0.8 - kdeltime = abs(oscil(0.02, 0.04)) + (gibid_beattime* 0.5) - aLdel deltapi kdeltime + 0.002 - delayw aL + (aLdel * 0.7) - aRdlr delayr 0.8 - aRdel deltapi kdeltime + 0.001 - delayw aR + (aRdel * 0.7) - ;aLdel *= 1-gkpump - ;aRdel *= 1-gkpump - bus_mix("master", aLdel, aRdel) -endin - -/* - Global send effects: reverb -*/ -instr global_reverb - aL, aR bus_read "reverb" - aL, aR freeverb aL, aR, 0.6, 0.3 - bus_mix("master", aL, aR) -endin - -/* - Master audio output -*/ -instr global_master - igain = 1 - 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 - - -/* - 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_delay1", 0, p3 - event_i "i", "global_reverb", 0, p3 - 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", "endfade", 0, gibid_beattime*8 - turnoff - endif - - - bid_seq "kick", kpos, ksection - bid_seq "hat1", kpos, ksection - bid_seq "hat2", kpos, ksection - bid_seq "snare", kpos, ksection - bid_seq "mel1", kpos, ksection - bid_seq "stringchord", kpos, ksection - bid_seq "chord1", kpos, ksection - bid_seq "bass", kpos, ksection - bid_seq "clap", kpos, ksection - bid_seq "303", kpos, ksection - - - kpos = (kpos < 31) ? kpos + 1 : 0 - ksection16ths = bid_getsectionlength(ksection) * 4 - - if (kposabs+1 < ksection16ths) then - kposabs += 1 - else - 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 - - - \ No newline at end of file diff --git a/BID-rework/bid.udo b/BID-rework/bid.udo deleted file mode 100644 index 4c0e797..0000000 --- a/BID-rework/bid.udo +++ /dev/null @@ -1,431 +0,0 @@ -#ifndef UDO_BID -#define UDO_BID ## -/* - Debugger - Unfixed Bugs : BUG #5 - - Bug Infested Directive file parser v1 and tools - - Designed to create a reusable loop based score format in the Unfixed Bugs project and beyond. -*/ - - -#define BID_VERSION #1.1# - -#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_sectionmax init 64 -gibid_sectionlengths ftgen 0, 0, -gibid_sectionmax, -7, 0 ; section lengths -gibid_sections ftgen 0, 0, -pow(gibid_sectionmax, 2), -7, 0 ; section pointers to data: dim0=section, dim1=instrument -gibid_sectiondata ftgen 0, 0, -(99*6), -7, 0 ; section data, ftables contained: dim0=ID, dim1=parameter ftable number - -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 - - - -/* - 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 = tab:k(ksection * gibid_sectionmax + instrindex, gibid_sections) - - if (kdata != -1) then ; null section - tab:k(kpos, - 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. - 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 - ifn = tab_i(idataindex * gibid_sectionmax + iparameter, gibid_sectiondata) - xout tab_i(ipos, ifn) -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 - ifn ftgen 0, 0, -isize, -7, 0 - tabw_i(ifn, ix1 * gibid_sectionmax + ix2, gibid_sectiondata) - 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 = tab_i(irepeatsection * gibid_sectionmax + instrindex, gibid_sections) - endif - tabw_i(inewsection, isection * gibid_sectionmax + instrindex, gibid_sections) - ;gibid_sections[isection][instrindex] = inewsection - else - isectiondataindex += 1 - tabw_i(isectiondataindex, isection * gibid_sectionmax + instrindex, gibid_sections) - 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 - - -/* - 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/BID-rework/bid_source.udo b/BID-rework/bid_source.udo deleted file mode 100644 index a64d00a..0000000 --- a/BID-rework/bid_source.udo +++ /dev/null @@ -1,135 +0,0 @@ -/* - Debugger - Unfixed Bugs : BUG #5 - - 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 #5 -v 1.1 - -; tempo, swing percent -b 123, 41 - -; chord groups -c 1 - 3.5, 56, 59, 61, 64 - 4.5, 56, 59, 63 - 8, 59, 60, 62, 65, 69 - -c 2 - 8, 56, 59, 61, 64, 69 - 8, 56, 59, 65, 71, 73 -;8, 56, 59, 63, 68 -;4.5, 57, 60, 65, 69, 71 -; 4.5, 60, 61, 65, 67, 70 ; 57, 60, 65, 69, 71 - - -; sections: section number, length, chordgroup -s 1, 32, 2 -s 2, 32, 1 -s 3, 32, 1 - - - -; patterns: trig , dur, amp, chance -i stringchord, 1 -; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - - 1, 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, 0, 0, 0 - 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4.5, 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, 1, 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, 2, -1 -i stringchord, 3, -1 - - -i chord1, 1, -1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-i kick, 1 -; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - - 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0 - .9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9 - 1, 0,.8, 0, 1, 0, 0, 0, 1, 0,.7, 0, 1, 0, 0, 0, 1, 0,.8, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0,.6,.6 - 1, 1,.1, 1, 1, 1, 1, 1, 1, 1,.5, 1, 1, 1, 1, 1, 1, 1,.1, 1, 1, 1, 1, 1, 1, 1,.5, 1, 1, 1,.6,.2 -i kick, 2, 1 -i kick, 3, 1 -}} diff --git a/BID-rework/bussing.udo b/BID-rework/bussing.udo deleted file mode 100644 index 78755ce..0000000 --- a/BID-rework/bussing.udo +++ /dev/null @@ -1,62 +0,0 @@ -#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/BID-rework/instruments.udo b/BID-rework/instruments.udo deleted file mode 100644 index 834f942..0000000 --- a/BID-rework/instruments.udo +++ /dev/null @@ -1,312 +0,0 @@ -#ifndef UDO_INSTRUMENTS -#define UDO_INSTRUMENTS ## -/* - Debugger - Unfixed Bugs : BUG #5 - - 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_hat1 - iamp = bid_getparameter(p4, p5, 2) - idel1 = random(0.01, 0.03) - idel2 = random(0.01, 0.03) - xtratim(max(idel1, idel2)) - p3 = 0.22 - kfreq linseg 1000, p3*0.2, 300, p3*0.8, 500 ; mid as 500 not 300 - aenv expsega .1, .0005, 1, p3 - .0005, .01 - asqr1 oscil 1, kfreq, gifnSquare, -1 - asqr2 oscil 1, kfreq*1.4471, gifnSquare, -1 - asqr3 oscil 1, kfreq*1.6170, gifnSquare, -1 - asqr4 oscil 1, kfreq*1.9265, gifnSquare, -1 - asqr5 oscil 1, kfreq*2.5028, gifnSquare, -1 - asqr6 oscil 1, kfreq*2.6637, gifnSquare, -1 - a808 sum asqr1, asqr2, asqr3, asqr4, asqr5, asqr6 - a808 butterhp a808, 3270 - a808 butterhp a808, 3270 - aout = a808 * aenv * iamp - aL delay aout, idel1 - aR delay aout, idel2 - bus_mix("master", aL, aR) -endin - - -instr play_hat2 - iamp = bid_getparameter(p4, p5, 2) - idel1 = random(0.005, 0.02) - idel2 = random(0.005, 0.02) - xtratim(max(idel1, idel2)) - kfreq init 415.3*0.8 - aenv expsega .1, .0005, 1, p3 - .0005, .01 - asqr1 oscil 1, kfreq, gifnSquare, -1 - asqr2 oscil 1, kfreq*1.4471, gifnSquare, -1 - asqr3 oscil 1, kfreq*1.6170, gifnSquare, -1 - asqr4 oscil 1, kfreq*1.9265, gifnSquare, -1 - asqr5 oscil 1, kfreq*2.5028, gifnSaw, -1 - asqr6 oscil 1, kfreq*2.6637, gifnSaw, -1 - a808 sum asqr1, asqr2, asqr3, asqr4, asqr5, asqr6 - a808 butterhp a808, 3270 - a808 butterhp a808, 3270 - aout = a808 * aenv * iamp - aL delay aout, idel1 - aR delay aout, idel2 - bus_mix("master", aL, aR) -endin - -instr play_bass - iamp = bid_getparameter(p4, p5, 2) - inote = tab_i(random(1, ftlen(gibid_chordfn) - 3), gibid_chordfn) - 24 - a1 foscil 0.56, cpsmidinn(inote), 1, 2, random(0, 6), gifnSine - a1 pareq a1, 150, 0.24, 0.9 - a1 pareq a1, 80, 1.3, 0.9 - kenv linseg 1, p3, 0 - aout = a1*kenv - bus_mix("master", aout, aout) -endin - - -instr play_kick ; 808 style kick - iamp = bid_getparameter(p4, p5, 2) - - idist = 0.35 ;= (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 distort amix, idist, gifnSine - - - aout1 *= 1.6 - bus_mix("master", aout1, aout1) -endin - - -instr play_snare - icps0 = 211 - iamp = bid_getparameter(p4, p5, 2) - ;p3 = random(0.03, 0.5) - icps1 = 2.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 2.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 - bus_mix("master", aout, aout) - -endin - - -/* - Convenience opcode for playing current chord on given instrument, passing p4 as note and p5 as amp - - chordinstrument Sinstrument - - Sinstrument the instrument name - ipos position in pattern - idataindex section specific data index; pointer to ftable -*/ -opcode chordinstrument, 0, Sii - Sinstrument, ipos, idataindex xin - iamp = bid_getparameter(ipos, idataindex, 2) - index = 1 ; index 0 is chordgroup length - while (index < ftlen(gibid_chordfn)) do - event_i "i", Sinstrument, 0, p3, tab_i(index, gibid_chordfn), iamp - index += 1 - od - -endop - - - -instr play_clap - iamp = bid_getparameter(p4, p5, 2) - ;p3 = 0.065 - aL noise 1, 0.9 - aR noise 0.5, 0.4 - aL butterbp aL, 1200, 1100 - aR butterbp aR, 1200, 1100 - aL butterhp aL, 400 - aR butterhp aR, 400 - kamp1 linseg 1, p3*0.1, 0, p3*0.1, 1, p3*0.2, 0.1, p3*0.3, 0.5, p3*0.2, 0, p3*0.05, 0.4, p3*0.05, 0 - kamp2 linseg 1, p3*0.15, 0, p3*0.15, 1, p3*0.1, 0.1, p3*0.2, 0.5, p3*0.3, 0, p3*0.05, 0.4, p3*0.05, 0 - - aL = aL*kamp1*12*iamp - aR = aR*kamp2*12*iamp - bus_mix("master", aL, aR) - bus_mix("reverb", aL*0.2, aR*0.2) -endin - -instr play_mel1 - iamp = bid_getparameter(p4, p5, 2) - inote = tab_i(1, gibid_chordfn) ;tab_i(random(1, ftlen(gibid_chordfn) - 3), gibid_chordfn) - 12 - inote2 = tab_i(2, gibid_chordfn) ;tab_i(random(1, ftlen(gibid_chordfn) - 3), gibid_chordfn) - 12 - aL moog 0.6*iamp, cpsmidinn(inote - 12), 0.1, 0.02, 4, 0.01, gifnSine, gifnSaw, gifnSine - aR moog 0.6*iamp, cpsmidinn(inote2 - 12), 0.1, 0.002, 4, 0.01, gifnSine, gifnSaw, gifnSine - kenv linseg 1, p3*0.8, 0, p3*0.2, 0 - aL *= kenv - aR *= kenv - bus_mix("master", aL, aR) -endin - -instr string - if (random(0, 1) > 0.8) then - ifqc = cpsmidinn(p4) - else - ifqc = cpsmidinn(p4+12) - endif - iamp = p5 -idur = p3 - ifm1 = ifqc - ifm2 = ifqc*3 - ifm3 = ifqc*4 - indx1 = 7.5/log(ifqc) ;range from ca 2 to 1 - indx2 = 15/sqrt(ifqc) ;range from ca 2.6 to .5 - indx3 = 1.25/sqrt(ifqc) ;range from ca .2 to .038 - - irise = 0.1 - idec = 0.4 - inoisdur= .1 - ivibdel = 0.25 - ivibwth = 0.01 - ivibrte = 5.5 - - kvib init 0 - kvbctl linen 1,.5,p3-ivibdel,.1 ; vibrato control envelope - krnd randi .0075,2 ; random deviation vib width - kvib oscili kvbctl*ivibwth+krnd,ivibrte*kvbctl ; generator - - ktrans linseg 1,inoisdur,0,1,0 ; transient envelope - anoise randi ktrans*iamp/4,.2*ifqc ; attack noise... - attack oscili anoise,2000 ; ...centered around 2kHz - - amod1 oscili ifm1*(indx1+ktrans),ifm1 - amod2 oscili ifm2*(indx2+ktrans),ifm2 - amod3 oscili ifm3*(indx3+ktrans),ifm3 - asig oscili iamp,(ifqc+amod1+amod2+amod3)*(1+kvib) - asig linen (asig+attack),irise,idur,idec - asig butterhp asig, 800 - asig butterhp asig, 200 - kenv linseg 0, p3*0.25, 0.7, p3*0.5, 1, p3*0.25, 0 - asig *= kenv - asig *= 0.2 - aL = asig - aR = asig - bus_mix("delay1", aL, aR) -bus_mix("reverb", aL, aR) - - -endin - - -instr play_303 - iamp = bid_getparameter(p4, p5, 2) - ifilter = random(50, 70) - inote = tab_i(random(1, ftlen(gibid_chordfn) - 1), gibid_chordfn) - - ifrq1 = 440 * exp(log(2) * (ifilter - 69) / 12) ; filter start freq. - kamp linseg 1, p3-0.01, 1, 0.025, 0, 1, 0 ; release envelope - kcps init cpsmidinn(inote) - kffrq port 0, 60/150, ifrq1 ; filter frequency - 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, 250 - a1 = a1 * kamp * 0.72 - aL, aR pan2 a1, random(0.3, 0.7) - bus_mix("reverb", aL*0.3, aR*0.3) - bus_mix("master", aL*0.8, aR*0.8) -endin - -instr chord1 - inote = p4 - iamp = p5 - kfreq init cpsmidinn(inote) - - aphs1 phasor kfreq - aphs2 phasor kfreq - koda = abs(oscil(random(0, 2), random(0, 1))) - a1 tablei aphs1, gifnSine, 1, 0, 1 - a1 *= linseg(1, p3*0.9, 0) - - av1L linseg 3, p3, 0 - aL tablei (aphs2+a1)+av1L+koda, gifnSine, 1, 0, 1 - - av1R linseg 4, p3, 0 - aR tablei (aphs2+a1)+av1R+koda, gifnSine, 1, 0, 1 - - kfi linseg 0, p3*0.2, 1, p3*0.8, 1 - aL phaser1 aL*kfi, oscil:k(7400, 0.1, gifnSine, random(0, 0.5)) + 1000, 8, .9 - aR phaser1 aR*kfi, oscil:k(7400, 0.1, gifnSine, random(0, 0.5)) + 1000, 8, .9 - aL *= 0.16 * iamp - aR *= 0.16 * iamp - aL butterhp aL, 520 - aR butterhp aR, 520 - if (i(gksection) == 3) then - aL butterlp aL, 1000 - aR butterlp aR, 1000 - endif - bus_mix("delay1", aL, aR) - ;bus_mix("master", aL, aR) -endin - - -/* - Play chord1 above, called from BID -*/ -instr play_chord1 - chordinstrument "chord1", p4, p5 - turnoff -endin - -instr play_stringchord - chordinstrument "string", p4, p5 - turnoff -endin - - - -#end diff --git a/BID-rework/txt_tools.udo b/BID-rework/txt_tools.udo deleted file mode 100644 index a6c4511..0000000 --- a/BID-rework/txt_tools.udo +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef UDO_TXTTOOLS -#define UDO_TXTTOOLS ## -/* - Debugger - Unfixed Bugs : BUG #5 - - 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/BID-rework/wavetables.udo b/BID-rework/wavetables.udo deleted file mode 100644 index 1b2c209..0000000 --- a/BID-rework/wavetables.udo +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef UDO_WAVETABLES -#define UDO_WAVETABLES ## -/* - Debugger - Unfixed Bugs : BUG #5 - - 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/BUG1/BUG1.csd b/BUG1/BUG1.csd index fb09f77..bbba770 100644 --- a/BUG1/BUG1.csd +++ b/BUG1/BUG1.csd @@ -1,6 +1,7 @@ -g -odac +-m0 /* @@ -8,11 +9,12 @@ Debugger - Unfixed Bugs - BUG1 By Richard Knight 2019 + Revised 2021 */ sr = 44100 -kr = 4410 +ksmps = 10 nchnls = 2 ; general globals @@ -126,9 +128,9 @@ endin instr 800 aL zar 3 aR zar 4 - ;aL compress aL, aL, -1, 30, 60, 1.2, 0.1, 0.01, 0.01 - ;aR compress aR, aR, -1, 30, 60, 1.2, 0.1, 0.01, 0.01 - outs aL*0.9, aR*0.9 + aL limit aL*2, -0dbfs, 0dbfs + aR limit aR*2, -0dbfs, 0dbfs + outs aL, aR zacl 3, 4 endin @@ -175,24 +177,26 @@ endin /* kick */ instr 901 - kax linseg 300, p3*0.05, 100, p3*0.1, 40, p3*0.8, 20 - kenv linseg 1,p3*0.2,0.6,p3*0.2,0.4,p3*0.2,0.1,p3*0.2,0 - kpit linseg 500, p3*0.2, 100, p3*0.4, 40, p3*0.2, 30, p3*0.2, 20 - a2 oscil 8500,kpit*0.35,1 - a3 oscil 9500,kpit*0.2,1 + aax linseg 300, p3*0.05, 100, p3*0.1, 40, p3*0.8, 20 + aenv linseg 1,p3*0.2,0.6,p3*0.2,0.4,p3*0.2,0.1,p3*0.2,0 + apit linseg 500, p3*0.2, 100, p3*0.4, 40, p3*0.2, 30, p3*0.2, 20 + a2 oscil 8500,apit*0.35,1 + a3 oscil 9500,apit*0.2,1 an noise 3000,-0.1 ax1 oscil 300, 400, 1 ax2 oscil 80, 900, 1 - kaxenv linseg 0.2, p3*0.02, 0 - akx = (ax1*ax2)*kaxenv + aaxenv linseg 0.2, p3*0.02, 0 + akx = (ax1*ax2)*aaxenv aout = a2+a3 ; + ax - gkpump = kenv - amix = p4*((aout*kenv)+akx) - adist distort amix, 0.13, 1 - aeq1 pareq adist, 70, 1.5, 2 - aeq2 pareq aeq1, 200, 0.7, 0.9 + gkpump = k(aenv) + amix = p4*((aout*aenv)+akx) + amix pareq amix, 100, 0.1, 0.9 + adist distort amix, 0.43, 1 + aeq1 pareq adist, 60, 1.5, 2 + aeq2 pareq aeq1, 100, 0.1, 0.9 aout pareq aeq2, 5000, 1.8, 0.5 + aout *= 2 zawm aout*0.7, 1 zawm aout*0.7, 2 endin diff --git a/BUG5/BUG5.csd b/BUG5/BUG5.csd index e240fcf..7d45739 100644 --- a/BUG5/BUG5.csd +++ b/BUG5/BUG5.csd @@ -1,6 +1,7 @@ -odac +-m0 /* @@ -67,6 +68,14 @@ endin instr global_master igain = 1 aL, aR bus_read "master" + itime6 = tab_i(1, 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 + endif + aL limit aL*0.5, -1, 1 aR limit aR*0.5, -1, 1 outs aL*gkmastergain*igain, aR*gkmastergain*igain @@ -95,6 +104,7 @@ endin instr sequencer isection = 1 + event_i "i", "bid_setcurrentchord", 0, 1, isection, 0 event_i "i", "global_delay1", 0, p3 event_i "i", "global_reverb", 0, p3 @@ -122,6 +132,7 @@ instr sequencer bid_seq "bass", kpos, ksection bid_seq "clap", kpos, ksection bid_seq "303", kpos, ksection + bid_seq "303b", kpos, ksection kpos = (kpos < 31) ? kpos + 1 : 0 diff --git a/BUG5/bid_source.udo b/BUG5/bid_source.udo index a64d00a..7052e2e 100644 --- a/BUG5/bid_source.udo +++ b/BUG5/bid_source.udo @@ -22,6 +22,16 @@ c 1 c 2 8, 56, 59, 61, 64, 69 8, 56, 59, 65, 71, 73 + +c 3 + 2.5, 56, 59, 65, 71, 73 + 1.5, 58, 59, 67, 71, 78 + 2.5, 59, 61, 67, 71, 73 + 1.5, 61, 64, 67, 71, 78 + + + + ;8, 56, 59, 63, 68 ;4.5, 57, 60, 65, 69, 71 ; 4.5, 60, 61, 65, 67, 70 ; 57, 60, 65, 69, 71 @@ -29,8 +39,12 @@ c 2 ; sections: section number, length, chordgroup s 1, 32, 2 -s 2, 32, 1 -s 3, 32, 1 +s 2, 64, 1 +s 3, 24, 1 +s 4, 8, 3 +s 5, 32, 2 +s 6, 32, 2 +s 7, 32, 1 @@ -43,6 +57,15 @@ i stringchord, 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, 2, -1 i stringchord, 3, -1 +i stringchord, 4, -1 +i stringchord, 5, 1 +i stringchord, 6, -1 +i stringchord, 7 +; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 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 chord1, 1, -1 @@ -53,6 +76,11 @@ i chord1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i kick, 1 1, 1,.1, 1, 1, 1, 1, 1, 1, 1,.5, 1, 1, 1, 1, 1, 1, 1,.1, 1, 1, 1, 1, 1, 1, 1,.5, 1, 1, 1,.6,.2 i kick, 2, 1 i kick, 3, 1 +i kick, 4 +; 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 + .9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.9,.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, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 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 kick, 5, 1 +i kick, 6, 1 +i kick, 7, 1 }} diff --git a/BUG5/instruments.udo b/BUG5/instruments.udo index 834f942..356d775 100644 --- a/BUG5/instruments.udo +++ b/BUG5/instruments.udo @@ -18,7 +18,12 @@ instr play_hat1 idel1 = random(0.01, 0.03) idel2 = random(0.01, 0.03) xtratim(max(idel1, idel2)) - p3 = 0.22 + isection = i(gksection) + if (isection == 5 || isection == 6 || isection == 7) then + p3 = 0.15 + else + p3 = 0.22 + endif kfreq linseg 1000, p3*0.2, 300, p3*0.8, 500 ; mid as 500 not 300 aenv expsega .1, .0005, 1, p3 - .0005, .01 asqr1 oscil 1, kfreq, gifnSquare, -1 @@ -53,7 +58,7 @@ instr play_hat2 a808 sum asqr1, asqr2, asqr3, asqr4, asqr5, asqr6 a808 butterhp a808, 3270 a808 butterhp a808, 3270 - aout = a808 * aenv * iamp + aout = a808 * aenv * iamp * 0.8 aL delay aout, idel1 aR delay aout, idel2 bus_mix("master", aL, aR) @@ -66,7 +71,7 @@ instr play_bass a1 pareq a1, 150, 0.24, 0.9 a1 pareq a1, 80, 1.3, 0.9 kenv linseg 1, p3, 0 - aout = a1*kenv + aout = a1*kenv * 1.2 bus_mix("master", aout, aout) endin @@ -261,6 +266,33 @@ instr play_303 bus_mix("master", aL*0.8, aR*0.8) endin +instr play_303b + iamp = bid_getparameter(p4, p5, 2) + ifilter = random(70, 90) + inote1 = cpsmidinn(tab_i(ftlen(gibid_chordfn) - 4, gibid_chordfn) + 12) + inote2 = cpsmidinn(tab_i(ftlen(gibid_chordfn) - 3, gibid_chordfn) + 12) + + ifrq1 = 440 * exp(log(2) * (ifilter - 69) / 12) ; filter start freq. + kcps linseg inote1, p3*0.2, inote1, p3*0.6, inote2, p3*0.2, inote2 + kffrq port 0, 60/150, ifrq1 ; filter frequency + 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 * 2.5 * iamp) + + keqf limit kffrq * 4, 10, sr * 0.48 ; EQ frequency + a1 pareq a1 * 0.4, keqf, 4.0, 1.0, 2 + a1 butterhp a1, 250 + aL, aR pan2 a1, random(0.3, 0.7) + bus_mix("reverb", aL*1.3, aR*1.3) + bus_mix("master", aL*0.5, aR*0.5) +endin + instr chord1 inote = p4 iamp = p5 @@ -279,16 +311,18 @@ instr chord1 aR tablei (aphs2+a1)+av1R+koda, gifnSine, 1, 0, 1 kfi linseg 0, p3*0.2, 1, p3*0.8, 1 - aL phaser1 aL*kfi, oscil:k(7400, 0.1, gifnSine, random(0, 0.5)) + 1000, 8, .9 - aR phaser1 aR*kfi, oscil:k(7400, 0.1, gifnSine, random(0, 0.5)) + 1000, 8, .9 + isection = i(gksection) + if (isection == 3 || isection == 4 || isection == 5 || isection == 6) then + aL butterlp aL, 600 + aR butterlp aR, 600 + else + aL phaser1 aL*kfi, oscil:k(7400, 0.1, gifnSine, random(0, 0.5)) + 1000, 8, .9 + aR phaser1 aR*kfi, oscil:k(7400, 0.1, gifnSine, random(0, 0.5)) + 1000, 8, .9 + endif aL *= 0.16 * iamp aR *= 0.16 * iamp aL butterhp aL, 520 aR butterhp aR, 520 - if (i(gksection) == 3) then - aL butterlp aL, 1000 - aR butterlp aR, 1000 - endif bus_mix("delay1", aL, aR) ;bus_mix("master", aL, aR) endin diff --git a/BUG6/BUG6.csd b/BUG6/BUG6.csd index 2520d25..394959b 100644 --- a/BUG6/BUG6.csd +++ b/BUG6/BUG6.csd @@ -1,7 +1,7 @@ -odac -;-m0 +-m0 /* @@ -130,6 +130,9 @@ instr global_master 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) + 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 diff --git a/BUG6/bid_source.udo b/BUG6/bid_source.udo index fd2b6b6..76d508a 100644 --- a/BUG6/bid_source.udo +++ b/BUG6/bid_source.udo @@ -26,7 +26,7 @@ s 1, 64, 1 s 2, 64, 1 s 3, 8, 2 s 4, 56, 1 - +s 5, 32, 2 i glitchread, 1, -1 i glitchread, 2, -1 @@ -37,7 +37,7 @@ i glitchread, 4 .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,.1 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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 5 - - - 6 - - - 7 - - - 8 - - - @@ -156,6 +179,12 @@ i kick, 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 i kick2, 1 ; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - @@ -166,4 +195,5 @@ i kick2, 1 i kick2, 2, 1 i kick2, 3, 1 i kick2, 4, 1 +i kick2, 5, 1 }} diff --git a/BUG6/instruments.udo b/BUG6/instruments.udo index 55a7b93..0dd7734 100644 --- a/BUG6/instruments.udo +++ b/BUG6/instruments.udo @@ -474,7 +474,7 @@ instr play_glitchread aL table awindex*giglitchsamples, giglitchbufferL aR table awindex*giglitchsamples, giglitchbufferR aL butterhp aL, 350 - aR butterhp aL, 350 + aR butterhp aR, 350 aL *= 0.4 * iamp aR *= 0.4 * iamp if (random(0, 1) > 0.7) then diff --git a/BUG7/BUG7.csd b/BUG7/BUG7.csd index b1b478e..9e52133 100644 --- a/BUG7/BUG7.csd +++ b/BUG7/BUG7.csd @@ -32,7 +32,8 @@ gksection init -1 #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 instr global_delay1 @@ -43,6 +44,31 @@ instr global_delay1 bus_mix("master", aL*0.8, aR*0.8) endin + +instr global_delay2 + aL, aR bus_read "delay2" + 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 */ @@ -60,24 +86,32 @@ instr global_master kclapamp init 0 kcofferamp init 0 if (gksection == 1) then - kclapamp linseg 0, itime1*0.6, 1, itime1*0.4, 1 + kclapamp linseg 0, itime1*0.3, 0, itime1*0.3, 1, itime1*0.4, 1 kcofferamp line 0, itime1, 1 - krevamp linseg 1, itime1*0.1, 0, itime1*0.9, 0 + krevamp linseg 1, itime1*0.2, 0, itime1*0.8, 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 + adeltime linseg 0.05, itime1*0.1, 0 + + adumpL delayr 1 + arL deltapi adeltime*abs(oscil(1, 3)) + delayw aL + + adumpR delayr 1 + arR deltapi adeltime*abs(oscil(1, 2)) + delayw aR + + klpf linseg 100, itime1*0.05, 6000, itime1*0.05, 8000, itime1*0.1, 22050, itime1*0.8, 22050 + + arL butterlp arL, klpf + arR butterlp arR, klpf + aL = (krevamp*arL) + ((1-krevamp)*aL) aR = (krevamp*arR) + ((1-krevamp)*aR) - + elseif (gksection == 3) then + kclapamp = 1 + kcofferamp = 1 endif aL += (aclapL * kclapamp) + (acofferL * kcofferamp) + (akickL * kclapamp) + (ahat1L * kcofferamp) + (arimL * kcofferamp) aR += (aclapR * kclapamp) + (acofferR * kcofferamp) + (akickR * kclapamp) + (ahat1R * kcofferamp) + (arimR * kcofferamp) @@ -109,6 +143,15 @@ instr notify_change endin +/* + Initialise the performance: run offline preparation and then call parseandrun +*/ +instr bootstrap + Sprepare[] fillarray "vox" + oprepare(Sprepare, "parseandrun") + turnoff +endin + /* Parse BID file and run the sequencer */ @@ -134,6 +177,11 @@ instr sequencer 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 + + if (isection == 1) then + event_i "i", "play_stringchord", 0, tab_i(1, gibid_sectionlengths)*gibid_beattime, 1, 1 + endif kmetro metro (gibid_tempo / 60) * 4 kpos init 0 kposabs init 0 @@ -148,12 +196,15 @@ instr sequencer endif bid_seq "kick", kpos, ksection + bid_seq "kick2", 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 "vox", kpos, ksection + bid_seq "vox2", kpos, ksection + bid_seq "hat2", kpos, ksection bid_seq "rim", kpos, ksection @@ -163,7 +214,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 @@ -187,6 +238,6 @@ endin -i"parseandrun" 0 1 +i"bootstrap" 0 1 \ No newline at end of file diff --git a/BUG7/bid_source.udo b/BUG7/bid_source.udo index bf034b4..e122649 100644 --- a/BUG7/bid_source.udo +++ b/BUG7/bid_source.udo @@ -21,24 +21,30 @@ c 1 ; sections: section number, length, chordgroup -s 1, 256, 1 -s 2, 64, 1 +s 1, 252, 1 +s 2, 4, 1 +s 3, 64, 1 -i glitchread, 1 +i glitchread, 1, -1 +i glitchread, 2, -1 +i glitchread, 3 ; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 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, 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 1 }} diff --git a/BUG7/instruments.udo b/BUG7/instruments.udo index 6c3bb31..4b1b46a 100644 --- a/BUG7/instruments.udo +++ b/BUG7/instruments.udo @@ -10,6 +10,7 @@ #include "wavetables.udo" #include "bussing.udo" +#include "oprepare.udo" #include "bid.udo" @@ -33,20 +34,16 @@ instr play_3031 kffrq port 0, 60/150, ifrq1 ; filter frequency 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 * 2.5 * iamp) ; distortion ; 2.5 - keqf limit kffrq * 4, 10, sr * 0.48 ; EQ frequency a1 pareq a1 * 0.6, keqf, 4.0, 1.0, 2 a1 pareq a1, 50, 1.3, 0.6 a1 pareq a1, 130, 0.6, 0.6 - a1 = a1 * kamp * 0.8 - ;a1 *= line(0, p3, 1) + a1 = a1 * kamp * 1.2 aL, aR pan2 a1, random(0.3, 0.7) bus_mix("delay1", aL*0.3, aR*0.3) bus_mix("master", aL, aR) @@ -85,13 +82,65 @@ instr play_3032 a1 pareq a1 * 0.6, keqf, 4.0, 1.0, 2 a1 pareq a1, 50, 1.3, 0.6 a1 pareq a1, 130, 0.6, 0.6 - a1 = a1 * kamp * 0.8 - ;a1 *= line(0, p3, 1) + a1 = a1 * kamp * 1.2 aL, aR pan2 a1, random(0.3, 0.7) bus_mix("delay1", aL*0.3, aR*0.3) bus_mix("master", aL, aR) endin +instr play_vox + iamp = bid_getparameter(p4, p5, 2) * 2.4 * random(0.5, 1) + ifn = giopreparedfns[0] ;oprepare_getfn("vox") + apos phasor (1/(ftlen(ifn)/sr)) + ioffset1 random 0, 1 + ioffset2 random 0, 1 + ioffset3 random 0, 1 + ioffset4 random 0, 1 + aL1 table3 apos+ioffset1, ifn, 1 + aR1 table3 apos+ioffset2, ifn, 1 + aL2 table3 apos+ioffset3, ifn, 1 + aR2 table3 apos+ioffset4, ifn, 1 + kamp = linseg(0, p3*0.2, 1, p3*0.7, 1, p3*0.1, 0) + aL = aL1 + aL2 + aR = aR1 + aR2 + aL butterhp aL, 240 + aR butterhp aR, 240 + aL *= iamp * kamp + aR *= iamp * kamp + bus_mix("delay1", aL*random(0, 1), aR*random(0, 1)) + if (random(0, 1) > 0.99) then + bus_mix("delay2", aL*random(0, 1), aR*random(0, 1)) + endif + bus_mix("master", aL, aR) +endin + +instr play_vox2 + iamp = bid_getparameter(p4, p5, 2) * 4.4 * random(0.5, 1) + ispecial = bid_getparameter(p4, p5, 4) + ifn = giopreparedfns[0] ;oprepare_getfn("vox") + apos phasor -(1/(ftlen(ifn)/sr)) + a1 table3 apos, ifn, 1 + ir = 256 + f1 pvsanal a1, ir, ir/4, ir, 1 + if (ispecial = 1) then + kshift = -abs:k(oscil:k(500, 1)) + else + kshift init -random(100, 400) + endif + f2 pvshift f1, kshift, 300 + aL pvsynth f2 + aL butterhp aL, 700 + aL *= iamp * 4 + aR = aL + if (ispecial == 1) then + bus_mix("delay2", aL*0.8, aR*0.8) + else + bus_mix("delay1", aL, aR) + endif + ;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.3 @@ -243,7 +292,7 @@ instr play_kick ; 808 style kick aenv linseg 0, 0.07, 1 acps expsega 400, 0.07, 0.001, 1, 0.001 amix = (asig*0.7)*1*iamp - gkpump = min(rms(amix) * 7, 1) + ;gkpump = min(rms(amix) * 7, 1) aout1 pareq amix, 100, 0.01, 0.7 aout1 distort aout1, idist, gifnSquare aout1 pareq aout1, 50, 2, 0.4 @@ -253,6 +302,39 @@ instr play_kick ; 808 style kick bus_mix("kick", aout1, aout1) endin + + +instr play_kick2 ; 808 style kick + iamp = bid_getparameter(p4, p5, 2) + + idist = 0.2 ;= (i(gksection) == 1) ? 0.55 : 0.35 + xtratim 0.1 + krelease release + ktune init 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, 50*octave(ktune)*semitone(kbend), 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 + gkpump = min(rms(amix) * 7, 1) + aout1 pareq amix, 150, 0.2, 0.7 + aout1 distort aout1, idist, gifnSaw + aout1 pareq aout1, 350, 0.1, 0.7 + aout1 pareq aout1, 90, 1.4, 0.7 + ;aout1 pareq aout1, 190, 0.7, 0.6 + aout1 pareq aout1, 4900, 2, 0.7 + aout1 pareq aout1, 8900, 2, 0.7 + aout1 *= 1.3 + bus_mix("delay2", aout1, aout1) + bus_mix("master", aout1, aout1) +endin + + instr play_koffer iamp = bid_getparameter(p4, p5, 2) ifreq = cpsmidinn(tab_i(ftlen(gibid_chordfn) - 2, gibid_chordfn)+12) @@ -268,5 +350,70 @@ instr play_koffer endin +instr stringin + ifqc = cpsmidinn(p4) + iamp = 1 + idur = p3 + ifm1 = ifqc + ifm2 = ifqc*3 + ifm3 = ifqc*4 + indx1 = 7.5/log(ifqc) ;range from ca 2 to 1 + indx2 = 15/sqrt(ifqc) ;range from ca 2.6 to .5 + indx3 = 1.25/sqrt(ifqc) ;range from ca .2 to .038 + + irise = 0.1 + idec = 0.4 + inoisdur = .1 + ivibdel = 0.25 + ivibwth = 0.01 + ivibrte = 5.5 + + kvib init 0 + kvbctl linen 1,.5,p3-ivibdel,.1 ; vibrato control envelope + krnd randi .0075,2 ; random deviation vib width + kvib oscili kvbctl*ivibwth+krnd,ivibrte*kvbctl ; generator + + ktrans linseg 1,inoisdur,0,1,0 ; transient envelope + anoise randi ktrans*iamp/4,.2*ifqc ; attack noise... + attack oscili anoise,2000 ; ...centered around 2kHz + + amod1 oscili ifm1*(indx1+ktrans),ifm1 + amod2 oscili ifm2*(indx2+ktrans),ifm2 + amod3 oscili ifm3*(indx3+ktrans),ifm3 + asig oscili iamp,(ifqc+amod1+amod2+amod3)*(1+kvib) + asig linen (asig+attack),irise,idur,idec + asig butterhp asig, 800 + asig butterhp asig, 200 + kenv linseg 0, p3*0.5, 0.1, p3*0.3, 0.3, p3*0.1, 0.6, p3*0.1, 1 + asig *= kenv * (abs:k(oscil:k(0.9, random(0.01, 1), -1, random(0, 1)))) + asig *= 0.1 + aL, aR pan2 asig, abs:k(oscil:k(1, random(0.1, 3), -1, random(0, 1))) + bus_mix("master", aL, aR) +endin + +/* + Convenience opcode for playing current chord on given instrument, passing p4 as note and p5 as amp + + chordinstrument Sinstrument + + Sinstrument the instrument name + ipos position in pattern + idataindex section specific data index; pointer to ftable +*/ +opcode chordinstrument, 0, Sii + Sinstrument, ipos, idataindex xin + iamp = bid_getparameter(ipos, idataindex, 2) + index = 1 ; index 0 is chordgroup length + while (index < ftlen(gibid_chordfn)) do + event_i "i", Sinstrument, 0, p3, tab_i(index, gibid_chordfn), iamp + index += 1 + od + +endop + +instr play_stringchord + chordinstrument "stringin", p4, p5 + turnoff +endin #end diff --git a/BUG7/oprepare.udo b/BUG7/oprepare.udo new file mode 100644 index 0000000..b4fdb05 --- /dev/null +++ b/BUG7/oprepare.udo @@ -0,0 +1,92 @@ +#ifndef UDO_OPREPARE +#define UDO_OPREPARE ## +/* + Debugger - Unfixed Bugs : BUG #3 + + Offline preparation system: record a sound in one k-cycle to a ftable for future use + To be used where online playback would be too CPU heavy + In the case of BUG3, it is used for the 909 hi-hat + + Instruments to be prepared should be prepended with src_ +*/ + + +/* + Internal preparation instrument: loop through gSoprepare + p4 index of gSoprepare to process + p5 instrument name to schedule when all sounds have been prepared +*/ +gSoprepare[] init 1 ; filled by oprepare opcode: input instrument names without src_ prepended +giopreparedfns[] init 1 ; filled by oprepare opcode: output ftable numbers corresponding to above +instr _oprepare + iprepareindex = p4 + SonComplete = p5 + if (iprepareindex >= lenarray(gSoprepare)) then + event_i "i", SonComplete, 0, 3600 + turnoff + else + Sprepareinstr = gSoprepare[iprepareindex] + Srcinstr = sprintf("src_%s", Sprepareinstr) + ilen = 0.8 + p3 = ilen + ifn ftgen 0, 0, sr*ilen, 7, 0 + giopreparedfns[iprepareindex] = ifn + ktimek timeinstk + if (ktimek == 1) then + kcycles = ilen * kr + kcount init 0 +loop: + apos phasor (1/(ftlen(ifn)/sr)) + aproc subinstr Srcinstr, 1, 0.1 + tabw aproc, apos, ifn, 1 + loop_lt kcount, 1, kcycles, loop + elseif (ktimek == 5) then + scoreline_i sprintf("i\"_oprepare\" 0 1 %d \"%s\"", iprepareindex+1, SonComplete) + turnoff + endif + endif + +endin + + +/* + Start the offline preparation + + oprepare Snames[], SonComplete + + Snames[] list of instruments to process (instrument name without src_ prepended) + SonComplete instrument to be scheduled when preparation process has completed +*/ +opcode oprepare, 0, S[]S + Snames[], SonComplete xin + gSoprepare = Snames + giopreparedfns[] init lenarray(Snames) + scoreline_i sprintf("i\"_oprepare\" 0 1 0 \"%s\"", SonComplete) +endop + + +/* + Get the ftable number of a specified instrument name as originally passed to oprepare + + ifn oprepare_getfn Sname + + ifn the ftable + Sname name of offline-prepared instrument +*/ +opcode oprepare_getfn, i, S + Sname xin + ifn = -1 + index = 0 + while (index < lenarray(gSoprepare)) do + if (strcmp(gSoprepare[index], Sname) == 0) then + ifn = giopreparedfns[index] + endif + index += 1 + od +complete: + xout ifn +endop + + +#end + diff --git a/BUG7/src_vox.udo b/BUG7/src_vox.udo new file mode 100644 index 0000000..1a0c87f --- /dev/null +++ b/BUG7/src_vox.udo @@ -0,0 +1,11 @@ +#ifndef SRC_VOX +#define SRC_VOX ## + + +instr src_vox + ipitch = p4 + a1 adsyn 1, 1, 1, "vox.het" + out a1 +endin + +#end diff --git a/BUG7/vox.het b/BUG7/vox.het new file mode 100644 index 0000000..09ccde7 --- /dev/null +++ b/BUG7/vox.het @@ -0,0 +1,301 @@ +HETRO 100 +-1,0,0,6,0,9,125,13,162,16,105,19,0,49,0,52,119,55,292,59,589,62,764,65,866,69,975,72,1199,75,1450,78,1807,82,2220,85,2627,88,3042,92,3438,95,3767,98,4107,102,4556,105,5119,108,6027,111,7776,115,8129,118,5518,121,3894,125,4006,128,4717,131,4854,134,4447,138,4378,141,4745,144,4865,148,4625,151,4452,154,4332,157,4012,161,3828,164,3818,167,3903,171,4106,174,4055,177,3853,180,3661,184,3651,187,3785,190,3825,194,3777,197,3649,200,3445,204,3273,207,3071,210,2860,213,2692,217,2607,220,2579,223,2589,227,2594,230,2639,233,2776,236,2935,240,3068,243,3197,246,3336,250,3473,253,3568,256,3569,259,3536,263,3629,266,3684,269,3324,273,2533,276,1799,279,1673,282,1611,286,1239,289,849,292,662,296,617,299,587,302,546,306,522,309,495,312,417,315,291,319,167,322,82,325,71,329,91,332,96,335,79,338,0,342,96,345,73,348,80,352,181,355,467,358,1125,361,1901,365,2455,368,2916,371,3352,375,3564,378,3524,381,3441,384,3425,388,3442,391,3428,394,3396,398,3311,401,3274,404,3306,408,3302,411,3208,414,3149,417,3085,421,2869,424,2461,427,1759,431,943,434,574,437,820,440,1242,444,1528,447,1578,450,1417,454,1121,457,768,460,558,463,680,467,957,470,1214,473,1364,477,1685,480,1943,483,2148,487,2322,490,2427,493,2420,496,2247,500,2051,503,2005,506,1990,510,1865,513,1769,516,1743,519,1697,523,1725,526,1833,529,1809,533,1722,536,1753,539,1787,542,1766,546,1713,549,1630,552,1544,556,1483,559,1443,562,1437,565,1519,569,1663,572,1790,575,1874,579,1903,582,1870,585,1781,589,1659,592,1556,595,1496,598,1462,602,1439,605,1414,608,1394,612,1382,615,1365,618,1354,621,1381,625,1457,628,1553,631,1613,635,1600,638,1572,641,1576,644,1592,648,1602,651,1551,654,1502,658,1507,661,1533,664,1515,667,1383,671,1114,674,910,677,1019,681,1199,684,1165,687,1005,691,879,694,749,697,540,700,326,704,155,707,68,710,105,714,97,717,145,720,198,723,140,727,0,746,0,750,70,753,0,756,77,760,104,763,90,766,0,769,0,773,69,776,0,32767 +-2,0,300,6,195,9,284,13,280,16,270,19,276,49,213,52,193,55,199,59,212,62,202,65,198,69,195,72,202,75,204,78,211,82,216,85,220,88,225,92,230,95,235,98,242,102,250,105,255,108,261,111,285,115,301,118,284,121,285,125,291,128,289,131,288,134,291,138,294,141,295,144,298,148,300,151,299,154,299,157,299,161,301,164,301,167,296,171,294,174,291,177,290,180,289,184,287,187,286,190,282,194,280,197,279,200,279,204,279,207,276,210,274,213,273,217,273,220,274,223,276,227,279,230,282,233,285,236,288,240,289,243,292,246,295,250,298,253,302,256,305,259,307,263,310,266,312,269,308,273,292,276,271,279,275,282,283,286,277,289,275,292,292,296,302,299,296,302,288,306,285,309,285,312,290,315,295,319,285,322,247,325,257,329,289,332,300,335,361,338,438,342,377,345,344,348,302,352,296,355,274,358,278,361,283,365,282,368,282,371,286,375,287,378,286,381,285,384,285,388,286,391,286,394,287,398,286,401,287,404,288,408,290,411,288,414,288,417,288,421,287,424,284,427,275,431,243,434,216,437,241,440,258,444,263,447,262,450,260,454,257,457,242,460,226,463,242,467,262,470,274,473,284,477,309,480,328,483,339,487,335,490,333,493,333,496,336,500,340,503,338,506,337,510,339,513,341,516,342,519,347,523,349,526,345,529,346,533,349,536,346,539,342,542,339,546,337,549,334,552,329,556,322,559,317,562,313,565,312,569,313,572,314,575,314,579,313,582,313,585,312,589,311,592,311,595,314,598,318,602,324,605,332,608,339,612,344,615,349,618,353,621,356,625,358,628,358,631,361,635,366,638,370,641,370,644,368,648,364,651,363,654,360,658,354,661,346,664,337,667,325,671,308,674,288,677,290,681,294,684,286,687,275,691,271,694,273,697,270,700,267,704,244,707,193,710,265,714,247,717,273,720,311,723,336,727,391,746,270,750,295,753,267,756,267,760,295,763,297,766,259,769,264,773,317,776,317,32767 + +-1,0,0,59,0,62,67,65,70,69,78,72,85,75,99,78,110,82,131,85,145,88,164,92,177,95,199,98,212,102,214,105,227,108,256,111,403,115,686,118,1531,121,2050,125,1911,128,2210,131,2509,134,2652,138,2763,141,2902,144,3011,148,3098,151,3143,154,3230,157,3278,161,3332,164,3337,167,3226,171,3040,174,2877,177,2683,180,2346,184,2168,187,2105,190,2154,194,2191,197,2000,200,1705,204,1274,207,1048,210,1275,213,1259,217,1203,220,1246,223,1269,227,1350,230,1424,233,1576,236,1817,240,2084,243,2256,246,2268,250,2160,253,1830,256,1357,259,980,263,598,266,219,269,259,273,452,276,475,279,327,282,209,286,113,289,0,292,85,296,86,299,0,329,0,332,66,335,89,338,99,342,0,358,0,361,71,365,120,368,250,371,370,375,454,378,578,381,702,384,780,388,826,391,863,394,885,398,941,401,980,404,987,408,981,411,980,414,945,417,886,421,785,424,638,427,507,431,404,434,289,437,188,440,84,444,89,447,152,450,119,454,0,457,78,460,123,463,141,467,121,470,91,473,0,477,98,480,190,483,299,487,426,490,691,493,1100,496,1717,500,2553,503,3479,506,4435,510,5368,513,5925,516,6029,519,5784,523,5290,526,4805,529,4325,533,3799,536,3227,539,2795,542,2728,546,2969,549,3222,552,3272,556,3266,559,3416,562,3347,565,2623,569,1827,572,1902,575,1952,579,1514,582,2137,585,3158,589,3389,592,3087,595,2789,598,2502,602,2174,605,2080,608,2513,612,3468,615,4458,618,4947,621,4581,625,3556,628,3233,631,4169,635,4331,638,3285,641,2707,644,2581,648,2291,651,2131,654,1661,658,1302,661,1521,664,1511,667,810,671,831,674,1298,677,788,681,1135,684,1050,687,486,691,446,694,482,697,398,700,267,704,135,707,98,710,132,714,219,717,212,720,79,723,0,727,67,730,71,733,121,737,109,740,74,743,0,750,0,753,83,756,128,760,102,763,0,766,0,769,102,773,110,776,99,779,85,783,0,829,0,832,78,835,0,32767 +-2,0,600,59,372,62,577,65,570,69,499,72,238,75,203,78,214,82,225,85,237,88,443,92,472,95,487,98,491,102,492,105,504,108,522,111,606,115,613,118,596,121,580,125,588,128,583,131,587,134,592,138,593,141,596,144,602,148,606,151,606,154,604,157,602,161,601,164,598,167,594,171,589,174,586,177,580,180,571,184,565,187,560,190,561,194,562,197,557,200,550,204,538,207,531,210,555,213,546,217,544,220,552,223,552,227,558,230,562,233,566,236,570,240,574,243,575,246,576,250,581,253,586,256,587,259,593,263,602,266,662,269,632,273,598,276,590,279,568,282,560,286,524,289,528,292,585,296,576,299,572,329,548,332,574,335,592,338,540,342,557,358,615,361,622,365,579,368,567,371,567,375,567,378,571,381,569,384,566,388,567,391,571,394,573,398,573,401,575,404,578,408,577,411,574,414,575,417,576,421,569,424,557,427,549,431,547,434,547,437,547,440,461,444,459,447,547,450,564,454,611,457,559,460,538,463,535,467,512,470,483,473,404,477,487,480,623,483,654,487,671,490,670,493,673,496,674,500,675,503,681,506,689,510,694,513,701,516,706,519,706,523,705,526,701,529,697,533,692,536,685,539,676,542,672,546,672,549,669,552,661,556,652,559,651,562,648,565,633,569,609,572,619,575,624,579,594,582,614,585,635,589,633,592,628,595,631,598,640,602,653,605,671,608,680,612,678,615,678,618,684,621,694,625,715,628,728,631,712,635,713,638,734,641,740,644,732,648,732,651,720,654,723,658,730,661,706,664,691,667,748,671,741,674,678,677,750,681,686,684,609,687,588,691,681,694,655,697,641,700,647,704,645,707,713,710,729,714,705,717,685,720,643,723,581,727,691,730,751,733,707,737,716,740,719,743,708,750,733,753,707,756,680,760,680,763,568,766,592,769,674,773,651,776,648,779,707,783,702,829,647,832,658,835,658,32767 + +-1,0,0,105,0,108,90,111,204,115,424,118,607,121,727,125,849,128,979,131,1075,134,1179,138,1215,141,1251,144,1351,148,1458,151,1564,154,1669,157,1753,161,1898,164,2032,167,2108,171,2196,174,2185,177,1962,180,1596,184,1255,187,1317,190,1570,194,1535,197,1111,200,711,204,815,207,909,210,713,213,516,217,433,220,358,223,360,227,419,230,492,233,600,236,582,240,477,243,346,246,228,250,179,253,152,256,88,259,0,263,0,266,114,269,146,273,131,276,0,335,0,338,80,342,99,345,0,404,0,408,70,411,0,421,0,424,66,427,0,467,0,470,66,473,0,480,0,483,69,487,134,490,182,493,222,496,272,500,366,503,557,506,885,510,1272,513,1709,516,2008,519,2017,523,1849,526,1718,529,1787,533,1974,536,2088,539,2209,542,2343,546,2415,549,2508,552,2503,556,2474,559,2464,562,2626,565,2787,569,2792,572,2594,575,2120,579,1889,582,1905,585,1890,589,1799,592,1725,595,1668,598,1646,602,1618,605,1516,608,1391,612,1238,615,1177,618,1092,621,1219,625,1412,628,1491,631,1698,635,1948,638,2085,641,1985,644,1716,648,1392,651,1098,654,792,658,597,661,513,664,535,667,635,671,775,674,757,677,553,681,469,684,384,687,273,691,278,694,148,697,0,700,124,704,166,707,106,710,128,714,142,717,95,720,0,733,0,737,75,740,0,773,0,776,71,779,74,783,70,786,0,789,0,793,67,796,86,799,0,802,0,806,70,809,0,812,68,816,70,819,66,822,0,32767 +-2,0,900,105,746,108,771,111,807,115,829,118,842,121,847,125,855,128,865,131,877,134,886,138,895,141,902,144,905,148,907,151,908,154,906,157,903,161,899,164,895,167,892,171,884,174,877,177,869,180,855,184,839,187,839,190,845,194,846,197,834,200,804,204,818,207,830,210,833,213,813,217,819,220,833,223,830,227,839,230,852,233,854,236,855,240,854,243,841,246,842,250,834,253,848,256,808,259,767,263,789,266,847,269,848,273,872,276,836,335,785,338,826,342,923,345,953,404,851,408,883,411,865,421,874,424,898,427,948,467,859,470,958,473,935,480,814,483,922,487,972,490,995,493,1007,496,903,500,688,503,684,506,695,510,701,513,709,516,714,519,713,523,847,526,1049,529,1049,533,1040,536,1035,539,1028,542,1019,546,1011,549,1002,552,990,556,974,559,964,562,955,565,949,569,947,572,942,575,936,579,928,582,935,585,941,589,940,592,940,595,946,598,952,602,963,605,981,608,1000,612,1021,615,1022,618,826,621,701,625,710,628,715,631,720,635,726,638,735,641,739,644,737,648,732,651,729,654,720,658,714,661,709,664,723,667,900,671,946,674,926,677,916,681,837,684,861,687,846,691,801,694,981,697,825,700,796,704,925,707,906,710,926,714,855,717,747,720,753,733,718,737,784,740,903,773,752,776,807,779,776,783,817,786,811,789,799,793,785,796,815,799,771,802,807,806,823,809,774,812,782,816,786,819,799,822,799,32767 + +-1,0,0,108,0,111,172,115,244,118,346,121,444,125,567,128,695,131,882,134,1068,138,1169,141,1157,144,992,148,787,151,645,154,577,157,526,161,437,164,398,167,461,171,527,174,570,177,612,180,624,184,621,187,608,190,502,194,324,197,227,200,286,204,266,207,227,210,265,213,223,217,267,220,280,223,222,227,224,230,242,233,221,236,208,240,214,243,229,246,210,250,170,253,94,256,0,401,0,404,65,408,71,411,0,414,0,417,79,421,66,424,0,467,0,470,93,473,0,477,71,480,0,483,0,487,78,490,94,493,111,496,168,500,243,503,330,506,422,510,583,513,798,516,1116,519,1469,523,1614,526,1656,529,1693,533,1665,536,1545,539,1405,542,1156,546,920,549,838,552,953,556,1077,559,1051,562,970,565,1026,569,1020,572,981,575,896,579,968,582,1125,585,1068,589,1059,592,868,595,768,598,763,602,733,605,710,608,584,612,602,615,769,618,815,621,860,625,846,628,685,631,554,635,361,638,327,641,270,644,269,648,246,651,201,654,191,658,147,661,201,664,273,667,420,671,706,674,880,677,811,681,703,684,619,687,543,691,296,694,119,697,116,700,73,704,0,707,82,710,88,714,88,717,0,730,0,733,69,737,0,789,0,793,88,796,0,32767 +-2,0,1200,108,950,111,1201,115,1140,118,1138,121,1131,125,1141,128,1149,131,1162,134,1172,138,1178,141,1188,144,1198,148,1212,151,1218,154,1210,157,1206,161,1210,164,1203,167,1181,171,1177,174,1174,177,1169,180,1161,184,1151,187,1143,190,1135,194,1107,197,1081,200,1102,204,1104,207,1078,210,1109,213,1086,217,1107,220,1114,223,1097,227,1106,230,1125,233,1140,236,1155,240,1162,243,1166,246,1174,250,1185,253,1117,256,1094,401,1159,404,1156,408,1161,411,1151,414,1159,417,1176,421,1153,424,1141,467,1111,470,1170,473,1123,477,1206,480,1247,483,1262,487,1290,490,1318,493,1342,496,1331,500,1339,503,1350,506,1365,510,1243,513,1059,516,1063,519,1065,523,1058,526,1053,529,1050,533,1045,536,1036,539,1031,542,1020,546,1008,549,1012,552,1198,556,1313,559,1293,562,1266,565,1261,569,1253,572,1245,575,1234,579,1239,582,1248,585,1246,589,1248,592,1245,595,1254,598,1266,602,1277,605,1294,608,1253,612,1050,615,1041,618,1045,621,1054,625,1063,628,1065,631,1078,635,1078,638,867,641,740,644,945,648,1070,651,904,654,1072,658,1040,661,1056,664,1115,667,1284,671,1266,674,1231,677,1197,681,1158,684,1140,687,1148,691,1188,694,1179,697,1155,700,1193,704,1089,707,1084,710,1074,714,1216,717,1140,730,1330,733,1233,737,1229,789,1154,793,1179,796,1179,32767 + +-1,0,0,59,0,62,68,65,0,69,65,72,74,75,72,78,75,82,72,85,0,92,0,95,66,98,106,102,131,105,102,108,0,111,139,115,302,118,399,121,420,125,447,128,418,131,409,134,354,138,376,141,436,144,470,148,476,151,491,154,532,157,517,161,486,164,482,167,512,171,535,174,483,177,413,180,394,184,420,187,405,190,327,194,272,197,241,200,190,204,114,207,100,210,113,213,100,217,78,220,74,223,120,227,143,230,106,233,96,236,119,240,121,243,124,246,122,250,86,253,0,463,0,467,123,470,123,473,0,477,0,480,92,483,150,487,198,490,255,493,320,496,386,500,433,503,482,506,632,510,984,513,1653,516,2445,519,3143,523,3467,526,3301,529,3141,533,2804,536,2229,539,1533,542,833,546,355,549,223,552,347,556,629,559,628,562,419,565,490,569,450,572,519,575,486,579,519,582,559,585,491,589,479,592,470,595,342,598,241,602,137,605,197,608,427,612,618,615,752,618,738,621,713,625,694,628,742,631,727,635,586,638,355,641,152,644,111,648,92,651,167,654,286,658,300,661,286,664,187,667,94,671,117,674,83,677,75,681,85,684,0,32767 +-2,0,1500,59,1468,62,1479,65,1466,69,1479,72,1486,75,1469,78,1471,82,1494,85,1554,92,1434,95,1457,98,1469,102,1481,105,1468,108,1383,111,1533,115,1462,118,1420,121,1610,125,1515,128,1430,131,1465,134,1488,138,1498,141,1495,144,1503,148,1513,151,1517,154,1505,157,1501,161,1497,164,1486,167,1476,171,1464,174,1454,177,1443,180,1432,184,1428,187,1420,190,1401,194,1393,197,1399,200,1408,204,1529,207,1670,210,1473,213,1486,217,1658,220,1597,223,1439,227,1427,230,1397,233,1402,236,1443,240,1460,243,1463,246,1469,250,1505,253,1545,463,1612,467,1597,470,1545,473,1539,477,1622,480,1562,483,1596,487,1620,490,1637,493,1648,496,1654,500,1660,503,1628,506,1411,510,1375,513,1396,516,1408,519,1410,523,1408,526,1400,529,1398,533,1394,536,1387,539,1377,542,1357,546,1309,549,1272,552,1318,556,1353,559,1409,562,1599,565,1574,569,1580,572,1547,575,1551,579,1560,582,1550,585,1559,589,1562,592,1555,595,1577,598,1529,602,1359,605,1297,608,1351,612,1371,615,1383,618,1388,621,1398,625,1402,628,1407,631,1418,635,1432,638,1405,641,1123,644,1164,648,931,651,1283,654,1424,658,1409,661,1397,664,1349,667,1262,671,1328,674,1389,677,1433,681,1412,684,1412,32767 + +-1,0,0,108,0,111,150,115,420,118,1079,121,1757,125,2193,128,2066,131,1937,134,2119,138,1971,141,1700,144,1673,148,2119,151,2249,154,1922,157,1737,161,1567,164,1165,167,718,171,443,174,383,177,443,180,465,184,439,187,513,190,497,194,536,197,459,200,432,204,439,207,376,210,330,213,301,217,301,220,212,223,201,227,240,230,194,233,152,236,180,240,158,243,157,246,132,250,198,253,180,256,147,259,91,263,0,457,0,460,69,463,153,467,176,470,191,473,157,477,85,480,94,483,0,487,101,490,205,493,332,496,462,500,582,503,738,506,908,510,970,513,884,516,625,519,389,523,316,526,288,529,314,533,331,536,300,539,242,542,168,546,112,549,95,552,124,556,149,559,158,562,190,565,210,569,240,572,266,575,267,579,256,582,239,585,205,589,192,592,194,595,152,598,116,602,91,605,108,608,153,612,134,615,138,618,113,621,123,625,141,628,151,631,186,635,214,638,216,641,180,644,139,648,105,651,114,654,126,658,100,661,0,32767 +-2,0,1800,108,1742,111,1702,115,1674,118,1718,121,1719,125,1728,128,1734,131,1750,134,1776,138,1782,141,1806,144,1817,148,1810,151,1814,154,1817,157,1810,161,1804,164,1798,167,1784,171,1761,174,1742,177,1738,180,1777,184,1972,187,1977,190,1965,194,1940,197,1965,200,1910,204,1923,207,1920,210,1913,213,1931,217,1944,220,1953,223,1953,227,1977,230,1967,233,1934,236,1801,240,1768,243,1804,246,1788,250,1814,253,1813,256,1824,259,1912,263,1934,457,1731,460,1785,463,1823,467,1835,470,1799,473,1810,477,1883,480,1759,483,1621,487,1609,490,1647,493,1655,496,1660,500,1664,503,1674,506,1688,510,1695,513,1708,516,1739,519,1768,523,1602,526,1592,529,1732,533,1721,536,1711,539,1699,542,1690,546,1664,549,1640,552,1647,556,1679,559,1873,562,1910,565,1894,569,1882,572,1872,575,1870,579,1872,582,1864,585,1863,589,1872,592,1876,595,1894,598,1910,602,1814,605,1655,608,1686,612,1696,615,1734,618,1741,621,1791,625,1772,628,1808,631,1825,635,1825,638,1842,641,1856,644,1857,648,1856,651,1826,654,1805,658,1760,661,1760,32767 + +-1,0,0,108,0,111,92,115,123,118,216,121,367,125,570,128,827,131,1090,134,1333,138,1605,141,1880,144,2182,148,2426,151,2720,154,3015,157,3484,161,4058,164,4466,167,4790,171,4923,174,4526,177,3413,180,1996,184,1267,187,1226,190,1289,194,1397,197,1722,200,1827,204,1959,207,1634,210,1604,213,1420,217,1344,220,1174,223,1025,227,765,230,494,233,331,236,449,240,580,243,420,246,388,250,326,253,176,256,219,259,183,263,118,266,108,269,118,273,131,276,101,279,0,282,0,286,66,289,0,335,0,338,66,342,93,345,0,381,0,384,74,388,89,391,101,394,115,398,113,401,113,404,120,408,136,411,137,414,137,417,123,421,96,424,89,427,102,431,92,434,0,487,0,490,78,493,111,496,140,500,166,503,205,506,279,510,359,513,426,516,444,519,458,523,442,526,386,529,357,533,333,536,287,539,231,542,183,546,138,549,132,552,113,556,101,559,117,562,140,565,164,569,160,572,170,575,177,579,141,582,142,585,144,589,111,592,101,595,91,598,67,602,80,605,75,608,83,612,120,615,123,618,120,621,123,625,119,628,93,631,73,635,76,638,66,641,0,32767 +-2,0,2100,108,2119,111,2160,115,2195,118,1996,121,1985,125,2005,128,2027,131,2053,134,2072,138,2085,141,2096,144,2107,148,2117,151,2121,154,2118,157,2114,161,2108,164,2098,167,2086,171,2074,174,2062,177,2045,180,2011,184,1999,187,2199,190,2245,194,2244,197,2221,200,2214,204,2195,207,2206,210,2199,213,2208,217,2207,220,2218,223,2224,227,2241,230,2205,233,2121,236,2234,240,2194,243,2042,246,2083,250,2116,253,2094,256,2187,259,2194,263,2205,266,2192,269,2215,273,2226,276,2229,279,2254,282,2246,286,2207,289,2139,335,2150,338,2180,342,2120,345,2066,381,2255,384,2259,388,2254,391,2141,394,2012,398,2008,401,2010,404,2021,408,2032,411,2023,414,2030,417,2031,421,2013,424,2169,427,2236,431,2166,434,2176,487,1960,490,1983,493,1994,496,1998,500,1997,503,2009,506,2025,510,2040,513,2065,516,2088,519,2098,523,2092,526,2093,529,2086,533,2074,536,2064,539,2043,542,2025,546,2001,549,1996,552,1970,556,1979,559,2184,562,2231,565,2213,569,2202,572,2187,575,2175,579,2191,582,2182,585,2174,589,2198,592,2190,595,2196,598,2246,602,2142,605,1976,608,1992,612,2052,615,2068,618,2097,621,2122,625,2134,628,2158,631,2194,635,2206,638,2221,641,2221,32767 + +-1,0,0,111,0,115,92,118,138,121,187,125,304,128,447,131,523,134,567,138,696,141,793,144,803,148,803,151,750,154,680,157,661,161,725,164,789,167,811,171,841,174,898,177,1054,180,1023,184,1010,187,1091,190,1153,194,1161,197,933,200,717,204,765,207,664,210,676,213,712,217,743,220,774,223,747,227,682,230,634,233,689,236,865,240,674,243,593,246,606,250,597,253,527,256,383,259,284,263,211,266,108,269,111,273,110,276,86,279,0,332,0,335,136,338,75,342,74,345,0,358,0,361,79,365,0,368,80,371,142,375,212,378,254,381,251,384,265,388,261,391,272,394,261,398,245,401,247,404,287,408,316,411,340,414,318,417,278,421,200,424,123,427,87,431,72,434,0,493,0,496,84,500,101,503,123,506,162,510,193,513,210,516,220,519,207,523,171,526,146,529,167,533,199,536,202,539,230,542,248,546,219,549,177,552,124,556,100,559,106,562,113,565,115,569,99,572,97,575,114,579,128,582,113,585,107,589,112,592,101,595,68,598,0,602,0,605,89,608,89,612,102,615,101,618,93,621,75,625,0,32767 +-2,0,2400,111,2444,115,2516,118,2503,121,2309,125,2290,128,2315,131,2343,134,2368,138,2374,141,2389,144,2406,148,2417,151,2421,154,2417,157,2416,161,2409,164,2390,167,2372,171,2351,174,2330,177,2321,180,2294,184,2272,187,2259,190,2250,194,2249,197,2228,200,2207,204,2305,207,2470,210,2481,213,2478,217,2480,220,2476,223,2304,227,2248,230,2269,233,2285,236,2306,240,2332,243,2367,246,2367,250,2413,253,2462,256,2499,259,2497,263,2518,266,2460,269,2325,273,2254,276,2253,279,2217,332,2445,335,2411,338,2501,342,2460,345,2446,358,2481,361,2508,365,2567,368,2556,371,2540,375,2535,378,2532,381,2540,384,2539,388,2543,391,2480,394,2315,398,2290,401,2291,404,2312,408,2314,411,2315,414,2313,417,2310,421,2295,424,2256,427,2248,431,2282,434,2318,493,2299,496,2330,500,2339,503,2348,506,2357,510,2371,513,2391,516,2411,519,2424,523,2433,526,2444,529,2435,533,2415,536,2404,539,2394,542,2379,546,2357,549,2330,552,2294,556,2264,559,2326,562,2456,565,2293,569,2484,572,2504,575,2486,579,2475,582,2497,585,2499,589,2496,592,2497,595,2513,598,2456,602,2264,605,2301,608,2358,612,2404,615,2415,618,2446,621,2482,625,2482,32767 + +-1,0,0,108,0,111,136,115,173,118,195,121,193,125,230,128,456,131,682,134,948,138,1092,141,1202,144,1315,148,1242,151,1201,154,1231,157,1261,161,1289,164,1297,167,1342,171,1261,174,1134,177,973,180,755,184,708,187,824,190,828,194,844,197,901,200,767,204,726,207,626,210,516,213,470,217,518,220,449,223,436,227,444,230,359,233,352,236,419,240,478,243,496,246,558,250,528,253,361,256,287,259,292,263,283,266,263,269,160,273,99,276,0,282,0,286,65,289,0,329,0,332,84,335,148,338,105,342,92,345,0,358,0,361,70,365,88,368,122,371,160,375,215,378,210,381,227,384,258,388,262,391,286,394,384,398,406,401,388,404,397,408,406,411,408,414,387,417,330,421,230,424,148,427,130,431,88,434,67,437,0,477,0,480,71,483,0,490,0,493,98,496,118,500,112,503,141,506,202,510,248,513,253,516,250,519,265,523,299,526,320,529,301,533,309,536,301,539,292,542,259,546,210,549,276,552,297,556,192,559,140,562,157,565,175,569,127,572,122,575,106,579,101,582,109,585,91,589,76,592,65,595,0,598,69,602,80,605,136,608,162,612,145,615,122,618,108,621,91,625,66,628,0,32767 +-2,0,2700,108,2659,111,2679,115,2773,118,2808,121,2710,125,2566,128,2596,131,2629,134,2653,138,2667,141,2683,144,2706,148,2721,151,2728,154,2712,157,2703,161,2698,164,2685,167,2675,171,2657,174,2638,177,2620,180,2633,184,2816,187,2816,190,2807,194,2785,197,2756,200,2761,204,2747,207,2735,210,2749,213,2764,217,2761,220,2770,223,2785,227,2804,230,2808,233,2665,236,2599,240,2614,243,2627,246,2671,250,2733,253,2767,256,2798,259,2805,263,2742,266,2664,269,2836,273,2811,276,2775,282,2770,286,2802,289,2820,329,2679,332,2700,335,2790,338,2811,342,2684,345,2718,358,2679,361,2778,365,2816,368,2808,371,2673,375,2563,378,2660,381,2709,384,2552,388,2618,391,2745,394,2599,398,2584,401,2586,404,2602,408,2606,411,2605,414,2613,417,2613,421,2602,424,2580,427,2609,431,2597,434,2603,437,2603,477,2638,480,2735,483,2606,490,2612,493,2649,496,2656,500,2648,503,2673,506,2698,510,2714,513,2749,516,2779,519,2786,523,2779,526,2773,529,2778,533,2766,536,2748,539,2731,542,2708,546,2674,549,2675,552,2659,556,2606,559,2622,562,2816,565,2837,569,2837,572,2814,575,2806,579,2806,582,2803,585,2796,589,2802,592,2832,595,2841,598,2739,602,2606,605,2633,608,2672,612,2726,615,2783,618,2801,621,2805,625,2740,628,2740,32767 + +-1,0,0,115,0,118,85,121,134,125,215,128,326,131,412,134,469,138,459,141,439,144,415,148,423,151,340,154,388,157,514,161,600,164,718,167,880,171,999,174,1077,177,1056,180,947,184,657,187,477,190,421,194,513,197,469,200,620,204,679,207,566,210,529,213,502,217,492,220,486,223,412,227,363,230,293,233,293,236,342,240,392,243,518,246,482,250,327,253,188,256,161,259,171,263,168,266,215,269,163,273,126,276,73,279,0,329,0,332,111,335,339,338,275,342,174,345,0,361,0,365,76,368,95,371,107,375,145,378,163,381,151,384,177,388,190,391,217,394,266,398,268,401,286,404,299,408,333,411,306,414,316,417,308,421,255,424,168,427,76,431,81,434,68,437,0,477,0,480,97,483,133,487,199,490,218,493,181,496,128,500,128,503,201,506,300,510,439,513,593,516,558,519,425,523,421,526,442,529,459,533,594,536,741,539,914,542,1078,546,1146,549,1133,552,898,556,565,559,359,562,307,565,231,569,321,572,311,575,337,579,381,582,342,585,251,589,206,592,233,595,218,598,138,602,112,605,158,608,211,612,271,615,259,618,233,621,178,625,120,628,88,631,125,635,83,638,0,641,98,644,88,648,0,32767 +-2,0,3000,115,2880,118,2829,121,2840,125,2858,128,2884,131,2916,134,2947,138,2970,141,2987,144,3019,148,3022,151,3047,154,3028,157,3010,161,3002,164,2986,167,2961,171,2945,174,2932,177,2910,180,2890,184,2875,187,3039,190,3095,194,3054,197,3061,200,3036,204,2999,207,3005,210,3026,213,3030,217,3034,220,3040,223,3064,227,3087,230,3098,233,2977,236,2891,240,2897,243,2938,246,2975,250,3008,253,3077,256,3105,259,3097,263,3002,266,2885,269,2868,273,2943,276,2952,279,2927,329,2990,332,2987,335,3022,338,3078,342,3031,345,2914,361,2873,365,3053,368,3102,371,3124,375,3112,378,3101,381,3120,384,3109,388,3094,391,3016,394,2883,398,2862,401,2869,404,2877,408,2900,411,2902,414,2915,417,2912,421,2909,424,2919,427,2904,431,2925,434,2911,437,2931,477,2933,480,3011,483,2953,487,2977,490,2987,493,2993,496,2969,500,2966,503,3003,506,3027,510,3045,513,3061,516,3097,519,3133,523,3135,526,3133,529,3134,533,3112,536,3096,539,3080,542,3060,546,3043,549,3022,552,2984,556,2937,559,2892,562,2905,565,3055,569,3125,572,3136,575,3126,579,3113,582,3116,585,3123,589,3125,592,3114,595,3095,598,2967,602,2900,605,2945,608,2985,612,3075,615,3112,618,3126,621,3144,625,3161,628,3136,631,2987,635,2925,638,2960,641,3026,644,3034,648,3034,32767 + +-1,0,0,125,0,128,68,131,98,134,160,138,195,141,222,144,236,148,248,151,283,154,279,157,264,161,275,164,300,167,314,171,298,174,212,177,199,180,193,184,230,187,283,190,296,194,289,197,315,200,256,204,201,207,278,210,356,213,318,217,291,220,292,223,261,227,210,230,193,233,185,236,149,240,134,243,151,246,170,250,159,253,100,256,0,259,77,263,87,266,110,269,0,329,0,332,80,335,319,338,302,342,137,345,0,365,0,368,88,371,80,375,77,378,120,381,116,384,123,388,114,391,91,394,82,398,76,401,0,404,0,408,70,411,67,414,0,493,0,496,120,500,192,503,192,506,145,510,93,513,111,516,175,519,251,523,281,526,296,529,271,533,227,536,175,539,171,542,192,546,242,549,298,552,321,556,346,559,357,562,343,565,276,569,229,572,203,575,189,579,166,582,151,585,136,589,97,592,111,595,148,598,179,602,200,605,190,608,181,612,130,615,117,618,144,621,160,625,233,628,227,631,211,635,225,638,148,641,125,644,123,648,122,651,90,654,105,658,111,661,102,664,127,667,67,671,0,32767 +-2,0,3300,125,3200,128,3212,131,3206,134,3253,138,3262,141,3290,144,3316,148,3324,151,3320,154,3319,157,3308,161,3295,164,3280,167,3268,171,3250,174,3199,177,3184,180,3245,184,3385,187,3379,190,3361,194,3345,197,3307,200,3296,204,3294,207,3277,210,3295,213,3301,217,3305,220,3322,223,3352,227,3383,230,3399,233,3401,236,3262,240,3190,243,3239,246,3281,250,3311,253,3381,256,3445,259,3408,263,3302,266,3248,269,3347,329,3277,332,3167,335,3257,338,3286,342,3195,345,3166,365,3366,368,3347,371,3252,375,3331,378,3370,381,3396,384,3388,388,3383,391,3288,394,3260,398,3414,401,3389,404,3202,408,3180,411,3184,414,3212,493,3347,496,3324,500,3334,503,3364,506,3375,510,3386,513,3319,516,3136,519,3134,523,3135,526,3138,529,3129,533,3116,536,3090,539,3186,542,3372,546,3370,549,3337,552,3303,556,3261,559,3221,562,3193,565,3165,569,3143,572,3132,575,3127,579,3120,582,3121,585,3151,589,3303,592,3192,595,3150,598,3182,602,3214,605,3287,608,3346,612,3301,615,3124,618,3141,621,3140,625,3193,628,3229,631,3254,635,3301,638,3362,641,3370,644,3362,648,3305,651,3240,654,3236,658,3211,661,3192,664,3310,667,3339,671,3339,32767 + +-1,0,0,125,0,128,70,131,0,134,112,138,128,141,163,144,185,148,146,151,133,154,140,157,162,161,193,164,235,167,275,171,252,174,188,177,142,180,143,184,163,187,167,190,168,194,154,197,145,200,187,204,223,207,215,210,206,213,158,217,187,220,207,223,163,227,109,230,98,233,100,236,91,240,77,243,120,246,142,250,128,253,73,256,81,259,69,263,71,266,0,332,0,335,155,338,209,342,146,345,91,348,65,352,0,490,0,493,67,496,95,500,125,503,140,506,151,510,123,513,80,516,69,519,86,523,95,526,104,529,117,533,104,536,79,539,76,542,89,546,130,549,159,552,177,556,127,559,140,562,161,565,127,569,106,572,109,575,108,579,92,582,75,585,0,589,0,592,65,595,0,598,71,602,133,605,174,608,130,612,124,615,105,618,82,621,108,625,169,628,162,631,138,635,98,638,116,641,93,644,0,648,0,651,71,654,80,658,72,661,70,664,67,667,0,32767 +-2,0,3600,125,3724,128,3744,131,3600,134,3545,138,3557,141,3588,144,3615,148,3631,151,3649,154,3626,157,3609,161,3589,164,3569,167,3555,171,3536,174,3507,177,3480,180,3514,184,3671,187,3666,190,3633,194,3617,197,3590,200,3575,204,3559,207,3558,210,3571,213,3566,217,3583,220,3604,223,3626,227,3661,230,3664,233,3507,236,3628,240,3601,243,3552,246,3568,250,3603,253,3519,256,3630,259,3737,263,3601,266,3516,332,3676,335,3594,338,3565,342,3539,345,3567,348,3560,352,3563,490,3641,493,3668,496,3660,500,3667,503,3692,506,3700,510,3725,513,3605,516,3484,519,3491,523,3494,526,3490,529,3471,533,3468,536,3527,539,3731,542,3737,546,3694,549,3684,552,3633,556,3571,559,3540,562,3518,565,3510,569,3703,572,3745,575,3733,579,3731,582,3726,585,3669,589,3466,592,3460,595,3471,598,3514,602,3552,605,3624,608,3681,612,3710,615,3639,618,3495,621,3517,625,3557,628,3583,631,3644,635,3703,638,3687,641,3711,644,3749,648,3700,651,3646,654,3580,658,3525,661,3553,664,3667,667,3667,32767 + +-1,0,0,111,0,115,91,118,149,121,144,125,161,128,117,131,118,134,202,138,236,141,226,144,298,148,379,151,447,154,425,157,373,161,387,164,351,167,243,171,174,174,178,177,173,180,156,184,153,187,159,190,181,194,207,197,210,200,160,204,120,207,111,210,132,213,117,217,122,220,129,223,144,227,176,230,186,233,132,236,79,240,72,243,88,246,65,250,0,253,65,256,0,335,0,338,74,342,0,345,0,348,66,352,0,365,0,368,65,371,0,375,0,378,66,381,0,384,0,388,66,391,89,394,72,398,74,401,91,404,79,408,88,411,86,414,70,417,75,421,0,490,0,493,79,496,91,500,102,503,100,506,109,510,132,513,133,516,114,519,116,523,94,526,0,529,0,533,76,536,104,539,101,542,0,546,0,549,70,552,102,556,134,559,187,562,176,565,147,569,148,572,109,575,78,579,0,589,0,592,70,595,81,598,112,602,133,605,86,608,0,612,70,615,144,618,160,621,140,625,102,628,104,631,82,635,0,32767 +-2,0,3900,111,3881,115,3855,118,3913,121,3967,125,3991,128,3963,131,3782,134,3836,138,3858,141,3885,144,3912,148,3927,151,3935,154,3927,157,3919,161,3912,164,3893,167,3848,171,3805,174,3802,177,3822,180,4017,184,3984,187,3932,190,3921,194,3911,197,3883,200,3861,204,3818,207,3815,210,3845,213,3845,217,3863,220,3883,223,3903,227,3918,230,3939,233,3989,236,4017,240,3905,243,3829,246,3879,250,3960,253,3957,256,3883,335,3821,338,3843,342,3925,345,3926,348,3896,352,3932,365,3900,368,3952,371,3973,375,3976,378,3942,381,3951,384,3979,388,3976,391,3975,394,4021,398,4030,401,4013,404,3999,408,3861,411,4026,414,4079,417,4048,421,4041,490,3950,493,3979,496,3988,500,3998,503,4023,506,4037,510,3992,513,3803,516,3803,519,3836,523,3825,526,3781,529,3820,533,3802,536,3782,539,3779,542,3833,546,3868,549,3859,552,3951,556,3919,559,3879,562,3834,565,3787,569,3781,572,3752,575,3736,579,3732,589,3948,592,3796,595,3783,598,3820,602,3853,605,3937,608,3896,612,3735,615,3805,618,3836,621,3865,625,3932,628,3930,631,3899,635,3899,32767 + +-1,0,0,125,0,128,100,131,133,134,188,138,190,141,126,144,130,148,134,151,129,154,142,157,132,161,184,164,180,167,156,171,178,174,191,177,189,180,169,184,124,187,110,190,114,194,111,197,108,200,122,204,92,207,0,210,82,213,84,217,89,220,87,223,68,227,0,332,0,335,72,338,123,342,74,345,0,401,0,404,70,408,108,411,114,414,128,417,107,421,0,503,0,506,71,510,174,513,295,516,318,519,321,523,387,526,416,529,380,533,325,536,215,539,88,542,81,546,85,549,92,552,133,556,72,559,0,569,0,572,73,575,0,32767 +-2,0,4200,125,3975,128,4057,131,4076,134,4114,138,4146,141,4203,144,4216,148,4227,151,4249,154,4231,157,4233,161,4204,164,4189,167,4146,171,4120,174,4100,177,4079,180,4088,184,4198,187,4230,190,4212,194,4179,197,4151,200,4152,204,4118,207,4066,210,4135,213,4110,217,4124,220,4160,223,4186,227,4202,332,4252,335,4247,338,4249,342,4208,345,4296,401,4233,404,4091,408,4079,411,4069,414,4082,417,4077,421,4065,503,4023,506,4016,510,4070,513,4110,516,4141,519,4188,523,4193,526,4189,529,4177,533,4159,536,4152,539,4157,542,4177,546,4237,549,4368,552,4294,556,4272,559,4249,569,4086,572,4108,575,4108,32767 + +-1,0,0,138,0,141,73,144,102,148,121,151,130,154,129,157,124,161,123,164,100,167,0,180,0,184,87,187,101,190,99,194,81,197,0,204,0,207,79,210,0,227,0,230,96,233,119,236,103,240,66,243,0,246,0,250,89,253,90,256,0,335,0,338,85,342,90,345,0,506,0,510,86,513,130,516,104,519,0,526,0,529,79,533,97,536,112,539,133,542,158,546,160,549,124,552,84,556,69,559,0,598,0,602,87,605,102,608,0,612,0,615,96,618,102,621,74,625,0,32767 +-2,0,4500,138,4465,141,4481,144,4500,148,4519,151,4532,154,4530,157,4523,161,4510,164,4486,167,4439,180,4421,184,4558,187,4520,190,4510,194,4490,197,4437,204,4483,207,4570,210,4636,227,4471,230,4508,233,4552,236,4594,240,4641,243,4584,246,4461,250,4521,253,4585,256,4641,335,4588,338,4528,342,4445,345,4505,506,4360,510,4401,513,4439,516,4475,519,4527,526,4528,529,4507,533,4491,536,4479,539,4451,542,4415,546,4395,549,4369,552,4356,556,4424,559,4479,598,4478,602,4485,605,4538,608,4548,612,4481,615,4480,618,4511,621,4514,625,4514,32767 + +-1,0,0,148,0,151,65,154,0,210,0,213,73,217,67,220,78,223,0,240,0,243,67,246,0,259,0,263,65,266,0,332,0,335,89,338,70,342,0,506,0,510,66,513,0,533,0,536,67,539,0,556,0,559,66,562,65,565,0,579,0,582,73,585,0,32767 +-2,0,4800,148,4816,151,4838,154,4822,210,4818,213,4824,217,4697,220,4710,223,4722,240,4699,243,4685,246,4768,259,4666,263,4717,266,4800,332,4950,335,4829,338,4876,342,4892,506,4704,510,4739,513,4757,533,4847,536,4821,539,4788,556,4899,559,4839,562,4792,565,4735,579,4653,582,4684,585,4684,32767 + +-1,0,0,115,0,118,87,121,112,125,104,128,71,131,0,138,0,141,69,144,129,148,186,151,135,154,104,157,100,161,105,164,86,167,70,171,0,174,77,177,100,180,92,184,87,187,86,190,90,194,0,223,0,227,66,230,0,342,0,345,65,348,0,470,0,473,81,477,104,480,83,483,90,487,92,490,0,496,0,500,68,503,89,506,102,510,94,513,70,516,0,32767 +-2,0,5100,115,5102,118,5043,121,5072,125,5122,128,5186,131,5158,138,5055,141,5078,144,5112,148,5125,151,5156,154,5154,157,5132,161,5098,164,5042,167,5015,171,4988,174,5073,177,5204,180,5168,184,5115,187,5075,190,5040,194,5002,223,5007,227,5045,230,5047,342,5035,345,5128,348,5196,470,5027,473,5113,477,5098,480,5071,483,5117,487,5162,490,5106,496,5001,500,5006,503,5028,506,5057,510,5080,513,5115,516,5115,32767 + +-1,0,0,141,0,144,65,148,99,151,125,154,133,157,116,161,89,164,81,167,83,171,87,174,82,177,81,180,91,184,112,187,114,190,85,194,0,493,0,496,66,500,0,503,70,506,73,510,68,513,74,516,0,32767 +-2,0,5400,141,5399,144,5424,148,5444,151,5446,154,5437,157,5434,161,5412,164,5356,167,5336,171,5305,174,5272,177,5297,180,5425,184,5401,187,5363,190,5333,194,5294,493,5316,496,5335,500,5355,503,5365,506,5388,510,5420,513,5448,516,5448,32767 + +-1,0,0,32767 +-2,0,5700,32767 + +-1,0,0,32767 +-2,0,6000,32767 + +-1,0,0,32767 +-2,0,6300,32767 + +-1,0,0,125,0,128,74,131,0,134,66,138,0,161,0,164,66,167,71,171,74,174,69,177,0,190,0,194,66,197,78,200,79,204,0,207,65,210,72,213,0,227,0,230,70,233,80,236,114,240,95,243,88,246,73,250,0,487,0,490,65,493,0,549,0,552,66,556,0,582,0,585,71,589,71,592,79,595,67,598,0,615,0,618,79,621,0,32767 +-2,0,6600,125,6545,128,6605,131,6715,134,6654,138,6566,161,6556,164,6587,167,6649,171,6717,174,6719,177,6677,190,6695,194,6667,197,6647,200,6630,204,6546,207,6549,210,6613,213,6615,227,6740,230,6736,233,6674,236,6612,240,6676,243,6624,246,6544,250,6618,487,6577,490,6595,493,6633,549,6660,552,6613,556,6524,582,6526,585,6542,589,6538,592,6579,595,6626,598,6678,615,6540,618,6612,621,6612,32767 + +-1,0,0,125,0,128,89,131,117,134,0,138,142,141,189,144,169,148,107,151,86,154,130,157,138,161,232,164,235,167,124,171,116,174,155,177,197,180,155,184,108,187,74,190,77,194,92,197,109,200,122,204,134,207,134,210,126,213,139,217,183,220,198,223,123,227,82,230,111,233,159,236,229,240,168,243,86,246,132,250,137,253,0,256,82,259,149,263,162,266,110,269,0,371,0,375,72,378,0,483,0,487,68,490,0,493,82,496,86,500,78,503,68,506,73,510,0,513,72,516,75,519,0,529,0,533,84,536,82,539,0,572,0,575,81,579,84,582,82,585,89,589,83,592,0,32767 +-2,0,6900,125,6861,128,6895,131,6876,134,6749,138,6855,141,6880,144,6897,148,6849,151,6839,154,6913,157,6921,161,6898,164,6902,167,6947,171,7004,174,7014,177,6959,180,6902,184,6866,187,6993,190,7009,194,6948,197,6887,200,6903,204,6875,207,6832,210,6846,213,6877,217,6873,220,6917,223,6975,227,7028,230,6851,233,6833,236,6904,240,6939,243,6914,246,6864,250,6908,253,6941,256,6839,259,6868,263,6940,266,6910,269,6836,371,6798,375,6874,378,6935,483,6846,487,6889,490,6923,493,6953,496,6982,500,7013,503,7040,506,7043,510,7022,513,6880,516,6928,519,6962,529,6958,533,6911,536,6882,539,6836,572,6872,575,6870,579,6846,582,6832,585,6849,589,6858,592,6858,32767 + +-1,0,0,128,0,131,66,134,94,138,113,141,109,144,122,148,86,151,0,154,91,157,109,161,179,164,230,167,155,171,120,174,110,177,133,180,154,184,111,187,77,190,67,194,91,197,159,200,185,204,166,207,122,210,125,213,84,217,95,220,115,223,71,227,0,230,70,233,98,236,114,240,100,243,78,246,88,250,77,253,0,256,69,259,89,263,83,266,0,368,0,371,80,375,122,378,78,381,0,384,0,388,105,391,141,394,127,398,128,401,140,404,175,408,201,411,194,414,197,417,206,421,156,424,87,427,0,480,0,483,74,487,89,490,84,493,116,496,102,500,86,503,0,506,116,510,149,513,161,516,147,519,113,523,73,526,0,529,0,533,86,536,80,539,0,32767 +-2,0,7200,128,7196,131,7271,134,7228,138,7134,141,7174,144,7201,148,7253,151,7320,154,7242,157,7228,161,7200,164,7168,167,7119,171,7084,174,7079,177,7216,180,7176,184,7122,187,7068,190,7064,194,7119,197,7184,200,7190,204,7124,207,7075,210,7148,213,7160,217,7123,220,7187,223,7242,227,7107,230,7067,233,7113,236,7207,240,7245,243,7205,246,7158,250,7247,253,7189,256,7120,259,7202,263,7264,266,7177,368,7045,371,7091,375,7148,378,7235,381,7175,384,7072,388,7089,391,7141,394,7147,398,7161,401,7191,404,7225,408,7237,411,7238,414,7255,417,7256,421,7236,424,7283,427,7256,480,7217,483,7180,487,7200,490,7271,493,7283,496,7301,500,7255,503,7165,506,7095,510,7112,513,7168,516,7272,519,7303,523,7336,526,7321,529,7319,533,7265,536,7218,539,7218,32767 + +-1,0,0,118,0,121,73,125,0,128,0,131,88,134,67,138,149,141,136,144,119,148,109,151,65,154,103,157,97,161,150,164,150,167,87,171,92,174,110,177,110,180,94,184,98,187,80,190,76,194,68,197,81,200,0,204,0,207,82,210,111,213,109,217,0,220,90,223,66,227,0,230,0,233,95,236,131,240,119,243,75,246,88,250,79,253,0,256,66,259,84,263,0,384,0,388,73,391,0,408,0,411,99,414,91,417,66,421,80,424,86,427,79,431,0,480,0,483,81,487,116,490,105,493,93,496,102,500,76,503,0,506,68,510,121,513,153,516,97,519,0,523,0,526,78,529,0,533,65,536,0,549,0,552,104,556,130,559,89,562,70,565,92,569,114,572,115,575,140,579,127,582,113,585,153,589,170,592,152,595,107,598,0,602,77,605,89,608,0,621,0,625,67,628,0,32767 +-2,0,7500,118,7539,121,7570,125,7586,128,7492,131,7521,134,7513,138,7488,141,7453,144,7514,148,7502,151,7412,154,7485,157,7524,161,7522,164,7447,167,7382,171,7463,174,7593,177,7542,180,7455,184,7481,187,7589,190,7524,194,7502,197,7472,200,7437,204,7569,207,7487,210,7429,213,7454,217,7401,220,7477,223,7555,227,7618,230,7585,233,7489,236,7499,240,7532,243,7490,246,7463,250,7554,253,7528,256,7442,259,7500,263,7599,384,7608,388,7528,391,7402,408,7534,411,7519,414,7542,417,7538,421,7486,424,7422,427,7410,431,7429,480,7580,483,7461,487,7505,490,7459,493,7485,496,7607,500,7618,503,7510,506,7415,510,7460,513,7504,516,7609,519,7555,523,7523,526,7512,529,7527,533,7595,536,7565,549,7540,552,7592,556,7524,559,7464,562,7529,565,7591,569,7532,572,7498,575,7488,579,7461,582,7452,585,7480,589,7482,592,7496,595,7538,598,7587,602,7482,605,7522,608,7575,621,7386,625,7473,628,7473,32767 + +-1,0,0,118,0,121,87,125,0,128,66,131,66,134,106,138,170,141,163,144,152,148,133,151,78,154,92,157,114,161,141,164,140,167,91,171,96,174,108,177,134,180,160,184,144,187,83,190,79,194,115,197,131,200,158,204,139,207,81,210,91,213,95,217,77,220,95,223,88,227,68,230,0,233,69,236,87,240,92,243,90,246,86,250,0,256,0,259,84,263,72,266,0,358,0,361,79,365,0,384,0,388,92,391,79,394,0,398,84,401,125,404,81,408,71,411,95,414,75,417,0,477,0,480,69,483,78,487,128,490,123,493,0,496,83,500,93,503,114,506,165,510,154,513,127,516,0,519,0,523,66,526,71,529,0,539,0,542,72,546,74,549,86,552,83,556,93,559,86,562,0,572,0,575,70,579,72,582,89,585,99,589,87,592,70,595,0,32767 +-2,0,7800,118,7856,121,7843,125,7834,128,7797,131,7831,134,7835,138,7736,141,7773,144,7799,148,7813,151,7746,154,7777,157,7821,161,7822,164,7754,167,7678,171,7747,174,7891,177,7843,180,7764,184,7748,187,7847,190,7826,194,7769,197,7735,200,7742,204,7809,207,7794,210,7702,213,7711,217,7696,220,7777,223,7830,227,7866,230,7868,233,7802,236,7804,240,7805,243,7746,246,7749,250,7706,256,7744,259,7812,263,7745,266,7690,358,7841,361,7816,365,7877,384,7908,388,7817,391,7759,394,7859,398,7805,401,7790,404,7823,408,7828,411,7817,414,7856,417,7818,477,7764,480,7722,483,7730,487,7832,490,7815,493,7619,496,7823,500,7760,503,7713,506,7768,510,7798,513,7775,516,7634,519,7673,523,7687,526,7767,529,7886,539,7845,542,7794,546,7703,549,7710,552,7818,556,7803,559,7779,562,7890,572,7835,575,7786,579,7765,582,7781,585,7799,589,7808,592,7823,595,7823,32767 + +-1,0,0,118,0,121,65,125,0,131,0,134,97,138,131,141,70,144,79,148,132,151,108,154,73,157,82,161,84,164,98,167,78,171,114,174,149,177,146,180,136,184,115,187,99,190,101,194,114,197,137,200,91,204,103,207,108,210,97,213,102,217,97,220,103,223,94,227,0,230,0,233,86,236,118,240,109,243,89,246,90,250,66,253,0,256,0,259,71,263,70,266,81,269,0,381,0,384,69,388,113,391,92,394,0,398,68,401,146,404,129,408,107,411,111,414,85,417,80,421,84,424,74,427,0,487,0,490,81,493,123,496,118,500,127,503,142,506,145,510,101,513,0,516,0,519,71,523,71,526,0,536,0,539,90,542,133,546,115,549,121,552,155,556,141,559,86,562,80,565,93,569,115,572,97,575,119,579,106,582,145,585,194,589,160,592,125,595,97,598,75,602,105,605,130,608,102,612,73,615,0,618,0,621,75,625,0,32767 +-2,0,8100,118,8184,121,8081,125,8138,131,8110,134,8067,138,8085,141,8022,144,8115,148,8160,151,8068,154,8013,157,8110,161,8154,164,8055,167,8105,171,8211,174,8179,177,8134,180,8050,184,8051,187,8118,190,8092,194,8048,197,8047,200,7987,204,8072,207,8192,210,8153,213,8074,217,8166,220,8062,223,8076,227,8018,230,8029,233,8078,236,8078,240,8106,243,8070,246,8071,250,8164,253,8089,256,8055,259,8117,263,8052,266,8007,269,8110,381,8198,384,8188,388,8091,391,8008,394,7970,398,7992,401,8077,404,8098,408,8119,411,8104,414,8141,417,8119,421,8075,424,8010,427,8103,487,8004,490,7958,493,7991,496,7979,500,8006,503,8048,506,8092,510,8145,513,8074,516,7978,519,8051,523,8061,526,8045,536,8199,539,8201,542,8135,546,8068,549,8039,552,8134,556,8157,559,8080,562,8188,565,8224,569,8148,572,8138,575,8099,579,8070,582,8097,585,8123,589,8115,592,8132,595,8122,598,8000,602,8064,605,8086,608,8047,612,8148,615,8279,618,8146,621,8128,625,8128,32767 + +-1,0,0,125,0,128,69,131,0,134,0,138,78,141,73,144,0,148,70,151,0,157,0,161,113,164,139,167,91,171,115,174,168,177,159,180,128,184,105,187,80,190,78,194,153,197,173,200,106,204,139,207,134,210,84,213,118,217,108,220,87,223,93,227,73,230,0,233,105,236,114,240,96,243,80,246,81,250,0,378,0,381,65,384,67,388,105,391,81,394,0,398,0,401,110,404,104,408,84,411,72,414,0,487,0,490,66,493,94,496,72,500,0,513,0,516,90,519,191,523,253,526,192,529,116,533,85,536,0,539,95,542,173,546,211,549,225,552,235,556,202,559,133,562,96,565,87,569,164,572,150,575,193,579,147,582,192,585,285,589,230,592,152,595,141,598,148,602,142,605,158,608,187,612,134,615,105,618,143,621,112,625,70,628,0,32767 +-2,0,8400,125,8534,128,8437,131,8435,134,8384,138,8316,141,8350,144,8454,148,8451,151,8344,157,8446,161,8421,164,8362,167,8276,171,8331,174,8460,177,8417,180,8351,184,8332,187,8381,190,8377,194,8340,197,8332,200,8456,204,8461,207,8457,210,8420,213,8352,217,8452,220,8358,223,8365,227,8424,230,8467,233,8363,236,8377,240,8406,243,8337,246,8375,250,8478,378,8493,381,8460,384,8475,388,8386,391,8295,394,8401,398,8458,401,8362,404,8364,408,8411,411,8391,414,8301,487,8328,490,8301,493,8338,496,8314,500,8317,513,8247,516,8284,519,8367,523,8386,526,8376,529,8341,533,8297,536,8322,539,8498,542,8471,546,8426,549,8379,552,8428,556,8458,559,8418,562,8312,565,8451,569,8452,572,8473,575,8413,579,8366,582,8394,585,8426,589,8436,592,8467,595,8435,598,8331,602,8362,605,8403,608,8361,612,8345,615,8321,618,8363,621,8462,625,8479,628,8479,32767 + +-1,0,0,144,0,148,75,151,75,154,0,157,0,161,74,164,109,167,72,171,129,174,147,177,117,180,98,184,85,187,0,190,106,194,138,197,148,200,101,204,164,207,176,210,85,213,72,217,80,220,0,223,86,227,71,230,0,233,78,236,113,240,79,243,88,246,137,250,88,253,87,256,98,259,87,263,65,266,0,384,0,388,71,391,72,394,0,398,0,401,120,404,119,408,96,411,77,414,0,424,0,427,72,431,0,470,0,473,69,477,0,500,0,503,74,506,116,510,84,513,68,516,122,519,131,523,98,526,69,529,69,533,116,536,80,539,80,542,139,546,165,549,209,552,160,556,164,559,132,562,117,565,81,569,134,572,137,575,185,579,144,582,177,585,259,589,209,592,129,595,96,598,118,602,142,605,145,608,152,612,133,615,150,618,147,621,90,625,0,32767 +-2,0,8700,144,8786,148,8797,151,8782,154,8793,157,8729,161,8733,164,8670,167,8715,171,8757,174,8762,177,8708,180,8661,184,8744,187,8780,190,8703,194,8618,197,8604,200,8708,204,8748,207,8730,210,8709,213,8621,217,8735,220,8612,223,8645,227,8625,230,8583,233,8604,236,8651,240,8681,243,8650,246,8652,250,8607,253,8620,256,8674,259,8725,263,8667,266,8641,384,8750,388,8665,391,8598,394,8557,398,8572,401,8647,404,8659,408,8696,411,8678,414,8705,424,8747,427,8764,431,8725,470,8735,473,8654,477,8672,500,8726,503,8728,506,8768,510,8732,513,8588,516,8629,519,8695,523,8743,526,8725,529,8677,533,8655,536,8580,539,8673,542,8798,546,8765,549,8701,552,8774,556,8729,559,8722,562,8630,565,8552,569,8726,572,8772,575,8710,579,8695,582,8718,585,8737,589,8749,592,8779,595,8744,598,8648,602,8689,605,8747,608,8710,612,8660,615,8657,618,8705,621,8736,625,8736,32767 + +-1,0,0,125,0,128,72,131,0,167,0,171,104,174,89,177,99,180,111,184,0,187,0,190,79,194,125,197,117,200,80,204,124,207,135,210,92,213,66,217,0,220,0,223,80,227,76,230,0,233,95,236,136,240,91,243,92,246,140,250,94,253,0,256,69,259,0,398,0,401,82,404,78,408,83,411,66,414,0,496,0,500,87,503,122,506,137,510,76,513,73,516,92,519,109,523,112,526,97,529,96,533,145,536,130,539,128,542,99,546,95,549,140,552,112,556,145,559,91,562,83,565,0,572,0,575,106,579,68,582,125,585,152,589,109,592,66,595,0,598,0,602,90,605,90,608,83,612,66,615,100,618,85,621,0,32767 +-2,0,9000,125,9124,128,9047,131,8984,167,8979,171,9040,174,9029,177,8980,180,8965,184,9018,187,9062,190,8973,194,8926,197,8922,200,8983,204,8986,207,9043,210,9080,213,9054,217,9031,220,8880,223,8928,227,8961,230,9042,233,8933,236,8948,240,8975,243,8937,246,8955,250,8925,253,8908,256,8996,259,9045,398,8914,401,8944,404,8950,408,8994,411,8964,414,8991,496,9170,500,9040,503,9022,506,9064,510,9092,513,8979,516,8976,519,9048,523,9069,526,9043,529,9037,533,9004,536,8918,539,8895,542,8864,546,8913,549,9023,552,9097,556,9042,559,9062,562,8918,565,8897,572,9077,575,8996,579,8849,582,8907,585,9049,589,9058,592,9112,595,9051,598,8929,602,9029,605,9059,608,9057,612,9003,615,8999,618,9035,621,9035,32767 + +-1,0,0,125,0,128,91,131,0,134,0,138,103,141,98,144,94,148,71,151,0,154,0,157,68,161,102,164,140,167,113,171,155,174,186,177,124,180,0,184,85,187,69,190,0,194,113,197,174,200,140,204,194,207,236,210,190,213,121,217,124,220,118,223,85,227,93,230,114,233,114,236,125,240,102,243,80,246,106,250,0,401,0,404,79,408,0,500,0,503,71,506,68,510,0,513,101,516,110,519,0,529,0,533,69,536,0,539,81,542,67,546,0,549,65,552,70,556,83,559,75,562,81,565,68,569,83,572,101,575,147,579,120,582,133,585,195,589,191,592,109,595,0,598,0,602,90,605,72,608,77,612,98,615,104,618,0,32767 +-2,0,9300,125,9414,128,9293,131,9332,134,9433,138,9334,141,9254,144,9241,148,9292,151,9410,154,9406,157,9324,161,9244,164,9279,167,9267,171,9332,174,9377,177,9353,180,9414,184,9375,187,9317,190,9287,194,9388,197,9385,200,9385,204,9292,207,9302,210,9349,213,9328,217,9371,220,9370,223,9267,227,9251,230,9297,233,9230,236,9246,240,9264,243,9205,246,9261,250,9199,401,9218,404,9256,408,9277,500,9330,503,9368,506,9373,510,9198,513,9257,516,9304,519,9414,529,9396,533,9332,536,9265,539,9242,542,9312,546,9432,549,9325,552,9229,556,9334,559,9376,562,9231,565,9231,569,9385,572,9368,575,9312,579,9299,582,9353,585,9359,589,9356,592,9409,595,9467,598,9437,602,9363,605,9409,608,9269,612,9201,615,9306,618,9306,32767 + +-1,0,0,115,0,118,65,121,0,125,91,128,150,131,82,134,97,138,152,141,161,144,182,148,125,151,102,154,79,157,148,161,171,164,233,167,225,171,283,174,306,177,188,180,161,184,239,187,229,190,152,194,132,197,205,200,210,204,264,207,278,210,260,213,200,217,165,220,157,223,119,227,91,230,111,233,126,236,149,240,105,243,109,246,166,250,115,253,87,256,99,259,0,263,66,266,118,269,70,273,0,381,0,384,73,388,65,391,101,394,89,398,73,401,0,404,72,408,76,411,0,493,0,496,70,500,82,503,72,506,80,510,89,513,170,516,162,519,81,523,0,526,0,529,106,533,137,536,131,539,134,542,82,546,0,549,106,552,116,556,125,559,97,562,144,565,117,569,73,572,88,575,135,579,145,582,157,585,161,589,155,592,100,595,0,598,0,602,89,605,0,608,0,612,113,615,99,618,0,621,77,625,79,628,0,32767 +-2,0,9600,115,9591,118,9631,121,9687,125,9711,128,9619,131,9584,134,9551,138,9514,141,9542,144,9559,148,9480,151,9545,154,9698,157,9614,161,9544,164,9575,167,9567,171,9619,174,9650,177,9532,180,9552,184,9632,187,9594,190,9562,194,9651,197,9668,200,9665,204,9575,207,9577,210,9611,213,9589,217,9681,220,9689,223,9691,227,9601,230,9604,233,9515,236,9528,240,9547,243,9528,246,9531,250,9516,253,9531,256,9610,259,9693,263,9615,266,9584,269,9523,273,9602,381,9602,384,9595,388,9596,391,9680,394,9730,398,9692,401,9545,404,9536,408,9602,411,9714,493,9611,496,9629,500,9654,503,9704,506,9691,510,9545,513,9611,516,9654,519,9592,523,9464,526,9650,529,9721,533,9698,536,9638,539,9575,542,9608,546,9744,549,9623,552,9581,556,9662,559,9709,562,9583,565,9517,569,9651,572,9689,575,9646,579,9623,582,9643,585,9673,589,9669,592,9686,595,9496,598,9504,602,9590,605,9532,608,9565,612,9548,615,9645,618,9727,621,9631,625,9599,628,9599,32767 + +-1,0,0,131,0,134,83,138,188,141,175,144,153,148,172,151,186,154,119,157,153,161,203,164,224,167,274,171,317,174,219,177,92,180,96,184,161,187,120,190,76,194,175,197,300,200,232,204,247,207,247,210,238,213,231,217,206,220,235,223,226,227,135,230,200,233,199,236,132,240,115,243,116,246,124,250,109,253,85,256,88,259,0,263,0,266,88,269,0,388,0,391,82,394,0,398,0,401,81,404,125,408,122,411,0,414,71,417,73,421,0,424,0,427,75,431,0,483,0,487,78,490,91,493,128,496,136,500,86,503,66,506,135,510,170,513,166,516,118,519,70,523,0,526,79,529,127,533,120,536,135,539,137,542,82,546,0,549,93,552,81,556,75,559,0,562,94,565,74,569,0,572,66,575,78,579,84,582,104,585,101,589,101,592,0,595,0,598,82,602,86,605,68,608,72,612,0,32767 +-2,0,9900,131,9748,134,9742,138,9810,141,9859,144,9834,148,9785,151,9816,154,9813,157,9827,161,9855,164,9858,167,9883,171,9911,174,9964,177,9808,180,9828,184,9923,187,9885,190,9877,194,9889,197,9921,200,9932,204,9866,207,9855,210,9895,213,9858,217,9952,220,9959,223,9969,227,9903,230,9888,233,9968,236,9923,240,9852,243,9839,246,9812,250,9834,253,9838,256,9906,259,10011,263,9941,266,9873,269,9837,388,9714,391,9840,394,9987,398,9966,401,9830,404,9823,408,9878,411,9810,414,9868,417,9901,421,9858,424,9835,427,9894,431,9865,483,9906,487,9878,490,9893,493,9948,496,9966,500,9857,503,9811,506,9812,510,9838,513,9935,516,10003,519,9963,523,9836,526,9937,529,9842,533,9985,536,9971,539,9917,542,9962,546,10072,549,9948,552,9906,556,9841,559,9920,562,9869,565,9846,569,9965,572,10002,575,9984,579,9935,582,9946,585,9992,589,9983,592,9973,595,9790,598,9844,602,9900,605,9883,608,9903,612,9903,32767 + +-1,0,0,131,0,134,81,138,141,141,146,144,181,148,181,151,170,154,93,157,104,161,161,164,163,167,145,171,196,174,211,177,197,180,192,184,227,187,156,190,114,194,152,197,266,200,241,204,233,207,134,210,141,213,149,217,109,220,114,223,159,227,108,230,138,233,127,236,84,240,89,243,89,246,154,250,196,253,131,256,109,259,85,263,0,266,66,269,0,381,0,384,69,388,103,391,119,394,95,398,0,408,0,411,77,414,112,417,104,421,0,493,0,496,66,500,134,503,105,506,98,510,96,513,94,516,97,519,98,523,137,526,121,529,171,533,176,536,96,539,0,542,82,546,0,549,122,552,121,556,116,559,0,562,106,565,103,569,0,572,68,575,77,579,133,582,139,585,94,589,85,592,95,595,88,598,108,602,127,605,97,608,0,612,0,615,67,618,79,621,0,32767 +-2,0,10200,131,10118,134,10153,138,10132,141,10131,144,10140,148,10116,151,10132,154,10100,157,10135,161,10156,164,10150,167,10158,171,10132,174,10108,177,10205,180,10225,184,10206,187,10258,190,10170,194,10076,197,10183,200,10213,204,10149,207,10109,210,10201,213,10113,217,10208,220,10252,223,10215,227,10203,230,10173,233,10216,236,10234,240,10137,243,10138,246,10122,250,10145,253,10136,256,10190,259,10225,263,10087,266,10164,269,10162,381,10231,384,10188,388,10181,391,10253,394,10297,398,10283,408,10169,411,10140,414,10152,417,10186,421,10196,493,10259,496,10136,500,10137,503,10130,506,10130,510,10116,513,10174,516,10130,519,10085,523,10148,526,10088,529,10088,533,10110,536,10205,539,10295,542,10210,546,10256,549,10242,552,10242,556,10181,559,10238,562,10198,565,10141,569,10268,572,10320,575,10326,579,10246,582,10218,585,10285,589,10284,592,10108,595,10082,598,10117,602,10215,605,10206,608,10228,612,10192,615,10169,618,10157,621,10157,32767 + +-1,0,0,171,0,174,68,177,0,500,0,503,88,506,120,510,83,513,0,526,0,529,93,533,97,536,66,539,0,552,0,556,78,559,0,565,0,569,79,572,83,575,75,579,100,582,0,585,0,589,104,592,127,595,0,605,0,608,87,612,86,615,0,631,0,635,65,638,0,32767 +-2,0,10500,171,10420,174,10407,177,10516,500,10407,503,10490,506,10454,510,10504,513,10570,526,10411,529,10446,533,10468,536,10488,539,10495,552,10407,556,10475,559,10603,565,10438,569,10594,572,10652,575,10659,579,10556,582,10463,585,10454,589,10527,592,10578,595,10600,605,10542,608,10516,612,10521,615,10529,631,10481,635,10544,638,10544,32767 + +-1,0,0,187,0,190,67,194,0,200,0,204,74,207,0,210,0,213,78,217,104,220,107,223,98,227,0,256,0,259,66,263,0,266,65,269,0,506,0,510,80,513,97,516,66,519,0,523,0,526,92,529,86,533,98,536,97,539,71,542,0,546,81,549,109,552,106,556,103,559,73,562,76,565,122,569,94,572,100,575,70,579,0,585,0,589,71,592,104,595,0,638,0,641,90,644,84,648,72,651,0,32767 +-2,0,10800,187,10781,190,10777,194,10747,200,10715,204,10794,207,10880,210,10873,213,10855,217,10784,220,10796,223,10838,227,10867,256,10842,259,10898,263,10894,266,10829,269,10838,506,10766,510,10812,513,10783,516,10754,519,10840,523,10838,526,10757,529,10757,533,10758,536,10782,539,10808,542,10847,546,10765,549,10728,552,10734,556,10768,559,10727,562,10685,565,10727,569,10665,572,10679,575,10650,579,10770,585,10732,589,10813,592,10754,595,10693,638,10667,641,10732,644,10786,648,10752,651,10752,32767 + +-1,0,0,32767 +-2,0,11100,32767 + +-1,0,0,148,0,151,70,154,0,157,0,161,71,164,73,167,0,187,0,190,65,194,0,32767 +-2,0,11400,148,11362,151,11336,154,11439,157,11439,161,11389,164,11460,167,11492,187,11438,190,11424,194,11424,32767 + +-1,0,0,121,0,125,74,128,85,131,0,194,0,197,66,200,88,204,79,207,76,210,66,213,0,575,0,579,65,582,0,32767 +-2,0,11700,121,11788,125,11808,128,11784,131,11850,194,11680,197,11634,200,11634,204,11629,207,11709,210,11782,213,11838,575,11661,579,11737,582,11737,32767 + +-1,0,0,115,0,118,80,121,94,125,73,128,103,131,95,134,0,144,0,148,86,151,143,154,168,157,96,161,0,164,91,167,0,171,0,174,93,177,107,180,67,184,0,187,0,190,68,194,96,197,98,200,93,204,88,207,139,210,129,213,103,217,96,220,85,223,0,227,0,230,86,233,0,575,0,579,82,582,0,32767 +-2,0,12000,115,12058,118,12014,121,12054,125,12111,128,12064,131,12002,134,11985,144,11955,148,11976,151,11955,154,11947,157,11953,161,12140,164,12060,167,11896,171,11936,174,12005,177,11981,180,12025,184,12061,187,11997,190,12057,194,11960,197,11920,200,12043,204,12038,207,11972,210,12054,213,12040,217,11925,220,12064,223,12079,227,12121,230,12089,233,12105,575,11885,579,12004,582,12004,32767 + +-1,0,0,148,0,151,65,154,85,157,0,194,0,197,66,200,0,204,65,207,86,210,0,213,0,217,65,220,0,227,0,230,66,233,0,32767 +-2,0,12300,148,12288,151,12246,154,12222,157,12172,194,12175,197,12195,200,12170,204,12162,207,12209,210,12221,213,12172,217,12164,220,12160,227,12186,230,12187,233,12187,32767 + +-1,0,0,151,0,154,74,157,0,32767 +-2,0,12600,151,12560,154,12546,157,12546,32767 + +-1,0,0,151,0,154,88,157,0,32767 +-2,0,12900,151,12896,154,12890,157,12890,32767 + +-1,0,0,32767 +-2,0,13200,32767 + +-1,0,0,184,0,187,77,190,0,197,0,200,81,204,106,207,85,210,165,213,139,217,91,220,0,32767 +-2,0,13500,184,13611,187,13546,190,13449,197,13458,200,13491,204,13485,207,13499,210,13531,213,13456,217,13431,220,13431,32767 + +-1,0,0,125,0,128,76,131,77,134,0,174,0,177,75,180,97,184,124,187,180,190,129,194,65,197,71,200,155,204,203,207,135,210,186,213,146,217,87,220,0,32767 +-2,0,13800,125,13783,128,13786,131,13850,134,13802,174,13837,177,13836,180,13835,184,13883,187,13839,190,13735,194,13708,197,13722,200,13774,204,13772,207,13777,210,13782,213,13730,217,13761,220,13761,32767 + +-1,0,0,125,0,128,67,131,0,141,0,144,75,148,0,171,0,174,65,177,81,180,82,184,87,187,116,190,107,194,91,197,0,200,120,204,173,207,160,210,199,213,121,217,88,220,67,223,0,227,68,230,0,32767 +-2,0,14100,125,14093,128,14091,131,14157,141,14105,144,14041,148,14012,171,14156,174,14151,177,14126,180,14134,184,14173,187,14073,190,14007,194,14015,197,14033,200,14044,204,14041,207,14043,210,14062,213,14016,217,14035,220,14169,223,14225,227,14176,230,14176,32767 + +-1,0,0,131,0,134,83,138,101,141,93,144,95,148,77,151,72,154,68,157,0,171,0,174,67,177,77,180,87,184,78,187,67,190,0,200,0,204,84,207,87,210,141,213,83,217,0,500,0,503,82,506,0,32767 +-2,0,14400,131,14478,134,14383,138,14327,141,14419,144,14380,148,14331,151,14406,154,14446,157,14492,171,14446,174,14453,177,14424,180,14406,184,14455,187,14361,190,14296,200,14325,204,14337,207,14321,210,14375,213,14471,217,14409,500,14302,503,14351,506,14351,32767 + +-1,0,0,141,0,144,77,148,93,151,75,154,94,157,66,161,71,164,82,167,0,171,0,174,79,177,97,180,117,184,136,187,82,190,0,204,0,207,78,210,116,213,0,32767 +-2,0,14700,141,14707,144,14677,148,14653,151,14720,154,14721,157,14806,161,14755,164,14761,167,14792,171,14783,174,14762,177,14737,180,14686,184,14734,187,14670,190,14769,204,14580,207,14602,210,14629,213,14629,32767 + +-1,0,0,177,0,180,89,184,120,187,96,190,72,194,0,32767 +-2,0,15000,177,15056,180,14971,184,15001,187,14938,190,14887,194,14887,32767 + +-1,0,0,32767 +-2,0,15300,32767 + +-1,0,0,32767 +-2,0,15600,32767 + +-1,0,0,32767 +-2,0,15900,32767 + +-1,0,0,32767 +-2,0,16200,32767 + +-1,0,0,32767 +-2,0,16500,32767 + +-1,0,0,32767 +-2,0,16800,32767 + +-1,0,0,32767 +-2,0,17100,32767 + +-1,0,0,32767 +-2,0,17400,32767 + +-1,0,0,32767 +-2,0,17700,32767 + +-1,0,0,32767 +-2,0,18000,32767 + +-1,0,0,32767 +-2,0,18300,32767 + +-1,0,0,32767 +-2,0,18600,32767 + +-1,0,0,32767 +-2,0,18900,32767 + +-1,0,0,32767 +-2,0,19200,32767 + +-1,0,0,32767 +-2,0,19500,32767 + +-1,0,0,32767 +-2,0,19800,32767 + +-1,0,0,32767 +-2,0,20100,32767 + +-1,0,0,32767 +-2,0,20400,32767 + +-1,0,0,32767 +-2,0,20700,32767 + +-1,0,0,32767 +-2,0,21000,32767 + +-1,0,0,32767 +-2,0,21300,32767 + +-1,0,0,32767 +-2,0,21600,32767 + +-1,0,0,32767 +-2,0,21900,32767 + +-1,0,0,32767 +-2,0,22200,32767 + +-1,0,0,32767 +-2,0,22500,32767 + +-1,0,0,32767 +-2,0,22800,32767 + +-1,0,0,32767 +-2,0,23100,32767 + +-1,0,0,32767 +-2,0,23400,32767 + +-1,0,0,32767 +-2,0,23700,32767 + +-1,0,0,32767 +-2,0,24000,32767 + +-1,0,0,32767 +-2,0,24300,32767 + +-1,0,0,32767 +-2,0,24600,32767 + +-1,0,0,32767 +-2,0,24900,32767 + +-1,0,0,32767 +-2,0,25200,32767 + +-1,0,0,32767 +-2,0,25500,32767 + +-1,0,0,32767 +-2,0,25800,32767 + +-1,0,0,32767 +-2,0,26100,32767 + +-1,0,0,32767 +-2,0,26400,32767 + +-1,0,0,32767 +-2,0,26700,32767 + +-1,0,0,32767 +-2,0,27000,32767 + +-1,0,0,32767 +-2,0,27300,32767 + +-1,0,0,32767 +-2,0,27600,32767 + +-1,0,0,32767 +-2,0,27900,32767 + +-1,0,0,32767 +-2,0,28200,32767 + +-1,0,0,32767 +-2,0,28500,32767 + +-1,0,0,32767 +-2,0,28800,32767 + +-1,0,0,177,0,180,89,184,120,187,96,190,72,194,0,32767 +-2,0,29100,177,29044,180,29129,184,29099,187,29162,190,29213,194,29213,32767 + +-1,0,0,141,0,144,77,148,93,151,75,154,94,157,66,161,71,164,82,167,0,171,0,174,79,177,97,180,117,184,136,187,82,190,0,204,0,207,78,210,116,213,0,32767 +-2,0,29400,141,29393,144,29423,148,29447,151,29380,154,29379,157,29294,161,29345,164,29339,167,29308,171,29317,174,29338,177,29363,180,29414,184,29366,187,29430,190,29331,204,29520,207,29498,210,29471,213,29471,32767 + +-1,0,0,131,0,134,83,138,101,141,93,144,95,148,77,151,72,154,68,157,0,171,0,174,67,177,77,180,87,184,78,187,67,190,0,200,0,204,84,207,87,210,141,213,83,217,0,500,0,503,82,506,0,32767 +-2,0,29700,131,29622,134,29717,138,29773,141,29681,144,29720,148,29769,151,29694,154,29654,157,29608,171,29654,174,29647,177,29676,180,29694,184,29645,187,29739,190,29804,200,29775,204,29763,207,29779,210,29725,213,29629,217,29691,500,29798,503,29749,506,29749,32767 + +-1,0,0,125,0,128,67,131,0,141,0,144,75,148,0,171,0,174,65,177,81,180,82,184,87,187,116,190,107,194,91,197,0,200,120,204,173,207,160,210,199,213,121,217,88,220,67,223,0,227,68,230,0,32767 +-2,0,30000,125,30007,128,30009,131,29943,141,29995,144,30059,148,30088,171,29944,174,29949,177,29974,180,29966,184,29927,187,30027,190,30093,194,30085,197,30067,200,30056,204,30059,207,30057,210,30038,213,30084,217,30065,220,29931,223,29875,227,29924,230,29924,32767 + diff --git a/BUG8/BUG8.csd b/BUG8/BUG8.csd new file mode 100644 index 0000000..5f27a86 --- /dev/null +++ b/BUG8/BUG8.csd @@ -0,0 +1,313 @@ + + +-odac + + +sr = 44100 +kr = 441 +nchnls = 2 +0dbfs = 1 +seed 0 + +#include "wavetables.udo" + +giampfn init -1 +gifreqfn init -1 +gifftsize = 1024 + + +opcode SCReverb, aa, aakkjpo + + setksmps 1 + + ainL, ainR, kFeedBack, kLPFreq, iSRate, iPitchMod, iSkip xin + iSRate = (iSRate <= 0 ? 1 : (sr / iSRate)) + if (iSkip != 0) igoto SkipInit + + afilt1 init 0 + afilt2 init 0 + afilt3 init 0 + afilt4 init 0 + afilt5 init 0 + afilt6 init 0 + afilt7 init 0 + afilt8 init 0 + + ; Delay times chosen to be prime numbers. + ; Works with sr=44100 ONLY. If you wish to + ; use a different delay time, find some new + ; prime numbers that will give roughly the + ; same delay times for the new sampling rate. + ; Or adjust to taste. + + idel1 = 2473.000 / (iSRate * 44100) + idel2 = 2767.000 / (iSRate * 44100) + idel3 = 3217.000 / (iSRate * 44100) + idel4 = 3557.000 / (iSRate * 44100) + idel5 = 3907.000 / (iSRate * 44100) + idel6 = 4127.000 / (iSRate * 44100) + idel7 = 2143.000 / (iSRate * 44100) + idel8 = 1933.000 / (iSRate * 44100) + + ; kFeedBack: + ; gain of reverb. Adjust empirically + ; for desired reverb time. .6 gives + ; a good small \\\"live\\\" room sound, .8 + ; a small hall, .9 a large hall, + ; .99 an enormous stone cavern. + + ; iPitchMod: + ; amount of random pitch modulation + ; for the delay lines. 1 is the \\\"normal\\\" + ; amount, but this may be too high for + ; held pitches such as piano tones. + ; Adjust to taste. + + ; kLPFreq: + ; Cutoff frequency of lowpass filters + ; in feedback loops of delay lines, + ; in Hz. Lower cutoff frequencies results + ; in a sound with more high-frequency + ; damping. + + ; k1-k8 are used to add random pitch modulation to the + ; delay lines. Helps eliminate metallic overtones + ; in the reverb sound. + + iPitchMod = iPitchMod / iSRate + + k1 randi 0.0010 * iPitchMod, 3.100 * iSRate, 0.06 + k2 randi 0.0011 * iPitchMod, 3.500 * iSRate, 0.90 + k3 randi 0.0017 * iPitchMod, 1.110 * iSRate, 0.70 + k4 randi 0.0006 * iPitchMod, 3.973 * iSRate, 0.30 + k5 randi 0.0010 * iPitchMod, 2.341 * iSRate, 0.63 + k6 randi 0.0011 * iPitchMod, 1.897 * iSRate, 0.70 + k7 randi 0.0017 * iPitchMod, 0.891 * iSRate, 0.90 + k8 randi 0.0006 * iPitchMod, 3.221 * iSRate, 0.44 + + ; apj is used to calculate \\\"resultant junction pressure\\\" for + ; the scattering junction of 8 lossless waveguides + ; of equal characteristic impedance. If you wish to + ; add more delay lines, simply add them to the following + ; equation, and replace the .25 by 2/N, where N is the + ; number of delay lines. + + apj = .25 * (afilt1+afilt2+afilt3+afilt4+afilt5+afilt6+afilt7+afilt8) + + adum1 delayr 1 + adel1 deltap3 idel1 + k1 + delayw ainL + apj - afilt1 + + adum2 delayr 1 + adel2 deltap3 idel2 + k2 + delayw ainR + apj - afilt2 + + adum3 delayr 1 + adel3 deltap3 idel3 + k3 + delayw ainL + apj - afilt3 + + adum4 delayr 1 + adel4 deltap3 idel4 + k4 + delayw ainR + apj - afilt4 + + adum5 delayr 1 + adel5 deltap3 idel5 + k5 + delayw ainL + apj - afilt5 + + adum6 delayr 1 + adel6 deltap3 idel6 + k6 + delayw ainR + apj - afilt6 + + adum7 delayr 1 + adel7 deltap3 idel7 + k7 + delayw ainL + apj - afilt7 + + adum8 delayr 1 + adel8 deltap3 idel8 + k8 + delayw ainR + apj - afilt8 + + ; 1st order lowpass filters in feedback + ; loops of delay lines. + + kLPFreq = kLPFreq * iSRate + + afilt1 tone adel1 * kFeedBack, kLPFreq + afilt2 tone adel2 * kFeedBack, kLPFreq + afilt3 tone adel3 * kFeedBack, kLPFreq + afilt4 tone adel4 * kFeedBack, kLPFreq + afilt5 tone adel5 * kFeedBack, kLPFreq + afilt6 tone adel6 * kFeedBack, kLPFreq + afilt7 tone adel7 * kFeedBack, kLPFreq + afilt8 tone adel8 * kFeedBack, kLPFreq + + ; The outputs of the delay lines are summed + ; and sent to the stereo outputs. This could + ; easily be modified for a 4 or 8-channel + ; sound system. + + aoutL = 0.35 * (afilt1 + afilt3 + afilt5 + afilt7) + aoutR = 0.35 * (afilt2 + afilt4 + afilt6 + afilt8) + + SkipInit: + xout aoutL, aoutR + endop + + +instr liner + index = p4 + isinit = p5 + iampscale = (((gifftsize / 2) - index) / (gifftsize / 2)) * 0.1 + isamp = (isinit == 1) ? random(0, iampscale) : tab_i(index, giampfn) + isfreq = (isinit == 1) ? 440 : tab_i(index, gifreqfn) + tabw oscil:k(1, random(0.01, 1), -1, random(0, 1)) * linseg(isamp, p3, random(0, iampscale)), index, giampfn + tabw linseg(isfreq, p3, random(50, 1900)), index, gifreqfn + +endin + +instr rndoise + ipanrange1 = p4 + ipanrange2 = p5 + ifreqmax = random(100, 1000) + if (random(0, 1) > 0.3) then + a1 oscil line(random(0.5, 1), p3, random(0.5, 1)), random(100, ifreqmax) + else + a1 noise line(random(0.5, 1), p3, random(0.5, 1)), random(-1, 1) + endif + + if (random(0, 1) > 0.6) then + a1 *= oscil(line(random(0.5, 1), p3, random(0.5, 1)), random(100, ifreqmax)) + endif + + if (random(0, 1) > 0.9) then + a1 *= noise(line(random(0.5, 1), p3, random(0.5, 1)), random(-1, 1)) + endif + + if (random(0, 1) > 0.6) then + a1 *= oscil(random:k(0.5, 1), random(100, ifreqmax)) + endif + + if (random(0, 1) > 0.9) then + a1 *= noise(random:k(0.5, 1), random(-1, 1)) + endif + + if (random(0, 1) > 0.6) then + a1 taninv a1 * line(random(1, 10), p3, random(1, 10)) + endif + + if (random(0, 1) > 0.6) then + a1 butterhp a1, line(random(20, 2000), p3, random(20, 2000)) + endif + + if (random(0, 1) > 0.6) then + a1 butterlp a1, line(random(500, 16000), p3, random(500, 16000)) + endif + + if (random(0, 1) > 0.5) then + a1 *= oscil(1, random(1, 50)) + else + a1 *= line(random(0, 1), p3, random(0, 1)) + endif + + if (random(0, 1) > 0.6) then + a1 waveset a1, random(1, 20) + endif + + a1 *= 0.5 + aL, aR pan2 a1, ipanrange1, ipanrange2 + outs aL, aR +endin + + +instr trigrndoise + itime = 0 + imax = random(5, 20) + while (itime < p3) do + ilen = (p3 / imax) * random(0.6, 1.2) + event_i "i", "rndoise", itime, ilen, random(0, 1), random(0, 1) + itime += ilen * random(0.8, 1.1) + od +endin + + +instr clicker + aL noise 0.4, 0.4 + aR noise 0.4, 0.4 + kamp linseg 1, p3, 0 + outs aL*kamp, aR*kamp +endin + + +instr clickmaker + idur random 0.001, 0.01 + kmetro metro random(1, 6) + if (kmetro == 1) then + event "i", "clicker", 0, idur + endif +endin + +instr 1 + ktime timeinsts + isize = gifftsize / 2 + giampfn ftgen 0, 0, isize, 7, 0 + gifreqfn ftgen 0, 0, isize, 7, 0 + + itime = 60 + kmetro metro 1/itime + kinit init 1 + if (kmetro == 1) then + kndex = 0 + while (kndex < isize) do + event "i", "liner", 0, itime, kndex, kinit + kndex += 1 + od + if (kinit == 1) then + kinit = 0 + endif + endif + + event_i "i", "clickmaker", 0, 1 + + kmetro2 metro 3 + if (ktime > 5 && kmetro2 == 1 && random:k(0, 1) > 0.95) then + event "i", "trigrndoise", 0, random:k(0.6, 2) + endif + + ; pvsinit not working here.. + f1 pvsanal oscils(1, 440, 0), gifftsize, gifftsize/4, gifftsize, 1 + pvsftr f1, giampfn, gifreqfn + f2L pvscale f1, 0.03 + oscil(0.01, 0.01) + f2R pvscale f1, 0.03 + oscil(0.01, 0.02, -1, 0.26) + + a2L pvsynth f2L + a2R pvsynth f2R + a2L pareq a2L, 200, 0.3, 0.6 + a2R pareq a2R, 200, 0.3, 0.6 + + k2mul = 3 * (abs(oscil(0.7, 0.1)) + 0.2) + a2L *= k2mul + a2R *= k2mul + + ay pvsynth f1 + ay *= abs(oscil(0.7, 0.001, -1, 0)) + ;ay exciter ay, 3000, 20000, 10, 10 + + a1L = ay + a1R = ay + ;a1L, a1R SCReverb ay, ay, 0.9, 10000 + aL = a1L + a2L + aR = a1R + a2R + + outs aL, aR +endin + + + + + + + + +i1 0 100 + + + \ No newline at end of file diff --git a/BUG8/wavetables.udo b/BUG8/wavetables.udo new file mode 100644 index 0000000..e81f075 --- /dev/null +++ b/BUG8/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/BUG9/BUG9.csd b/BUG9/BUG9.csd new file mode 100644 index 0000000..f320921 --- /dev/null +++ b/BUG9/BUG9.csd @@ -0,0 +1,145 @@ + + +-odac +-m0 + + +/* + Debugger - Unfixed Bugs : BUG #8 + + http://git.1bpm.net/csd-unfixedbugs1/about/ + + By Richard Knight 2021 + http://1bpm.net + q@1bpm.net + +*/ + +sr = 44100 +ksmps = 100 +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 + + +/* + Master audio output +*/ +instr global_master + igain = 1 + 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 +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 + + + +/* + 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 + + + endif + +endin + + + +i"parseandrun" 0 1 + + diff --git a/BUG9/bid.udo b/BUG9/bid.udo new file mode 100644 index 0000000..17e9be2 --- /dev/null +++ b/BUG9/bid.udo @@ -0,0 +1,425 @@ +#ifndef UDO_BID +#define UDO_BID ## +/* + Debugger - Unfixed Bugs : BUG #5 + + Bug Infested Directive file parser v1 and tools + + Designed to create a reusable loop based score format in the Unfixed Bugs project and beyond. +*/ + + +#define BID_VERSION #1.1# + +#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 + + +/* + 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. + 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 + + +/* + 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/BUG9/bid_source.udo b/BUG9/bid_source.udo new file mode 100644 index 0000000..205939b --- /dev/null +++ b/BUG9/bid_source.udo @@ -0,0 +1,84 @@ +/* + Debugger - Unfixed Bugs : BUG #8 + + 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 #4 +v 1.1 + +; tempo, swing percent +b 121, 42 + +; chord groups +c 1 + 4, 60, 65, 67, 75, 77 + 4, 63, 65, 66, 71, 72 + + +; sections: section number, length, chordgroup +s 1, 64, 1 + + +; patterns: trig , dur, amp, chance + + +i clap, 1 +; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - + 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, 0, 0, 0, 1, 0, 0, 0 + 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 bass, 1 +; 1 - - - 2 - - - 3 - - - 4 - - - 5 - - - 6 - - - 7 - - - 8 - - - + 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0 + .2,.2,.2,.2,.2,.4,.2,.2,.2,.2,.2,.2,.2,.2,.2,.2,.2,.4,.2,.2,.2,.2,.4,.2,.2,.2,.2,.2,.2,.2,.2,.2 + 1, 1, 1, 1, 1,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 1, 0, 1, 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 + .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,.3 + 1, 0,.8, 0, 1, 0,.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0,.8, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0,.6,.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,.6,.2 + +}} diff --git a/BUG9/bussing.udo b/BUG9/bussing.udo new file mode 100644 index 0000000..62e4e1c --- /dev/null +++ b/BUG9/bussing.udo @@ -0,0 +1,67 @@ +#ifndef UDO_BUSSING +#define UDO_BUSSING ## +/* + Debugger - Unfixed Bugs : BUG #4 + + Global audio 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/BUG9/instruments.udo b/BUG9/instruments.udo new file mode 100644 index 0000000..198d196 --- /dev/null +++ b/BUG9/instruments.udo @@ -0,0 +1,179 @@ +#ifndef UDO_INSTRUMENTS +#define UDO_INSTRUMENTS ## +/* + Debugger - Unfixed Bugs : BUG #8 + + 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_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 + 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 + 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) + kamp init 1 + aL wgbowedbar 1, ifreq, 0.5, 0.2, 0.995 + aR wgbowedbar 1, ifreq, 0.3, 0.5, 0.995 + bus_mix("master", aL*kamp*iamp, aR*kamp*iamp) +endin + +instr play_mel2 + iamp = bid_getparameter(p4, p5, 2) + ifreq = cpsmidinn(table(random(1, 4), gibid_chordfn, 0, 0, 1) - 12) + 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 + aL foscil 1, ifreq, 4, k1, k2, gifnSine + aR foscil 1, ifreq, 3.9, k1, k2, gifnSine + aL pareq aL, 200, 0.3, 0.7 + aR pareq aR, 200, 0.3, 0.7 + bus_mix("master", aL*kamp*iamp, aR*kamp*iamp) +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 + 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) + + apt oscil 1, line(50, p3, 2000) + apt2 oscil 1, line(500, p3, 20) + + aL *= apt * apt2 + aR *= apt * apt2 + aL butterbp aL, kfreqL, 1000 + aR butterbp aR, kfreqR, 1000 + + kndx phasor 1/p3 + kamp tab kndx, gifnClap, 1 + kamp *= linseg(1, p3*0.5, 0.2, p3*0.5, 0) * iamp * 8 + aL *= kamp + aR *= kamp + bus_mix("master", aL, aR) +/* + p3 = 0.03 + kbt linseg 0.5, p3, -0.5 + aL noise 1, kbt + aR noise 1, kbt+0.1 + kbpf linseg 1500, p3, 100 + kbnp linseg 800, p3, 100 + aL butterbp aL, kbpf, kbnp + aR butterbp aR, kbpf, kbnp + aL taninv aL*7 + aR taninv aR*7 + + kamp linseg 1, p3*0.1, 0.3, p3*0.1, 0.9, p3*0.1, 0.3, p3*0.1, 0.8, p3*0.1, 0.2, p3*0.1, 0.7, p3*0.4, 0 + kamp2 = abs(oscil(0.5, 4)) + 0.5 + aL *= kamp * iamp + aR *= kamp * iamp + bus_mix("delay2", aL, aR) + bus_mix("master", aL, aR) + */ +endin + + +/* + Closed lower frequency hi-hat +*/ +instr play_hat1 + iamp = bid_getparameter(p4, p5, 2) + idel = random(0.001, 0.02) + xtratim idel + p3 = random(0.01, 0.04) + ifreq = 200 + aenv expsega .1, .0005, 1, p3 - .0005, .01 + asqr1 oscil 1, ifreq, gifnSaw, -1 + asqr2 oscil 1, ifreq*1.4471, gifnSquare, -1 + asqr3 oscil 1, ifreq*1.6170, gifnSaw, -1 + asqr4 oscil 1, ifreq*1.9265, gifnSaw, -1 + asqr5 oscil 1, ifreq*2.5028, gifnSaw, -1 + asqr6 oscil 1, ifreq*2.6637, gifnSaw, -1 + a808L sum asqr1, asqr2, asqr3, asqr4, asqr5, asqr6 + a808L butterhp a808L, 4270 + ;a808L butterhp a808L, 4270 + aoutL = a808L * aenv * iamp + aoutL delay aoutL, idel + + asqr1 oscil 1, ifreq, gifnSaw, -1 + asqr2 oscil 1, ifreq*1.3471, gifnSaw, -1 + asqr3 oscil 1, ifreq*1.6470, gifnSaw, -1 + asqr4 oscil 1, ifreq*1.8765, gifnSaw, -1 + asqr5 oscil 1, ifreq*2.4028, gifnSaw, -1 + asqr6 oscil 1, ifreq*2.5637, gifnSaw, -1 + a808R sum asqr1, asqr2, asqr3, asqr4, asqr5, asqr6 + a808R butterhp a808R, 4270 + ;a808L butterhp a808L, 4270 + aoutR = a808R * aenv * iamp + aoutR delay aoutR, idel + bus_mix("master", aoutL, aoutR) +endin + + +instr play_hat2 + iamp = bid_getparameter(p4, p5, 2) + idel1 = random(0.005, 0.02) + idel2 = random(0.005, 0.02) + xtratim(max:i(idel1, idel2)) + kfreq = abs(oscil(50, 10)) + 800 + aenv expsega .1, .0005, 1, p3 - .0005, .01 + asqr1 oscil 1, kfreq, gifnSquare, -1 + asqr2 oscil 1, kfreq*1.4471, gifnSquare, -1 + asqr3 oscil 1, kfreq*1.6170, gifnSquare, -1 + asqr4 oscil 1, kfreq*1.9265, gifnSquare, -1 + asqr5 oscil 1, kfreq*2.5028, gifnSquare, -1 + asqr6 oscil 1, kfreq*2.6637, gifnSquare, -1 + a808 sum asqr1, asqr2, asqr3, asqr4, asqr5, asqr6 + a808 butterhp a808, 3270 + a808 butterhp a808, 3270 + aout = a808 * aenv * iamp * 0.64 + aL delay aout, idel1 + aR delay aout, idel2 + bus_mix("master", aL, aR) +endin + + + + +/* + Lightly distorted 808 style kick +*/ +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 pareq aout1, 130, 0.3, 0.6 + aout1 pareq aout1, 9000, 5, 0.6 + aout1 *= 0.8 + bus_mix("master", aout1, aout1) +endin + + + + +#end diff --git a/BUG9/txt_tools.udo b/BUG9/txt_tools.udo new file mode 100644 index 0000000..d34459e --- /dev/null +++ b/BUG9/txt_tools.udo @@ -0,0 +1,82 @@ +#ifndef UDO_TXTTOOLS +#define UDO_TXTTOOLS ## +/* + Debugger - Unfixed Bugs : BUG #4 + + 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/BUG9/wavetables.udo b/BUG9/wavetables.udo new file mode 100644 index 0000000..82b0552 --- /dev/null +++ b/BUG9/wavetables.udo @@ -0,0 +1,16 @@ +#ifndef UDO_WAVETABLES +#define UDO_WAVETABLES ## +/* + Debugger - Unfixed Bugs : BUG #4 + + 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 + -- cgit v1.2.3