Steven Yi 44100 1 2 true 1 44100 1 2 true 1 true true false false true true true true false false true true true true false false RingModeInstr i<INSTR_ID> 0 3600 ain in acar poscil <carrierAmp>, <carrierFreq> ;acar vco2 .25, 2000 aout ringmod ain, acar aout limit aout, -0.5, 0.5 outs aout, aout carrierFreq 9 5 true 30.0 2000.0 300.0 60 true carrierAmp 81 7 true 0.0 1.0 0.20426057 60 true ringmod a aa ain, acarrier xin itab chnget "ringmod.table" ; TABLE INIT if(itab == 0) then ; generate table according to formula 2 in document itablen = 2^16 itab ftgen 0, 0, itablen, -2, 0 i_vb = 0.2 i_vl = 0.4 i_h = 1.0 indx = 0 chnset itab, "ringmod.table" ihalf = itablen / 2 until (indx >= itablen) do iv = (indx - ihalf) / ihalf iv = abs(iv) i_vl_add = i_h * ( ((i_vl - i_vb)^2) / ((2 * i_vl) - (2 * i_vb))) i_h_vl = i_h * i_vl if(indx <= i_vb) then ; ignore as table is initialized to 0 elseif(indx <= i_vl) then ival = i_h * ( ((iv - i_vb)^2) / ((2 * i_vl) - (2 * i_vb))) tableiw ival, indx, itab, 0, 0, 2 else ival = (i_h * iv) - i_h_vl + i_vl_add tableiw ival, indx, itab, 0, 0, 2 endif indx += 1 od endif ; END TABLE INIT ain1 = (ain * .5) acar2 = acarrier + ain1 ain2 = acarrier - ain1 asig1 table3 acar2, itab, 1, 0.5 asig2 table3 acar2 * -1, itab, 1, 0.5 asig3 table3 ain2, itab, 1, 0.5 asig4 table3 ain2 * -1, itab, 1, 0.5 asiginv = (asig3 + asig4) * -1 aout sum asig1, asig2, asiginv xout aout This is an implementation of Julian Parker's digital model of a Ring Modulator, written about in his 2011 DAFx paper: http://www.acoustics.hut.fi/publications/papers/dafx11-ringmod/ I based this Csound implementation on the WebAudio code presented at the BBC Radiophonic Workshop site that also implements the model: http://webaudio.prototyping.bbc.co.uk/ring-modulator/ true 0.0 1 Master 0.0 false false Master Master 0.0 false false csound -Wdo devaudio -L stdin false false 4 60 false false 64 false 1.0 0 5 2.0 0.0 SoundObject Layer Group -10066279 0 true 0 64 false 1.0 0 5 true 0.0 -1.0 false PCH MIDI 12TET 261.62558 2.0 1.0 1.0594631 1.122462 1.1892071 1.2599211 1.3348398 1.4142135 1.4983071 1.587401 1.6817929 1.7817974 1.8877486