├── README ├── examples ├── ChnInOut │ ├── ChnInOut.pde │ ├── data │ │ └── ChnInOut.csd │ ├── icon-36.png │ ├── icon-48.png │ ├── icon-72.png │ └── sketch.properties ├── DevScratchPad │ ├── AndroidManifest.xml │ ├── DevScratchPad.pde │ ├── data │ │ └── DevScratchPad.csd │ ├── icon-36.png │ ├── icon-48.png │ ├── icon-72.png │ └── sketch.properties ├── DrawTables │ ├── AndroidManifest.xml │ ├── DrawTables.pde │ ├── data │ │ └── DrawTables.csd │ ├── icon-36.png │ ├── icon-48.png │ └── icon-72.png ├── DrawWaveform │ ├── AndroidManifest.xml │ ├── DrawWaveform.pde │ ├── data │ │ └── DrawWaveform.csd │ └── sketch.properties ├── Events │ ├── AndroidManifest.xml │ ├── Events.pde │ ├── data │ │ └── Events.csd │ ├── icon-36.png │ ├── icon-48.png │ ├── icon-72.png │ └── sketch.properties ├── Experiment_1 │ ├── AndroidManifest.xml │ ├── Animation.pde │ ├── Experiment_1.pde │ ├── crawler.pde │ ├── data │ │ └── Experiment_1.csd │ ├── edge.pde │ ├── icon-36.png │ ├── icon-48.png │ ├── icon-72.png │ ├── net.pde │ ├── node.pde │ └── sketch.properties ├── HeaderInfo │ ├── HeaderInfo.pde │ ├── data │ │ ├── Courier-24.vlw │ │ └── HeaderInfo.csd │ ├── icon-36.png │ ├── icon-48.png │ ├── icon-72.png │ └── sketch.properties ├── KeyboardSynth │ ├── AndroidManifest.xml │ ├── KeyboardSynth.pde │ ├── data │ │ ├── KeyboardSynth.csd │ │ ├── button_a.png │ │ ├── button_b.png │ │ └── button_c.png │ └── sketch.properties ├── PlayMessage │ ├── AndroidManifest.xml │ ├── PlayMessage.pde │ ├── data │ │ └── PlayMessage.csd │ ├── icon-36.png │ ├── icon-48.png │ ├── icon-72.png │ └── sketch.properties ├── ProtectedTable │ ├── AndroidManifest.xml │ ├── ProtectedTable.pde │ ├── data │ │ └── ProtectedTable.csd │ ├── icon-36.png │ ├── icon-48.png │ ├── icon-72.png │ └── sketch.properties ├── Random │ ├── AndroidManifest.xml │ ├── Random.pde │ ├── data │ │ └── Random.csd │ ├── icon-36.png │ ├── icon-48.png │ ├── icon-72.png │ └── sketch.properties ├── Sliders │ ├── Sliders.pde │ ├── data │ │ └── Sliders.csd │ ├── icon-36.png │ ├── icon-48.png │ ├── icon-72.png │ └── sketch.properties ├── Snake │ ├── AndroidManifest.xml │ ├── Snake.pde │ ├── data │ │ └── Snake.csd │ └── sketch.properties ├── SonicSausages │ ├── AndroidManifest.xml │ ├── SonicSausages.pde │ ├── data │ │ └── SonicSausages.csd │ ├── icon-36.png │ ├── icon-48.png │ ├── icon-72.png │ └── sketch.properties └── SonicSock │ ├── AndroidManifest.xml │ ├── SonicSock.pde │ ├── data │ └── SonicSock.csd │ ├── icon-36.png │ ├── icon-48.png │ ├── icon-72.png │ └── sketch.properties ├── icons ├── icon-36.png ├── icon-48.png └── icon-72.png ├── library ├── .DS_Store ├── csnd6.jar └── csoundo.jar ├── p5jsExample ├── .DS_Store ├── FileManager.js ├── README.md ├── csound-p5js.js ├── index.html ├── p5.dom.min.js ├── p5.min.js ├── p5.sound.min.js ├── random.csd ├── sketch.js ├── style.css └── wasm │ ├── CsoundObj.js │ ├── FileList.js │ ├── csound.js │ ├── libcsound.js │ ├── libcsound.js.map │ └── libcsound.wasm ├── reference ├── allclasses-frame.html ├── allclasses-noframe.html ├── constant-values.html ├── csoundo │ ├── Csoundo.html │ ├── Engine.html │ ├── Mutex.html │ ├── package-frame.html │ ├── package-summary.html │ └── package-tree.html ├── deprecated-list.html ├── help-doc.html ├── index-all.html ├── index.html ├── overview-tree.html ├── package-list ├── resources │ └── inherit.gif └── stylesheet.css └── src ├── CallbackWrapper.java ├── ChannelMessage.java ├── Csoundo.java ├── CsoundoArray.java ├── MessageQueue.java ├── TableMessage.java ├── csoundo.jar ├── csoundo ├── CallbackWrapper.class ├── ChannelMessage.class ├── Csoundo.class ├── CsoundoArray.class ├── MessageQueue.class └── TableMessage.class ├── make.bat └── make.sh /README: -------------------------------------------------------------------------------- 1 | 'Csoundo' 2 | A Csound library for Processing 3 | 4 | Jacob Joaquin, Conor Robotham, Rory Walsh 5 | 6 | Copyright (c) 2010 jacobjoaquin@gmail.com 7 | http://csoundblog.com/ 8 | 9 | 10 | What is Processing? 11 | ------------------- 12 | 13 | "Processing is an open source programming language and environment 14 | for people who want to create images, animations, and interactions. 15 | Initially developed to serve as a software sketchbook and to teach 16 | fundamentals of computer programming within a visual context, 17 | Processing also has evolved into a tool for generating finished 18 | professional work. Today, tens of thousands of students, artists, 19 | designers, researchers, and hobbyists who use Processing for learning, 20 | prototyping, and production." 21 | 22 | http://processing.org/ 23 | 24 | 25 | What is Csound? 26 | --------------- 27 | 28 | "Csound is a sound and music synthesis system, providing facilities 29 | for composition and performance over a wide range of platforms. It 30 | is not restricted to any style of music, having been used for many 31 | years in the creation of classical, pop, techno, ambient, experimental, 32 | and (of course) computer music, as well as music for film and 33 | television." 34 | 35 | http://csound.sourceforge.net/ 36 | 37 | 38 | Building 39 | ========================================================== 40 | 1) Install Csound or build from source(Instructions below). 41 | 42 | 2) cd to the src directory of the csoundo folder and edit the make.sh file 43 | there so that it points to valid core.jar and csnd6.jar files. 44 | 45 | 3) From the same directory run ./make.sh to build the library. 46 | 47 | 3) After it builds you need to copy your entire csoundo folder, minus the src 48 | directory if you wish, to your sketchbook/libraries/ folder. 49 | This is a folder that Processing creates in your home directory when it runs. 50 | 51 | 52 | 4) (Windows and Linux only) Open your Processing and Processing.java files from your 53 | processing install directory and add the csound library path. Just replace the following lines: 54 | 55 | java -Djna.nosys=true processing.app.Base "$SKETCH" & 56 | 57 | with: 58 | 59 | java -Djna.nosys=true -Djava.library.path=/usr/local/lib processing.app.Base "$SKETCH" & 60 | 61 | 4) (OSX users) If you receive an 'java.lang.UnsatisfiedLinkError: no _jcsound6 in java.library.path' error, 62 | please try adding a copy of lib_jcsound6.jnilib from the Csound64.framework to the library folder of csoundo that resides 63 | in your Processing documents folder. The folder structure of your installed csoundo library should look like this: 64 | 65 | processing -> 66 | libraries -> 67 | csoundo -> 68 | examples 69 | library -> 70 | csoundo.jar 71 | csnd.jar 72 | lib_jcsound6.jnilib 73 | 74 | ### Note for Linux users 75 | You many need to install java 1.6 in order for Processing to recognise the Csoundo library. Many flavours of Linux ship with 76 | Open Java. You can check the version by typing 'java -version' from the terminal. If you have openJDK installed you will need 77 | to revert to Java SE 1.6. After you have installed Java 1.6 you will need to rebild Csound so that the csnd6.jar file is rebuilt 78 | with the correct version of Java. 79 | 80 | Building Csound 6 81 | ========================================================== 82 | The first thing to do is get a copy of the Csound 6 sources. The following instructions are written for those getting a copy of the source code from Git. You will need to adjust the steps accordingly when using the source tarball from the files section. 83 | 84 | The first thing to do is make sure you have all of the required dependencies for building Csound. In a terminal, do the following: 85 | 86 | sudo apt-get build-dep csound 87 | sudo apt-get install cmake 88 | sudo apt-get install git 89 | 90 | The following numbered steps are to be done in a terminal for building and installing Csound: 91 | 92 | cd ~ 93 | mkdir csound 94 | cd csound 95 | git clone https://github.com/csound/csound.git csound 96 | mkdir cs6make 97 | cd cs6make 98 | cmake ../csound 99 | make -j6 100 | sudo make install 101 | sudo ldconfig 102 | 103 | At this point, Csound 6 should now be compiled and installed into the /usr/local set of folders. 104 | -------------------------------------------------------------------------------- /examples/ChnInOut/ChnInOut.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * Demonstrates writing data to a csound channel (chn) bus then reading 3 | * back the data. Move the mouse pointer around the screen. 4 | * 5 | * Example by Jacob Joaquin 6 | */ 7 | 8 | import csoundo.*; 9 | 10 | Csoundo cs; 11 | 12 | void setup() { 13 | size(740, 480); 14 | frameRate(30); 15 | smooth(); 16 | 17 | cs = new Csoundo(this, "ChnInOut.csd"); 18 | cs.run(); 19 | } 20 | 21 | void draw() { 22 | background(0); 23 | 24 | // Send mouse position to Csound chn busses 25 | cs.setChn("mouse_x", mouseX / (float) width); 26 | cs.setChn("mouse_y", (1 - (mouseY / (float) height))); 27 | 28 | // Read chn busses 29 | float mx = cs.getChn("mouse_x"); 30 | float my = cs.getChn("mouse_y"); 31 | 32 | ellipseMode(RADIUS); 33 | fill(255, mx * 255, 0, my * 255); 34 | ellipse(width / 2.0, height / 2.0, 200, 200); 35 | } 36 | -------------------------------------------------------------------------------- /examples/ChnInOut/data/ChnInOut.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -o dac -+rtaudio=null -d -+msg_color=0 -m0 -b512 4 | 5 | 6 | sr = 44100 7 | kr = 1470 8 | ksmps = 30 9 | nchnls = 1 10 | 0dbfs = 1 11 | 12 | gi_wave ftgen 1, 0, 8192, 9, 0.5, 1, 0 13 | 14 | chn_k "mouse_x", 1 15 | chn_k "mouse_y", 1 16 | chnset 0, "mouse_x" 17 | chnset 0, "mouse_y" 18 | 19 | instr 1 20 | idur = p3 21 | iamp = p4 22 | 23 | k1 chnget "mouse_y" 24 | k2 chnget "mouse_x" 25 | a1 oscil iamp * k1, 100 * 8 ^ k2, gi_wave 26 | 27 | out a1 28 | endin 29 | 30 | 31 | 32 | i 1 0 [60 * 60 * 24] 0.707 33 | 34 | 35 | -------------------------------------------------------------------------------- /examples/ChnInOut/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/ChnInOut/icon-36.png -------------------------------------------------------------------------------- /examples/ChnInOut/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/ChnInOut/icon-48.png -------------------------------------------------------------------------------- /examples/ChnInOut/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/ChnInOut/icon-72.png -------------------------------------------------------------------------------- /examples/ChnInOut/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.java.JavaMode 2 | mode=Java 3 | -------------------------------------------------------------------------------- /examples/DevScratchPad/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/DevScratchPad/DevScratchPad.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * Developer scratch pad. This isn't an example, just a place to try things. 3 | */ 4 | 5 | import csoundo.*; 6 | 7 | Csoundo cs; 8 | 9 | void setup() { 10 | size(720, 480); 11 | noLoop(); 12 | 13 | cs = new Csoundo(this, "DevScratchPad.csd"); 14 | cs.run(); 15 | } 16 | 17 | void draw() { 18 | background(0); 19 | println(cs.get0dBFS()); 20 | println(cs.getOptions()); 21 | } 22 | -------------------------------------------------------------------------------- /examples/DevScratchPad/data/DevScratchPad.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -o dac -+rtaudio=null -d -+msg_color=0 -m0 -b512 4 | 5 | 6 | sr = 44100 7 | kr = 4410 8 | ksmps = 10 9 | nchnls = 1 10 | 0dbfs = 1 11 | 12 | chn_k "elapsed", 1 13 | 14 | chnset 0, "elapsed" 15 | 16 | instr 1 17 | k1 chnget "elapsed" 18 | chnset k1 + 1, "elapsed" 19 | 20 | endin 21 | 22 | 23 | 24 | i 1 0 [60 * 60 * 24] 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /examples/DevScratchPad/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/DevScratchPad/icon-36.png -------------------------------------------------------------------------------- /examples/DevScratchPad/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/DevScratchPad/icon-48.png -------------------------------------------------------------------------------- /examples/DevScratchPad/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/DevScratchPad/icon-72.png -------------------------------------------------------------------------------- /examples/DevScratchPad/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.java.JavaMode 2 | mode=Java 3 | -------------------------------------------------------------------------------- /examples/DrawTables/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/DrawTables/DrawTables.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * Demonstrates reading values from an f-table and how to format f-tables 3 | * into nice looking graphics. Perfect for the class room, papers and blogs. 4 | * 5 | * This example can be modified to output scalable vector graphics (SVG) 6 | * to use in programs such as illustrator. See the PDF Library for details. 7 | * 8 | * Example by Jacob Joaquin 9 | */ 10 | 11 | 12 | import csoundo.*; 13 | 14 | Csoundo cs; 15 | 16 | void setup() { 17 | size(720, 480); 18 | smooth(); 19 | noLoop(); 20 | 21 | cs = new Csoundo(this, "DrawTables.csd"); 22 | cs.run(); 23 | } 24 | 25 | void draw() { 26 | background(255); 27 | 28 | displayTable(1, 20, height * 0.25, width - 40, height * 0.20); 29 | displayDiscreteTable(2, 20, height * 0.75, width - 40, height * 0.20); 30 | } 31 | 32 | void displayDiscreteTable(int t, float x, float y, float w, float h) { 33 | int length = cs.tableLength(t); 34 | 35 | stroke(0); 36 | strokeWeight(1); 37 | line(x, y, x + w, y); 38 | 39 | for (int i = 0; i < length; i++) { 40 | float xpos = x + (float) i / (float) (length - 1) * w; 41 | float ypos = y + (cs.tableGet(t, i) * -1) * h; 42 | line(xpos, y, xpos, ypos); 43 | } 44 | 45 | for (int i = 0; i < length; i++) { 46 | float xpos = x + (float) i / (float) (length - 1) * w; 47 | float ypos = y + (cs.tableGet(t, i) * -1) * h; 48 | fill(0); 49 | noStroke(); 50 | ellipseMode(RADIUS); 51 | ellipse(xpos, ypos, 3, 3); 52 | } 53 | } 54 | 55 | void displayTable(int t, float x, float y, float w, float h) { 56 | int length = cs.tableLength(t); 57 | 58 | stroke(0); 59 | strokeWeight(1); 60 | noFill(); 61 | line(x, y, x + w, y); 62 | 63 | beginShape(); 64 | for (int i = 0; i < length; i++) { 65 | float v = cs.tableGet(t, i); 66 | float xpos = x + (float) i / (float) (length - 1) * w; 67 | float ypos = y + (v * -1) * h; 68 | 69 | vertex(xpos, ypos); 70 | } 71 | endShape(); 72 | } 73 | -------------------------------------------------------------------------------- /examples/DrawTables/data/DrawTables.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -o dac -+rtaudio=null -d -+msg_color=0 -m0 -b512 4 | 5 | 6 | sr = 44100 7 | kr = 4410 8 | ksmps = 10 9 | nchnls = 2 10 | 0dbfs = 1 11 | 12 | instr 1 13 | ; Keep synth running 14 | endin 15 | 16 | 17 | 18 | f 1 0 512 10 1 0 [1/3] 0 [1/5] 0 [1/7] 0 [1/9] 0 [1/11] 0 [1/13] 0 [1/15] 19 | f 2 0 64 21 6 1 20 | 21 | i 1 0 [60 * 60] ; Turn on for 1 hour 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/DrawTables/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/DrawTables/icon-36.png -------------------------------------------------------------------------------- /examples/DrawTables/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/DrawTables/icon-48.png -------------------------------------------------------------------------------- /examples/DrawTables/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/DrawTables/icon-72.png -------------------------------------------------------------------------------- /examples/DrawWaveform/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/DrawWaveform/DrawWaveform.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Continuous Lines. 3 | * 4 | * Click and drag the mouse to draw a line. 5 | */ 6 | import csoundo.*; 7 | 8 | Csoundo cs; 9 | 10 | float[] points; 11 | float prevY = height/2; 12 | float prevX = 0; 13 | int tableNumber = 1; 14 | int tableLength = 1024; 15 | 16 | 17 | void setup() { 18 | cs = new Csoundo(this, "DrawWaveform.csd"); 19 | cs.run(); 20 | points = new float[1024]; 21 | for(int i=0;i<1024;i++) 22 | points[i]=0; 23 | size(640, 360); 24 | background(255); 25 | fillPointsArray(); 26 | drawPoints(); 27 | noLoop(); 28 | 29 | } 30 | 31 | void draw() { 32 | background(255); 33 | fill(255); 34 | rect(0, 0, width, height); 35 | drawPoints(); 36 | } 37 | 38 | void mouseDragged(){ 39 | float index = (float(mouseX)/float(width))*tableLength; 40 | float amp = (float(mouseY)/float(height)*-2)+1; 41 | if(index>5 && index<(tableLength-5)){ 42 | points[int(index)-1] = amp; 43 | cs.tableSet(1, int(index)-1, amp); 44 | points[int(index)-2] = amp; 45 | cs.tableSet(1, int(index)-2, amp); 46 | points[int(index)-3] = amp; 47 | cs.tableSet(1, int(index)-3, amp); 48 | points[int(index)-4] = amp; 49 | cs.tableSet(1, int(index)-4, amp); 50 | points[int(index)] = amp; 51 | cs.tableSet(1, int(index), amp); 52 | points[int(index)+1] = amp; 53 | cs.tableSet(1, int(index)+1, amp); 54 | points[int(index)+2] = amp; 55 | cs.tableSet(1, int(index)+2, amp); 56 | points[int(index)+3] = amp; 57 | cs.tableSet(1, int(index)+3, amp); 58 | points[int(index)+4] = amp; 59 | cs.tableSet(1, int(index)+4, amp); 60 | } 61 | redraw(); 62 | } 63 | 64 | void fillPointsArray() { 65 | for(int i=0;i 2 | 3 | -o dac -d -+msg_color=0 -m0 -b512 4 | 5 | 6 | sr = 44100 7 | kr = 4410 8 | ksmps = 10 9 | nchnls = 2 10 | 0dbfs = 1 11 | 12 | instr 1 13 | a1 oscil .5, 400, 1 14 | outs a1, a1 15 | endin 16 | 17 | 18 | 19 | f1 0 1024 10 1 20 | 21 | i 1 0 [60 * 60] ; Turn on for 1 hour 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/DrawWaveform/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.java.JavaMode 2 | mode=Java 3 | -------------------------------------------------------------------------------- /examples/Events/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/Events/Events.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * Create i-events using the cs.event() method. For example: 3 | * cs.event("i 2 0 0.25 0.4 880"); 4 | * 5 | * Example by Jacob Joaquin 6 | */ 7 | 8 | import csoundo.*; 9 | 10 | Csoundo cs; 11 | boolean enter = false; 12 | 13 | void setup() { 14 | size(displayWidth, displayHeight); 15 | frameRate(30); 16 | smooth(); 17 | background(0); 18 | noStroke(); 19 | 20 | cs = new Csoundo(this, "Events.csd"); 21 | cs.run(); 22 | } 23 | 24 | void draw() { 25 | //background(0, 64); 26 | fill(0, 32); 27 | rect(0, 0, width, height); 28 | 29 | // Trigger note once per second 30 | if (frameCount % 30 == 0) { 31 | cs.event("i 2 0 1 0.4 440"); 32 | } 33 | 34 | // Trigger note 6 times per second when mouse is in blue circle 35 | float xpos = width * 0.333; 36 | float ypos = height * 0.5; 37 | float r = 150; 38 | 39 | if (dist(mouseY, mouseX, ypos, xpos) < r) { 40 | if (frameCount % 5 == 0) { 41 | cs.event("i 2 0 0.25 0.4 880"); 42 | } 43 | 44 | fill(0, 0, 255, 128); 45 | } else { 46 | fill(0, 0, 255, 64); 47 | } 48 | 49 | ellipseMode(RADIUS); 50 | ellipse(xpos, ypos, r, r); 51 | 52 | // Turn on note when mouse is in red circle, turn off after exit 53 | xpos = xpos+200;//width * 0.666; 54 | ypos = height * 0.5; 55 | 56 | if (dist(mouseY, mouseX, ypos, xpos) < r) { 57 | if (enter == false) { 58 | cs.event("i 4 0 -1 0.3 220"); // Turn on instr 4 indefintely 59 | enter = true; 60 | } 61 | 62 | fill(255, 0, 0, 128); 63 | } else { 64 | if (enter == true) { 65 | cs.event("i 3 0 1"); // Turn off instr 4 66 | enter = false; 67 | } 68 | 69 | fill(255, 0, 0, 64); 70 | } 71 | 72 | ellipseMode(RADIUS); 73 | ellipse(xpos, ypos, r, r); 74 | } 75 | -------------------------------------------------------------------------------- /examples/Events/data/Events.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -o dac -+rtaudio=null -d -+msg_color=0 -m0 -b512 4 | 5 | 6 | sr = 44100 7 | ksmps = 64 8 | nchnls = 1 9 | 0dbfs = 1 10 | 11 | gi_sin ftgen 1, 0, 8192, 10, 1 12 | 13 | instr 1 14 | ; Keep Csound running 15 | endin 16 | 17 | instr 2 18 | idur = p3 19 | iamp = p4 20 | ifreq = p5 21 | 22 | k1 line iamp, idur, 0 23 | a1 oscil k1, ifreq, gi_sin 24 | 25 | out a1 26 | endin 27 | 28 | instr 3 29 | turnoff2 4, 0, 0 30 | turnoff 31 | endin 32 | 33 | instr 4 34 | idur = p3 35 | iamp = p4 36 | ifreq = p5 37 | 38 | a1 foscil iamp, ifreq, 1, 2, 1, gi_sin 39 | 40 | out a1 41 | endin 42 | 43 | 44 | 45 | 46 | i 1 0 [60 * 60 * 24] 47 | 48 | -------------------------------------------------------------------------------- /examples/Events/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/Events/icon-36.png -------------------------------------------------------------------------------- /examples/Events/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/Events/icon-48.png -------------------------------------------------------------------------------- /examples/Events/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/Events/icon-72.png -------------------------------------------------------------------------------- /examples/Events/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.java.JavaMode 2 | mode=Java 3 | -------------------------------------------------------------------------------- /examples/Experiment_1/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/Experiment_1/Animation.pde: -------------------------------------------------------------------------------- 1 | class AnimationController { 2 | ArrayList animations; // Active animations 3 | ArrayList garbage; // Collect animations to be destroyed 4 | 5 | AnimationController() { 6 | animations = new ArrayList(); 7 | garbage = new ArrayList(); 8 | } 9 | 10 | void add(Animation a) { 11 | animations.add(a); 12 | } 13 | 14 | void empty_garbage() { 15 | int i; 16 | 17 | for (i = 0; i < garbage.size(); i++) { 18 | Animation a = (Animation) garbage.get(i); 19 | animations.remove(animations.indexOf(a)); 20 | } 21 | 22 | garbage.clear(); 23 | } 24 | 25 | void update() { 26 | update_animations(); 27 | empty_garbage(); 28 | } 29 | 30 | void update_animations() { 31 | int i; 32 | 33 | for (i = 0; i < animations.size(); i++) { 34 | Animation a = (Animation) animations.get(i); 35 | a.update(); 36 | a.frames_left--; 37 | 38 | if (a.frames_left <= 0) { 39 | garbage.add(a); 40 | } 41 | } 42 | } 43 | } 44 | 45 | class Animation { 46 | int frames_left = 0; 47 | 48 | Animation() {} 49 | 50 | void update() {} 51 | } 52 | 53 | class SimpleRipple extends Animation { 54 | float xpos; 55 | float ypos; 56 | float r; 57 | float start_opacity = 96; 58 | float opacity = start_opacity; 59 | float grow = 1.05; 60 | float total_frames; 61 | Crawler c; 62 | Edge e; 63 | 64 | SimpleRipple(Crawler _c) { 65 | super(); 66 | c = _c; 67 | e = c.edge; 68 | 69 | this.frames_left = (int) (get_duration() * (float) frameRate); 70 | total_frames = (float) frames_left; 71 | xpos = e.node_1.xpos; 72 | ypos = e.node_1.ypos; 73 | r = e.node_1.r; 74 | sound(); 75 | } 76 | 77 | void display() { 78 | pushStyle(); 79 | noStroke(); 80 | ellipseMode(RADIUS); 81 | fill(255, 200, 0, opacity); 82 | ellipse(xpos, ypos, r, r); 83 | fill(0, opacity); 84 | ellipse(e.node_1.xpos, e.node_1.ypos, e.node_1.r, e.node_1.r); 85 | popStyle(); 86 | } 87 | 88 | float get_duration() { 89 | return dist(e.node_1.xpos, e.node_1.ypos, e.node_2.xpos, 90 | e.node_2.ypos) / c.velocity / frameRate; 91 | } 92 | 93 | void update() { 94 | opacity -= (start_opacity * (1.0 / (float) total_frames)); 95 | 96 | if (opacity < 0) opacity = 0; 97 | r = r * grow; 98 | display(); 99 | } 100 | 101 | void sound() { 102 | NodeSound ns; 103 | ns = (NodeSound) net.node_sounds.get(net.nodes.indexOf(e.node_1)); 104 | float amp = AMP; 105 | float freq = ns.freq; 106 | float pan = e.node_1.xpos / (float) width; 107 | float index = (float) net.nodes.indexOf(e.node_1) / (float) N_NODES; 108 | 109 | cs.event("i 1 0 " + get_duration() + " " + amp + " " + freq + 110 | " " + pan + " " + index); 111 | } 112 | 113 | void sound(float dur, float amp, float freq, float pan, float index) { 114 | cs.event("i 1 0 " + dur + " " + amp + " " + freq + " " + pan + 115 | " " + index); 116 | } 117 | 118 | } 119 | 120 | 121 | -------------------------------------------------------------------------------- /examples/Experiment_1/Experiment_1.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * Something between a lava lamp and a wind chime. 3 | * 4 | * Example by Jacob Joaquin 5 | */ 6 | 7 | import csoundo.*; 8 | 9 | Net net; 10 | Csoundo cs; 11 | 12 | float SCALE = 1; 13 | int N_NODES = 50; 14 | float MIN_NODE_SIZE = 5.0 * SCALE; 15 | float MAX_NODE_SIZE = 100.0 * SCALE; 16 | float MAX_NODE_VELOCITY = 1 * SCALE; 17 | float MIN_NODE_VELOCITY = 0.3 * SCALE; 18 | int N_CRAWLERS = 2; 19 | float CRAWLER_RADIUS = 5 * SCALE; 20 | float MAX_CRAWLER_VELOCITY = 2 * SCALE; 21 | float MIN_CRAWLER_VELOCITY = 0.5 * SCALE; 22 | float AMP = 0.6; 23 | float BASE_FREQ = 180; 24 | boolean IS_SOUND_ON = true; 25 | boolean setup = false; 26 | 27 | void setup() { 28 | size((int) (720 * SCALE), (int) (480 * SCALE)); 29 | frameRate(30); 30 | smooth(); 31 | 32 | net = new Net(N_NODES, MIN_NODE_SIZE, MAX_NODE_SIZE); 33 | 34 | if (IS_SOUND_ON) { 35 | 36 | cs.run(); 37 | setup = true; 38 | 39 | } 40 | } 41 | 42 | void draw() { 43 | if (mousePressed) { 44 | net = new Net(N_NODES, MIN_NODE_SIZE, MAX_NODE_SIZE); 45 | } 46 | 47 | background(32, 0, 0); 48 | net.update(); 49 | } 50 | 51 | //Comment out method onPause for Java mode 52 | @Override 53 | public void onPause() { 54 | super.onPause(); // Always call the superclass method first 55 | if(setup){ 56 | cs.pause(); 57 | } 58 | } 59 | //Comment out method onResume for Java mode 60 | @Override 61 | public void onResume() { 62 | super.onResume(); // Always call the superclass method first 63 | if(setup){ 64 | cs.resume(); 65 | } 66 | } 67 | 68 | void keyPressed() { 69 | // net = new Net(N_NODES, MIN_NODE_SIZE, MAX_NODE_SIZE); 70 | } 71 | 72 | float random_range_scaled(float min, float max) { 73 | return min * pow((max / min), random(1.0)); 74 | } 75 | 76 | class NodeSound { 77 | float freq; 78 | float timbre; 79 | } 80 | 81 | -------------------------------------------------------------------------------- /examples/Experiment_1/crawler.pde: -------------------------------------------------------------------------------- 1 | class Crawler { 2 | Net net; 3 | Edge edge; 4 | float edge_pos; 5 | float distance; 6 | float radius = CRAWLER_RADIUS; 7 | 8 | float velocity = random(MIN_CRAWLER_VELOCITY, MAX_CRAWLER_VELOCITY); 9 | 10 | Crawler(Net _net) { 11 | net = _net; 12 | Node n; 13 | boolean is_isolated = true; 14 | 15 | n = (Node) net.nodes.get(int(random(net.nodes.size()))); 16 | is_isolated = net.is_node_isolated(net.nodes, n); 17 | 18 | while (is_isolated) { 19 | n = (Node) net.nodes.get(int(random(net.nodes.size()))); 20 | is_isolated = net.is_node_isolated(net.nodes, n); 21 | } 22 | 23 | ArrayList near_nodes = new ArrayList(); 24 | near_nodes = net.get_near_nodes(n); 25 | 26 | int r = int(random(near_nodes.size())); 27 | Node end = (Node) near_nodes.get(r); 28 | 29 | Node start = n; 30 | edge = new Edge(start, end); 31 | edge_pos = 0.0; 32 | distance = dist(edge.node_1.xpos, edge.node_1.ypos, 33 | edge.node_2.xpos, edge.node_2.ypos); 34 | } 35 | 36 | void bang() { 37 | if (edge.node_1 != edge.node_2) { 38 | net.ac.add(new SimpleRipple(this)); 39 | } 40 | } 41 | 42 | void display() { 43 | if (edge.node_1 == edge.node_2) { 44 | pushStyle(); 45 | float col = random(255); 46 | fill(255, col, random(col), 180); 47 | ellipseMode(RADIUS); 48 | float x = edge.node_1.xpos; 49 | float y = edge.node_1.ypos; 50 | float r = edge.node_1.r; 51 | ellipse(x, y, r, r); 52 | popStyle(); 53 | } else { 54 | pushStyle(); 55 | strokeWeight(2.0); 56 | float col = random(255); 57 | noStroke(); 58 | fill(255, col, random(col), 180); 59 | ellipseMode(RADIUS); 60 | 61 | float x = get_x(); 62 | float y = get_y(); 63 | ellipse(x, y, radius, radius); 64 | 65 | float col_2 = random(255.0); 66 | stroke(255, col_2, random(col_2), 128); 67 | line(edge.node_1.xpos, edge.node_1.ypos, 68 | edge.node_2.xpos, edge.node_2.ypos); 69 | popStyle(); 70 | } 71 | } 72 | 73 | float get_x() { 74 | return lerp(edge.node_1.xpos, edge.node_2.xpos, (edge_pos / distance)); 75 | } 76 | 77 | float get_y() { 78 | return lerp(edge.node_1.ypos, edge.node_2.ypos, (edge_pos / distance)); 79 | } 80 | 81 | void move() { 82 | edge_pos += velocity; 83 | } 84 | 85 | void next_edge() { 86 | // choose new node 87 | ArrayList near_nodes = new ArrayList(); 88 | 89 | float d; 90 | int i; 91 | 92 | near_nodes = net.get_near_nodes(edge.node_2); 93 | Node new_n = node_chooser(edge, near_nodes); 94 | 95 | // Calculate distance and direction 96 | edge = new Edge(edge.node_2, new_n); 97 | edge_pos = 0.0; 98 | distance = dist(edge.node_1.xpos, edge.node_1.ypos, 99 | edge.node_2.xpos, edge.node_2.ypos); 100 | } 101 | 102 | Node node_chooser(Edge e, ArrayList node_list) { 103 | int size = node_list.size(); 104 | float[] delta = new float[size]; 105 | float total = 0.0; 106 | 107 | // Get direction 108 | float v = (atan2(edge.node_2.ypos - edge.node_1.ypos, 109 | edge.node_2.xpos - edge.node_1.xpos) + PI) % TWO_PI; 110 | float v2; 111 | int i; 112 | 113 | if (size == 1) { 114 | return (Node) node_list.get(0); 115 | } 116 | 117 | // Create statistics table for adjacent nodes 118 | for (i = 0; i < node_list.size(); i++) { 119 | Node n2 = (Node) node_list.get(i); 120 | v2 = atan2(n2.ypos - edge.node_2.ypos, n2.xpos - edge.node_2.xpos); 121 | if (v2 < 0) v2 += TWO_PI; 122 | float s = abs(v2 - v) % PI; 123 | total = total + s; 124 | delta[i] = total; 125 | } 126 | 127 | float r = random(total); 128 | 129 | for (i = 0; i < size; i++) { 130 | if (r < delta[i]) { 131 | return (Node) node_list.get(i); 132 | } 133 | } 134 | 135 | if (net.is_node_isolated(net.nodes, edge.node_2)) { 136 | return edge.node_2; 137 | } 138 | 139 | println("Oops. Something ain't right in node_chooser of class Net."); 140 | return edge.node_2; 141 | } 142 | 143 | void update() { 144 | if (edge_pos >= distance - velocity) { 145 | next_edge(); 146 | bang(); 147 | } else { 148 | move(); 149 | } 150 | 151 | display(); 152 | } 153 | } 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /examples/Experiment_1/data/Experiment_1.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -o dac -+rtaudio=null -d -+msg_color=0 -m0 -b512 4 | 5 | 6 | sr = 44100 7 | kr = 441 8 | ksmps = 100 9 | nchnls = 2 10 | 0dbfs = 1 11 | 12 | gi_sin ftgen 1, 0, 8192, 10, 1 13 | 14 | chn_a "left", 3 15 | chn_a "right", 3 16 | 17 | instr 1 18 | idur = p3 ; Duration 19 | iamp = p4 ; Amplitude 20 | ifreq = p5 ; Frequency 21 | ipan = p6 ; Pan 22 | i_index = p7 ; FM index amount 23 | 24 | imix = 0.75 25 | 26 | irandom random 0.995, 1.005 27 | a2 linseg 0, 0.05, 1, idur - 0.05, 0 28 | k2 line 0.5 + (3 * i_index), idur, 0.5 29 | a1 foscil iamp, ifreq * irandom, 1, 1.61803399, k2, 1 30 | 31 | a1 = a1 * a2 32 | 33 | aleft = a1 * sqrt(1 - ipan) 34 | aright = a1 * sqrt(ipan) 35 | 36 | outs aleft * sqrt(1 - imix), aright * sqrt(1 - imix) 37 | 38 | chnmix aleft * sqrt(imix), "left" 39 | chnmix aright * sqrt(imix), "right" 40 | event_i "i", 2, 0, 1, iamp * 0.4 * sqrt(1 - imix), ifreq * 3, ipan 41 | endin 42 | 43 | instr 2 44 | p3 = 0.2 ; Set duration 45 | idur = p3 ; Duration 46 | iamp = p4 ; Amplitude 47 | ifreq = p5 ; Frequency 48 | ipan = p6 ; Pan 49 | 50 | a1 line iamp, idur, 0 51 | a2 oscil a1, ifreq , 1 52 | 53 | outs a2 * sqrt(1 - ipan), a2 * sqrt(ipan) 54 | chnmix a2 * sqrt(1 - ipan), "left" 55 | chnmix a2 * sqrt(ipan), "right" 56 | endin 57 | 58 | instr 3 59 | iamp = p4 ; Amplitude 60 | imax_delay = 35 61 | imin_delay = 10 62 | 63 | a1 chnget "left" 64 | a2 chnget "right" 65 | chnclear "left" 66 | chnclear "right" 67 | 68 | ifb = 0.6 69 | it = 0.1 70 | 71 | alfo1 oscil 0.5, 0.1, 1 72 | alfo1 = (alfo1 + 0.5) * (imax_delay - imin_delay) + imin_delay 73 | alfo2 oscil 0.5, 0.11, 1, 0.3 74 | alfo2 = (alfo2 + 0.5) * (imax_delay - imin_delay) + imin_delay 75 | 76 | afb1 delayr it 77 | ad1 vdelay3 a1 + afb1, alfo1, imax_delay 78 | delayw ad1 * ifb 79 | 80 | afb2 delayr it 81 | ad2 vdelay3 a2 + afb2, alfo2, imax_delay 82 | delayw ad2 * ifb 83 | 84 | a3, a4 freeverb ad2, ad1, 0.8, 0.5 85 | outs a3 * iamp, a4 * iamp 86 | endin 87 | 88 | 89 | 90 | i 3 0 [60 * 60 * 24] 0.8 ; Turn of fx for 24 hours 91 | 92 | 93 | -------------------------------------------------------------------------------- /examples/Experiment_1/edge.pde: -------------------------------------------------------------------------------- 1 | class Edge { 2 | Node node_1; 3 | Node node_2; 4 | 5 | Edge(Node n_1, Node n_2) { 6 | node_1 = n_1; 7 | node_2 = n_2; 8 | } 9 | 10 | void display() { 11 | pushStyle(); 12 | float col = random(255.0); 13 | stroke(255, col, random(col), 96); 14 | strokeWeight(1); 15 | line(node_1.xpos, node_1.ypos, node_2.xpos, node_2.ypos); 16 | popStyle(); 17 | } 18 | 19 | void update() { 20 | display(); 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /examples/Experiment_1/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/Experiment_1/icon-36.png -------------------------------------------------------------------------------- /examples/Experiment_1/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/Experiment_1/icon-48.png -------------------------------------------------------------------------------- /examples/Experiment_1/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/Experiment_1/icon-72.png -------------------------------------------------------------------------------- /examples/Experiment_1/net.pde: -------------------------------------------------------------------------------- 1 | class Net { 2 | ArrayList nodes; 3 | ArrayList edges; 4 | ArrayList crawlers; 5 | AnimationController ac; 6 | ArrayList node_sounds; 7 | 8 | int n_crawlers = N_CRAWLERS; 9 | 10 | Net(int n_nodes, float min, float max) { 11 | createNodes(n_nodes, min, max); 12 | createEdges(); 13 | createCrawlers(); 14 | 15 | ac = new AnimationController(); 16 | createNodeSounds(); 17 | } 18 | 19 | void createCrawlers() { 20 | crawlers = new ArrayList(); 21 | int i; 22 | 23 | for (i = 0; i < n_crawlers; i++) { 24 | Crawler crawler = new Crawler(this); 25 | crawlers.add(crawler); 26 | } 27 | } 28 | 29 | void createEdges() { 30 | edges = new ArrayList(); 31 | int i; 32 | int j; 33 | float d; 34 | 35 | for (i = 0; i < nodes.size(); i++) { 36 | Node n1 = (Node) nodes.get(i); 37 | 38 | for (j = i + 1; j < nodes.size(); j++) { 39 | Node n2 = (Node) nodes.get(j); 40 | d = dist(n1.xpos, n1.ypos, n2.xpos, n2.ypos); 41 | 42 | if (d <= (n1.r + n2.r)) { 43 | edges.add(new Edge(n1, n2)); 44 | } 45 | } 46 | } 47 | } 48 | 49 | void createNodes(int n, float min, float max) { 50 | nodes = new ArrayList(); 51 | ArrayList temp_nodes = new ArrayList(); 52 | 53 | int i; 54 | 55 | for (i = 0; i < n; i++) { 56 | nodes.add(new Node(random(width), random(height), 57 | random_range_scaled(min, max))); 58 | } 59 | } 60 | 61 | void createNodeSounds() { 62 | node_sounds = new ArrayList(); 63 | 64 | // float[] scale = {0, 3, 5, 7, 9, 11, 12}; 65 | float[] scale = {0, 3, 5, 7, 10, 12, 15, 17, 19, 22, 66 | 24, 27, 29, 31, 34, 36}; 67 | 68 | int i; 69 | 70 | for (i = 0; i < nodes.size(); i++) { 71 | Node n = (Node) nodes.get(i); 72 | NodeSound ns = new NodeSound(); 73 | 74 | float normal = (1.0 - (n.r - MIN_NODE_SIZE) / 75 | (MAX_NODE_SIZE - MIN_NODE_SIZE)); 76 | float foo = scale[(int) (normal * (float) scale.length)]; 77 | ns.freq = BASE_FREQ * pow(2, foo / 12.0); 78 | ns.timbre = i; 79 | 80 | node_sounds.add(ns); 81 | } 82 | } 83 | 84 | void draw_edges() { 85 | int i; 86 | 87 | for (i = 0; i < edges.size(); i++) { 88 | Edge edge = (Edge) edges.get(i); 89 | edge.update(); 90 | } 91 | } 92 | 93 | void draw_nodes() { 94 | int i; 95 | 96 | for (i = 0; i < nodes.size(); i++) { 97 | Node n = (Node) nodes.get(i); 98 | n.update(); 99 | } 100 | } 101 | 102 | ArrayList get_near_nodes(Node n1) { 103 | ArrayList near_nodes = new ArrayList(); 104 | int i; 105 | float d; 106 | 107 | for (i = 0; i < this.nodes.size(); i++) { 108 | Node n2 = (Node) this.nodes.get(i); 109 | 110 | if (n1 != n2) { 111 | d = dist(n1.xpos, n1.ypos, n2.xpos, n2.ypos); 112 | 113 | if (d <= (n1.r + n2.r)) { 114 | near_nodes.add(n2); 115 | } 116 | } 117 | } 118 | 119 | return near_nodes; 120 | } 121 | 122 | boolean is_node_isolated(ArrayList _nodes, Node n) { 123 | int i; 124 | 125 | for (i = 0; i < _nodes.size(); i++) { 126 | Node temp = (Node) _nodes.get(i); 127 | 128 | if (temp != n) { 129 | float d; 130 | d = dist(temp.xpos, temp.ypos, n.xpos, n.ypos); 131 | 132 | if (d <= (temp.r + n.r)) { 133 | return false; 134 | } 135 | 136 | } 137 | } 138 | 139 | return true; 140 | } 141 | 142 | void update() { 143 | ac.update(); 144 | draw_nodes(); 145 | createEdges(); 146 | draw_edges(); 147 | update_crawlers(); 148 | } 149 | 150 | void update_crawlers() { 151 | int i; 152 | 153 | for (i = 0; i < crawlers.size(); i++) { 154 | Crawler crawler = (Crawler) crawlers.get(i); 155 | crawler.update(); 156 | } 157 | } 158 | } 159 | 160 | -------------------------------------------------------------------------------- /examples/Experiment_1/node.pde: -------------------------------------------------------------------------------- 1 | class Node { 2 | float xpos; 3 | float ypos; 4 | float r; 5 | 6 | float velocity = random(MAX_NODE_VELOCITY - MIN_NODE_VELOCITY) + 7 | MIN_NODE_VELOCITY; 8 | float direction = random(TWO_PI); 9 | 10 | Node(float x, float y, float _r) { 11 | xpos = x; 12 | ypos = y; 13 | r = _r; 14 | } 15 | 16 | void display() { 17 | float c = net.nodes.indexOf(this); 18 | 19 | pushStyle(); 20 | fill(255, 0, 0, 32); 21 | noStroke(); 22 | ellipseMode(RADIUS); 23 | ellipse(xpos, ypos, r, r); 24 | fill(255, 255 * (c / (float) N_NODES), 0, 128); 25 | ellipse(xpos, ypos, 2, 2); 26 | popStyle(); 27 | } 28 | 29 | void move() { 30 | xpos = xpos + cos(direction) * velocity; 31 | ypos = ypos + sin(direction) * velocity; 32 | 33 | if (xpos < r) { 34 | xpos = r; 35 | direction = PI - direction; 36 | } else if (xpos > width - 1 - r) { 37 | xpos = width - 1 - r; 38 | direction = PI - direction; 39 | } 40 | 41 | if (ypos < r) { 42 | ypos = r; 43 | direction = TWO_PI - direction; 44 | } else if (ypos > height - 1 - r) { 45 | ypos = height - 1 - r; 46 | direction = TWO_PI - direction; 47 | } 48 | } 49 | 50 | void update() { 51 | move(); 52 | display(); 53 | } 54 | } 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /examples/Experiment_1/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.android.AndroidMode 2 | mode=Android 3 | -------------------------------------------------------------------------------- /examples/HeaderInfo/HeaderInfo.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * Demonstrates how to use information about a running Csound process. 3 | * 4 | * Example by Jacob Joaquin 5 | */ 6 | 7 | import csoundo.*; 8 | 9 | Csoundo cs; 10 | PFont font; 11 | 12 | void setup() { 13 | size(720, 480); 14 | background(0); 15 | noLoop(); 16 | 17 | font = loadFont("Courier-24.vlw"); 18 | textFont(font); 19 | 20 | //Android Mode (comment out either) 21 | //cs = new Csoundo(this, super.getApplicationContext()); 22 | //Java Mode 23 | cs = new Csoundo(this, "HeaderInfo.csd"); 24 | cs.run(); 25 | } 26 | 27 | void draw() { 28 | translate(30, height - 180); 29 | text("Sample rate: " + cs.sr(), 0, 0); 30 | text("Control rate: " + cs.kr(), 0, 30); 31 | text("Ksmps: " + cs.ksmps(), 0, 60); 32 | text("Channels: " + cs.nchnls(), 0, 90); 33 | text("0dBfs: " + cs.get0dBFS(), 0, 120); 34 | text("Options: " + cs.getOptions(), 0, 150); 35 | } 36 | -------------------------------------------------------------------------------- /examples/HeaderInfo/data/Courier-24.vlw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/HeaderInfo/data/Courier-24.vlw -------------------------------------------------------------------------------- /examples/HeaderInfo/data/HeaderInfo.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -o dac -+rtaudio=null -d -+msg_color=0 -m0 -b512 4 | 5 | 6 | sr = 44100 7 | kr = 1470 8 | ksmps = 30 9 | nchnls = 1 10 | 0dbfs = 1 11 | 12 | gi_sin ftgen 1, 0, 8192, 10, 1 13 | 14 | instr 1 15 | ; Keep Csound running 16 | endin 17 | 18 | instr 2 19 | idur = p3 20 | iamp = p4 21 | ifreq = p5 22 | 23 | k1 line iamp, idur, 0 24 | a1 oscil k1, ifreq, gi_sin 25 | 26 | out a1 27 | endin 28 | 29 | 30 | 31 | i 1 0 [60 * 60 * 24] 32 | i 2 0 4 0.5 262 33 | 34 | 35 | -------------------------------------------------------------------------------- /examples/HeaderInfo/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/HeaderInfo/icon-36.png -------------------------------------------------------------------------------- /examples/HeaderInfo/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/HeaderInfo/icon-48.png -------------------------------------------------------------------------------- /examples/HeaderInfo/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/HeaderInfo/icon-72.png -------------------------------------------------------------------------------- /examples/HeaderInfo/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.java.JavaMode 2 | mode=Java 3 | -------------------------------------------------------------------------------- /examples/KeyboardSynth/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/KeyboardSynth/KeyboardSynth.pde: -------------------------------------------------------------------------------- 1 | /*************************/ 2 | /* Simple Keyboard Synth */ 3 | /*************************/ 4 | 5 | //import Csoundo, controlP5 6 | import csoundo.*; 7 | import controlP5.*; 8 | 9 | //Csoundo and ControlP5 objects 10 | Csoundo cs; 11 | ControlP5 cp5; 12 | 13 | void setup() { 14 | cs = new Csoundo(this, "KeyboardSynth.csd"); 15 | cs.run(); 16 | 17 | size(displayWidth,displayHeight); 18 | //size(500, 300); 19 | noStroke(); 20 | cp5 = new ControlP5(this); 21 | 22 | int whiteKeyWidth = width/7; 23 | int whiteKeyHeight = (int)(height-(height*.2)); 24 | int keyYPos = height-whiteKeyHeight; 25 | int blackKeyOffset = int(whiteKeyWidth*.7); 26 | int blackKeyWidth = int(whiteKeyWidth*.6); 27 | int blackKeyHeight = int(whiteKeyHeight*.6); 28 | 29 | cp5.addSlider("harmonics").setMin(1).setMax(10).setSize(displayWidth-20, 40).setPosition(5, 10); 30 | 31 | //whitekeys 32 | cp5.addButton("C").setValue(0).setPosition(0,keyYPos).setSize(whiteKeyWidth-2,whiteKeyHeight).setLabelVisible(false) 33 | .setColorActive(color(100)).setColorForeground(color(255)).setColorBackground(color(255)); 34 | cp5.addButton("D").setValue(.02).setPosition(whiteKeyWidth,keyYPos).setSize(whiteKeyWidth-2,whiteKeyHeight).setLabelVisible(false). 35 | setColorForeground(color(255)).setColorBackground(color(255)); 36 | cp5.addButton("E").setValue(.04).setPosition(whiteKeyWidth*2,keyYPos).setSize(whiteKeyWidth-2,whiteKeyHeight).setLabelVisible(false) 37 | .setColorForeground(color(255)).setColorBackground(color(255)); 38 | cp5.addButton("F").setValue(.05).setPosition(whiteKeyWidth*3,keyYPos).setSize(whiteKeyWidth-2,whiteKeyHeight).setLabelVisible(false) 39 | .setColorForeground(color(255)).setColorBackground(color(255)); 40 | cp5.addButton("G").setValue(.07).setPosition(whiteKeyWidth*4,keyYPos).setSize(whiteKeyWidth-2,whiteKeyHeight).setLabelVisible(false) 41 | .setColorForeground(color(255)).setColorBackground(color(255)); 42 | cp5.addButton("A").setValue(.09).setPosition(whiteKeyWidth*5,keyYPos).setSize(whiteKeyWidth-2,whiteKeyHeight).setLabelVisible(false) 43 | .setColorForeground(color(255)).setColorBackground(color(255)); 44 | cp5.addButton("B").setValue(.11).setPosition(whiteKeyWidth*6,keyYPos).setSize(whiteKeyWidth-2,whiteKeyHeight).setLabelVisible(false) 45 | .setColorForeground(color(255)).setColorBackground(color(255)); 46 | 47 | //black keys 48 | cp5.addButton("C#").setValue(.01).setPosition(0+blackKeyOffset,keyYPos).setSize(blackKeyWidth-2,blackKeyHeight).setLabelVisible(false) 49 | .setColorForeground(color(0)).setColorBackground(color(1)); 50 | cp5.addButton("D#").setValue(.03).setPosition(whiteKeyWidth+blackKeyOffset,keyYPos).setSize(blackKeyWidth-2,blackKeyHeight).setLabelVisible(false) 51 | .setColorForeground(color(0)).setColorBackground(color(1)); 52 | cp5.addButton("F#").setValue(.06).setPosition(whiteKeyWidth*3+blackKeyOffset,keyYPos).setSize(blackKeyWidth-2,blackKeyHeight).setLabelVisible(false). 53 | setColorForeground(color(0)).setColorBackground(color(1)); 54 | cp5.addButton("G#").setValue(.08).setPosition(whiteKeyWidth*4+blackKeyOffset, keyYPos).setSize(blackKeyWidth-2,blackKeyHeight).setLabelVisible(false) 55 | .setColorForeground(color(0)).setColorBackground(color(1)); 56 | cp5.addButton("A#").setValue(.10).setPosition(whiteKeyWidth*5+blackKeyOffset,keyYPos).setSize(blackKeyWidth-2,blackKeyHeight).setLabelVisible(false) 57 | .setColorForeground(color(0)).setColorBackground(color(1)); 58 | 59 | } 60 | 61 | void draw() { 62 | background(140); 63 | } 64 | 65 | public void controlEvent(ControlEvent theEvent) { 66 | println(theEvent.getController().getName()+":"+theEvent.getController().getValue()); 67 | if(theEvent.getController().getName()!="harmonics") 68 | cs.setChn("freq", theEvent.getController().getValue()+8); 69 | else if(theEvent.getController().getName()=="harmonics") 70 | cs.setChn("hrms", theEvent.getController().getValue()); 71 | 72 | } 73 | 74 | 75 | 76 | /* 77 | a list of all methods available for the Button Controller 78 | use ControlP5.printPublicMethodsFor(Button.class); 79 | to print the following list into the console. 80 | 81 | You can find further details about class Button in the javadoc. 82 | 83 | Format: 84 | ClassName : returnType methodName(parameter type) 85 | 86 | 87 | controlP5.Button : Button activateBy(int) 88 | controlP5.Button : Button setOff() 89 | controlP5.Button : Button setOn() 90 | controlP5.Button : Button setSwitch(boolean) 91 | controlP5.Button : Button setValue(float) 92 | controlP5.Button : Button update() 93 | controlP5.Button : String getInfo() 94 | controlP5.Button : String toString() 95 | controlP5.Button : boolean getBooleanValue() 96 | controlP5.Button : boolean isOn() 97 | controlP5.Button : boolean isPressed() 98 | controlP5.Controller : Button addCallback(CallbackListener) 99 | controlP5.Controller : Button addListener(ControlListener) 100 | controlP5.Controller : Button bringToFront() 101 | controlP5.Controller : Button bringToFront(ControllerInterface) 102 | controlP5.Controller : Button hide() 103 | controlP5.Controller : Button linebreak() 104 | controlP5.Controller : Button listen(boolean) 105 | controlP5.Controller : Button lock() 106 | controlP5.Controller : Button plugTo(Object) 107 | controlP5.Controller : Button plugTo(Object, String) 108 | controlP5.Controller : Button plugTo(Object[]) 109 | controlP5.Controller : Button plugTo(Object[], String) 110 | controlP5.Controller : Button registerProperty(String) 111 | controlP5.Controller : Button registerProperty(String, String) 112 | controlP5.Controller : Button registerTooltip(String) 113 | controlP5.Controller : Button removeBehavior() 114 | controlP5.Controller : Button removeCallback() 115 | controlP5.Controller : Button removeCallback(CallbackListener) 116 | controlP5.Controller : Button removeListener(ControlListener) 117 | controlP5.Controller : Button removeProperty(String) 118 | controlP5.Controller : Button removeProperty(String, String) 119 | controlP5.Controller : Button setArrayValue(float[]) 120 | controlP5.Controller : Button setArrayValue(int, float) 121 | controlP5.Controller : Button setBehavior(ControlBehavior) 122 | controlP5.Controller : Button setBroadcast(boolean) 123 | controlP5.Controller : Button setCaptionLabel(String) 124 | controlP5.Controller : Button setColor(CColor) 125 | controlP5.Controller : Button setColorActive(int) 126 | controlP5.Controller : Button setColorBackground(int) 127 | controlP5.Controller : Button setColorCaptionLabel(int) 128 | controlP5.Controller : Button setColorForeground(int) 129 | controlP5.Controller : Button setColorValueLabel(int) 130 | controlP5.Controller : Button setDecimalPrecision(int) 131 | controlP5.Controller : Button setDefaultValue(float) 132 | controlP5.Controller : Button setHeight(int) 133 | controlP5.Controller : Button setId(int) 134 | controlP5.Controller : Button setImages(PImage, PImage, PImage) 135 | controlP5.Controller : Button setImages(PImage, PImage, PImage, PImage) 136 | controlP5.Controller : Button setLabelVisible(boolean) 137 | controlP5.Controller : Button setLock(boolean) 138 | controlP5.Controller : Button setMax(float) 139 | controlP5.Controller : Button setMin(float) 140 | controlP5.Controller : Button setMouseOver(boolean) 141 | controlP5.Controller : Button setMoveable(boolean) 142 | controlP5.Controller : Button setPosition(PVector) 143 | controlP5.Controller : Button setPosition(float, float) 144 | controlP5.Controller : Button setSize(PImage) 145 | controlP5.Controller : Button setSize(int, int) 146 | controlP5.Controller : Button setStringValue(String) 147 | controlP5.Controller : Button setUpdate(boolean) 148 | controlP5.Controller : Button setValueLabel(String) 149 | controlP5.Controller : Button setView(ControllerView) 150 | controlP5.Controller : Button setVisible(boolean) 151 | controlP5.Controller : Button setWidth(int) 152 | controlP5.Controller : Button show() 153 | controlP5.Controller : Button unlock() 154 | controlP5.Controller : Button unplugFrom(Object) 155 | controlP5.Controller : Button unplugFrom(Object[]) 156 | controlP5.Controller : Button unregisterTooltip() 157 | controlP5.Controller : Button update() 158 | controlP5.Controller : Button updateSize() 159 | controlP5.Controller : CColor getColor() 160 | controlP5.Controller : ControlBehavior getBehavior() 161 | controlP5.Controller : ControlWindow getControlWindow() 162 | controlP5.Controller : ControlWindow getWindow() 163 | controlP5.Controller : ControllerProperty getProperty(String) 164 | controlP5.Controller : ControllerProperty getProperty(String, String) 165 | controlP5.Controller : Label getCaptionLabel() 166 | controlP5.Controller : Label getValueLabel() 167 | controlP5.Controller : List getControllerPlugList() 168 | controlP5.Controller : PImage setImage(PImage) 169 | controlP5.Controller : PImage setImage(PImage, int) 170 | controlP5.Controller : PVector getAbsolutePosition() 171 | controlP5.Controller : PVector getPosition() 172 | controlP5.Controller : String getAddress() 173 | controlP5.Controller : String getInfo() 174 | controlP5.Controller : String getName() 175 | controlP5.Controller : String getStringValue() 176 | controlP5.Controller : String toString() 177 | controlP5.Controller : Tab getTab() 178 | controlP5.Controller : boolean isActive() 179 | controlP5.Controller : boolean isBroadcast() 180 | controlP5.Controller : boolean isInside() 181 | controlP5.Controller : boolean isLabelVisible() 182 | controlP5.Controller : boolean isListening() 183 | controlP5.Controller : boolean isLock() 184 | controlP5.Controller : boolean isMouseOver() 185 | controlP5.Controller : boolean isMousePressed() 186 | controlP5.Controller : boolean isMoveable() 187 | controlP5.Controller : boolean isUpdate() 188 | controlP5.Controller : boolean isVisible() 189 | controlP5.Controller : float getArrayValue(int) 190 | controlP5.Controller : float getDefaultValue() 191 | controlP5.Controller : float getMax() 192 | controlP5.Controller : float getMin() 193 | controlP5.Controller : float getValue() 194 | controlP5.Controller : float[] getArrayValue() 195 | controlP5.Controller : int getDecimalPrecision() 196 | controlP5.Controller : int getHeight() 197 | controlP5.Controller : int getId() 198 | controlP5.Controller : int getWidth() 199 | controlP5.Controller : int listenerSize() 200 | controlP5.Controller : void remove() 201 | controlP5.Controller : void setView(ControllerView, int) 202 | java.lang.Object : String toString() 203 | java.lang.Object : boolean equals(Object) 204 | 205 | 206 | */ 207 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /examples/KeyboardSynth/data/KeyboardSynth.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | sr = 44100 7 | ksmps = 64 8 | nchnls = 2 9 | 10 | 0dbfs = 1 11 | 12 | instr 1 13 | kFreq chnget "freq" 14 | ;kAmp chnget "amp" 15 | kHrms chnget "hrms" 16 | kGo changed kFreq 17 | if(kGo==1) then 18 | event "i", 10, 0, 3, cpspch(kFreq), .6, kHrms 19 | endif 20 | endin 21 | 22 | 23 | instr 10 24 | aexp expon p5/10, p3, 0.001 25 | a1 buzz aexp, p4, p6, 1 26 | outs a1, a1 27 | endin 28 | 29 | 30 | 31 | 32 | f1 0 1024 10 1 33 | i1 0 3600 34 | 35 | 36 | -------------------------------------------------------------------------------- /examples/KeyboardSynth/data/button_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/KeyboardSynth/data/button_a.png -------------------------------------------------------------------------------- /examples/KeyboardSynth/data/button_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/KeyboardSynth/data/button_b.png -------------------------------------------------------------------------------- /examples/KeyboardSynth/data/button_c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/KeyboardSynth/data/button_c.png -------------------------------------------------------------------------------- /examples/KeyboardSynth/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.android.AndroidMode 2 | mode=Android 3 | -------------------------------------------------------------------------------- /examples/PlayMessage/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/PlayMessage/PlayMessage.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * Demonstrates running a Csound composition. 3 | * 4 | * Message From Another Planet by Jacob Joaquin 5 | */ 6 | 7 | import csoundo.*; 8 | 9 | Csoundo cs; 10 | 11 | void setup() { 12 | size(740, 480); 13 | background(0); 14 | noLoop(); 15 | 16 | cs = new Csoundo(this, "PlayMessage.csd"); 17 | cs.run(); 18 | } 19 | 20 | void draw() { } 21 | -------------------------------------------------------------------------------- /examples/PlayMessage/data/PlayMessage.csd: -------------------------------------------------------------------------------- 1 | Message From Another Planet 2 | Jacob Joaquin 3 | Spring 1999 4 | Revision June 2, 2010 5 | jacobjoaquin@gmail.com 6 | csoundblog.com 7 | 8 | 9 | To search for extraterrestrial intelligence from your home computer visit 10 | http://setiathome.berkeley.edu/ 11 | 12 | 13 | Bio 14 | 15 | Jacob Joaquin started tinkering with music on a Commodore 64 while 16 | in elementary school. From 1994 - 1996 he ran the Digital Dissonance 17 | BBS, an online Fresno community where musicians traded original 18 | tracker-based electronic compositions. He received his BA in Music 19 | Synthesis from Berklee College of Music in 1999. During his time 20 | at Berklee he recieved his first C programming lesson from Max 21 | Mathews and was the first recipient of Berklee's Max Mathews' award. 22 | Jacob completed his Masters Degree in Composition New Media and 23 | Integrated Media at California Institute of the Arts in 2002. He 24 | has studied composition with Dr. Richard Boulanger, Mark Trayle and 25 | Morton Subotnick. 26 | 27 | 28 | 29 | 30 | -o dac -+rtaudio=null -d -+msg_color=0 -m0 -b512 31 | 32 | 33 | sr = 44100 34 | kr = 44100 35 | ksmps = 1 36 | nchnls = 2 37 | 0dbfs = 1 38 | 39 | ; Shape of cycling envelope 40 | gi_env ftgen 0, 0, 32768, 7, 0, 2048, 1, 30720, 0 41 | 42 | instr M 43 | iamp = p4 ; Amplitude 44 | iratio = p5 ; Frequency ratio 45 | icycle = p6 ; Rate of cycling envelope 46 | 47 | iamp_mod = ((iratio + 1) / iratio) * 0.5 48 | ifreq = 440 * 2 ^ (-9 / 12) * iratio 49 | 50 | ; Cycling envelope 51 | k2 expseg 0.0625, 15, 0.0625, 113, 3.75, 113, 0.03125, 15, 0.0625 52 | k1 phasor icycle * k2 53 | k1 tablei ftlen(gi_env) * k1, gi_env, 0, 0, 1 54 | 55 | ; Random panner 56 | krand randi 0.5, icycle * 5, rnd(1), 1, 0.5 57 | 58 | ; Sine wave oscillator 59 | a1 oscils iamp * iamp_mod, ifreq, 0, 2 60 | a1 = a1 * k1 61 | 62 | ; Output to chn bus 63 | chnmix a1 * sqrt(krand), "left" 64 | chnmix a1 * (sqrt(1 - krand)), "right" 65 | endin 66 | 67 | instr Mixer 68 | iamp = p4 ; Amplitude 69 | 70 | aleft chnget "left" 71 | aright chnget "right" 72 | aenv linseg iamp, 240, iamp, 16, 0 73 | 74 | outs aleft * aenv, aright * aenv 75 | 76 | chnclear "left" 77 | chnclear "right" 78 | endin 79 | 80 | 81 | 82 | i "M" 0 256 1 1 1.24 83 | i "M" 0 . . 1.0666 1.23 84 | i "M" 0 . . 1.125 1.22 85 | i "M" 0 . . 1.14285 1.21 86 | i "M" 0 . . 1.23076 1.20 87 | i "M" 0 . . 1.28571 1.19 88 | i "M" 0 . . 1.333 1.18 89 | i "M" 0 . . 1.4545 1.17 90 | i "M" 0 . . 1.5 1.16 91 | i "M" 0 . . 1.6 1.15 92 | i "M" 0 . . 1.777 1.14 93 | i "M" 0 . . 1.8 1.13 94 | i "M" 0 . . 2 1.12 95 | i "M" 0 . . 2.25 1.10 96 | i "M" 0 . . 2.28571 1.09 97 | i "M" 0 . . 2.666 1.08 98 | i "M" 0 . . 3 1.07 99 | i "M" 0 . . 3.2 1.06 100 | i "M" 0 . . 4 1.05 101 | i "M" 0 . . 4.5 1.04 102 | i "M" 0 . . 5.333 1.03 103 | i "M" 0 . . 8 1.02 104 | i "M" 0 . [1 / 3] 9 1.01 105 | i "M" 0 . [1 / 6] 16 1.00 106 | 107 | i "Mixer" 0 256 0.1058362578313075 108 | 109 | e 256 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /examples/PlayMessage/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/PlayMessage/icon-36.png -------------------------------------------------------------------------------- /examples/PlayMessage/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/PlayMessage/icon-48.png -------------------------------------------------------------------------------- /examples/PlayMessage/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/PlayMessage/icon-72.png -------------------------------------------------------------------------------- /examples/PlayMessage/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.android.AndroidMode 2 | mode=Android 3 | -------------------------------------------------------------------------------- /examples/ProtectedTable/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/ProtectedTable/ProtectedTable.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * Not an example, but a test to make sure table data is protected. 3 | * 4 | * Every frame, a new Csound table is generated, overwriting the existing 5 | * table. Each value is replaced with a sine + noise value, and then read 6 | * from the table and used for drawing an animation. 7 | * 8 | * Some indicators that the test fails at times, where it reads a value 9 | * before it has been properly set. Watch the zero line. Pay attention 10 | * or you'll miss it. 11 | * 12 | * !Example by Jacob Joaquin 13 | */ 14 | 15 | import csoundo.*; 16 | 17 | Csoundo cs; 18 | int bugs = 0; 19 | 20 | void setup() { 21 | size(740, 480); 22 | frameRate(30); 23 | smooth(); 24 | 25 | ellipseMode(RADIUS); 26 | background(0); 27 | cs = new Csoundo(this, "ProtectedTable.csd"); 28 | cs.run(); 29 | } 30 | 31 | void draw() { 32 | noStroke(); 33 | fill(0, 8); 34 | rect(0, 0, width, height); 35 | 36 | // Create empty table 37 | float size = pow(2, 12); 38 | cs.event("f 20 0 " + size + " 10 0"); 39 | int length = cs.tableLength(20); 40 | 41 | // Increment phase of sine table input 42 | int inc = 60; 43 | float phase = (float) (frameCount % inc) / inc * TWO_PI; 44 | 45 | // Create, write, read and draw sine waveform 46 | stroke(255, 255); 47 | beginShape(); 48 | 49 | for (int i = length - 1; i >= 0; i--) { 50 | 51 | // Generate sine data point and input into table 52 | float input = sin(TWO_PI * (float) i / (float) length + phase); 53 | cs.tableSet(20, length, input); 54 | 55 | // Read the from the table at the same index 56 | float output = cs.tableGet(20, length); 57 | 58 | // Print message if input != output 59 | if (output != input) { 60 | println(output + " != " + input + " @index " + i); 61 | bugs++; 62 | println("fail rate = " + ((float) bugs / (float) frameCount)); 63 | } 64 | 65 | // Draw wave form 66 | vertex((float) i / (float) (length - 1) * (float) width, 67 | height / 2.0 + height / 2.0 * output); 68 | 69 | } 70 | 71 | endShape(); 72 | } 73 | -------------------------------------------------------------------------------- /examples/ProtectedTable/data/ProtectedTable.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -o dac -+rtaudio=null -d -+msg_color=0 -m0 -b512 4 | 5 | 6 | sr = 44100 7 | kr = 1470 8 | ksmps = 30 9 | nchnls = 1 10 | 0dbfs = 1 11 | 12 | gi_sin ftgen 1, 0, 8192, 10, 1 13 | 14 | instr 1 15 | ; Keep Csound running 16 | endin 17 | 18 | instr 2 19 | idur = p3 20 | iamp = p4 21 | ifreq = p5 22 | 23 | k1 line iamp, idur, 0 24 | a1 oscil k1, ifreq, gi_sin 25 | 26 | out a1 27 | endin 28 | 29 | 30 | 31 | i 1 0 [60 * 60 * 24] 32 | i 2 0 4 0.5 262 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /examples/ProtectedTable/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/ProtectedTable/icon-36.png -------------------------------------------------------------------------------- /examples/ProtectedTable/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/ProtectedTable/icon-48.png -------------------------------------------------------------------------------- /examples/ProtectedTable/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/ProtectedTable/icon-72.png -------------------------------------------------------------------------------- /examples/ProtectedTable/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.android.AndroidMode 2 | mode=Android 3 | -------------------------------------------------------------------------------- /examples/Random/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/Random/Random.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * Randomly generated visuals synchronized with audio. 3 | * 4 | * Example by Rory Walsh 5 | */ 6 | 7 | import csoundo.*; 8 | 9 | Csoundo cs; 10 | int cnt=0; 11 | float x,y,amp; 12 | boolean setup = false; 13 | 14 | 15 | void setup() { 16 | size(displayWidth, displayHeight); 17 | //orientation(LANDSCAPE); 18 | background(0); 19 | frameRate(10); 20 | smooth(); 21 | 22 | 23 | cs = new Csoundo(this, "Random.csd"); 24 | cs.run(); 25 | setup = true; 26 | } 27 | 28 | void draw() { 29 | x = random(width); 30 | y = random(height); 31 | amp = random(15000); 32 | 33 | cs.setChn("pitch", y); 34 | cs.setChn("pan", x/740); 35 | cs.setChn("amp", amp); 36 | 37 | 38 | 39 | fill(255, (x/800) * 255, 0, (y/480) * 255); 40 | ellipse(x,y, 20*(amp/2500), 20*(amp/2500)); 41 | fill(0, 0, 0, 10); 42 | rect(0, 0, width, height); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /examples/Random/data/Random.csd: -------------------------------------------------------------------------------- 1 | Example by Rory Walsh. 2 | 3 | 4 | 5 | -odac -b4096 6 | 7 | 8 | sr = 44100 9 | ksmps = 64 10 | nchnls = 2 11 | 12 | 0dbfs = 1 13 | 14 | instr 1 15 | 16 | kfreq chnget "pitch" 17 | kpan chnget "pan" 18 | kamp chnget "amp" 19 | kchanged changed kfreq 20 | if(kchanged==1) then 21 | event "i", 10, 0, 3, kfreq, kpan, kamp/60000 22 | endif 23 | endin 24 | 25 | 26 | instr 10 27 | aexp expon p6, p3, 0.001 28 | a1 oscil aexp, p4, 1 29 | outs a1*p5, a1*(1-p5) 30 | endin 31 | 32 | 33 | 34 | f 1 0 1024 10 1 35 | i 1 0 [60 * 60 * 24] 36 | 37 | 38 | -------------------------------------------------------------------------------- /examples/Random/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/Random/icon-36.png -------------------------------------------------------------------------------- /examples/Random/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/Random/icon-48.png -------------------------------------------------------------------------------- /examples/Random/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/Random/icon-72.png -------------------------------------------------------------------------------- /examples/Random/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.android.AndroidMode 2 | mode=Android 3 | -------------------------------------------------------------------------------- /examples/Sliders/Sliders.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * A bank of seven sliders controlling an FM synthesizer (foscil). The 3 | * sliders are generated using the controlP5 library by Andreas Schlegel. 4 | * Great for old school lasers and UFOs. 5 | * 6 | * Downlaod controlP5: http://www.sojamo.de/libraries/controlP5/ 7 | * 8 | * Example by Jacob Joaquin 9 | */ 10 | 11 | import controlP5.*; 12 | import csoundo.*; 13 | 14 | ControlP5 controlP5; 15 | Csoundo cs; 16 | 17 | void setup() { 18 | size(550, 220); 19 | frameRate(30); 20 | smooth(); 21 | 22 | controlP5 = new ControlP5(this); 23 | //Android Mode (comment out either) 24 | //cs = new Csoundo(this, super.getApplicationContext()); 25 | //Java Mode 26 | cs = new Csoundo(this, "Sliders.csd"); 27 | cs.run(); 28 | 29 | // Set default values in Csound chn bus memory 30 | cs.setChn("amp", 0.707); 31 | cs.setChn("freq", 100); 32 | cs.setChn("c", 1.0); 33 | cs.setChn("m", 1.0); 34 | cs.setChn("index", 1.0); 35 | cs.setChn("lfo_amp", 0.0); 36 | cs.setChn("lfo_rate", 0.0); 37 | 38 | // Create sliders 39 | controlP5.addSlider("amp", 0, 1, 0.707, 40, 40, 40, 120); 40 | controlP5.addSlider("freq", 100, 200, 100, 110, 40, 40, 120); 41 | controlP5.addSlider("c", 0, 8, 1.0, 180, 40, 40, 120); 42 | controlP5.addSlider("m", 0, 8, 1.0, 250, 40, 40, 120); 43 | controlP5.addSlider("index", 0, 8, 1.0, 320, 40, 40, 120); 44 | controlP5.addSlider("lfo_amp", 0, 1, 0.0, 390, 40, 40, 120); 45 | controlP5.addSlider("lfo_rate", 0, 20, 0.0, 470, 40, 40, 120); 46 | } 47 | 48 | void draw() { 49 | background(0); 50 | } 51 | 52 | void controlEvent(ControlEvent e) { 53 | // Update chn bus related to ControlEvent 54 | cs.setChn(e.controller().name(), e.controller().value()); 55 | } 56 | -------------------------------------------------------------------------------- /examples/Sliders/data/Sliders.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -o dac -+rtaudio=null -d -+msg_color=0 -m0 -b512 4 | 5 | 6 | sr = 44100 7 | kr = 1470 8 | ksmps = 30 9 | nchnls = 1 10 | 0dbfs = 1 11 | 12 | ; Create sine table 13 | gi_sin ftgen 1, 0, 8192, 10, 1 14 | 15 | ; Define chn busses 16 | chn_k "amp", 1 ; Amplitude 17 | chn_k "freq", 1 ; Frequency 18 | chn_k "c", 1 ; Carrier amount 19 | chn_k "m", 1 ; Modulation amount 20 | chn_k "index", 1 ; FM Index 21 | chn_k "lfo_amp", 1 ; LFO amplitude 22 | chn_k "lfo_rate", 1 ; LFO rate 23 | 24 | instr 1 25 | idur = p3 ; Duration 26 | iamp = p4 ; Amplitude 27 | 28 | ; Read values from chn busses 29 | kamp chnget "amp" 30 | kfreq chnget "freq" 31 | kc chnget "c" 32 | km chnget "m" 33 | kindex chnget "index" 34 | klfo_amp chnget "lfo_amp" 35 | klfo_rate chnget "lfo_rate" 36 | 37 | ; FM Synthesizer 38 | klfo oscil 0.5, klfo_rate, gi_sin, 0.75 39 | klfo = (klfo + 0.5) * klfo_amp 40 | a1 foscil iamp * kamp, kfreq + kfreq * klfo, kc, km, kindex, gi_sin 41 | 42 | ; Output 43 | out a1 44 | endin 45 | 46 | 47 | 48 | i 1 0 [60 * 60 * 24] 0.707 ; Turn on instrument 1 49 | 50 | 51 | -------------------------------------------------------------------------------- /examples/Sliders/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/Sliders/icon-36.png -------------------------------------------------------------------------------- /examples/Sliders/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/Sliders/icon-48.png -------------------------------------------------------------------------------- /examples/Sliders/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/Sliders/icon-72.png -------------------------------------------------------------------------------- /examples/Sliders/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.java.JavaMode 2 | mode=Java 3 | -------------------------------------------------------------------------------- /examples/Snake/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/Snake/Snake.pde: -------------------------------------------------------------------------------- 1 | //================================================= 2 | //initialise and declare variables 3 | // 4 | // THIS FILE WILL NOT RUN IN THIS VERSION OF CSOUNDO 5 | // I'M LEAVING THE CODE HERE IN CASE ANYONE WANTS TO 6 | // USE IT IN A STANDARD CSOUNDO SKETCH. 7 | //================================================= 8 | import csoundo.*; 9 | 10 | Csoundo cs; 11 | 12 | color col=color(255,255,192); 13 | color foodColor = color(255,0, 0); 14 | float speed = 100; 15 | int cx, cy; 16 | 17 | int moveX = 0; 18 | int moveY = 0; 19 | int snakeX = 0; 20 | int snakeY = 0; 21 | int foodX = -1; 22 | int numberOfNotes = 1; 23 | int foodY = -1; 24 | float speedIncr = 1; 25 | boolean check = true; 26 | int []snakesX; 27 | int []snakesY; 28 | int playNote = 0; 29 | 30 | int snakeSize = 1; 31 | int windowHeight; 32 | int windowWidth; 33 | float controlHeight; 34 | float controlWidth; 35 | 36 | boolean gameOver = false; 37 | PFont Font = createFont("Arial",20, true); 38 | int[] obstaclesX = new int[1000]; 39 | int[] obstaclesY = new int[1000]; 40 | int numberOfObstacles=0; 41 | //================================================= 42 | //setup 43 | //================================================= 44 | void setup(){ 45 | //size(int(windowSize), int(windowSize),P3D); 46 | size(displayWidth, displayHeight); 47 | windowHeight = displayHeight-int((displayHeight*.25)); 48 | windowWidth = displayWidth; 49 | 50 | background(0); 51 | speed = 100; 52 | speed=speed/frameRate; 53 | snakesX = new int[100]; 54 | snakesY = new int[100]; 55 | 56 | cx = width/2; 57 | cy = height/2; 58 | 59 | snakeX = cx-5; 60 | snakeY = cy-5; 61 | foodX = -1; 62 | foodY = -1; 63 | gameOver = false; 64 | check = true; 65 | snakeSize =1; 66 | 67 | 68 | //Android Mode 69 | cs = new Csoundo(this, super.getApplicationContext()); 70 | cs.run(); 71 | cs.setChn("note", 6); 72 | } 73 | 74 | //================================================= 75 | //draw 76 | //================================================= 77 | void draw() 78 | { 79 | if(speed%10 == 0){ 80 | background(0); 81 | runGame(); 82 | } 83 | speed+=speedIncr; 84 | 85 | fill(255, 0, 0); 86 | controlHeight = displayHeight*.2; 87 | controlWidth = displayWidth*.2; 88 | 89 | /* 90 | | |-------| | 91 | | | up | | 92 | | | | | 93 | | |------|-------|-------| | 94 | | | | | | | 95 | | | left | down | right | | 96 | | |------|-------|-------| | 97 | */ 98 | 99 | rect(controlWidth*2, windowHeight, controlHeight/2, controlHeight/2, 7); 100 | rect(controlWidth, (windowHeight+controlHeight/2)+10, controlHeight/2, controlHeight/2, 7); 101 | rect(controlWidth*2, (windowHeight+controlHeight/2)+10, controlHeight/2, controlHeight/2, 7); 102 | rect(controlWidth*3, (windowHeight+controlHeight/2)+10, controlHeight/2, controlHeight/2, 7); 103 | 104 | textFont(Font); 105 | textAlign (CENTER); 106 | fill(255, 255, 255); 107 | int offset = int(controlWidth/2); 108 | 109 | text("Up", (controlWidth*2), windowHeight+50, controlHeight/2, 40); 110 | text("Left", controlWidth, (windowHeight+controlHeight/2)+50, controlHeight/2, 40); 111 | text("Down", (controlWidth*2), (windowHeight+controlHeight/2)+50, controlHeight/2, 40); 112 | text("Right", (controlWidth*3), (windowHeight+controlHeight/2)+50, controlHeight/2, 40); 113 | 114 | 115 | String scoreString = "Score:"+snakeSize; 116 | text(scoreString, 10, displayHeight-50, controlHeight/2, 40); 117 | } 118 | //================================================= 119 | //Android onPause() and onResume() methods for Csoundo 120 | //================================================= 121 | @Override 122 | public void onPause() { 123 | super.onPause(); // Always call the superclass method first 124 | cs.dispose(); 125 | } 126 | 127 | @Override 128 | public void onResume() { 129 | super.onResume(); // Always call the superclass method first 130 | cs = new Csoundo(this, super.getApplicationContext()); 131 | cs.run(); 132 | } 133 | //================================================= 134 | //reset 135 | //================================================= 136 | void reset(){ 137 | snakeX = cx-5; 138 | snakeY = cy-5; 139 | gameOver = false; 140 | check = true; 141 | snakeSize =1; 142 | speedIncr=1; 143 | moveY = 0; 144 | moveX = 0; 145 | } 146 | 147 | //================================================= 148 | //run game 149 | //================================================= 150 | void runGame(){ 151 | if(gameOver==false){ 152 | drawfood(); 153 | drawSnake(); 154 | snakeMove(); 155 | ateFood(); 156 | createObstacles(); 157 | checkHitSelf(); 158 | }else{ 159 | String modelString = "game over\ntap screen to restart"; 160 | textAlign (CENTER); 161 | textFont(Font); 162 | text(modelString,windowWidth/2,windowHeight/2,40); 163 | } 164 | } 165 | 166 | //================================================= 167 | //check if snake hits itself 168 | //================================================= 169 | void checkHitSelf(){ 170 | for(int i = 1; i < snakeSize; i++){ 171 | if(snakeX == snakesX[i] && snakeY== snakesY[i]){ 172 | gameOver = true; 173 | } 174 | } 175 | } 176 | 177 | //================================================= 178 | //ate food 179 | //================================================= 180 | void ateFood(){ 181 | if(foodX == snakeX && foodY == snakeY){ 182 | check = true; 183 | snakeSize++; 184 | //freqIncr=freqIncr+.01; 185 | for(int i=0;i<10;i++){ 186 | obstaclesY[numberOfObstacles+i] = int(random(windowHeight)); 187 | obstaclesX[numberOfObstacles+i] = int(random(windowWidth)); 188 | } 189 | numberOfObstacles+=10; 190 | cs.setChn("numberOfNotes", numberOfNotes); 191 | numberOfNotes++; 192 | } 193 | 194 | } 195 | 196 | //================================================= 197 | //draw food 198 | //================================================= 199 | void drawfood(){ 200 | fill(foodColor); 201 | 202 | while(check){ 203 | int x = (int)random(1,displayWidth/10); 204 | int y = (int)random(1,windowHeight/10); 205 | foodX = 5+x*10; 206 | foodY = 5+y*10; 207 | 208 | for(int i = 0; i < snakeSize; i++){ 209 | if(x == snakesX[i] && y == snakesY[i]){ 210 | check = true; 211 | i = snakeSize; 212 | }else{ 213 | check = false; 214 | } 215 | } 216 | 217 | } 218 | 219 | rect(foodX-5, foodY-5, 10, 10); 220 | 221 | } 222 | 223 | //================================================= 224 | //draw snake 225 | //================================================= 226 | void drawSnake(){ 227 | fill(col); 228 | 229 | for(int i = 0; i < snakeSize; i++) { 230 | int X = snakesX[i]; 231 | int Y = snakesY[i]; 232 | rect(X-5,Y-5,10,10); 233 | } 234 | 235 | for(int i = snakeSize; i > 0; i--){ 236 | snakesX[i] = snakesX[i-1]; 237 | snakesY[i] = snakesY[i-1]; 238 | } 239 | } 240 | 241 | //================================================= 242 | //add obstacles 243 | //================================================= 244 | void createObstacles(){ 245 | for(int i=0;i displayWidth-5 || snakeX < 5 || snakeY > (windowHeight)-5 || snakeY < 5){ 258 | gameOver = true; 259 | } 260 | 261 | for(int i=0;i obstaclesY[i]-8 && snakeY < obstaclesY[i]+8) 263 | if(snakeX > obstaclesX[i]-8 && snakeX < obstaclesX[i]+8) 264 | gameOver = true; 265 | } 266 | 267 | snakesX[0] = snakeX; 268 | snakesY[0] = snakeY; 269 | 270 | // if(playNote%2==0){ 271 | float rand = random(numberOfNotes); 272 | cs.setChn("note", int(rand)); 273 | //} 274 | // playNote++; 275 | 276 | } 277 | 278 | //================================================= 279 | //mouse pressed 280 | //================================================= 281 | void mousePressed() { 282 | //up: rect(controlWidth*2, windowHeight, controlHeight/2, controlHeight/2, 7); 283 | //left: rect(controlWidth, (windowHeight+controlHeight/2)+10, controlHeight/2, controlHeight/2, 7); 284 | //down: rect(controlWidth*2, (windowHeight+controlHeight/2)+10, controlHeight/2, controlHeight/2, 7); 285 | //right: rect(controlWidth*3, (windowHeight+controlHeight/2)+10, controlHeight/2, controlHeight/2, 7); 286 | 287 | if(mouseY>windowHeight){ 288 | 289 | //up 290 | if((mouseX>controlWidth*2) && (mouseXwindowHeight) && (mouseYcontrolWidth*2) && (mouseXwindowHeight+controlHeight/2)) 301 | { 302 | if(snakesY[1] != snakesY[0]+10){ 303 | moveY = 10; 304 | moveX = 0; 305 | } 306 | } 307 | 308 | //left 309 | if((mouseX>controlWidth) && (mouseXwindowHeight+controlHeight/2)) 311 | { 312 | if(snakesX[1] != snakesX[0]-10){ 313 | moveX = -10; 314 | moveY = 0; 315 | } 316 | } 317 | 318 | //right 319 | if((mouseX>controlWidth*3) && (mouseXwindowHeight+controlHeight/2)) 321 | { 322 | if(snakesX[1] != snakesX[0]+10){ 323 | moveX = 10; 324 | moveY = 0; 325 | } 326 | } 327 | 328 | } 329 | else 330 | if(gameOver) 331 | reset(); 332 | } 333 | -------------------------------------------------------------------------------- /examples/Snake/data/Snake.csd: -------------------------------------------------------------------------------- 1 | ;Rory Walsh. 2 | 3 | 4 | 5 | -o dac -+rtaudio=null -d -+msg_color=0 -m0 -b512 6 | 7 | 8 | sr = 44100 9 | ksmps = 64 10 | nchnls = 2 11 | 12 | 0dbfs = 1 13 | 14 | instr 1 15 | kIndex chnget "note" 16 | kOctave chnget "numberOfNotes" 17 | kchanged1 changed kIndex 18 | kchanged2 changed kOctave 19 | kMute randh 1, 10, 1 20 | 21 | if(kchanged1==1) then 22 | if(kIndex<16) then 23 | kNote tab int(kIndex), 2 24 | event "i", 10, 0, 1, cpspch(kNote+7)*round(abs(kMute)); 25 | endif 26 | endif 27 | 28 | if(kchanged2==1) then 29 | event "i", 20, 0, 3 30 | endif 31 | endin 32 | 33 | 34 | instr 10 35 | aexp expon .5, p3, 0.001 36 | a1 oscil aexp, p4, 1 37 | outs a1, a1 38 | endin 39 | 40 | instr 20 41 | aexp expon .5, p3, 0.001 42 | a1 randi aexp, 1000 43 | a2 oscil a1, 200, 1 44 | outs a2, a2 45 | endin 46 | 47 | 48 | 49 | 50 | f1 0 1024 10 1 51 | f2 0 16 -2 0 .02 .04 .05 .07 .09 .11 1 1.02 1.04 1.05 1.07 1.09 1.11 2 2.02 52 | i 1 0 [60 * 60 * 24] 53 | 54 | 55 | -------------------------------------------------------------------------------- /examples/Snake/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.android.AndroidMode 2 | mode=Android 3 | -------------------------------------------------------------------------------- /examples/SonicSausages/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/SonicSausages/SonicSausages.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Based on Processing code from Keith Peters (www.bit-101.com). 3 | * 4 | * Example by Rory Walsh 5 | */ 6 | 7 | import csoundo.*; 8 | 9 | Csoundo cs; 10 | 11 | float[] x = new float[20]; 12 | float[] y = new float[20]; 13 | float segLength = 50; 14 | float r, g, b; 15 | 16 | void setup() { 17 | size(displayWidth, displayHeight); 18 | orientation(LANDSCAPE); 19 | frameRate(10); 20 | smooth(); 21 | stroke(0, 100); 22 | smooth(); 23 | //Android Mode (comment out either) 24 | //cs = new Csoundo(this, super.getApplicationContext()); 25 | //Java Mode 26 | cs = new Csoundo(this, "SonicSausages.csd"); 27 | cs.run(); 28 | } 29 | 30 | void draw() { 31 | background(1); 32 | dragSegment(0, mouseX, mouseY); 33 | for(int i=0; i 4 | 5 | -odac -b512 6 | 7 | 8 | sr = 44100 9 | ksmps = 64 10 | nchnls = 2 11 | 12 | 0dbfs = 1 13 | gaSig init 0 14 | gaSigL init 0 15 | gaSigR init 0 16 | 17 | 18 | instr 1 19 | kmod chnget "mod" 20 | kcar chnget "car" 21 | amod lfo .1, kmod 22 | acar oscil amod, kcar, 1 23 | gaSig = acar 24 | endin 25 | 26 | ;global delay 27 | instr 2 28 | acombL comb gaSig*.1, 2, .3 29 | acombR comb gaSig*.1, 2, .42 30 | gaSigL = acombL 31 | gaSigR = acombR 32 | endin 33 | 34 | 35 | instr 3 36 | a1, a2 reverbsc gaSigL, gaSigR, .5, 1000 37 | outs a1, a2 38 | gaSigL = 0 39 | gaSigR = 0 40 | endin 41 | 42 | 43 | 44 | f1 0 1024 10 1 0.5 .2 45 | i1 0 [60 * 60 * 24] 46 | i2 0 [60 * 60 * 24] 47 | i3 0 [60 * 60 * 24] 48 | 49 | 50 | -------------------------------------------------------------------------------- /examples/SonicSausages/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/SonicSausages/icon-36.png -------------------------------------------------------------------------------- /examples/SonicSausages/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/SonicSausages/icon-48.png -------------------------------------------------------------------------------- /examples/SonicSausages/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/SonicSausages/icon-72.png -------------------------------------------------------------------------------- /examples/SonicSausages/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.android.AndroidMode 2 | mode=Android 3 | -------------------------------------------------------------------------------- /examples/SonicSock/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/SonicSock/SonicSock.pde: -------------------------------------------------------------------------------- 1 | /** 2 | * Based on Processing code from Keith Peters (www.bit-101.com). 3 | * 4 | * Example by Rory Walsh 5 | */ 6 | 7 | import csoundo.*; 8 | 9 | Csoundo cs; 10 | 11 | float[] x = new float[20]; 12 | float[] y = new float[20]; 13 | float segLength = 50; 14 | float r, g, b; 15 | 16 | void setup() { 17 | size(displayWidth, displayHeight); 18 | frameRate(10); 19 | smooth(); 20 | stroke(0, 100); 21 | smooth(); 22 | cs = new Csoundo(this, "SonicSock.csd"); 23 | cs.run(); 24 | } 25 | 26 | void draw() { 27 | background(1); 28 | dragSegment(0, mouseX, mouseY); 29 | for(int i=0; i 4 | 5 | -odac -b1024 6 | 7 | 8 | sr = 44100 9 | ksmps = 64 10 | nchnls = 2 11 | 12 | 0dbfs = 1 13 | 14 | gaSig init 0 15 | gaSigL init 0 16 | gaSigR init 0 17 | 18 | 19 | instr 1 20 | kmod chnget "mod" 21 | kcar chnget "car" 22 | amod lfo .1, kmod 23 | acar oscil amod, kcar, 1 24 | gaSig = acar 25 | endin 26 | 27 | ;global delay 28 | instr 2 29 | acombL comb gaSig*.1, 2, .3 30 | acombR comb gaSig*.1, 2, .42 31 | outs acombL, acombR 32 | endin 33 | 34 | 35 | 36 | 37 | 38 | f1 0 1024 10 1 0.5 .2 39 | i1 0 [60 * 60 * 24] 40 | i2 0 [60 * 60 * 24] 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /examples/SonicSock/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/SonicSock/icon-36.png -------------------------------------------------------------------------------- /examples/SonicSock/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/SonicSock/icon-48.png -------------------------------------------------------------------------------- /examples/SonicSock/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/examples/SonicSock/icon-72.png -------------------------------------------------------------------------------- /examples/SonicSock/sketch.properties: -------------------------------------------------------------------------------- 1 | mode.id=processing.mode.android.AndroidMode 2 | mode=Android 3 | -------------------------------------------------------------------------------- /icons/icon-36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/icons/icon-36.png -------------------------------------------------------------------------------- /icons/icon-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/icons/icon-48.png -------------------------------------------------------------------------------- /icons/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/icons/icon-72.png -------------------------------------------------------------------------------- /library/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/library/.DS_Store -------------------------------------------------------------------------------- /library/csnd6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/library/csnd6.jar -------------------------------------------------------------------------------- /library/csoundo.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/library/csoundo.jar -------------------------------------------------------------------------------- /p5jsExample/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/p5jsExample/.DS_Store -------------------------------------------------------------------------------- /p5jsExample/FileManager.js: -------------------------------------------------------------------------------- 1 | /* 2 | * C S O U N D 3 | * 4 | * L I C E N S E 5 | * 6 | * This software is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This software is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this software; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | var FileManager = function(allowedFileExtensions, errorPrintCallback) { 22 | 23 | 24 | function checkFileExtension(fileURL) { 25 | 26 | var fileExtension = fileURL.split('.').pop(); 27 | 28 | for (var i = 0; i < allowedFileExtensions.length; ++i) { 29 | 30 | if (fileExtension.localeCompare(allowedFileExtensions[i]) === 0) { 31 | 32 | return true; 33 | } 34 | } 35 | 36 | return false; 37 | }; 38 | this.fileUploadFromServer = function(fileURL, fileUploadCallback) { 39 | 40 | if (checkFileExtension(fileURL) == false) { 41 | 42 | errorPrintCallback("File extension not allowed for file " + fileURL); 43 | return; 44 | } 45 | 46 | var xmlHttpRequest = new XMLHttpRequest(); 47 | 48 | xmlHttpRequest.onload = function () { 49 | 50 | var data = new Uint8Array(xmlHttpRequest.response); 51 | var stream = FS.open(fileURL, 'w+'); 52 | FS.write(stream, data, 0, data.length, 0); 53 | FS.close(stream); 54 | 55 | if (typeof fileUploadCallback !== 'undefined') { 56 | 57 | fileUploadCallback(data, fileURL); 58 | } 59 | }; 60 | 61 | xmlHttpRequest.onerror = function () { 62 | 63 | errorPrintCallback(this.statusText); 64 | }; 65 | 66 | xmlHttpRequest.open("get", fileURL, true); 67 | xmlHttpRequest.responseType = "arraybuffer"; 68 | xmlHttpRequest.send(null); 69 | }; 70 | 71 | this.fileUploadFromClient = function(fileObject, fileUploadCallback) { 72 | 73 | 74 | if (checkFileExtension(fileObject.name) == false) { 75 | errorPrintCallback("File extension not allowed for file " + fileObject.name); 76 | return; 77 | } 78 | var reader = new FileReader(); 79 | reader.onload = function(e) { 80 | 81 | 82 | var data = new Uint8Array(e.target.result); 83 | var stream = FS.open(fileObject.name, 'w+'); 84 | FS.write(stream, data, 0, data.length, 0); 85 | FS.close(stream); 86 | fileUploadCallback(); 87 | } 88 | reader.readAsArrayBuffer(fileObject); 89 | 90 | }; 91 | 92 | this.readFileAsString = function(filePath) { 93 | 94 | var data = FS.readFile(filePath); 95 | var string = String.fromCharCode.apply(null, data); 96 | 97 | return string; 98 | }; 99 | 100 | this.writeStringToFile = function(filePath, fileString) { 101 | 102 | FS.writeFile(filePath, fileString, {encoding: 'utf8'}); 103 | }; 104 | }; 105 | -------------------------------------------------------------------------------- /p5jsExample/README.md: -------------------------------------------------------------------------------- 1 | # Csound p5.js Random Example 2 | 3 | Based on code posted to Csound mailing list by Steven Yi\ 4 | and hosted [here](https://github.com/kunstmusik/csound-p5js) 5 | Modified and updated by Rory Walsh. 6 | 7 | ## Description 8 | 9 | Presents the simple Random example from the Csoundo examples as a self-contained project using p5.js and 10 | a WebAssembly build of Csound. 11 | 12 | ## Local Testing 13 | 14 | This example can be run with the latest version of Firefox without the need of a local server. Steven recommends the following options if you wish to run the examples through a local web server: 15 | 16 | 1. If you have node.js and npm installed, install and use http-server. A useful article on setting up http-server is found here. You can install http-server with npm by running npm install -g http-server. Afterwards, go to the folder where this project is checked out and run http-server. This will start the server using the default port of 8080. Finally, go to your browser and enter the URL http://localhost:8080 and you should see this project loaded in your browser. 17 | 18 | 2. If you have python installed, used its builtin SimpleHTTPServer by opening a terminal, going to the folder where this project is checked out and run python -m SimpleHTTPServer 3000. Then, go to your browser and use http://localhost:3000 as the URL to view this project. 19 | 20 | -------------------------------------------------------------------------------- /p5jsExample/csound-p5js.js: -------------------------------------------------------------------------------- 1 | /** Csound p5.js Example 2 | * Based on code posted by Steven Yi to the Csound mailing list. 3 | * Modified by RW, 2018 4 | * 5 | * Description: Simple JS file that creates a CsoundObj 6 | * object and compiles and instance of Csound. This object is global 7 | * and can be accessed from the sketch.js file 8 | */ 9 | 10 | // Signals when csound is loaded and used from sketch.js file 11 | var csoundLoaded = false; 12 | var cs; 13 | 14 | // Called when Csound WASM completes loading 15 | function onRuntimeInitialized() 16 | { 17 | cs = new CsoundObj(); 18 | 19 | //use this code to load a .csd file and have Csound compile and start it 20 | var fileManger = new FileManager(['csd'], console.log); 21 | fileManger.fileUploadFromServer("random.csd", function(){ 22 | cs.compileCSD("random.csd"); 23 | cs.start(); 24 | cs.audioContext.resume(); 25 | }); 26 | 27 | csoundLoaded = true; 28 | 29 | } 30 | 31 | function load_script(src, async) 32 | { 33 | var script = document.createElement('script'); 34 | script.src = src; 35 | script.async = async; 36 | document.head.appendChild(script); 37 | } 38 | 39 | // Initialize Module before WASM loads 40 | Module = {}; 41 | Module['wasmBinaryFile'] = 'wasm/libcsound.wasm'; 42 | Module['print'] = console.log; 43 | Module['printErr'] = console.log; 44 | Module['onRuntimeInitialized'] = onRuntimeInitialized; 45 | 46 | if(typeof WebAssembly !== undefined) 47 | { 48 | console.log("Using WASM Csound..."); 49 | load_script("FileManager.js", false); 50 | load_script("wasm/libcsound.js", false); 51 | load_script("wasm/FileList.js", false); 52 | load_script("wasm/CsoundObj.js", false); 53 | } 54 | -------------------------------------------------------------------------------- /p5jsExample/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Csound p5.js Example 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /p5jsExample/random.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -m0d 4 | 5 | 6 | sr = 44100 7 | ksmps = 64 8 | nchnls = 2 9 | 0dbfs = 1 10 | 11 | instr 1 12 | kfreq chnget "pitch" 13 | kpan chnget "pan" 14 | kamp chnget "amp" 15 | kchanged changed kfreq 16 | if(kchanged==1) then 17 | event "i", 10, 0, 3, kfreq, kpan, kamp/60000 18 | endif 19 | endin 20 | 21 | 22 | instr 10 23 | aexp expon p6, p3, 0.001 24 | a1 oscil aexp, p4 25 | outs a1*p5, a1*(1-p5) 26 | endin 27 | 28 | 29 | 30 | 31 | i1 0 z 32 | 33 | 34 | -------------------------------------------------------------------------------- /p5jsExample/sketch.js: -------------------------------------------------------------------------------- 1 | /** Csound p5.js Example 2 | * Based on code posted by Steven Yi to the Csound mailing list. 3 | * Modified by RW, 2018 4 | * 5 | * Description: Simple p5 sketch that draws random circles to the 6 | * screen and triggers an corresponing random note. The cs var has been 7 | * created globally in the csound-p5js.js file 8 | */ 9 | 10 | 11 | var textAlpha = 0; 12 | var textAlphaSpeed = 0.01; 13 | 14 | function setup() 15 | { 16 | var cnvs = createCanvas(windowWidth, windowHeight); 17 | cnvs.style('display', 'block'); 18 | textAlign(CENTER); 19 | frameRate(3) 20 | } 21 | 22 | function draw() 23 | { 24 | background(0,0,0); 25 | 26 | if(csoundLoaded) 27 | { 28 | //put all Csound API calls here 29 | x = random(width); 30 | y = random(height); 31 | amp = random(15000); 32 | 33 | cs.setControlChannel("pitch", y); 34 | cs.setControlChannel("pan", x/740); 35 | cs.setControlChannel("amp", amp); 36 | 37 | 38 | fill(255, (x/800) * 255, 0, (y/480) * 255); 39 | ellipse(x,y, 20*(amp/2500), 20*(amp/2500)); 40 | fill(0, 0, 0, 10); 41 | rect(0, 0, width, height); 42 | } 43 | else 44 | { 45 | //basic code to indicate Csound is still loading... 46 | fill(0, 0, 100, textAlpha); 47 | text("...LOADING CSOUND...", width/2, height/2); 48 | textAlpha += textAlphaSpeed; 49 | if(textAlpha > 1 || textAlpha < 0) 50 | { 51 | textAlphaSpeed *= -1; 52 | } 53 | } 54 | } 55 | 56 | 57 | function windowResized() 58 | { 59 | resizeCanvas(windowWidth, windowHeight); 60 | } 61 | -------------------------------------------------------------------------------- /p5jsExample/style.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | -------------------------------------------------------------------------------- /p5jsExample/wasm/FileList.js: -------------------------------------------------------------------------------- 1 | /* 2 | * C S O U N D 3 | * 4 | * L I C E N S E 5 | * 6 | * This software is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This software is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | */ 15 | 16 | 17 | var FileList = function(path) { 18 | 19 | var that = this; 20 | var _getFileCount = cwrap('FileList_getFileCount', ['number'], ['string']); 21 | var _getFileNameString = cwrap('FileList_getFileNameString', ['string'], ['string', 'number']); 22 | 23 | this.getFileList = function() { 24 | 25 | var count = _getFileCount(path); 26 | 27 | var fileList = []; 28 | 29 | for (var i = 0; i < count; ++i) { 30 | 31 | var filePointer = _getFileNameString(path, i); 32 | var buffer = new Uint8Array(Module.HEAP8.buffer, filePointer, _strlen(filePointer)); 33 | var fileName = String.fromCharCode.apply(null, buffer); 34 | fileList.push(fileName); 35 | } 36 | 37 | return fileList; 38 | }; 39 | }; 40 | -------------------------------------------------------------------------------- /p5jsExample/wasm/libcsound.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"libcsound.js","sources":[],"names":[],"mappings":""} -------------------------------------------------------------------------------- /p5jsExample/wasm/libcsound.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/p5jsExample/wasm/libcsound.wasm -------------------------------------------------------------------------------- /reference/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes (Javadocs: csoundo) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | All Classes 20 |
21 | 22 | 23 | 24 | 31 | 32 |
Csoundo 25 |
26 | Engine 27 |
28 | Mutex 29 |
30 |
33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /reference/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes (Javadocs: csoundo) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | All Classes 20 |
21 | 22 | 23 | 24 | 31 | 32 |
Csoundo 25 |
26 | Engine 27 |
28 | Mutex 29 |
30 |
33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /reference/constant-values.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Constant Field Values (Javadocs: csoundo) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 |
80 |
81 |

82 | Constant Field Values

83 |
84 |
85 | Contents 88 | 89 | 90 | 91 | 92 | 94 | 95 |
93 | csoundo.*
96 | 97 |

98 | 99 | 100 | 101 | 102 | 103 | 104 | 106 | 107 | 108 | 109 | 110 | 111 |
csoundo.Csoundo
105 | public static final java.lang.StringVERSION"0.1.2"
112 | 113 |

114 | 115 |

116 |


117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 137 | 140 | 141 | 142 | 143 | 146 | 162 | 163 |
138 | 139 |
164 | 165 | 166 | 167 |
168 | processing library csoundo by Jacob Joaquin. (c) 2010 169 | 170 | 171 | -------------------------------------------------------------------------------- /reference/csoundo/Engine.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Engine (Javadocs: csoundo) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 | 76 | 78 | 80 | 81 |
50 | 51 |
82 | 83 | 84 | 85 |
86 | 87 |

88 | 89 | csoundo 90 |
91 | Class Engine

92 |
 93 | java.lang.Object
 94 |   extended by csoundo.Engine
 95 | 
96 |
97 |
98 |
public class Engine
extends java.lang.Object
99 | 100 | 101 |

102 | This class is for getting Csound up and running. 103 |

104 | 105 |

106 |


107 | 108 |

109 | 110 | 111 | 112 | 113 | 114 | 116 | 117 | 118 | 120 | 124 | 125 | 126 | 128 | 132 | 133 | 134 | 136 | 140 | 141 | 142 | 144 | 148 | 149 | 150 | 152 | 156 | 157 | 158 | 160 | 164 | 165 | 166 | 168 | 172 | 173 | 174 | 176 | 180 | 181 |
115 | Field Summary
119 |  Csoundcsound 121 | 122 |
123 |            
127 |  SWIGTYPE_p_CSOUND_csound_p 129 | 130 |
131 |            
135 |  CsoundFilecsoundFile 137 | 138 |
139 |            
143 |  booleanisRunning 145 | 146 |
147 |            
151 |  Mutexmutex 153 | 154 |
155 |            
159 |  java.lang.Stringoptions 161 | 162 |
163 |            
167 |  CsoundPerformanceThreadperfThread 169 | 170 |
171 |            
175 |  SWIGTYPE_p_voidv 177 | 178 |
179 |            
182 |   183 | 184 | 185 | 186 | 187 | 188 | 190 | 191 | 192 | 198 | 199 |
189 | Constructor Summary
Engine(java.lang.String _csd, 193 | java.lang.String _path) 194 | 195 |
196 |           The Engine constructor, usually called in the setup() method in your 197 | sketch to initialize and start the library.
200 |   201 | 202 | 203 | 204 | 205 | 206 | 208 | 209 | 210 | 212 | 216 | 217 |
207 | Method Summary
211 |  voidstart() 213 | 214 |
215 |           Start Csound.
218 |   219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 |
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
227 |   228 |

229 | 230 | 231 | 232 | 233 | 234 | 235 | 237 | 238 |
236 | Field Detail
239 | 240 |

241 | options

242 |
243 | public java.lang.String options
244 |
245 |
246 |
247 |
248 |
249 | 250 |

251 | isRunning

252 |
253 | public boolean isRunning
254 |
255 |
256 |
257 |
258 |
259 | 260 |

261 | csound

262 |
263 | public Csound csound
264 |
265 |
266 |
267 |
268 |
269 | 270 |

271 | csoundFile

272 |
273 | public CsoundFile csoundFile
274 |
275 |
276 |
277 |
278 |
279 | 280 |

281 | perfThread

282 |
283 | public CsoundPerformanceThread perfThread
284 |
285 |
286 |
287 |
288 |
289 | 290 |

291 | v

292 |
293 | public SWIGTYPE_p_void v
294 |
295 |
296 |
297 |
298 |
299 | 300 |

301 | csound_p

302 |
303 | public SWIGTYPE_p_CSOUND_ csound_p
304 |
305 |
306 |
307 |
308 |
309 | 310 |

311 | mutex

312 |
313 | public Mutex mutex
314 |
315 |
316 |
317 |
318 | 319 | 320 | 321 | 322 | 323 | 324 | 326 | 327 |
325 | Constructor Detail
328 | 329 |

330 | Engine

331 |
332 | public Engine(java.lang.String _csd,
333 |               java.lang.String _path)
334 |
335 |
The Engine constructor, usually called in the setup() method in your 336 | sketch to initialize and start the library. 337 |

338 |

339 |
Parameters:
_csd - The name of the csd file
_path - The path to the csd
340 |
341 | 342 | 343 | 344 | 345 | 346 | 347 | 349 | 350 |
348 | Method Detail
351 | 352 |

353 | start

354 |
355 | public void start()
356 |
357 |
Start Csound. 358 |

359 |

360 |
361 |
362 |
363 | 364 |
365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 385 | 388 | 389 | 390 | 391 | 394 | 410 | 411 | 412 | 414 | 416 | 417 |
386 | 387 |
418 | 419 | 420 | 421 |
422 | processing library csoundo by Jacob Joaquin. (c) 2010 423 | 424 | 425 | -------------------------------------------------------------------------------- /reference/csoundo/Mutex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Mutex (Javadocs: csoundo) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 | 76 | 78 | 80 | 81 |
50 | 51 |
82 | 83 | 84 | 85 |
86 | 87 |

88 | 89 | csoundo 90 |
91 | Class Mutex

92 |
 93 | java.lang.Object
 94 |   extended by csoundo.Mutex
 95 | 
96 |
97 |
98 |
public class Mutex
extends java.lang.Object
99 | 100 | 101 |

102 | Experimental class for thread locking/memory protection. 103 |

104 | 105 |

106 |


107 | 108 |

109 | 110 | 111 | 112 | 113 | 114 | 115 | 117 | 118 | 119 | 123 | 124 |
116 | Constructor Summary
Mutex() 120 | 121 |
122 |            
125 |   126 | 127 | 128 | 129 | 130 | 131 | 133 | 134 | 135 | 137 | 141 | 142 | 143 | 145 | 149 | 150 | 151 | 153 | 157 | 158 | 159 | 161 | 165 | 166 |
132 | Method Summary
136 |  intactiveThreads() 138 | 139 |
140 |            
144 |  voidcleanup() 146 | 147 |
148 |            
152 |  voidlock() 154 | 155 |
156 |            
160 |  voidunlock() 162 | 163 |
164 |            
167 |   168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 |
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
176 |   177 |

178 | 179 | 180 | 181 | 182 | 183 | 184 | 186 | 187 |
185 | Constructor Detail
188 | 189 |

190 | Mutex

191 |
192 | public Mutex()
193 |
194 |
195 | 196 | 197 | 198 | 199 | 200 | 201 | 203 | 204 |
202 | Method Detail
205 | 206 |

207 | activeThreads

208 |
209 | public int activeThreads()
210 |
211 |
212 |
213 |
214 |
215 |
216 | 217 |

218 | cleanup

219 |
220 | public void cleanup()
221 |
222 |
223 |
224 |
225 |
226 |
227 | 228 |

229 | lock

230 |
231 | public void lock()
232 |
233 |
234 |
235 |
236 |
237 |
238 | 239 |

240 | unlock

241 |
242 | public void unlock()
243 |
244 |
245 |
246 |
247 |
248 | 249 |
250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 270 | 273 | 274 | 275 | 276 | 279 | 295 | 296 | 297 | 299 | 301 | 302 |
271 | 272 |
303 | 304 | 305 | 306 |
307 | processing library csoundo by Jacob Joaquin. (c) 2010 308 | 309 | 310 | -------------------------------------------------------------------------------- /reference/csoundo/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | csoundo (Javadocs: csoundo) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | csoundo 20 | 21 | 22 | 31 | 32 |
23 | Classes  24 | 25 |
26 | Csoundo 27 |
28 | Engine 29 |
30 | Mutex
33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /reference/csoundo/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | csoundo (Javadocs: csoundo) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 |
80 |

81 | Package csoundo 82 |

83 | 84 | 85 | 86 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 |
87 | Class Summary
Csoundo 
EngineThis class is for getting Csound up and running.
MutexExperimental class for thread locking/memory protection.
102 |   103 | 104 |

105 |

106 |
107 |
108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 128 | 131 | 132 | 133 | 134 | 137 | 153 | 154 |
129 | 130 |
155 | 156 | 157 | 158 |
159 | processing library csoundo by Jacob Joaquin. (c) 2010 160 | 161 | 162 | -------------------------------------------------------------------------------- /reference/csoundo/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | csoundo Class Hierarchy (Javadocs: csoundo) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 |
80 |
81 |

82 | Hierarchy For Package csoundo 83 |

84 |
85 |

86 | Class Hierarchy 87 |

88 |
    89 |
  • java.lang.Object
      90 |
    • csoundo.Engine
    • csoundo.Mutex
    • java.lang.Thread (implements java.lang.Runnable) 91 | 93 |
    94 |
95 |
96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 116 | 119 | 120 | 121 | 122 | 125 | 141 | 142 |
117 | 118 |
143 | 144 | 145 | 146 |
147 | processing library csoundo by Jacob Joaquin. (c) 2010 148 | 149 | 150 | -------------------------------------------------------------------------------- /reference/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Deprecated List (Javadocs: csoundo) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 |
80 |
81 |

82 | Deprecated API

83 |
84 |
85 | Contents
    86 |
87 | 88 |
89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 109 | 112 | 113 | 114 | 115 | 118 | 134 | 135 |
110 | 111 |
136 | 137 | 138 | 139 |
140 | processing library csoundo by Jacob Joaquin. (c) 2010 141 | 142 | 143 | -------------------------------------------------------------------------------- /reference/help-doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | API Help (Javadocs: csoundo) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 |
80 |
81 |

82 | How This API Document Is Organized

83 |
84 | This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

85 | Package

86 |
87 | 88 |

89 | Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    90 |
  • Interfaces (italic)
  • Classes
  • Enums
  • Exceptions
  • Errors
  • Annotation Types
91 |
92 |

93 | Class/Interface

94 |
95 | 96 |

97 | Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    98 |
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description 99 |

    100 |

  • Nested Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary 101 |

    102 |

  • Field Detail
  • Constructor Detail
  • Method Detail
103 | Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
104 | 105 |

106 | Annotation Type

107 |
108 | 109 |

110 | Each annotation type has its own separate page with the following sections:

    111 |
  • Annotation Type declaration
  • Annotation Type description
  • Required Element Summary
  • Optional Element Summary
  • Element Detail
112 |
113 | 114 |

115 | Enum

116 |
117 | 118 |

119 | Each enum has its own separate page with the following sections:

    120 |
  • Enum declaration
  • Enum description
  • Enum Constant Summary
  • Enum Constant Detail
121 |
122 |

123 | Tree (Class Hierarchy)

124 |
125 | There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    126 |
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
127 |
128 |

129 | Deprecated API

130 |
131 | The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
132 |

133 | Index

134 |
135 | The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
136 |

137 | Prev/Next

138 | These links take you to the next or previous class, interface, package, or related page.

139 | Frames/No Frames

140 | These links show and hide the HTML frames. All pages are available with or without frames. 141 |

142 |

143 | Serialized Form

144 | Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. 145 |

146 |

147 | Constant Field Values

148 | The Constant Field Values page lists the static final fields and their values. 149 |

150 | 151 | 152 | This help file applies to API documentation generated using the standard doclet. 153 | 154 |
155 |


156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 176 | 179 | 180 | 181 | 182 | 185 | 201 | 202 |
177 | 178 |
203 | 204 | 205 | 206 |
207 | processing library csoundo by Jacob Joaquin. (c) 2010 208 | 209 | 210 | -------------------------------------------------------------------------------- /reference/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Javadocs: csoundo 8 | 9 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | <H2> 28 | Frame Alert</H2> 29 | 30 | <P> 31 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 32 | <BR> 33 | Link to<A HREF="csoundo/package-summary.html">Non-frame version.</A> 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /reference/overview-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Class Hierarchy (Javadocs: csoundo) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 49 | 52 | 53 | 54 | 55 | 58 | 74 | 75 |
50 | 51 |
76 | 77 | 78 | 79 |
80 |
81 |

82 | Hierarchy For All Packages

83 |
84 |
85 |
Package Hierarchies:
csoundo
86 |
87 |

88 | Class Hierarchy 89 |

90 |
    91 |
  • java.lang.Object
      92 |
    • csoundo.Engine
    • csoundo.Mutex
    • java.lang.Thread (implements java.lang.Runnable) 93 | 95 |
    96 |
97 |
98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 118 | 121 | 122 | 123 | 124 | 127 | 143 | 144 |
119 | 120 |
145 | 146 | 147 | 148 |
149 | processing library csoundo by Jacob Joaquin. (c) 2010 150 | 151 | 152 | -------------------------------------------------------------------------------- /reference/package-list: -------------------------------------------------------------------------------- 1 | csoundo 2 | -------------------------------------------------------------------------------- /reference/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/reference/resources/inherit.gif -------------------------------------------------------------------------------- /reference/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | /* Define colors, fonts and other style attributes here to override the defaults */ 3 | /* processingLibs style by andreas schlegel, sojamo */ 4 | 5 | 6 | body { 7 | margin : 0; 8 | padding : 0; 9 | padding-left : 10px; 10 | padding-right : 8px; 11 | background-color : #FFFFFF; 12 | font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; 13 | font-size : 100%; 14 | font-size : 0.7em; 15 | font-weight : normal; 16 | line-height : normal; 17 | margin-bottom:30px; 18 | } 19 | 20 | 21 | 22 | 23 | /* Headings */ 24 | h1, h2, h3, h4, h5, th { 25 | font-family :Arial, Helvetica, sans-serif; 26 | font-size:1.2em; 27 | } 28 | 29 | 30 | p { 31 | font-size : 1em; 32 | width:80%; 33 | } 34 | 35 | pre, code { 36 | font-family : "Courier New", Courier, monospace; 37 | font-size : 12px; 38 | line-height : normal; 39 | } 40 | 41 | 42 | 43 | table { 44 | border:0; 45 | margin-bottom:10px; 46 | margin-top:10px; 47 | } 48 | 49 | 50 | tr, td { 51 | border-top: 0px solid; 52 | border-left: 0px solid; 53 | padding-top:8px; 54 | padding-bottom:8px; 55 | } 56 | 57 | 58 | 59 | hr { 60 | border:0; 61 | height:1px; 62 | padding:0; 63 | margin:0; 64 | margin-bottom:4px; 65 | 66 | } 67 | 68 | 69 | 70 | dd, th, td, font { 71 | font-size:1.0em; 72 | line-height:1.0em; 73 | } 74 | 75 | 76 | 77 | dt { 78 | margin-bottom:0px; 79 | } 80 | 81 | 82 | 83 | dd { 84 | margin-top:2px; 85 | margin-bottom:4px; 86 | } 87 | 88 | 89 | 90 | a { 91 | text-decoration: underline; 92 | font-weight: normal; 93 | } 94 | 95 | a:hover, 96 | a:active { 97 | text-decoration: underline; 98 | font-weight: normal; 99 | } 100 | 101 | a:visited, 102 | a:link:visited { 103 | text-decoration: underline; 104 | font-weight: normal; 105 | } 106 | 107 | 108 | img { 109 | border: 0px solid #000000; 110 | } 111 | 112 | 113 | 114 | /* Navigation bar fonts */ 115 | .NavBarCell1 { 116 | border:0; 117 | } 118 | 119 | .NavBarCell1Rev { 120 | border:0; 121 | } 122 | 123 | .NavBarFont1 { 124 | font-family: Arial, Helvetica, sans-serif; 125 | font-size:1.1em; 126 | } 127 | 128 | 129 | .NavBarFont1 b { 130 | font-weight:normal; 131 | } 132 | 133 | 134 | 135 | .NavBarFont1:after, .NavBarFont1Rev:after { 136 | font-weight:normal; 137 | content: " \\"; 138 | } 139 | 140 | 141 | .NavBarFont1Rev { 142 | font-family: Arial, Helvetica, sans-serif; 143 | font-size:1.1em; 144 | } 145 | 146 | .NavBarFont1Rev b { 147 | font-family: Arial, Helvetica, sans-serif; 148 | font-size:1.1em; 149 | font-weight:normal; 150 | } 151 | 152 | .NavBarCell2 { 153 | font-family: Arial, Helvetica, sans-serif; 154 | } 155 | 156 | .NavBarCell3 { 157 | font-family: Arial, Helvetica, sans-serif; 158 | } 159 | 160 | 161 | 162 | font.FrameItemFont { 163 | font-family: Helvetica, Arial, sans-serif; 164 | font-size:1.1em; 165 | line-height:1.1em; 166 | } 167 | 168 | font.FrameHeadingFont { 169 | font-family: Helvetica, Arial, sans-serif; 170 | line-height:32px; 171 | } 172 | 173 | /* Font used in left-hand frame lists */ 174 | .FrameTitleFont { 175 | font-family: Helvetica, Arial, sans-serif 176 | } 177 | 178 | 179 | .toggleList { 180 | padding:0; 181 | margin:0; 182 | margin-top:12px; 183 | } 184 | 185 | .toggleList dt { 186 | font-weight:bold; 187 | font-size:12px; 188 | font-family:arial,sans-serif; 189 | padding:0px; 190 | margin:10px 0px 10px 0px; 191 | } 192 | 193 | .toggleList dt span { 194 | font-family: monospace; 195 | padding:0; 196 | margin:0; 197 | } 198 | 199 | 200 | .toggleList dd { 201 | margin:0; 202 | padding:0; 203 | } 204 | 205 | html.isjs .toggleList dd { 206 | display: none; 207 | } 208 | 209 | .toggleList pre { 210 | padding: 4px 4px 4px 4px; 211 | } 212 | 213 | 214 | 215 | 216 | 217 | /* COLORS */ 218 | 219 | pre, code { 220 | color: #000000; 221 | } 222 | 223 | 224 | body { 225 | color : #333333; 226 | background-color :#FFFFFF; 227 | } 228 | 229 | 230 | h1, h2, h3, h4, h5, h6 { 231 | color:#555; 232 | } 233 | 234 | a, 235 | .toggleList dt { 236 | color: #1a7eb0; 237 | } 238 | 239 | a:hover, 240 | a:active { 241 | color: #1a7eb0; 242 | } 243 | 244 | a:visited, 245 | a:link:visited { 246 | color: #1a7eb0; 247 | } 248 | 249 | td,tr { 250 | border-color: #999999; 251 | } 252 | 253 | hr { 254 | color:#999999; 255 | background:#999999; 256 | } 257 | 258 | 259 | .TableHeadingColor { 260 | background: #dcdcdc; 261 | color: #555; 262 | } 263 | 264 | 265 | .TableSubHeadingColor { 266 | background: #EEEEFF 267 | } 268 | 269 | .TableRowColor { 270 | background: #FFFFFF 271 | } 272 | 273 | 274 | .NavBarCell1 { 275 | background-color:#dcdcdc; 276 | color:#000; 277 | } 278 | 279 | .NavBarCell1 a { 280 | color:#333; 281 | } 282 | 283 | 284 | .NavBarCell1Rev { 285 | background-color:transparent; 286 | } 287 | 288 | .NavBarFont1 { 289 | color:#333; 290 | } 291 | 292 | 293 | .NavBarFont1Rev { 294 | color:#fff; 295 | } 296 | 297 | .NavBarCell2 { 298 | background-color:#999; 299 | } 300 | 301 | .NavBarCell2 a { 302 | color:#fff; 303 | } 304 | 305 | 306 | 307 | .NavBarCell3 { 308 | background-color:#dcdcdc; 309 | } 310 | 311 | -------------------------------------------------------------------------------- /src/CallbackWrapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * A Csound interface library for Processing. 3 | * 4 | * (c) 2010 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General 17 | * Public License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 19 | * Boston, MA 02111-1307 USA 20 | * 21 | * @author Rory Walsh 22 | * @modified 10/01/2012 23 | * @version 0.2.1 24 | */ 25 | 26 | package csoundo; 27 | 28 | import processing.core.*; 29 | 30 | import csnd6.*; 31 | import java.io.*; 32 | import java.util.*; 33 | 34 | 35 | public class CallbackWrapper extends CsoundCallbackWrapper{ 36 | public Csound csound; 37 | public MessageQueue messageQueue; 38 | public Csoundo csoundoObject; 39 | 40 | 41 | public CallbackWrapper(Csound csnd){ 42 | super(csnd); 43 | //System.out.print(this.getClass().getSuperclass().getName()+"\n"); 44 | csound = csnd; 45 | messageQueue = new MessageQueue(); 46 | } 47 | 48 | 49 | public void OutputValueCallback(String _chan, double _val) { 50 | csoundoObject.outValueCallbackFunction(_chan, _val); 51 | messageQueue.addMessageToValueQueue(_chan, _val); 52 | } 53 | 54 | 55 | 56 | public void setCsoundoObj(Csoundo obj){ 57 | csoundoObject = obj; 58 | } 59 | 60 | public void SetMessageCallback() { 61 | //System.out.print("messagecallback"); 62 | } 63 | 64 | public int YieldCallback() 65 | { 66 | //update Csound channels 67 | for(int i=0;i channelMessageQueue; 40 | private Vector tableMessageQueue; 41 | private Vector valueMessageQueue; 42 | 43 | 44 | public MessageQueue(){ 45 | channelMessageQueue = new Vector(); 46 | valueMessageQueue = new Vector(); 47 | tableMessageQueue = new Vector(); 48 | } 49 | 50 | public void addMessageToChannelQueue(String _chan, double _val){ 51 | channelMessageQueue.addElement(new ChannelMessage(_chan, _val)); 52 | } 53 | 54 | public void addMessageToTableQueue(int _tableNumber, int _index, double _amp){ 55 | tableMessageQueue.addElement(new TableMessage(_tableNumber, _index, _amp)); 56 | } 57 | 58 | public void addMessageToValueQueue(String _chan, double _val){ 59 | valueMessageQueue.addElement(new ChannelMessage(_chan, _val)); 60 | } 61 | 62 | public void fillArrayWithTablePoints(int table, float[] array){ 63 | 64 | } 65 | 66 | 67 | public ChannelMessage getMessageFromChannelQueue(int index){ 68 | return channelMessageQueue.get(index); 69 | } 70 | 71 | public TableMessage getMessageFromTableQueue(int index){ 72 | return tableMessageQueue.get(index); 73 | } 74 | 75 | public ChannelMessage getMessageFromValueQueue(int index){ 76 | return valueMessageQueue.get(index); 77 | } 78 | 79 | public int getNumberOfMessagesInQueue(String queue){ 80 | if(queue=="channel") 81 | return channelMessageQueue.size(); 82 | else if(queue=="table") 83 | return tableMessageQueue.size(); 84 | else if(queue=="value") 85 | return valueMessageQueue.size(); 86 | else return 0; 87 | } 88 | 89 | public void flushMessagesFromQueue(String queue){ 90 | if(queue=="channel") 91 | channelMessageQueue.removeAllElements(); 92 | else if(queue=="table") 93 | tableMessageQueue.removeAllElements(); 94 | else if(queue=="value") 95 | valueMessageQueue.removeAllElements(); 96 | } 97 | 98 | } 99 | 100 | -------------------------------------------------------------------------------- /src/TableMessage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * A Csound interface library for Processing. 3 | * 4 | * (c) 2010 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General 17 | * Public License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 19 | * Boston, MA 02111-1307 USA 20 | * 21 | * @author Jacob Joaquin, Rory Walsh, Conor Dempsey 22 | * @modified 10/01/2012 23 | * @version 0.2.1 24 | */ 25 | 26 | package csoundo; 27 | 28 | import csnd6.*; 29 | import java.io.*; 30 | import java.util.*; 31 | 32 | /** 33 | * Simple class to hold channel name and value. 34 | */ 35 | 36 | public class TableMessage { 37 | public int xVal; 38 | public double yVal; 39 | public int tableNumber; 40 | 41 | public TableMessage(int tableNum, int xPos, double yPos){ 42 | xVal = xPos; 43 | yVal = yPos; 44 | tableNumber = tableNum; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/csoundo.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/src/csoundo.jar -------------------------------------------------------------------------------- /src/csoundo/CallbackWrapper.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/src/csoundo/CallbackWrapper.class -------------------------------------------------------------------------------- /src/csoundo/ChannelMessage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/src/csoundo/ChannelMessage.class -------------------------------------------------------------------------------- /src/csoundo/Csoundo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/src/csoundo/Csoundo.class -------------------------------------------------------------------------------- /src/csoundo/CsoundoArray.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/src/csoundo/CsoundoArray.class -------------------------------------------------------------------------------- /src/csoundo/MessageQueue.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/src/csoundo/MessageQueue.class -------------------------------------------------------------------------------- /src/csoundo/TableMessage.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rorywalsh/csoundo/0491e8d0a3f711f1fbe5854b8c17f8de69cce018/src/csoundo/TableMessage.class -------------------------------------------------------------------------------- /src/make.bat: -------------------------------------------------------------------------------- 1 | echo "BUILD SCRIPT FOR CSOUNDO." 2 | echo "" 3 | echo "PLEASE EDIT THE SCRIPTS VARIABLES" 4 | echo "SO THAT IT USES THE CORRECT PATH" 5 | 6 | set PROCESSING_LIB=C:\Users\rory\sourcecode\processing-3.3.7\core\library\core.jar 7 | set CSOUND_LIB=C:\PROGRA~1\Csound6_x64\bin\csnd6.jar 8 | javac -classpath %PROCESSING_LIB%;%CSOUND_LIB% -d . *.java 9 | jar -cf ../library/csoundo.jar ./csoundo/*.class 10 | -------------------------------------------------------------------------------- /src/make.sh: -------------------------------------------------------------------------------- 1 | echo "BUILD SCRIPT FOR CSOUNDO." 2 | echo "" 3 | echo "PLEASE EDIT THE SCRIPTS VARIABLES" 4 | echo "SO THAT IT USES THE CORRECT PATH" 5 | 6 | PROCESSING_LIB=/home/rory/sourcecode/processing-2.2.1/core/library/core.jar 7 | CSOUND_LIB=/home/rory/sourcecode/cabbageaudio/csound/build/csnd6.jar 8 | javac -classpath $PROCESSING_LIB:$CSOUND_LIB -d . *.java 9 | jar -cf ../library/csoundo.jar ./csoundo/*.class 10 | --------------------------------------------------------------------------------