fork(1) download
  1.  
  2.  
  3. autowatch = 1;
  4.  
  5.  
  6. var Live = new Object();
  7.  
  8. Live.api = new LiveAPI(this.patcher);
  9. Live.Panner = function(pans) {
  10. this.Init = function(pans) {
  11. this.pans = pans.length ? pans : Live.Panner.Default;
  12. this.pan = 0;
  13. };
  14. this.Next = function() {
  15. this.OutputPan();
  16. if (++this.pan >= this.pans.length)
  17. this.pan = 0;
  18. };
  19.  
  20. this.OutputPan = function() {
  21. this.Outlet(this.Convert(this.pans[this.pan]));
  22. };
  23.  
  24. this.Convert = function(x) {
  25. return Math.round(127 * (x + 1) / 2);
  26. };
  27.  
  28. this.Outlet = function(_) {
  29. outlet(0, arrayfromargs(arguments));
  30. };
  31.  
  32. };
  33.  
  34. Live.Panner.Default = [
  35. ];
  36. var panner = new Live.Panner();
  37. panner.Init(jsarguments.slice(1));
  38. function note(note, velocity) {
  39. if (velocity)
  40. panner.Next();
  41. };
  42. function set(_) {
  43. panner.Init(arrayfromargs(arguments));
  44. };
  45. post('recompiled megapan.js\n');
  46.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:45:6: warning: character constant too long for its type
prog.cpp:3: error: expected constructor, destructor, or type conversion before ‘=’ token
prog.cpp:6: error: ‘var’ does not name a type
prog.cpp:8: error: expected constructor, destructor, or type conversion before ‘.’ token
prog.cpp:9: error: expected constructor, destructor, or type conversion before ‘.’ token
stdout
Standard output is empty