Skip to content

Commit

Permalink
v1
Browse files Browse the repository at this point in the history
  • Loading branch information
s3g committed Sep 16, 2012
1 parent 06aef2d commit 3d375ae
Show file tree
Hide file tree
Showing 9 changed files with 1,791 additions and 0 deletions.
Binary file added images/screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/tbmidistuff_protodrom.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
229 changes: 229 additions & 0 deletions protoDrom_tutorial1/data/drom_t1.pd
@@ -0,0 +1,229 @@
#N canvas 130 273 1436 814 10;
#X obj 433 399 dac~;
#X obj 433 345 clip~ -1 1;
#X obj 433 310 hip~ 1;
#X obj 436 -90 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 254 1;
#X obj 575 -90 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 6350 1;
#X obj 538 345 clip~ -1 1;
#X obj 538 310 hip~ 1;
#N canvas 404 50 889 639 OmGen 0;
#X obj 37 583 outlet~;
#X obj 101 22 inlet;
#X obj 101 127 phasor~ 100;
#X obj 101 149 -~ 0.5;
#X obj 101 171 cos~;
#X obj 101 193 +~ 1;
#X obj 101 215 *~ 0.5;
#X obj 101 237 *~;
#X obj 206 137 sig~;
#X obj 206 159 lop~ 10;
#X obj 191 190 *~;
#X obj 191 212 cos~;
#X floatatom 101 76 5 0 0 1 frequency - -;
#X floatatom 206 117 5 0 0 1 ripple - -;
#X obj 101 299 *~;
#X floatatom 355 155 5 0 0 1 width - -;
#X obj 101 352 *~;
#X obj 101 374 +~ 1;
#X obj 37 447 /~;
#X obj 37 374 sig~ 1;
#X obj 37 505 hip~ 1;
#X obj 205 21 inlet;
#X obj 355 21 inlet;
#X text 256 387 based on an example in Andy Farnell's book \, Designing
Sound \, see section 52 on Mammals;
#X connect 1 0 12 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 0 10 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 7 0 14 0;
#X connect 8 0 9 0;
#X connect 9 0 10 1;
#X connect 10 0 11 0;
#X connect 11 0 7 1;
#X connect 12 0 2 0;
#X connect 13 0 8 0;
#X connect 14 0 16 0;
#X connect 14 0 16 1;
#X connect 15 0 14 1;
#X connect 16 0 17 0;
#X connect 17 0 18 1;
#X connect 18 0 20 0;
#X connect 19 0 18 0;
#X connect 20 0 0 0;
#X connect 21 0 13 0;
#X connect 22 0 15 0;
#X restore 433 119 pd OmGen;
#X floatatom 433 83 5 0 0 0 - - -;
#X obj 433 -48 * 1400;
#N canvas 394 175 839 516 schroederReverb 0;
#X obj 82 91 +~;
#X obj 82 18 inlet~;
#X obj 142 91 +~;
#X obj 327 213 +~;
#X obj 327 254 +~;
#X obj 327 293 *~ 0.4;
#X obj 359 213 -~;
#X obj 376 293 *~ 0.37;
#X obj 359 254 +~;
#X obj 82 247 outlet~;
#X obj 142 247 outlet~;
#X obj 390 213 +~;
#X obj 420 213 -~;
#X obj 390 254 -~;
#X obj 421 254 -~;
#X obj 431 294 *~ 0.333;
#X obj 492 294 *~ 0.3;
#X text 427 454 Schroeder reverb \, source: Andy Farnell's Designing
Sound \, page 234 \, Claude Heiland-Allen credited;
#X obj 127 18 delread~ drom1A 101;
#X obj 250 18 delread~ drom1B 143;
#X obj 373 18 delread~ drom1C 165;
#X obj 496 18 delread~ drom1D 177;
#X obj 87 341 delwrite~ drom1A 1000;
#X obj 222 341 delwrite~ drom1B 1000;
#X obj 357 341 delwrite~ drom1C 1000;
#X obj 492 341 delwrite~ drom1D 1000;
#X connect 0 0 3 0;
#X connect 0 0 9 0;
#X connect 0 0 6 0;
#X connect 1 0 0 0;
#X connect 1 0 2 0;
#X connect 2 0 10 0;
#X connect 2 0 6 1;
#X connect 2 0 3 1;
#X connect 3 0 4 0;
#X connect 3 0 13 0;
#X connect 4 0 5 0;
#X connect 5 0 22 0;
#X connect 6 0 8 0;
#X connect 6 0 14 0;
#X connect 7 0 23 0;
#X connect 8 0 7 0;
#X connect 11 0 13 1;
#X connect 11 0 4 1;
#X connect 12 0 14 1;
#X connect 12 0 8 1;
#X connect 13 0 15 0;
#X connect 14 0 16 0;
#X connect 15 0 24 0;
#X connect 16 0 25 0;
#X connect 18 0 0 1;
#X connect 19 0 2 1;
#X connect 20 0 11 0;
#X connect 20 0 12 0;
#X connect 21 0 11 1;
#X connect 21 0 12 1;
#X restore 433 236 pd schroederReverb;
#X floatatom 572 -5 10 0 0 0 - - -;
#X obj 857 -91 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 1524 1;
#X floatatom 854 75 5 0 0 0 - - -;
#X obj 854 47 line;
#X obj 854 18 pack f 200;
#X obj 433 9 pack f 200;
#X obj 433 38 line;
#X obj 854 -28 + 5;
#X obj 854 -58 * 95;
#X obj 718 -90 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 5080 1;
#X floatatom 715 76 5 0 0 0 - - -;
#X obj 715 48 line;
#X obj 715 19 pack f 200;
#X obj 715 -57 * 10;
#X obj 715 -27 + 2;
#X obj 55 -58 loadbang;
#N canvas 0 22 423 363 sinTaperFade 0;
#X obj 158 33 inlet~;
#X obj 202 33 inlet;
#X obj 161 255 *~;
#X obj 161 301 outlet~;
#X obj 177 187 sin;
#X obj 202 58 * 2;
#X obj 202 80 - 1;
#X obj 202 102 + 1;
#X obj 202 124 / 4;
#X obj 202 146 * 3.14159;
#X floatatom 202 168 5 0 0 0 - - -;
#X msg 176 208 \$1 60;
#X obj 176 230 line~;
#X connect 0 0 2 0;
#X connect 1 0 5 0;
#X connect 2 0 3 0;
#X connect 4 0 11 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 10 0 4 0;
#X connect 11 0 12 0;
#X connect 12 0 2 1;
#X restore 433 174 pd sinTaperFade;
#N canvas 0 22 458 286 sin 0;
#X obj 202 33 inlet;
#X obj 202 187 sin;
#X obj 202 58 * 2;
#X obj 202 80 - 1;
#X obj 202 102 + 1;
#X obj 202 124 / 4;
#X obj 202 146 * 3.14159;
#X floatatom 202 168 5 0 0 0 - - -;
#X obj 202 209 outlet;
#X connect 0 0 2 0;
#X connect 1 0 8 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 7 0 1 0;
#X restore 433 -71 pd sin;
#X obj 433 -20 + 20;
#X obj 572 -118 r pd_vol;
#X obj 433 -118 r pd_freq;
#X obj 715 -118 r pd_ripple;
#X obj 854 -119 r pd_width;
#X msg 55 -12 \; pd_ripple 0.4 \; pd_width 0.12 \; pd_freq 0.02 \;
pd_vol 0.5 \;;
#X text 53 -89 Pd patch for protoDrom tutorial 1 by Shawn Greenlee
;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 3 0 28 0;
#X connect 4 0 11 0;
#X connect 5 0 0 1;
#X connect 6 0 5 0;
#X connect 7 0 27 0;
#X connect 8 0 7 0;
#X connect 9 0 29 0;
#X connect 10 0 2 0;
#X connect 10 1 6 0;
#X connect 11 0 27 1;
#X connect 12 0 19 0;
#X connect 13 0 7 2;
#X connect 14 0 13 0;
#X connect 15 0 14 0;
#X connect 16 0 17 0;
#X connect 17 0 8 0;
#X connect 18 0 15 0;
#X connect 19 0 18 0;
#X connect 20 0 24 0;
#X connect 21 0 7 1;
#X connect 22 0 21 0;
#X connect 23 0 22 0;
#X connect 24 0 25 0;
#X connect 25 0 23 0;
#X connect 26 0 34 0;
#X connect 27 0 10 0;
#X connect 28 0 9 0;
#X connect 29 0 16 0;
#X connect 30 0 4 0;
#X connect 31 0 3 0;
#X connect 32 0 20 0;
#X connect 33 0 12 0;
65 changes: 65 additions & 0 deletions protoDrom_tutorial1/protoDrom_tutorial1.pde
@@ -0,0 +1,65 @@
/**
* protoDrom tutorial 1: quick start for libPd + Processing
* by Shawn Greenlee
*
* for this example, you will need these libraries:
* 1) libPd for Processing (puredataP5) - https://github.com/libpd/puredatap5
* 2) controlP5 - http://www.sojamo.de/libraries/controlP5/
* consult documentation for these libaries for further info.
*/

// OK, let's get started...

// first, import the libaries (these need to be installed in your libraries folder)

import org.puredata.processing.PureData;
import controlP5.*;

// then, declare variables for the libraries

PureData pd;
ControlP5 controlP5;

// and we'll also need to declare two floats: one for frequency, another for volume

float freq = 0.02;
float vol = 0.5;

// ok, now we are ready for the setup

void setup() {
size(680, 400);
frameRate(25);
pd = new PureData(this, 44100, 0, 2); // set sampling rate, input channels, & output channels
pd.openPatch("drom_t1.pd"); // open the Pd patch contained in the data folder
pd.start(); // get Pd ready
controlP5 = new ControlP5(this); // get controlP5 ready

// while we are here, let's change our colors for controlP5

controlP5.setColorForeground(#ffffff);
controlP5.setColorBackground(#999999);
controlP5.setColorLabel(#ffffff);
controlP5.setColorValue(#ffffff);
controlP5.setColorActive(#ffffff);

// and we must setup our sliders, one for the frequency and one for the volume

Slider freq = controlP5.addSlider("freq", 0, 1, 0.02, 40, 50, 30, 200); // name, range-lo, range-hi, start-val, pos-X, pos-Y, width, height
freq.setSliderMode(Slider.FLEXIBLE); // this gives us a fader-like interface

Slider vol = controlP5.addSlider("vol", 0, 1, 0.5, 100, 50, 30, 200); // name, range-lo, range-hi, start-val, pos-X, pos-Y, width, height
vol.setSliderMode(Slider.FLEXIBLE); // this gives us a fader-like interface
}

// OK, setup is done. Now to draw and send these slider values to the Pd patch

void draw() {
background(#77896C); // we need to set background color in the draw function, so that the sliders value draw correctly, comment out to see the difference
pd.sendFloat("pd_freq", (float)freq); // send the freq value to a receive in Pd called "pd_freq"
pd.sendFloat("pd_vol", (float)vol); // send the vol value to a receive in Pd called "pd_vol"
}

// that's it!
// if you've got a handle on this, you are ready for the next example which adds OSC functionality to this sketch

0 comments on commit 3d375ae

Please sign in to comment.