home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February / PCWorld_2008-02_cd.bin / audio-video / reaper / reaper2028-install.exe / Effects / Analysis / gfxscope < prev    next >
Text File  |  2007-12-11  |  1KB  |  80 lines

  1. desc: simple scope
  2.  
  3. @init
  4. gfx_clear=0; // set clearing to "black". red would be 255, green 255*256, etc.
  5. histlen=65536;
  6.  
  7.  
  8. @sample
  9. splpos[]=spl0;
  10. splpos[1]=spl1;
  11. splpos+=2;
  12. splpos >= histlen?splpos=0;
  13.  
  14. @gfx 400 300
  15.  
  16.  
  17. 0 ? loop(30,
  18.   gfx_x=rand(gfx_w); gfx_y=rand(gfx_h);
  19.   gfx_r=rand(100)/100; gfx_g=rand(100)/100; gfx_b=rand(100)/100; gfx_a=rand(50)/100;
  20.   gfx_rectto(rand(gfx_w),rand(gfx_h));
  21. );
  22.  
  23. // test of mouse stuff (will trace the cursor when clicked+dragged)
  24. mouse_cap ? (
  25.   gfx_a=0.5;
  26.   gfx_r=1;
  27.   gfx_g=gfx_b=0;
  28.   gfx_x=mouse_x-20;
  29.   gfx_y=mouse_y;
  30.   gfx_lineto(gfx_x+40,gfx_y,0);
  31.   gfx_x=mouse_x; gfx_y-=20;
  32.   gfx_lineto(gfx_x,gfx_y+40,0);
  33. );
  34.  
  35. gfx_a=1; // alpha 1.0
  36.  
  37. gfx_x=0;
  38. gfx_y=0;
  39. gfx_r=gfx_g=gfx_b=0;
  40.  
  41. gfx_r=gfx_g=gfx_b=1;
  42.  
  43. isplpos=splpos;
  44. chan=0;
  45. loop(2,
  46. i=0;
  47.  
  48. rdpos=isplpos-samplesblock*2;
  49. rdpos<0? rdpos+=histlen;
  50. rdpos+=chan;
  51.  
  52. gfx_x=0;
  53. offs= gfx_h*0.25+ chan*gfx_h*0.5;
  54. loop(samplesblock,
  55.   val = rdpos[]*gfx_h*0.25+offs;
  56.   (rdpos+=2) >= histlen ? rdpos-=histlen;
  57.   i == 0 ? (gfx_y=val) : (
  58.     gfx_lineto(i*(gfx_w)/samplesblock,val,1);
  59.   );
  60.   i+=1;
  61. );
  62. chan+=1;
  63. );
  64.  
  65.  
  66. gfx_x=0;
  67. gfx_y=gfx_h-gfx_texth;
  68. gfx_drawnumber(0,0);
  69. gfx_drawchar($'s');
  70. gfx_drawchar($'p');
  71. gfx_drawchar($'l');
  72.  
  73. gfx_x=gfx_w/2;
  74. gfx_drawnumber(samplesblock/2,0);
  75. gfx_drawchar($'s');
  76. gfx_drawchar($'p');
  77. gfx_drawchar($'l');
  78.  
  79.  
  80.