Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const dgram = require('dgram');
- const client = dgram.createSocket('udp4');
- compileOrc = function(orc) {
- client.send(orc, 6006, 'localhost', (err) => {
- if (err) {
- console.log(`err: ${err}`)
- }
- });
- }
- inputMessage = function(message) {
- client.send(Buffer.from('$' + message), 6006, 'localhost', (err) => {
- if (err) {
- console.log(`err: ${err}`);
- }
- });
- }
- var orcTest = `
- opcode Chorus,aa,aaiiiiii
- ainL,ainR,irate,idereg,idepth,ioffset,iwidth,iwet xin
- idereg min 10, idereg
- kdereg rspline -idereg, idereg, 0.1, 0.5
- krate = irate * octave(kdereg)
- ktrem rspline 0,-1,0.1,0.5
- ktrem pow 2,ktrem
- kdepth = idepth * ktrem
- kporttime linseg 0,0.001,0.02
- kChoDepth portk kdepth*0.01, kporttime
- ;; kChoDepth line kdepth*0.01, p3*0.1, idepth
- kmod1 rspline ioffset,kChoDepth, krate*4+0.01, ((krate*4*kdereg)+0.01)
- kmod2 rspline kChoDepth,ioffset, krate*4+0.01, ((krate*4*kdereg)+0.01)
- kmod1 limit kmod1,0.0001,1.2
- kmod2 limit kmod2,0.0001,1.2
- amod1 interp kmod1
- amod2 interp kmod2
- aCho1 vdelay ainL, amod1*1000, 1.2*1000
- aCho2 vdelay ainR, amod2*1000, 1.2*1000
- kpan rspline 0,1,krate,2*krate*kdereg
- kpan limit kpan,0,1
- apan interp kpan
- aChoL = (aCho1*apan)+(aCho2*(1-apan))
- aChoR = (aCho2*apan)+(aCho1*(1-apan))
- aChoL ntrpol aChoL,aCho1,iwidth
- aChoR ntrpol aChoR,aCho2,iwidth
- aoutL ntrpol ainL*0.6, aChoL*0.6, iwet
- aoutR ntrpol ainR*0.6, aChoR*0.6, iwet
- xout aoutL,aoutR
- endop
- instr 1
- aL vco2 0.2, p4
- aR vco2 0.1, p4/2
- aL,aR Chorus aL,aR, 5.5, 1, 0.3, 0.001, 0.5, 1
- outs aL, aR
- endin
- instr 10000
- aMasterLeft chnget "OutL"
- aMasterRight chnget "OutR"
- aMasterLeft clip aMasterLeft, 1, 0.8
- aMasterRight clip aMasterRight, 1, 0.8
- outs aMasterRight, aMasterLeft
- chnclear "OutL"
- chnclear "OutR"
- endin
- `;
- compileOrc(orcTest);
- setTimeout(function(){
- setInterval(function() {
- inputMessage(`i 1 0 1 400`);
- }, 100);
- }, 1100);
Advertisement
Add Comment
Please, Sign In to add comment