Guest User

Untitled

a guest
Oct 26th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const dgram = require('dgram');
  2. const client = dgram.createSocket('udp4');
  3.  
  4.  
  5. compileOrc = function(orc) {
  6.     client.send(orc, 6006, 'localhost', (err) => {
  7.     if (err) {
  8.         console.log(`err: ${err}`)
  9.     }
  10.     });
  11. }
  12.  
  13. inputMessage = function(message) {
  14.     client.send(Buffer.from('$' + message), 6006, 'localhost', (err) => {
  15.     if (err) {
  16.         console.log(`err: ${err}`);
  17.     }
  18.     });
  19. }
  20.  
  21.  
  22. var orcTest = `
  23.  
  24. opcode Chorus,aa,aaiiiiii
  25.   ainL,ainR,irate,idereg,idepth,ioffset,iwidth,iwet xin
  26.   idereg min 10, idereg
  27.   kdereg rspline -idereg, idereg, 0.1, 0.5
  28.   krate = irate * octave(kdereg)
  29.   ktrem rspline 0,-1,0.1,0.5
  30.   ktrem pow 2,ktrem
  31.   kdepth = idepth * ktrem
  32.  
  33.   kporttime linseg 0,0.001,0.02
  34.   kChoDepth portk kdepth*0.01, kporttime
  35.   ;; kChoDepth line kdepth*0.01, p3*0.1, idepth
  36.   kmod1 rspline ioffset,kChoDepth, krate*4+0.01, ((krate*4*kdereg)+0.01)
  37.   kmod2 rspline kChoDepth,ioffset, krate*4+0.01, ((krate*4*kdereg)+0.01)
  38.   kmod1 limit kmod1,0.0001,1.2
  39.   kmod2 limit kmod2,0.0001,1.2
  40.   amod1 interp kmod1
  41.   amod2 interp kmod2
  42.   aCho1 vdelay ainL, amod1*1000, 1.2*1000
  43.   aCho2 vdelay ainR, amod2*1000, 1.2*1000
  44.   kpan rspline 0,1,krate,2*krate*kdereg
  45.   kpan limit kpan,0,1
  46.   apan interp kpan
  47.   aChoL = (aCho1*apan)+(aCho2*(1-apan))
  48.   aChoR = (aCho2*apan)+(aCho1*(1-apan))
  49.   aChoL ntrpol aChoL,aCho1,iwidth
  50.   aChoR ntrpol aChoR,aCho2,iwidth
  51.   aoutL ntrpol ainL*0.6, aChoL*0.6, iwet
  52.   aoutR ntrpol ainR*0.6, aChoR*0.6, iwet
  53.   xout aoutL,aoutR
  54. endop
  55.  
  56. instr 1
  57.   aL vco2 0.2, p4
  58.   aR vco2 0.1, p4/2
  59.   aL,aR Chorus aL,aR, 5.5, 1, 0.3, 0.001, 0.5, 1
  60.   outs aL, aR
  61. endin
  62.  
  63.  
  64. instr 10000
  65.   aMasterLeft chnget "OutL"
  66.   aMasterRight chnget "OutR"
  67.  
  68.   aMasterLeft  clip aMasterLeft,  1, 0.8
  69.   aMasterRight clip aMasterRight, 1, 0.8
  70.  
  71.   outs aMasterRight, aMasterLeft
  72.  
  73.   chnclear "OutL"
  74.   chnclear "OutR"
  75.  
  76. endin
  77. `;
  78.  
  79. compileOrc(orcTest);
  80.  
  81.  
  82. setTimeout(function(){
  83.     setInterval(function() {
  84.     inputMessage(`i 1 0 1 400`);
  85.     }, 100);
  86. }, 1100);
Advertisement
Add Comment
Please, Sign In to add comment