| 1 | <!doctype html> |
| 2 | <html lang="en-us"> |
| 3 | <head> |
| 4 | <meta charset="utf-8"> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 | <title>ChucK + JS => ChucKScript</title> |
| 7 | <link rel="stylesheet" href="../../css/editor.css"> |
| 8 | </head> |
| 9 | <body onresize="chuckEditor.resize();"> |
| 10 | <div> |
| 11 | <div id="program">// Pan 1: Demonstrating panning in ChucK |
| 12 | TriOsc tLeft => dac.chan(0); |
| 13 | TriOsc tRight => dac.chan(1); |
| 14 | // short for p.left => dac.chan(0); p.right => dac.chan(1); |
| 15 | TriOsc tPan => Pan2 p => dac; |
| 16 | |
| 17 | // left = low, right = mid, panning = high |
| 18 | tLeft.freq() * 1.5 => tRight.freq; |
| 19 | tLeft.freq() * 2 => tPan.freq; |
| 20 | // make left / right quieter |
| 21 | 0.4 => tLeft.gain => tRight.gain; |
| 22 | |
| 23 | // pan at 0.3 cycles per second |
| 24 | SinOsc lfo => blackhole; |
| 25 | 0.3 => lfo.freq; |
| 26 | while( true ) |
| 27 | { |
| 28 | lfo.last() => p.pan; |
| 29 | 10::ms => now; |
| 30 | } |
| 31 | </div> |
| 32 | </div> |
| 33 | <div class="buttons"> |
| 34 | <button class="chuckButton" id="startChuck" disabled="disabled">Start ChucK</button> |
| 35 | <button class="chuckButton" id="compileButton" disabled="disabled">Compile and Run</button> |
| 36 | <button class="chuckButton" id="replaceButton" disabled="disabled">Replace</button> |
| 37 | <button class="chuckButton" id="removeButton" disabled="disabled">Remove</button> |
| 38 | <button class="chuckButton" id="clearButton" disabled="disabled">Clear VM and Globals</button> |
| 39 | <button class="chuckButton" id="micButton" disabled="disabled">Enable Microphone</button> |
| 40 | <button class="chuckButton" id="fileFormButton">Show File Uploader</button> |
| 41 | </div> |
| 42 | <div id="fileForm" class="hidden"> |
| 43 | <p>File name to use in ChucK: <input type="text" id="uploadFilename"></p> |
| 44 | <p>Local file to upload: <input type="file" id="uploadFile" name="uploadFile"></p> |
| 45 | <p><button class="chuckButton" id="fileButton" disabled="disabled">Upload File to Virtual File System</button></p> |
| 46 | </div> |
| 47 | <div> |
| 48 | <textarea id="output"></textarea> |
| 49 | <div id="shreds"> |
| 50 | <table id="shredstable"> |
| 51 | <col width="60px"> |
| 52 | <col width="1*"> |
| 53 | <col width="50px"> |
| 54 | <col width="60px"> |
| 55 | <tr><th>shred</th><th>code</th><th>time</th><th>remove</th> |
| 56 | </table> |
| 57 | </div> |
| 58 | <div class="clearfix"></div> |
| 59 | </div> |
| 60 | <script type="text/javascript" src="../../js/ace-min-noconflict/ace.js" charset="utf-8"></script> |
| 61 | <script type="text/javascript" src="../../js/editor.js"></script> |
| 62 | <script type="text/javascript" src="../../js/defer.js"></script> |
| 63 | <script> |
| 64 | // override |
| 65 | var whereIsChuck = "../../js"; |
| 66 | </script> |
| 67 | <script type="text/javascript" src="../../js/webchuck_host.js"></script> |
| 68 | <script type="text/javascript" src="../../js/host.js"></script> |
| 69 | </body> |
| 70 | </html> |
| 71 | |
| 72 |