├── README.md ├── auditory-display-example ├── bin │ └── data │ │ ├── .gitkeep │ │ └── sounds │ │ ├── s0.wav │ │ ├── s1.wav │ │ └── s2.wav └── src │ ├── Cell.cpp │ ├── Cell.h │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── binaural-positioning-example ├── bin │ └── data │ │ ├── .gitkeep │ │ └── sounds │ │ ├── s0.wav │ │ ├── s1.wav │ │ └── s2.wav └── src │ ├── Orbit.cpp │ ├── Orbit.h │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── continuous-datastream-example ├── bin │ └── data │ │ ├── .gitkeep │ │ └── sounds │ │ └── minorscale.wav └── src │ ├── DataStream.cpp │ ├── DataStream.h │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── discrete-data-example ├── bin │ └── data │ │ ├── .gitkeep │ │ └── sounds │ │ ├── s0.wav │ │ ├── s1.wav │ │ └── s2.wav └── src │ ├── DataObject.cpp │ ├── DataObject.h │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── example └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── lib ├── blocks │ ├── custom │ │ └── customObjectGenerator.pd │ ├── freezing │ │ └── freezeGenerator.pd │ ├── sampling │ │ ├── samplerGenerator.pd │ │ └── soundSample.pd │ ├── synthesis │ │ ├── sinewave.pd │ │ ├── squarewave.pd │ │ ├── synth.pd │ │ ├── synthGenerator.pd │ │ └── triwave.pd │ └── texture │ │ └── textureGenerator.pd ├── chains │ ├── depth │ │ ├── c_xfade.pd │ │ ├── depth.pd │ │ ├── e_platereverb.pd │ │ ├── u_dispatch.pd │ │ ├── u_loader.pd │ │ └── u_sssad.pd │ └── pan │ │ ├── binaural.pd │ │ ├── earplug_data.txt │ │ └── pan.pd ├── main-help.pd ├── main.pd └── utils │ ├── s-char2midi.pd │ ├── s-counter.pd │ └── s-distance.pd └── src ├── SodaObject.cpp ├── SodaObject.h ├── externals ├── earplug~.c ├── earplug~.h └── lrshift~.c ├── ofxSodaLib.cpp └── ofxSodaLib.h /README.md: -------------------------------------------------------------------------------- 1 | # SodaLib 2 | 3 | *Sonificating Data Library*, an open source multipurpose sonification tool for designers, programmers and creative practicioners. SodaLib’s core functions are written in [libPd](http://www.libpd.cc). That means, it is easily embeddable into many creative coding environments, including c++, java, python, etc. It also means, it is cross platform (has been tested on OSX, iOS, Raspberry Pi). 4 | 5 | ## Dependencies 6 | 7 | [LibPd] (http://www.libpd.cc) can be added to your project using different methods, depending on your selection of language. For OpenFrameworks, use [ofxPd] (https://github.com/danomatika/ofxPd), read its install instructions carefully. 8 | 9 | ## Folder Structure 10 | 11 | The *lib* folder has everything that is related to the audio engine, it is a collection of [Pure Data](https://puredata.info/) patches. *main.pd* is called & opened upon every initialization. This patch handles the messages and synthesis parameters of the process. There are a few basic blocks that are generating and manipulating sounds based on the messages sent to them. 12 | 13 | ## Functions 14 | 15 | SodaLib is communicating with libPd itself via some simple utility functions. When the program is started, it is generating the needed patches (sound generators) dynamically. When the program runs, it communicates with these generators with simple messages. Soda objects have a "set" function, individual generators can be addressed by calling this function with the generator's name as its argument. As of writing, shift, volume, pan and depth of a sound can be modified simultaneously using a handy chainable syntax. It is best to think of these functions as (extendable) dimensions of the parameter-field of a sound. Ideally all parameters should be set between 0 and 1, in order to keep these dimensions interchangeable. 16 | 17 | See the "Example" project for more details on how to initiate & address Soda objects. Use OpenFramework's project generator tool to create a project. Don't forget to add the [ofxPd](https://github.com/danomatika/ofxPd) addon to your project and set up the C flags as indicated. 18 | 19 | ## Purpose 20 | 21 | SodaLib's purpose is to create a high level set of sonic tools that is focusing on representing data instead of musical concepts. Thus, you won't see traditional dsp building blocks like filters, effects etc here. While visualisation has really advanced concepts for interpreting highly complex multidimensional data, sonification lacks most of these, and what's out there are mainly accessible to creators with high-level musical (or dsp related) knowledge and experience. At the moment, SodaLib targets two key concepts of Sonification thus trying to make it available for a wider field of practitioners: 22 | 23 | * Event based sonification (earcons, auditory icons, etc) >> The system is playing back individual short sound samples with customizable number of polyphony. See *discrete-data-example* 24 | * Parameter mapping (multidimensional, realtime sensory data, etc) >> The system is playing back a sound sample, where the playback position is controlled by different type of data values. The method is similar to slit scanning of images: since the spectrum is "frozen", the pitch remains the same, independently from the speed of playback. See *continuous-datastream-example* 25 | 26 | *auditory-display-example* shows how to create and access several hundreds of soda objects with just a few lines of code and use them for special sonification purposes, in this case, audio-cells of an (auditory) display with custom resolution: the volume of each cell is mapped to the cell's brightness value (loading of this example might take a while) 27 | 28 | *binaural-positioning-example* is an experiment for spatializing sound for headphones (thus, mobile apps & VR) using binaural filtering based on the [earplug~](https://puredata.info/downloads/earplug) external 29 | 30 | The following projects are made with SodaLib so far: [SoundBow](http://www.binaura.net/apps/soundbow/), [SphereTones] (http://www.binaura.net/spheretones), [Echo](https://github.com/stc/echo) 31 | 32 | Download modidied [iOS examples] (http://binaura.net/stc/iOS.zip) for demo purposes 33 | 34 | - 35 | 36 | All code is under GPLv3 Licensed unless otherwise stated. (c) Agoston Nagy / 2016 37 | -------------------------------------------------------------------------------- /auditory-display-example/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/auditory-display-example/bin/data/.gitkeep -------------------------------------------------------------------------------- /auditory-display-example/bin/data/sounds/s0.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/auditory-display-example/bin/data/sounds/s0.wav -------------------------------------------------------------------------------- /auditory-display-example/bin/data/sounds/s1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/auditory-display-example/bin/data/sounds/s1.wav -------------------------------------------------------------------------------- /auditory-display-example/bin/data/sounds/s2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/auditory-display-example/bin/data/sounds/s2.wav -------------------------------------------------------------------------------- /auditory-display-example/src/Cell.cpp: -------------------------------------------------------------------------------- 1 | #include "Cell.h" 2 | 3 | Cell::Cell(int x, int y, int w, int h) { 4 | mX = x; 5 | mY = y; 6 | mW = w; 7 | mH = h; 8 | brightness = 0; 9 | } 10 | 11 | void Cell::display(ofVec2f mPos) { 12 | ofNoFill(); 13 | ofSetColor(255,50); 14 | ofDrawRectangle(mX, mY, mW, mH); 15 | ofFill(); 16 | ofSetColor(255,brightness*255); 17 | ofDrawRectangle(mX,mY,mW,mH); 18 | if((mPos.x>mX && mPos.xmY&&mPos.y0) brightness -= 0.005; 22 | } 23 | } -------------------------------------------------------------------------------- /auditory-display-example/src/Cell.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ofMain.h" 3 | 4 | class Cell { 5 | public: 6 | Cell(int x, int y, int w, int h); 7 | void display(ofVec2f mPos); 8 | int mX; 9 | int mY; 10 | int mW; 11 | int mH; 12 | 13 | float brightness; 14 | }; -------------------------------------------------------------------------------- /auditory-display-example/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /auditory-display-example/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | void ofApp::setup(){ 4 | int ticksPerBuffer = 8; // 8 * 64 = buffer len of 512 5 | ofSoundStreamSetup(2, 2, this, 44100, ofxPd::blockSize()*ticksPerBuffer, 3); 6 | soda.init(); 7 | 8 | // populate cells of the display 9 | rows = 10; 10 | cols = 5; 11 | int index = 0; 12 | 13 | for(int i=0; i c; 15 | for(int j=0; jshift(ofMap(i/float(rows),0,1,0.6,0.2)); 24 | 25 | // setup pan for the soda object based on its col index 26 | soda.set("soda-" + ofToString(index))->pan(j/float(cols)); 27 | 28 | index++; 29 | } 30 | cells.push_back(c); 31 | } 32 | } 33 | 34 | void ofApp::update(){} 35 | 36 | void ofApp::draw(){ 37 | ofBackground(0); 38 | int index = 0; 39 | for (auto cellRow : cells) { 40 | for(auto cell : cellRow) { 41 | cell->display(ofVec2f(mouseX,mouseY)); 42 | soda.set("soda-" + ofToString(index))->volume(cell->brightness)->play(); 43 | index++; 44 | } 45 | } 46 | } 47 | 48 | void ofApp::keyPressed(int key){} 49 | void ofApp::keyReleased(int key){} 50 | void ofApp::mouseMoved(int x, int y ){} 51 | void ofApp::mouseDragged(int x, int y, int button){} 52 | void ofApp::mousePressed(int x, int y, int button){} 53 | void ofApp::mouseReleased(int x, int y, int button){} 54 | void ofApp::mouseEntered(int x, int y){} 55 | void ofApp::mouseExited(int x, int y){} 56 | void ofApp::windowResized(int w, int h){} 57 | void ofApp::gotMessage(ofMessage msg){} 58 | void ofApp::dragEvent(ofDragInfo dragInfo){} 59 | 60 | void ofApp::audioReceived(float * input, int bufferSize, int nChannels) { 61 | soda.audioReceived(input, bufferSize, nChannels); 62 | } 63 | 64 | void ofApp::audioRequested(float * output, int bufferSize, int nChannels) { 65 | soda.audioRequested(output, bufferSize, nChannels); 66 | } 67 | 68 | -------------------------------------------------------------------------------- /auditory-display-example/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | #include "ofxSodaLib.h" 5 | #include "Cell.h" 6 | 7 | class ofApp : public ofBaseApp{ 8 | 9 | public: 10 | void setup(); 11 | void update(); 12 | void draw(); 13 | 14 | void keyPressed(int key); 15 | void keyReleased(int key); 16 | void mouseMoved(int x, int y ); 17 | void mouseDragged(int x, int y, int button); 18 | void mousePressed(int x, int y, int button); 19 | void mouseReleased(int x, int y, int button); 20 | void mouseEntered(int x, int y); 21 | void mouseExited(int x, int y); 22 | void windowResized(int w, int h); 23 | void dragEvent(ofDragInfo dragInfo); 24 | void gotMessage(ofMessage msg); 25 | 26 | void audioReceived(float * input, int bufferSize, int nChannels); 27 | void audioRequested(float * output, int bufferSize, int nChannels); 28 | 29 | ofxSodaLib soda; 30 | int rows; 31 | int cols; 32 | vector< vector< Cell *> > cells; 33 | }; 34 | -------------------------------------------------------------------------------- /binaural-positioning-example/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/binaural-positioning-example/bin/data/.gitkeep -------------------------------------------------------------------------------- /binaural-positioning-example/bin/data/sounds/s0.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/binaural-positioning-example/bin/data/sounds/s0.wav -------------------------------------------------------------------------------- /binaural-positioning-example/bin/data/sounds/s1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/binaural-positioning-example/bin/data/sounds/s1.wav -------------------------------------------------------------------------------- /binaural-positioning-example/bin/data/sounds/s2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/binaural-positioning-example/bin/data/sounds/s2.wav -------------------------------------------------------------------------------- /binaural-positioning-example/src/Orbit.cpp: -------------------------------------------------------------------------------- 1 | #include "Orbit.h" 2 | 3 | Orbit::Orbit(ofVec2f centerPos, float rad, float vel) { 4 | cPos = centerPos; 5 | mVel = vel; 6 | mRad = rad; 7 | } 8 | 9 | void Orbit::draw() { 10 | ofSetColor(255,200); 11 | mPos = ofVec2f(cPos.x + sin(mCount) * mRad, cPos.y + cos(mCount) * mRad); 12 | ofFill(); 13 | ofDrawCircle(mPos, 5); 14 | mCount += mVel; 15 | 16 | ofNoFill(); 17 | ofSetColor(255,50); 18 | ofDrawCircle(cPos,mRad); 19 | ofDrawLine(cPos,mPos); 20 | } 21 | -------------------------------------------------------------------------------- /binaural-positioning-example/src/Orbit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ofMain.h" 3 | 4 | class Orbit { 5 | public: 6 | ofVec2f cPos; 7 | ofVec2f mPos; 8 | float mVel; 9 | float mCount; 10 | float mRad; 11 | Orbit(ofVec2f centerPos, float rad, float vel); 12 | void draw(); 13 | }; 14 | -------------------------------------------------------------------------------- /binaural-positioning-example/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | } 13 | -------------------------------------------------------------------------------- /binaural-positioning-example/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | 4 | void ofApp::setup(){ 5 | int ticksPerBuffer = 8; // 8 * 64 = buffer len of 512 6 | ofSoundStreamSetup(2, 2, this, 44100, ofxPd::blockSize()*ticksPerBuffer, 3); 7 | soda.init(); 8 | soda.createSynth("s", "triwave", "D"); 9 | ofBackground(60); 10 | } 11 | 12 | void ofApp::update(){} 13 | 14 | void ofApp::draw(){ 15 | // distance to fade out 16 | float mMaxDistance = 300; 17 | float elevation = 70; // degrees 18 | 19 | // sound location 20 | ofVec2f mSoundHorizontalLocation = ofVec3f(mouseX,mouseY); 21 | // stage center (head) location 22 | ofVec3f mCenter = ofVec3f(ofGetWidth()/2, ofGetHeight()/2, 0); 23 | // angle (mapped to 0 - 1 from 0 - 360 ) 24 | float mAzimuth = getAngleFromPoint2D(mCenter, mSoundHorizontalLocation); 25 | // distance ( mapped to 0 - 1 from 0 - maximum distance to fade out) 26 | float mDistance = ofClamp((mMaxDistance - mSoundHorizontalLocation.distance(mCenter))/mMaxDistance,0,1); 27 | // elevation ( mapped to 0 - 1 from -40 90 ) 28 | float mElevation = ofMap(elevation,-40,90,0,1); 29 | 30 | ofFill(); 31 | ofSetCircleResolution(120); 32 | ofSetColor(255); 33 | ofDrawCircle(mCenter,20); 34 | ofSetColor(60); 35 | ofDrawCircle(mCenter,5); 36 | 37 | ofNoFill(); 38 | ofSetColor(255,100); 39 | ofDrawCircle(mCenter,300); 40 | 41 | ofFill(); 42 | ofSetColor(77,192,255,mDistance * 255); 43 | ofDrawCircle(mSoundHorizontalLocation,10); 44 | ofDrawLine(mCenter, mSoundHorizontalLocation); 45 | 46 | soda.set("s")->pan(mAzimuth,mDistance,mElevation)->play(); 47 | 48 | for(int i=0; i< orbits.size(); i++) { 49 | orbits[i].draw(); 50 | float tmpAzimuth = getAngleFromPoint2D(mCenter, orbits[i].mPos); 51 | float tmpDistance = ofClamp((mMaxDistance - orbits[i].mPos.distance(mCenter))/mMaxDistance,0,1); 52 | soda.set("s-" + ofToString(i))->pan(tmpAzimuth, tmpDistance, mElevation)->play(); 53 | } 54 | } 55 | 56 | float ofApp::getAngleFromPoint2D(ofVec2f center, ofVec2f pos) { 57 | float azimuth = atan2(pos.y - center.y, pos.x - center.x); 58 | float mappedAzimuth; 59 | if(azimuth<0) { 60 | mappedAzimuth = ofRadToDeg(azimuth) + 360; 61 | } else { 62 | mappedAzimuth = ofRadToDeg(azimuth); 63 | } 64 | float remappedAzimuth; 65 | if(mappedAzimuth>=90) { 66 | remappedAzimuth = mappedAzimuth-90; 67 | } else { 68 | remappedAzimuth = mappedAzimuth + 270; 69 | } 70 | float destAzimuth = remappedAzimuth; 71 | return destAzimuth/360; 72 | } 73 | 74 | void ofApp::keyPressed(int key){ 75 | if(key == ' ') { 76 | ofVec2f v = ofVec2f(ofRandom(ofGetWidth()/2) + ofGetWidth()/4,ofRandom(ofGetHeight())); 77 | orbits.push_back(Orbit(v, ofRandom(100) + 50,(ofRandom(2)-1)/20)); 78 | soda.createSynth("s-"+ofToString(index), "triwave", notes[int(ofRandom(7))]); 79 | soda.set("s-"+ofToString(index))->shift(ofRandom(0.5) + 0.2); 80 | index++; 81 | } 82 | } 83 | void ofApp::keyReleased(int key){} 84 | void ofApp::mouseMoved(int x, int y ){} 85 | void ofApp::mouseDragged(int x, int y, int button){} 86 | void ofApp::mousePressed(int x, int y, int button){} 87 | void ofApp::mouseReleased(int x, int y, int button){} 88 | void ofApp::mouseEntered(int x, int y){} 89 | void ofApp::mouseExited(int x, int y){} 90 | void ofApp::windowResized(int w, int h){} 91 | void ofApp::gotMessage(ofMessage msg){} 92 | void ofApp::dragEvent(ofDragInfo dragInfo){} 93 | 94 | void ofApp::audioReceived(float * input, int bufferSize, int nChannels) { 95 | soda.audioReceived(input, bufferSize, nChannels); 96 | } 97 | 98 | void ofApp::audioRequested(float * output, int bufferSize, int nChannels) { 99 | soda.audioRequested(output, bufferSize, nChannels); 100 | } 101 | 102 | -------------------------------------------------------------------------------- /binaural-positioning-example/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | #include "ofxSodaLib.h" 5 | #include "Orbit.h" 6 | 7 | class ofApp : public ofBaseApp{ 8 | 9 | public: 10 | void setup(); 11 | void update(); 12 | void draw(); 13 | 14 | void keyPressed(int key); 15 | void keyReleased(int key); 16 | void mouseMoved(int x, int y ); 17 | void mouseDragged(int x, int y, int button); 18 | void mousePressed(int x, int y, int button); 19 | void mouseReleased(int x, int y, int button); 20 | void mouseEntered(int x, int y); 21 | void mouseExited(int x, int y); 22 | void windowResized(int w, int h); 23 | void dragEvent(ofDragInfo dragInfo); 24 | void gotMessage(ofMessage msg); 25 | 26 | // audio callbacks 27 | void audioReceived(float * input, int bufferSize, int nChannels); 28 | void audioRequested(float * output, int bufferSize, int nChannels); 29 | 30 | ofxSodaLib soda; 31 | float getAngleFromPoint2D(ofVec2f center, ofVec2f soundLocation); 32 | 33 | vector< Orbit > orbits; 34 | const string notes[7] = {"C", "D", "Eb", "F", "G", "Ab", "A"}; 35 | 36 | int index = 0; 37 | }; 38 | -------------------------------------------------------------------------------- /continuous-datastream-example/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/continuous-datastream-example/bin/data/.gitkeep -------------------------------------------------------------------------------- /continuous-datastream-example/bin/data/sounds/minorscale.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/continuous-datastream-example/bin/data/sounds/minorscale.wav -------------------------------------------------------------------------------- /continuous-datastream-example/src/DataStream.cpp: -------------------------------------------------------------------------------- 1 | #include "DataStream.h" 2 | 3 | void DataStream::update() { 4 | mTick++; 5 | valHistory.push_back( mValue ); 6 | if( valHistory.size() >= 400 ){ 7 | valHistory.erase(valHistory.begin(), valHistory.begin()+1); 8 | } 9 | } 10 | 11 | void DataStream::drawNoiseData(int x, int y) { 12 | mValue = ofRandom(1); 13 | 14 | ofPushStyle(); 15 | ofPushMatrix(); 16 | ofTranslate(x, y, 0); 17 | 18 | ofSetColor(225); 19 | ofDrawBitmapString("Noisy data", 4, 18); 20 | ofNoFill(); 21 | ofDrawRectangle(0, 0, 400, 100); 22 | 23 | if(mCursorOver) { 24 | ofSetColor(245); 25 | }else { 26 | ofSetColor(100); 27 | } 28 | ofFill(); 29 | ofBeginShape(); 30 | for (unsigned int i = 0; i < valHistory.size(); i++){ 31 | if( i == 0 ) ofVertex(i, 100); 32 | ofVertex(i, 100 - valHistory[i] * 70); 33 | if( i == valHistory.size() -1 ) ofVertex(i, 100); 34 | } 35 | ofEndShape(false); 36 | 37 | ofPopMatrix(); 38 | ofPopStyle(); 39 | } 40 | 41 | void DataStream::drawHarmonicData(int x, int y) { 42 | mValue = (sin(mTick * 0.1) + 1) / 2; 43 | ofPushStyle(); 44 | ofPushMatrix(); 45 | ofTranslate(x, y, 0); 46 | 47 | ofSetColor(225); 48 | ofDrawBitmapString("Harmonic data", 4, 18); 49 | ofNoFill(); 50 | ofDrawRectangle(0, 0, 400, 100); 51 | 52 | if(mCursorOver) { 53 | ofSetColor(245); 54 | }else { 55 | ofSetColor(100); 56 | } 57 | ofFill(); 58 | ofBeginShape(); 59 | for (unsigned int i = 0; i < valHistory.size(); i++){ 60 | if( i == 0 ) ofVertex(i, 100); 61 | ofVertex(i, 100 - valHistory[i] * 70); 62 | if( i == valHistory.size() -1 ) ofVertex(i, 100); 63 | } 64 | ofEndShape(false); 65 | 66 | ofPopMatrix(); 67 | ofPopStyle(); 68 | 69 | } 70 | 71 | void DataStream::drawBrownData(int x, int y) { 72 | if(mTick%10==0) mValue = ofClamp((sin(mTick * 0.005) + 1) / 2 + ofRandom(0.5),0,1); 73 | ofPushStyle(); 74 | ofPushMatrix(); 75 | ofTranslate(x, y, 0); 76 | 77 | ofSetColor(225); 78 | ofDrawBitmapString("Brownian data", 4, 18); 79 | ofNoFill(); 80 | ofDrawRectangle(0, 0, 400, 100); 81 | 82 | if(mCursorOver) { 83 | ofSetColor(245); 84 | }else { 85 | ofSetColor(100); 86 | } 87 | ofFill(); 88 | ofBeginShape(); 89 | for (unsigned int i = 0; i < valHistory.size(); i++){ 90 | if( i == 0 ) ofVertex(i, 100); 91 | ofVertex(i, 100 - valHistory[i] * 70); 92 | if( i == valHistory.size() -1 ) ofVertex(i, 100); 93 | } 94 | ofEndShape(false); 95 | 96 | ofPopMatrix(); 97 | ofPopStyle(); 98 | } 99 | 100 | void DataStream::drawGestureData(int x, int y, float acc) { 101 | mValue = ofClamp(acc,0,1); 102 | ofPushStyle(); 103 | ofPushMatrix(); 104 | ofTranslate(x, y, 0); 105 | 106 | ofSetColor(225); 107 | ofDrawBitmapString("Gesture data", 4, 18); 108 | ofNoFill(); 109 | ofDrawRectangle(0, 0, 400, 100); 110 | 111 | if(mCursorOver) { 112 | ofSetColor(245); 113 | }else { 114 | ofSetColor(100); 115 | } 116 | ofFill(); 117 | ofBeginShape(); 118 | for (unsigned int i = 0; i < valHistory.size(); i++){ 119 | if( i == 0 ) ofVertex(i, 100); 120 | ofVertex(i, 100 - valHistory[i] * 70); 121 | if( i == valHistory.size() -1 ) ofVertex(i, 100); 122 | } 123 | ofEndShape(false); 124 | 125 | ofPopMatrix(); 126 | ofPopStyle(); 127 | } 128 | 129 | void DataStream::drawLinearData(int x, int y) { 130 | mValue = (mTick%100) / 100.; 131 | ofPushStyle(); 132 | ofPushMatrix(); 133 | ofTranslate(x, y, 0); 134 | 135 | ofSetColor(225); 136 | ofDrawBitmapString("Linear data", 4, 18); 137 | ofNoFill(); 138 | ofDrawRectangle(0, 0, 400, 100); 139 | 140 | if(mCursorOver) { 141 | ofSetColor(245); 142 | }else { 143 | ofSetColor(100); 144 | } 145 | ofFill(); 146 | ofBeginShape(); 147 | for (unsigned int i = 0; i < valHistory.size(); i++){ 148 | if( i == 0 ) ofVertex(i, 100); 149 | ofVertex(i, 100 - valHistory[i] * 70); 150 | if( i == valHistory.size() -1 ) ofVertex(i, 100); 151 | } 152 | ofEndShape(false); 153 | 154 | ofPopMatrix(); 155 | ofPopStyle(); 156 | 157 | } -------------------------------------------------------------------------------- /continuous-datastream-example/src/DataStream.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ofMain.h" 3 | 4 | class DataStream { 5 | public: 6 | void update(); 7 | void drawNoiseData(int x, int y); 8 | void drawHarmonicData(int x, int y); 9 | void drawBrownData(int x, int y); 10 | void drawLinearData(int x, int y); 11 | void drawGestureData(int x, int y, float acc); 12 | bool mCursorOver = false; 13 | int mTick; 14 | float mValue; 15 | vector valHistory; 16 | }; -------------------------------------------------------------------------------- /continuous-datastream-example/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /continuous-datastream-example/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | void ofApp::setup(){ 4 | int ticksPerBuffer = 8; // 8 * 64 = buffer len of 512 5 | ofSoundStreamSetup(2, 2, this, 44100, ofxPd::blockSize()*ticksPerBuffer, 3); 6 | 7 | soda.init(); 8 | 9 | string path = "sounds"; 10 | ofDirectory dir(path); 11 | string absPath = dir.getAbsolutePath(); 12 | 13 | soda.createFreezer("noise", absPath + "/minorscale.wav"); 14 | soda.createFreezer("harmonic", absPath + "/minorscale.wav"); 15 | soda.createFreezer("brownian", absPath + "/minorscale.wav"); 16 | soda.createFreezer("gesture", absPath + "/minorscale.wav"); 17 | soda.createFreezer("linear", absPath + "/minorscale.wav"); 18 | } 19 | 20 | void ofApp::update(){ 21 | noiseData.update(); 22 | harmonicData.update(); 23 | brownianData.update(); 24 | gestureData.update(); 25 | linearData.update(); 26 | switchCursor(); 27 | 28 | // handle sound positions based on the data stream values. 29 | // would be much more effective with for loops & vectors 30 | // this example stands here for clarity 31 | 32 | if(noiseData.mCursorOver) { 33 | soda.set("noise")->volume(0.8)->shift(noiseData.mValue * 0.8)->play(); 34 | } else { 35 | soda.set("noise")->volume(0); 36 | } 37 | if(harmonicData.mCursorOver) { 38 | soda.set("harmonic")->volume(0.8)->shift(harmonicData.mValue * 0.8)->play(); 39 | } else { 40 | soda.set("harmonic")->volume(0); 41 | } 42 | if(brownianData.mCursorOver) { 43 | soda.set("brownian")->volume(0.8)->shift(brownianData.mValue * 0.8)->play(); 44 | } else { 45 | soda.set("brownian")->volume(0); 46 | } 47 | if(gestureData.mCursorOver) { 48 | soda.set("gesture")->volume(0.8)->shift(gestureData.mValue * 0.8)->play(); 49 | } else { 50 | soda.set("gesture")->volume(0); 51 | } 52 | if(linearData.mCursorOver) { 53 | soda.set("linear")->volume(0.8)->shift(linearData.mValue * 0.8)->play(); 54 | } else { 55 | soda.set("linear")->volume(0); 56 | } 57 | } 58 | 59 | void ofApp::draw(){ 60 | ofBackground(34); 61 | listenToAll(100,200); 62 | ofSetColor(140); 63 | string s = "hover all the streams to listen to their actual state\nposition of playback is controlled by y value"; 64 | ofDrawBitmapString(s, 40, 40); 65 | 66 | noiseData.drawNoiseData(500,200); 67 | harmonicData.drawHarmonicData(500,300); 68 | brownianData.drawBrownData(100,300); 69 | gestureData.drawGestureData(100,400, speed / 10); 70 | linearData.drawLinearData(500,400); 71 | 72 | speed = ofVec2f(mouseX,mouseY).distance(pPos); 73 | 74 | pPos.x = mouseX; 75 | pPos.y = mouseY; 76 | } 77 | 78 | void ofApp::listenToAll(int x, int y) { 79 | ofPushStyle(); 80 | ofPushMatrix(); 81 | ofTranslate(x, y, 0); 82 | 83 | ofSetColor(225); 84 | ofDrawBitmapString("Hover here to listen to all data at once", 4, 18); 85 | ofNoFill(); 86 | ofDrawRectangle(0, 0, 400, 100); 87 | ofPopMatrix(); 88 | ofPopStyle(); 89 | } 90 | 91 | void ofApp::switchCursor() { 92 | if((mouseX>100 && mouseX < 500)&&(mouseY>200&&mouseY<300)) { 93 | noiseData.mCursorOver = true; 94 | harmonicData.mCursorOver = true; 95 | brownianData.mCursorOver = true; 96 | gestureData.mCursorOver = true; 97 | linearData.mCursorOver = true; 98 | } 99 | if((mouseX>500 && mouseX < 900)&&(mouseY>200&&mouseY<300)) { 100 | noiseData.mCursorOver = true; 101 | harmonicData.mCursorOver = false; 102 | brownianData.mCursorOver = false; 103 | gestureData.mCursorOver = false; 104 | linearData.mCursorOver = false; 105 | } 106 | if((mouseX>500 && mouseX < 900)&&(mouseY>300&&mouseY<400)) { 107 | noiseData.mCursorOver = false; 108 | harmonicData.mCursorOver = true; 109 | brownianData.mCursorOver = false; 110 | gestureData.mCursorOver = false; 111 | linearData.mCursorOver = false; 112 | } 113 | if((mouseX>100 && mouseX < 500)&&(mouseY>300&&mouseY<400)) { 114 | noiseData.mCursorOver = false; 115 | harmonicData.mCursorOver = false; 116 | brownianData.mCursorOver = true; 117 | gestureData.mCursorOver = false; 118 | linearData.mCursorOver = false; 119 | } 120 | if((mouseX>100 && mouseX < 500)&&(mouseY>400&&mouseY<500)) { 121 | noiseData.mCursorOver = false; 122 | harmonicData.mCursorOver = false; 123 | brownianData.mCursorOver = false; 124 | gestureData.mCursorOver = true; 125 | linearData.mCursorOver = false; 126 | } 127 | if((mouseX>500 && mouseX < 900)&&(mouseY>400&&mouseY<500)) { 128 | noiseData.mCursorOver = false; 129 | harmonicData.mCursorOver = false; 130 | brownianData.mCursorOver = false; 131 | gestureData.mCursorOver = false; 132 | linearData.mCursorOver = true; 133 | } 134 | } 135 | 136 | void ofApp::keyPressed(int key){} 137 | void ofApp::keyReleased(int key){} 138 | void ofApp::mouseMoved(int x, int y ){} 139 | void ofApp::mouseDragged(int x, int y, int button){} 140 | void ofApp::mousePressed(int x, int y, int button){} 141 | void ofApp::mouseReleased(int x, int y, int button){} 142 | void ofApp::mouseEntered(int x, int y){} 143 | void ofApp::mouseExited(int x, int y){} 144 | void ofApp::windowResized(int w, int h){} 145 | void ofApp::gotMessage(ofMessage msg){} 146 | void ofApp::dragEvent(ofDragInfo dragInfo){} 147 | 148 | void ofApp::audioReceived(float * input, int bufferSize, int nChannels) { 149 | soda.audioReceived(input, bufferSize, nChannels); 150 | } 151 | 152 | void ofApp::audioRequested(float * output, int bufferSize, int nChannels) { 153 | soda.audioRequested(output, bufferSize, nChannels); 154 | } 155 | 156 | -------------------------------------------------------------------------------- /continuous-datastream-example/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | #include "ofxSodaLib.h" 5 | #include "DataStream.h" 6 | 7 | class ofApp : public ofBaseApp{ 8 | 9 | public: 10 | void setup(); 11 | void update(); 12 | void draw(); 13 | 14 | void keyPressed(int key); 15 | void keyReleased(int key); 16 | void mouseMoved(int x, int y ); 17 | void mouseDragged(int x, int y, int button); 18 | void mousePressed(int x, int y, int button); 19 | void mouseReleased(int x, int y, int button); 20 | void mouseEntered(int x, int y); 21 | void mouseExited(int x, int y); 22 | void windowResized(int w, int h); 23 | void dragEvent(ofDragInfo dragInfo); 24 | void gotMessage(ofMessage msg); 25 | 26 | void audioReceived(float * input, int bufferSize, int nChannels); 27 | void audioRequested(float * output, int bufferSize, int nChannels); 28 | 29 | ofxSodaLib soda; 30 | DataStream noiseData; 31 | DataStream harmonicData; 32 | DataStream brownianData; 33 | DataStream gestureData; 34 | DataStream linearData; 35 | 36 | ofVec2f pPos; 37 | float speed; 38 | 39 | void listenToAll(int x, int y); 40 | void switchCursor(); 41 | }; 42 | -------------------------------------------------------------------------------- /discrete-data-example/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/discrete-data-example/bin/data/.gitkeep -------------------------------------------------------------------------------- /discrete-data-example/bin/data/sounds/s0.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/discrete-data-example/bin/data/sounds/s0.wav -------------------------------------------------------------------------------- /discrete-data-example/bin/data/sounds/s1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/discrete-data-example/bin/data/sounds/s1.wav -------------------------------------------------------------------------------- /discrete-data-example/bin/data/sounds/s2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stc/ofxSodaLib/cffae899d0313f3ab32f892e7469a0ca9649082b/discrete-data-example/bin/data/sounds/s2.wav -------------------------------------------------------------------------------- /discrete-data-example/src/DataObject.cpp: -------------------------------------------------------------------------------- 1 | #include "DataObject.h" 2 | 3 | DataObject::DataObject(ofVec2f p) { 4 | mPos = p; 5 | mSize = 5; 6 | fade = 0; 7 | } 8 | 9 | void DataObject::draw(ofColor c) { 10 | ofSetColor(c); 11 | ofMesh meshUp; 12 | meshUp.addVertex(ofVec2f(mPos.x-mSize,mPos.y)); 13 | meshUp.addVertex(ofVec2f(mPos.x,mPos.y-mSize)); 14 | meshUp.addVertex(ofVec2f(mPos.x+mSize,mPos.y)); 15 | meshUp.draw(); 16 | 17 | ofSetColor(c,100); 18 | ofMesh meshDown; 19 | meshDown.addVertex(ofVec2f(mPos.x-mSize,mPos.y)); 20 | meshDown.addVertex(ofVec2f(mPos.x,mPos.y+mSize)); 21 | meshDown.addVertex(ofVec2f(mPos.x+mSize,mPos.y)); 22 | meshDown.draw(); 23 | 24 | ofSetColor(c, fade); 25 | ofDrawCircle(mPos,mSize*2); 26 | fade-=10; 27 | } -------------------------------------------------------------------------------- /discrete-data-example/src/DataObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ofMain.h" 3 | 4 | class DataObject { 5 | public: 6 | DataObject(ofVec2f p); 7 | void draw(ofColor c); 8 | ofVec2f mPos; 9 | float mSize; 10 | bool canPlay = true; 11 | float fade; 12 | }; -------------------------------------------------------------------------------- /discrete-data-example/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,500,OF_WINDOW); // <-------- setup the GL context 7 | ofRunApp(new ofApp()); 8 | } 9 | -------------------------------------------------------------------------------- /discrete-data-example/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | void ofApp::setup(){ 4 | int ticksPerBuffer = 8; // 8 * 64 = buffer len of 512 5 | ofSoundStreamSetup(2, 2, this, 44100, ofxPd::blockSize()*ticksPerBuffer, 3); 6 | 7 | // give absolute paths to soundfiles 8 | string path = "sounds"; 9 | ofDirectory dir(path); 10 | string absPath = dir.getAbsolutePath(); 11 | 12 | soda.init(); 13 | soda.createSampler("s0",absPath + "/s0.wav",10); 14 | soda.createSampler("s1",absPath + "/s1.wav",10); 15 | soda.createSampler("s2",absPath + "/s2.wav",10); 16 | 17 | // populate dataset with random data 18 | vector v1; 19 | for(int i=0; i<50; i++) { v1.push_back(new DataObject(ofVec2f(ofRandom(ofGetWidth()), ofRandom(100)))); } 20 | dataset.push_back(v1); 21 | 22 | vector v2; 23 | for(int i=0; i<80; i++) { v2.push_back(new DataObject(ofVec2f(ofRandom(ofGetWidth()), ofRandom(100)))); } 24 | dataset.push_back(v2); 25 | 26 | vector v3; 27 | for(int i=0; i<40; i++) { v3.push_back(new DataObject(ofVec2f(ofRandom(ofGetWidth()), ofRandom(100)))); } 28 | dataset.push_back(v3); 29 | } 30 | 31 | void ofApp::update(){} 32 | void ofApp::draw(){ 33 | ofBackground(34); 34 | 35 | ofPushMatrix(); 36 | ofTranslate(0,ofGetHeight()/2-200); 37 | ofColor c1 = ofColor(255,121,115); 38 | for(auto data : dataset[0]) { 39 | data->draw(c1); 40 | } 41 | ofPopMatrix(); 42 | 43 | ofPushMatrix(); 44 | ofTranslate(0,ofGetHeight()/2-100); 45 | ofColor c2 = ofColor(200); 46 | for(auto data : dataset[1]) { 47 | data->draw(c2); 48 | } 49 | ofPopMatrix(); 50 | 51 | ofPushMatrix(); 52 | ofTranslate(0,ofGetHeight()/2); 53 | ofColor c3 = ofColor(71,206,255); 54 | for(auto data : dataset[2]) { 55 | data->draw(c3); 56 | } 57 | ofPopMatrix(); 58 | 59 | ofSetColor(c1); 60 | ofDrawLine(0,ofGetHeight()/2-100,ofGetWidth(),ofGetHeight()/2-100); 61 | ofSetColor(c3); 62 | ofDrawLine(0,ofGetHeight()/2,ofGetWidth(),ofGetHeight()/2); 63 | 64 | ofSetColor(240); 65 | if(mouseYofGetHeight()/2-100 && mouseYofGetHeight()/2 && mouseYofGetHeight()/2-100 && mouseYofGetHeight()/2 && mouseYmPos.distance(ofVec2f(mouseX,data->mPos.y)) < data->mSize) { 95 | if(data->canPlay) { 96 | float panValue = data->mPos.x/float(ofGetWidth()); 97 | float shiftValue = ofMap(data->mPos.y,0,100,20,2); 98 | soda.set("s0")->volume(0.4)->pan(panValue)->shift(shiftValue)->play(); 99 | data->fade = 255; 100 | } 101 | data->canPlay = false; 102 | }else { 103 | data->canPlay = true; 104 | } 105 | } 106 | } 107 | 108 | void ofApp::playSecondSet() { 109 | for(auto data : dataset[1]) { 110 | if(data->mPos.distance(ofVec2f(mouseX,data->mPos.y)) < data->mSize) { 111 | if(data->canPlay) { 112 | float panValue = data->mPos.x/float(ofGetWidth()); 113 | float shiftValue = ofMap(data->mPos.y,0,100,3,0.2); 114 | soda.set("s1")->volume(0.4)->pan(panValue)->shift(shiftValue)->play(); 115 | data->fade = 255; 116 | } 117 | data->canPlay = false; 118 | }else { 119 | data->canPlay = true; 120 | } 121 | } 122 | } 123 | 124 | void ofApp::playThirdSet() { 125 | for(auto data : dataset[2]) { 126 | if(data->mPos.distance(ofVec2f(mouseX,data->mPos.y)) < data->mSize) { 127 | if(data->canPlay) { 128 | float panValue = data->mPos.x/float(ofGetWidth()); 129 | float shiftValue = ofMap(data->mPos.y,0,100,2,0.1); 130 | soda.set("s2")->volume(0.2)->pan(panValue)->shift(shiftValue)->play(); 131 | data->fade = 255; 132 | } 133 | data->canPlay = false; 134 | }else { 135 | data->canPlay = true; 136 | } 137 | } 138 | } 139 | 140 | void ofApp::mouseDragged(int x, int y, int button){} 141 | void ofApp::mousePressed(int x, int y, int button){} 142 | void ofApp::mouseReleased(int x, int y, int button){} 143 | void ofApp::mouseEntered(int x, int y){} 144 | void ofApp::mouseExited(int x, int y){} 145 | void ofApp::windowResized(int w, int h){} 146 | void ofApp::gotMessage(ofMessage msg){} 147 | void ofApp::dragEvent(ofDragInfo dragInfo){} 148 | 149 | void ofApp::audioReceived(float * input, int bufferSize, int nChannels) { 150 | soda.audioReceived(input, bufferSize, nChannels); 151 | } 152 | 153 | void ofApp::audioRequested(float * output, int bufferSize, int nChannels) { 154 | soda.audioRequested(output, bufferSize, nChannels); 155 | } 156 | 157 | -------------------------------------------------------------------------------- /discrete-data-example/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | #include "ofxSodaLib.h" 5 | #include "DataObject.h" 6 | 7 | class ofApp : public ofBaseApp{ 8 | 9 | public: 10 | void setup(); 11 | void update(); 12 | void draw(); 13 | 14 | void keyPressed(int key); 15 | void keyReleased(int key); 16 | void mouseMoved(int x, int y ); 17 | void mouseDragged(int x, int y, int button); 18 | void mousePressed(int x, int y, int button); 19 | void mouseReleased(int x, int y, int button); 20 | void mouseEntered(int x, int y); 21 | void mouseExited(int x, int y); 22 | void windowResized(int w, int h); 23 | void dragEvent(ofDragInfo dragInfo); 24 | void gotMessage(ofMessage msg); 25 | 26 | void audioReceived(float * input, int bufferSize, int nChannels); 27 | void audioRequested(float * output, int bufferSize, int nChannels); 28 | 29 | ofxSodaLib soda; 30 | void playFirstSet(); 31 | void playSecondSet(); 32 | void playThirdSet(); 33 | vector < vector < DataObject* > > dataset; 34 | 35 | }; 36 | -------------------------------------------------------------------------------- /example/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /example/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | void ofApp::setup(){ 4 | int ticksPerBuffer = 8; // 8 * 64 = buffer len of 512 5 | ofSoundStreamSetup(2, 2, this, 44100, ofxPd::blockSize()*ticksPerBuffer, 3); 6 | soda.init(); 7 | soda.clear(); 8 | } 9 | 10 | void ofApp::update(){} 11 | 12 | void ofApp::draw(){ 13 | 14 | } 15 | 16 | void ofApp::keyPressed(int key){} 17 | void ofApp::keyReleased(int key){} 18 | void ofApp::mouseMoved(int x, int y ){} 19 | void ofApp::mouseDragged(int x, int y, int button){} 20 | void ofApp::mousePressed(int x, int y, int button){} 21 | void ofApp::mouseReleased(int x, int y, int button){} 22 | void ofApp::mouseEntered(int x, int y){} 23 | void ofApp::mouseExited(int x, int y){} 24 | void ofApp::windowResized(int w, int h){} 25 | void ofApp::gotMessage(ofMessage msg){} 26 | void ofApp::dragEvent(ofDragInfo dragInfo){} 27 | 28 | void ofApp::audioReceived(float * input, int bufferSize, int nChannels) { 29 | soda.audioReceived(input, bufferSize, nChannels); 30 | } 31 | 32 | void ofApp::audioRequested(float * output, int bufferSize, int nChannels) { 33 | soda.audioRequested(output, bufferSize, nChannels); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /example/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | #include "ofxSodaLib.h" 5 | 6 | class ofApp : public ofBaseApp{ 7 | 8 | public: 9 | void setup(); 10 | void update(); 11 | void draw(); 12 | 13 | void keyPressed(int key); 14 | void keyReleased(int key); 15 | void mouseMoved(int x, int y ); 16 | void mouseDragged(int x, int y, int button); 17 | void mousePressed(int x, int y, int button); 18 | void mouseReleased(int x, int y, int button); 19 | void mouseEntered(int x, int y); 20 | void mouseExited(int x, int y); 21 | void windowResized(int w, int h); 22 | void dragEvent(ofDragInfo dragInfo); 23 | void gotMessage(ofMessage msg); 24 | 25 | void audioReceived(float * input, int bufferSize, int nChannels); 26 | void audioRequested(float * output, int bufferSize, int nChannels); 27 | 28 | ofxSodaLib soda; 29 | }; 30 | -------------------------------------------------------------------------------- /lib/blocks/custom/customObjectGenerator.pd: -------------------------------------------------------------------------------- 1 | #N canvas 252 244 1 1 10; 2 | #X obj 266 550 line~; 3 | #X msg 266 525 \$1 5; 4 | #X obj 232 575 *~; 5 | #X obj 232 600 throw~ outL; 6 | #X obj 320 575 *~; 7 | #X obj 320 600 throw~ outR; 8 | #X text 133 17 Custom Object : you can create your own objects by editing 9 | this template; 10 | #X obj 205 139 s \$0-vol; 11 | #X obj 266 504 r \$0-vol; 12 | #X text 133 47 Arguments: 1st - receiving address; 13 | #X text 229 221 develop & add your audio unit here \, signal output 14 | connects here; 15 | #X text 283 93 use these inter-patch values to control stuff; 16 | #X obj 724 98 r \$1-dsp; 17 | #X obj 724 156 switch~; 18 | #X text 722 63 turn on / off dsp; 19 | #X obj 781 98 loadbang; 20 | #X msg 736 131 1; 21 | #X obj 137 139 s \$0-shift; 22 | #X obj 137 95 r \$1-shift; 23 | #X obj 209 95 r \$1-vol; 24 | #X obj 358 281 r \$1-pan; 25 | #X obj 232 479 ../../chains/depth/depth; 26 | #X obj 373 451 r \$1-depth; 27 | #X obj 230 371 ../../chains/pan/pan; 28 | #X obj 231 306 *~; 29 | #X obj 358 305 unpack f f f; 30 | #X text 232 256 |; 31 | #X text 232 263 |; 32 | #X text 232 269 |; 33 | #X connect 0 0 2 1; 34 | #X connect 0 0 4 1; 35 | #X connect 1 0 0 0; 36 | #X connect 2 0 3 0; 37 | #X connect 4 0 5 0; 38 | #X connect 8 0 1 0; 39 | #X connect 12 0 13 0; 40 | #X connect 15 0 16 0; 41 | #X connect 16 0 13 0; 42 | #X connect 18 0 17 0; 43 | #X connect 19 0 7 0; 44 | #X connect 20 0 25 0; 45 | #X connect 21 0 2 0; 46 | #X connect 21 1 4 0; 47 | #X connect 22 0 21 2; 48 | #X connect 23 0 21 0; 49 | #X connect 23 1 21 1; 50 | #X connect 24 0 23 0; 51 | #X connect 24 0 23 1; 52 | #X connect 25 0 23 2; 53 | #X connect 25 1 23 3; 54 | #X connect 25 2 23 4; 55 | -------------------------------------------------------------------------------- /lib/blocks/freezing/freezeGenerator.pd: -------------------------------------------------------------------------------- 1 | #N canvas 328 153 1156 832 10; 2 | #X obj 242 477 line~; 3 | #X msg 242 452 \$1 5; 4 | #X obj 209 512 *~; 5 | #X obj 215 576 throw~ outL; 6 | #X obj 283 511 *~; 7 | #X obj 356 575 throw~ outR; 8 | #X obj 501 473 r \$1-dsp; 9 | #X obj 501 531 switch~; 10 | #X text 499 438 turn on / off dsp; 11 | #X obj 558 473 loadbang; 12 | #X msg 513 506 1; 13 | #X obj 363 143 s \$0-depth; 14 | #X obj 326 512 r \$0-depth; 15 | #X obj 215 554 ../../chains/depth/depth; 16 | #X obj 150 91 r \$1-shift; 17 | #X obj 269 83 r \$1-vol; 18 | #X obj 315 310 r \$1-pan; 19 | #X obj 397 82 r \$1-depth; 20 | #X obj 202 383 ../../chains/pan/pan; 21 | #X obj 316 334 unpack f f f; 22 | #N canvas 0 23 1 1 freezer 1; 23 | #X floatatom 384 317 5 0 0 0 - transpo-set -, f 5; 24 | #X floatatom 274 224 3 0 0 0 - speed-set -, f 3; 25 | #N canvas 283 193 974 807 fft-analysis 0; 26 | #X obj 51 477 *~; 27 | #X obj 18 477 *~; 28 | #X obj 18 499 -~; 29 | #X obj 167 475 *~; 30 | #X obj 136 475 *~; 31 | #X obj 136 497 +~; 32 | #X obj 109 193 *~; 33 | #X obj 78 193 *~; 34 | #X obj 50 193 *~; 35 | #X obj 19 193 *~; 36 | #X obj 19 218 +~; 37 | #X obj 127 379 *~; 38 | #X obj 20 622 *~; 39 | #X obj 238 430 rfft~; 40 | #X obj 108 161 rfft~; 41 | #X obj 19 564 rifft~; 42 | #X obj 21 646 outlet~; 43 | #X obj 97 379 *~; 44 | #X obj 97 401 +~; 45 | #X obj 124 218 -~; 46 | #X obj 18 431 *~; 47 | #X obj 51 432 *~; 48 | #X obj 426 644 block~; 49 | #X obj 19 349 +~ 1e-15; 50 | #X obj 19 598 *~; 51 | #X obj 52 598 tabreceive~ \$0-hann; 52 | #X obj 591 563 loadbang; 53 | #X msg 426 619 set \$1 4; 54 | #X obj 97 425 q8_rsqrt~; 55 | #N canvas 594 197 1086 827 read-windows 0; 56 | #X obj 18 693 *~; 57 | #X obj 166 303 f; 58 | #X obj 102 139 /; 59 | #X obj 195 695 *~; 60 | #X obj 166 252 bang~; 61 | #X obj 17 551 line~; 62 | #X obj 102 164 * 1000; 63 | #X obj 208 305 +; 64 | #X obj 288 275 *; 65 | #X obj 188 371 / 1000; 66 | #X obj 166 394 *; 67 | #X text 198 394 reading location (samples); 68 | #X obj 51 597 / 4; 69 | #X obj 288 245 * 0.01; 70 | #X floatatom 340 498 7 0 0 0 - - -, f 7; 71 | #X obj 340 474 *; 72 | #X obj 499 387 * 0.01; 73 | #X obj 501 408 + 69; 74 | #X obj 502 429 mtof; 75 | #X obj 502 451 / 440; 76 | #X obj 375 474 t b f; 77 | #X obj 19 719 outlet~; 78 | #X obj 195 720 outlet~; 79 | #X obj 218 664 tabreceive~ \$0-hann; 80 | #X msg 803 409 0; 81 | #X obj 803 432 s speed; 82 | #X msg 768 532 set \$1; 83 | #X text 411 498 stretched window size (samples); 84 | #X msg 877 533 set \$1; 85 | #X msg 826 278 set \$1; 86 | #X obj 808 140 t b f; 87 | #X obj 826 257 f; 88 | #X obj 754 171 int; 89 | #X obj 754 203 sel 0; 90 | #X msg 813 174 1; 91 | #X msg 813 197 0; 92 | #X obj 754 228 del 300; 93 | #X obj 17 637 tabread4~ \$0-sample; 94 | #X obj 194 637 tabread4~ \$0-sample; 95 | #X obj 188 347 r \$0-insamprate; 96 | #X floatatom 111 187 5 0 0 0 - - -, f 5; 97 | #X obj 102 115 t f b; 98 | #X obj 142 139 samplerate~; 99 | #X obj 102 208 / 4; 100 | #X obj 243 309 s see-loc; 101 | #X obj 203 420 / 2; 102 | #X obj 166 420 -; 103 | #X text 239 417 back up 1/2 window; 104 | #X obj 16 597 -~; 105 | #X text 43 6 Read two windows out of the recorded sample \, one 1/4 106 | ahead of the other. The mid point of the front window is specified 107 | by "location". If "speed" is nonzero \, "location" automatically precesses. 108 | ; 109 | #X obj 572 714 * -0.5; 110 | #X text 81 601 "back" window 1/4 cycle behind "front" one; 111 | #X text 137 205 computation period (msec) for overlap of 4; 112 | #X text 164 186 msec in a window; 113 | #X obj 528 666 /; 114 | #X obj 528 691 * 1000; 115 | #X obj 528 642 t f b; 116 | #X obj 568 666 samplerate~; 117 | #X obj 528 619 f; 118 | #X text 326 275 loop to precess the location according; 119 | #X text 325 291 to the "speed" parameter.; 120 | #X text 611 31 if location changes \, update number box; 121 | #X text 610 50 in main window via "location-set" \, but; 122 | #X text 613 69 taking care to limit frequency of updates.; 123 | #X text 756 462 reflect control changes; 124 | #X text 756 479 in main window.; 125 | #X text 754 344 setting location by hand; 126 | #X text 752 362 sets speed to zero.; 127 | #X text 760 653 misc controls; 128 | #X text 496 527 "rewind" control takes us; 129 | #X text 499 545 to a location depending on; 130 | #X text 499 564 stretched window size.; 131 | #X obj 16 469 f; 132 | #X obj 17 496 pack; 133 | #X obj 15 440 b; 134 | #X msg 17 523 0 \, \$1 \$2; 135 | #X obj 102 91 r \$0-window-size; 136 | #X obj 187 276 r \$0-location; 137 | #X obj 288 222 r \$0-speed; 138 | #X obj 340 448 r \$0-window-size; 139 | #X obj 499 365 r \$0-transpo; 140 | #X obj 528 586 r \$0-rewind; 141 | #X obj 877 558 s \$0-transpo-set; 142 | #X obj 768 557 s \$0-speed-set; 143 | #X obj 768 508 r \$0-speed; 144 | #X obj 877 507 r \$0-transpo; 145 | #X obj 803 386 r \$0-location; 146 | #X obj 826 302 s \$0-location-set; 147 | #X obj 808 94 r \$0-location; 148 | #X obj 817 116 r \$0-see-loc; 149 | #X obj 730 685 r \$0-no-detune; 150 | #X obj 861 641 r \$0-auto; 151 | #X obj 533 739 pack f f; 152 | #X obj 628 716 \$0; 153 | #X obj 626 691 loadbang; 154 | #X msg 528 755 \; \$2-location \$1; 155 | #X obj 730 712 \$0; 156 | #X msg 730 742 \; \$1-transpo 0; 157 | #X msg 845 711 \; \$2-rewind bang \; \$2-speed \$1; 158 | #X obj 858 679 pack f f; 159 | #X obj 930 641 \$0; 160 | #X obj 930 620 loadbang; 161 | #X connect 0 0 21 0; 162 | #X connect 1 0 7 0; 163 | #X connect 1 0 10 0; 164 | #X connect 2 0 6 0; 165 | #X connect 3 0 22 0; 166 | #X connect 4 0 1 0; 167 | #X connect 5 0 48 0; 168 | #X connect 5 0 38 0; 169 | #X connect 6 0 40 0; 170 | #X connect 6 0 43 0; 171 | #X connect 7 0 1 1; 172 | #X connect 7 0 44 0; 173 | #X connect 8 0 7 1; 174 | #X connect 9 0 10 1; 175 | #X connect 10 0 46 0; 176 | #X connect 12 0 48 1; 177 | #X connect 13 0 8 0; 178 | #X connect 14 0 12 0; 179 | #X connect 14 0 45 0; 180 | #X connect 14 0 58 1; 181 | #X connect 14 0 72 1; 182 | #X connect 15 0 14 0; 183 | #X connect 16 0 17 0; 184 | #X connect 17 0 18 0; 185 | #X connect 18 0 19 0; 186 | #X connect 19 0 20 0; 187 | #X connect 20 0 15 0; 188 | #X connect 20 1 15 1; 189 | #X connect 23 0 3 1; 190 | #X connect 23 0 0 1; 191 | #X connect 24 0 25 0; 192 | #X connect 26 0 83 0; 193 | #X connect 28 0 82 0; 194 | #X connect 29 0 87 0; 195 | #X connect 30 0 32 0; 196 | #X connect 30 1 31 1; 197 | #X connect 31 0 29 0; 198 | #X connect 32 0 33 0; 199 | #X connect 33 0 34 0; 200 | #X connect 33 0 36 0; 201 | #X connect 34 0 32 1; 202 | #X connect 35 0 32 1; 203 | #X connect 36 0 35 0; 204 | #X connect 36 0 31 0; 205 | #X connect 37 0 0 0; 206 | #X connect 38 0 3 0; 207 | #X connect 39 0 9 0; 208 | #X connect 41 0 2 0; 209 | #X connect 41 1 42 0; 210 | #X connect 42 0 2 1; 211 | #X connect 43 0 8 1; 212 | #X connect 43 0 73 1; 213 | #X connect 45 0 46 1; 214 | #X connect 46 0 74 0; 215 | #X connect 46 0 37 1; 216 | #X connect 46 0 38 1; 217 | #X connect 48 0 37 0; 218 | #X connect 50 0 92 0; 219 | #X connect 54 0 55 0; 220 | #X connect 55 0 50 0; 221 | #X connect 56 0 54 0; 222 | #X connect 56 1 57 0; 223 | #X connect 57 0 54 1; 224 | #X connect 58 0 56 0; 225 | #X connect 72 0 73 0; 226 | #X connect 73 0 75 0; 227 | #X connect 74 0 72 0; 228 | #X connect 75 0 5 0; 229 | #X connect 76 0 41 0; 230 | #X connect 77 0 1 1; 231 | #X connect 78 0 13 0; 232 | #X connect 79 0 15 0; 233 | #X connect 80 0 16 0; 234 | #X connect 81 0 58 0; 235 | #X connect 84 0 26 0; 236 | #X connect 85 0 28 0; 237 | #X connect 86 0 24 0; 238 | #X connect 88 0 30 0; 239 | #X connect 89 0 30 0; 240 | #X connect 90 0 96 0; 241 | #X connect 91 0 99 0; 242 | #X connect 92 0 95 0; 243 | #X connect 93 0 92 1; 244 | #X connect 94 0 93 0; 245 | #X connect 96 0 97 0; 246 | #X connect 99 0 98 0; 247 | #X connect 100 0 99 1; 248 | #X connect 101 0 100 0; 249 | #X restore 109 133 pd read-windows; 250 | #X text 272 5 recall previous output amplitude. Its phase will be added 251 | to the phase difference we measure from two windows in the the recorded 252 | sound.; 253 | #X obj 121 69 *~; 254 | #X obj 89 69 *~; 255 | #X obj 89 91 +~; 256 | #X obj 159 94 q8_rsqrt~; 257 | #X obj 159 71 +~ 1e-20; 258 | #X obj 73 119 *~; 259 | #X obj 19 118 *~; 260 | #X obj 29 245 lrshift~ 1; 261 | #X obj 24 269 lrshift~ -1; 262 | #X obj 141 245 lrshift~ 1; 263 | #X obj 133 269 lrshift~ -1; 264 | #X obj 35 300 *~; 265 | #X obj 159 312 *~; 266 | #X obj 19 325 +~; 267 | #X obj 125 331 +~; 268 | #X text 247 66 divide by the magnitude to make a unit-magnitude complex 269 | amplitude (phase only). The 1e-20 is to prevent overflows. q8_rsqrt~ 270 | is reciprocal square root.; 271 | #X text 247 165 Take FT of the window in back. Multiply its conjugate 272 | by the normalized previous output. The result has the magnitude of 273 | the input sound and phase (previous output phase) minus (back window 274 | phase).; 275 | #X text 249 370 Normalize again \, this time taking care to salt each 276 | channel with 1e-15 so that we get a unit complex number even if everything 277 | was zero heretofore.; 278 | #X text 288 427 Now take the FT of the forward window and multiply 279 | it by the unit complex number from above. The magnitude will be that 280 | of the forward window and the phase will be the previous output phase 281 | plus the phase difference between the two analysis windows -- except 282 | that if "lock" is on \, they will be modified to agree progressively 283 | better with the inter-channel phase relationships of the input.; 284 | #X text 249 242 If "lock" is on \, encourage neighboring channels to 285 | stay in phase by adding the two neighboring complex amplitudes. The 286 | result will tend toward the channel with the strongest amplitude. If 287 | the phase relationships between channels in the output and those in 288 | the input are in parallel \, then neighboring channels of the quotient 289 | will all have the same phase and this will not change any phases. (lrshift 290 | shifts the signal to the left or right depending on its argument.) 291 | ; 292 | #X text 387 560 'set' message to block; 293 | #X text 390 577 allows variable size; 294 | #X text 259 126 Read two windows \, one 1/4 length behind the other 295 | \, of the input sound \, with Hann window function (see inside).; 296 | #X obj 20 8 tabreceive~ \$0-prev-real; 297 | #X obj 73 29 tabreceive~ \$0-prev-imag; 298 | #X obj 181 290 r \$0-lock; 299 | #X obj 137 543 tabsend~ \$0-prev-imag; 300 | #X obj 136 567 tabsend~ \$0-prev-real; 301 | #X obj 127 622 r \$0-window-size; 302 | #X obj 426 595 r \$0-window-size; 303 | #X obj 592 592 \$0; 304 | #X msg 594 621 \; pd dsp 1 \; \$1-window-size 2048 \; \$1-transpo 0 305 | \; \$1-rewind bang; 306 | #X obj 127 641 * 3; 307 | #X msg 128 662 2 \$1; 308 | #X obj 127 681 /; 309 | #X connect 0 0 2 1; 310 | #X connect 1 0 2 0; 311 | #X connect 2 0 15 0; 312 | #X connect 2 0 58 0; 313 | #X connect 3 0 5 1; 314 | #X connect 4 0 5 0; 315 | #X connect 5 0 15 1; 316 | #X connect 5 0 57 0; 317 | #X connect 6 0 19 1; 318 | #X connect 7 0 19 0; 319 | #X connect 8 0 10 1; 320 | #X connect 9 0 10 0; 321 | #X connect 10 0 39 0; 322 | #X connect 10 0 38 0; 323 | #X connect 10 0 44 0; 324 | #X connect 11 0 18 1; 325 | #X connect 12 0 16 0; 326 | #X connect 13 0 1 1; 327 | #X connect 13 0 3 1; 328 | #X connect 13 1 0 1; 329 | #X connect 13 1 4 1; 330 | #X connect 14 0 9 1; 331 | #X connect 14 0 7 1; 332 | #X connect 14 1 6 1; 333 | #X connect 14 1 8 1; 334 | #X connect 15 0 24 0; 335 | #X connect 17 0 18 0; 336 | #X connect 18 0 28 0; 337 | #X connect 19 0 40 0; 338 | #X connect 19 0 41 0; 339 | #X connect 19 0 45 0; 340 | #X connect 20 0 1 0; 341 | #X connect 20 0 4 0; 342 | #X connect 21 0 0 0; 343 | #X connect 21 0 3 0; 344 | #X connect 23 0 17 1; 345 | #X connect 23 0 17 0; 346 | #X connect 23 0 20 0; 347 | #X connect 24 0 12 0; 348 | #X connect 25 0 24 1; 349 | #X connect 26 0 61 0; 350 | #X connect 27 0 22 0; 351 | #X connect 28 0 20 1; 352 | #X connect 28 0 21 1; 353 | #X connect 29 0 14 0; 354 | #X connect 29 1 13 0; 355 | #X connect 31 0 33 1; 356 | #X connect 32 0 33 0; 357 | #X connect 33 0 35 0; 358 | #X connect 34 0 36 1; 359 | #X connect 34 0 37 1; 360 | #X connect 35 0 34 0; 361 | #X connect 36 0 8 0; 362 | #X connect 36 0 7 0; 363 | #X connect 37 0 9 0; 364 | #X connect 37 0 6 0; 365 | #X connect 38 0 42 0; 366 | #X connect 39 0 42 0; 367 | #X connect 40 0 43 0; 368 | #X connect 41 0 43 0; 369 | #X connect 42 0 44 1; 370 | #X connect 43 0 45 1; 371 | #X connect 44 0 23 0; 372 | #X connect 45 0 11 0; 373 | #X connect 45 0 11 1; 374 | #X connect 45 0 21 0; 375 | #X connect 54 0 32 1; 376 | #X connect 54 0 32 0; 377 | #X connect 54 0 37 0; 378 | #X connect 55 0 31 1; 379 | #X connect 55 0 31 0; 380 | #X connect 55 0 36 0; 381 | #X connect 56 0 42 1; 382 | #X connect 56 0 43 1; 383 | #X connect 59 0 63 0; 384 | #X connect 60 0 27 0; 385 | #X connect 61 0 62 0; 386 | #X connect 63 0 64 0; 387 | #X connect 64 0 65 0; 388 | #X connect 65 0 12 1; 389 | #X restore 93 475 pd fft-analysis; 390 | #N canvas 260 23 1 1 phase-tables 0; 391 | #N canvas 0 22 450 300 (subpatch) 0; 392 | #X array \$0-prev-imag 4096 float 0; 393 | #X coords 0 1000 4096 -1000 400 300 1; 394 | #X restore 169 326 graph; 395 | #N canvas 0 22 450 300 (subpatch) 0; 396 | #X array \$0-prev-real 4096 float 0; 397 | #X coords 0 500 4096 -500 400 300 1 0 0; 398 | #X restore 170 17 graph; 399 | #X restore 330 506 pd phase-tables; 400 | #X text 383 296 in cents; 401 | #X text 320 333 normal; 402 | #N canvas 0 110 1 1 hann-window 0; 403 | #N canvas 0 22 450 300 (subpatch) 0; 404 | #X array \$0-hann 4096 float 0; 405 | #X coords 0 1 4095 0 300 100 1; 406 | #X restore 82 311 graph; 407 | #X obj 378 165 osc~; 408 | #X obj 378 190 *~ -0.5; 409 | #X obj 378 214 +~ 0.5; 410 | #X obj 331 247 tabwrite~ \$0-hann; 411 | #X obj 38 173 /; 412 | #X obj 127 142 samplerate~; 413 | #X obj 177 204 swap; 414 | #X obj 177 228 /; 415 | #X obj 49 201 * 1000; 416 | #X obj 38 115 t f b f; 417 | #X msg 173 92 resize \$1; 418 | #X obj 173 116 s \$0-hann; 419 | #X msg 382 130 0; 420 | #X obj 330 131 t f b; 421 | #X text 15 8 calculate Hann window table (variable window size) and 422 | constants window-hz (fundamental frequency of analysis) \, window-sec 423 | and window-msec (analysis window size in seconds and msec).; 424 | #X obj 177 252 s \$0-window-hz; 425 | #X obj 38 251 s \$0-window-sec; 426 | #X obj 49 228 s \$0-window-msec; 427 | #X obj 37 88 r \$0-window-size; 428 | #X obj 330 105 r \$0-window-hz; 429 | #X connect 1 0 2 0; 430 | #X connect 2 0 3 0; 431 | #X connect 3 0 4 0; 432 | #X connect 5 0 9 0; 433 | #X connect 5 0 17 0; 434 | #X connect 6 0 5 1; 435 | #X connect 6 0 7 1; 436 | #X connect 7 0 8 0; 437 | #X connect 7 1 8 1; 438 | #X connect 8 0 16 0; 439 | #X connect 9 0 18 0; 440 | #X connect 10 0 5 0; 441 | #X connect 10 0 7 0; 442 | #X connect 10 1 6 0; 443 | #X connect 10 2 11 0; 444 | #X connect 11 0 12 0; 445 | #X connect 13 0 1 1; 446 | #X connect 14 0 1 0; 447 | #X connect 14 1 4 0; 448 | #X connect 14 1 13 0; 449 | #X connect 19 0 10 0; 450 | #X connect 20 0 14 0; 451 | #X restore 330 530 pd hann-window; 452 | #N canvas 703 71 1 1 insample 0; 453 | #N canvas 0 22 450 300 (subpatch) 0; 454 | #X array \$0-sample 366912 float 0; 455 | #X coords 0 1 366911 -1 400 150 1; 456 | #X restore 281 135 graph; 457 | #X obj 28 184 unpack s f; 458 | #X obj 28 294 soundfiler; 459 | #X obj 28 210 t s b; 460 | #X obj 84 209 symbol \$0-sample; 461 | #X obj 28 245 pack s s; 462 | #X msg 28 270 read -resize \$1 \$2; 463 | #X obj 83 156 44100; 464 | #X obj 28 157 t a b; 465 | #X obj 38 318 s \$0-samplength; 466 | #X obj 125 184 s \$0-insamprate; 467 | #X obj 28 357 /; 468 | #X obj 28 381 * 1000; 469 | #X obj 28 404 s \$0-samp-msec; 470 | #X obj 66 357 r \$0-insamprate; 471 | #X obj 29 70 hip~ 5; 472 | #X obj 29 46 adc~ 1; 473 | #X obj 29 9 inlet; 474 | #X obj 91 46 samplerate~; 475 | #X obj 29 93 tabwrite~ \$0-sample; 476 | #X obj 91 70 s \$0-insamprate; 477 | #X obj 276 20 inlet; 478 | #X obj 276 42 openpanel; 479 | #X obj 28 133 r \$0-read-sample; 480 | #X obj 276 67 s \$0-read-sample; 481 | #X connect 1 0 3 0; 482 | #X connect 1 1 10 0; 483 | #X connect 2 0 9 0; 484 | #X connect 2 0 11 0; 485 | #X connect 3 0 5 0; 486 | #X connect 3 1 4 0; 487 | #X connect 4 0 5 1; 488 | #X connect 5 0 6 0; 489 | #X connect 6 0 2 0; 490 | #X connect 7 0 10 0; 491 | #X connect 8 0 1 0; 492 | #X connect 8 1 7 0; 493 | #X connect 11 0 12 0; 494 | #X connect 12 0 13 0; 495 | #X connect 14 0 11 1; 496 | #X connect 15 0 19 0; 497 | #X connect 16 0 15 0; 498 | #X connect 17 0 18 0; 499 | #X connect 17 0 16 0; 500 | #X connect 18 0 20 0; 501 | #X connect 21 0 22 0; 502 | #X connect 22 0 24 0; 503 | #X connect 23 0 8 0; 504 | #X restore 331 482 pd insample; 505 | #X floatatom 442 482 5 0 0 0 - #0-samp-msec -, f 5; 506 | #X obj 331 441 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 507 | -1; 508 | #X text 350 440 <- record; 509 | #X obj 385 363 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 510 | 1; 511 | #X obj 369 227 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 512 | -1; 513 | #X msg 276 310 200; 514 | #X msg 276 332 100; 515 | #X msg 276 354 20; 516 | #X text 317 309 contract; 517 | #X text 321 354 expand; 518 | #X text 384 279 detune; 519 | #X text 494 481 length \, msec; 520 | #X floatatom 497 418 5 0 0 0 - window-size -, f 5; 521 | #X msg 497 309 512; 522 | #X msg 497 331 1024; 523 | #X msg 497 353 2048; 524 | #X msg 526 375 4096; 525 | #X text 497 276 window size \,; 526 | #X text 497 291 samples; 527 | #X text 538 308 <- set; 528 | #X text 550 418 (check); 529 | #X obj 276 381 s auto; 530 | #X obj 441 318 bng 15 250 50 0 no-detune empty empty 0 -6 0 8 -262144 531 | -1 -1; 532 | #X obj 425 462 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 533 | -1; 534 | #X text 356 460 file ->; 535 | #X obj 442 499 s \$0-length; 536 | #X obj 99 268 r \$0-length; 537 | #X floatatom 84 190 5 0 0 0 - - -, f 5; 538 | #X obj 84 292 *; 539 | #X text 126 190 sample position (0 - 1); 540 | #X text 75 62 Spectral freezing; 541 | #X obj 540 353 loadbang; 542 | #X obj 84 402 s \$0-location; 543 | #X obj 274 248 s \$0-speed; 544 | #X obj 369 249 s \$0-rewind; 545 | #X obj 505 230 s \$0-read-sample; 546 | #X obj 497 397 s \$0-window-size; 547 | #X obj 385 383 s \$0-lock; 548 | #X obj 384 340 s \$0-transpo; 549 | #X text 74 79 Based on Pd audio example I07 (phase vocoder); 550 | #X obj 92 503 outlet~; 551 | #X obj 86 157 inlet; 552 | #X obj 506 180 inlet; 553 | #X connect 0 0 46 0; 554 | #X connect 1 0 41 0; 555 | #X connect 2 0 48 0; 556 | #X connect 8 0 33 0; 557 | #X connect 9 0 7 0; 558 | #X connect 11 0 45 0; 559 | #X connect 12 0 42 0; 560 | #X connect 13 0 29 0; 561 | #X connect 14 0 29 0; 562 | #X connect 15 0 29 0; 563 | #X connect 21 0 44 0; 564 | #X connect 22 0 44 0; 565 | #X connect 23 0 44 0; 566 | #X connect 24 0 44 0; 567 | #X connect 31 0 7 1; 568 | #X connect 34 0 36 1; 569 | #X connect 35 0 36 0; 570 | #X connect 36 0 40 0; 571 | #X connect 39 0 24 0; 572 | #X connect 49 0 35 0; 573 | #X connect 50 0 43 0; 574 | #X restore 128 239 pd freezer; 575 | #X obj 187 184 loadbang; 576 | #X text 123 37 Argumenst: 1st: address for receiving 2nd : sound file 577 | name; 578 | #X obj 187 213 symbol \$2; 579 | #X connect 0 0 2 1; 580 | #X connect 0 0 4 1; 581 | #X connect 1 0 0 0; 582 | #X connect 2 0 13 0; 583 | #X connect 4 0 13 1; 584 | #X connect 6 0 7 0; 585 | #X connect 9 0 10 0; 586 | #X connect 10 0 7 0; 587 | #X connect 12 0 13 2; 588 | #X connect 13 0 3 0; 589 | #X connect 13 1 5 0; 590 | #X connect 14 0 20 0; 591 | #X connect 15 0 1 0; 592 | #X connect 16 0 19 0; 593 | #X connect 17 0 11 0; 594 | #X connect 18 0 2 0; 595 | #X connect 18 1 4 0; 596 | #X connect 19 0 18 2; 597 | #X connect 19 1 18 3; 598 | #X connect 19 2 18 4; 599 | #X connect 20 0 18 0; 600 | #X connect 20 0 18 1; 601 | #X connect 21 0 23 0; 602 | #X connect 23 0 20 1; 603 | -------------------------------------------------------------------------------- /lib/blocks/sampling/samplerGenerator.pd: -------------------------------------------------------------------------------- 1 | #N canvas 154 84 1354 883 10; 2 | #X obj 500 346 until; 3 | #X msg 459 275 clear; 4 | #X obj 581 409 del 1; 5 | #X obj 581 388 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 6 | -1 -1; 7 | #X obj 106 393 t b f; 8 | #X obj 190 436 - 1; 9 | #X text 269 467 <- switch between sample players; 10 | #X text 104 707 A dynamic \, addressable [send]; 11 | #X text 609 19 Create the samplers; 12 | #X text 542 276 <- clear subpatch first \, then...; 13 | #X text 682 365 create n samplers; 14 | #X text 608 664 <- samplers go here; 15 | #X obj 891 184 inlet; 16 | #X obj 891 258 line~; 17 | #X msg 901 235 1 5; 18 | #X obj 901 214 loadbang; 19 | #X obj 190 392 loadbang; 20 | #X obj 498 138 t b b; 21 | #X obj 530 179 > 0; 22 | #N canvas 421 470 672 402 samplerate-switch 0; 23 | #X obj 91 61 inlet; 24 | #X obj 410 60 inlet; 25 | #X obj 109 351 outlet; 26 | #X obj 109 187 spigot; 27 | #X text 148 62 trigger; 28 | #X text 464 81 check if 3rd argument exist; 29 | #X obj 213 187 spigot; 30 | #X obj 109 246 f 44100; 31 | #X text 176 248 <- original samplerate \, if no 3rd argument given 32 | ; 33 | #X obj 109 224 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 34 | -1 -1; 35 | #X obj 213 275 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 36 | -1 -1; 37 | #X text 462 101 (aka > 0); 38 | #X msg 344 149 1; 39 | #X msg 376 149 0; 40 | #X obj 276 125 t b b; 41 | #X obj 410 85 sel 1; 42 | #X msg 308 150 1; 43 | #X msg 276 150 0; 44 | #X obj 344 125 t b b; 45 | #X text 264 298 <- desired samplerate if 4th argument is given; 46 | #X obj 213 296 f \$4; 47 | #X connect 0 0 3 0; 48 | #X connect 0 0 6 0; 49 | #X connect 1 0 15 0; 50 | #X connect 3 0 9 0; 51 | #X connect 6 0 10 0; 52 | #X connect 7 0 2 0; 53 | #X connect 9 0 7 0; 54 | #X connect 10 0 20 0; 55 | #X connect 12 0 3 1; 56 | #X connect 13 0 6 1; 57 | #X connect 14 0 16 0; 58 | #X connect 14 1 17 0; 59 | #X connect 15 0 14 0; 60 | #X connect 15 1 18 0; 61 | #X connect 16 0 6 1; 62 | #X connect 17 0 3 1; 63 | #X connect 18 0 12 0; 64 | #X connect 18 1 13 0; 65 | #X connect 20 0 2 0; 66 | #X restore 1068 488 pd samplerate-switch; 67 | #X obj 500 489 * 40; 68 | #X text 856 155 Set Overall Volume ( 0-1 ); 69 | #X text 110 69 Part of SodaLib / stc@binaura.net / 2015; 70 | #X text 134 90 1st argument: < address to receive trigger >; 71 | #X text 134 108 2nd argument: < name of soundfile >; 72 | #X text 135 128 3rd argument: < number of polyphony >; 73 | #X text 134 148 4th argument: < samplerate >; 74 | #X obj 553 488 symbol \$2; 75 | #X obj 190 413 f \$3; 76 | #X obj 500 326 f \$3; 77 | #X obj 530 159 f \$4; 78 | #X obj 498 73 loadbang; 79 | #X obj 627 71 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 80 | -1; 81 | #X obj 487 645 s pd-\$0-samplePool; 82 | #N canvas 166 168 581 335 \$0-samplePool 0; 83 | #X restore 499 667 pd \$0-samplePool; 84 | #X obj 1178 438 r \$0-samplerate; 85 | #X obj 918 488 makefilename \$0-init; 86 | #X obj 774 488 makefilename \$0-vol; 87 | #X obj 626 488 makefilename \$0-ID%d; 88 | #X obj 106 496 makefilename \$0-ID%d; 89 | #X obj 530 198 s \$0-samplerate; 90 | #X obj 581 431 s \$0-init; 91 | #X obj 891 280 s~ \$0-vol; 92 | #X obj 627 48 r genSample; 93 | #X obj 500 235 t b b b; 94 | #X msg 585 342 0; 95 | #X obj 615 97 t b b b b; 96 | #X obj 1068 52 r \$1-dsp; 97 | #X obj 1068 110 switch~; 98 | #X text 1066 17 turn on / off dsp; 99 | #X obj 1125 52 loadbang; 100 | #X msg 1080 85 1; 101 | #X obj 500 367 ../../utils/s-counter \$3; 102 | #X obj 106 468 ../../utils/s-counter; 103 | #X text 109 30 Generate polyphonic sample players based on creation 104 | arguments.; 105 | #X obj 505 770 throw~ outL; 106 | #X obj 646 770 throw~ outR; 107 | #X text 686 706 catch output from inner samplers; 108 | #X obj 1217 488 makefilename \$0-out; 109 | #X obj 500 453 t f b f f f f f, f 26; 110 | #X msg 500 587 obj 10 \$1 soundSample \$2 \$3 \$4 \$5 \$6 \$7; 111 | #X obj 466 709 catch~ \$0-out-L; 112 | #X obj 583 708 catch~ \$0-out-R; 113 | #X obj 500 562 pack f s s s s f s; 114 | #X obj 505 749 ../../chains/depth/depth; 115 | #X obj 175 354 s \$0-depth; 116 | #X obj 647 728 r \$0-depth; 117 | #X obj 107 267 r \$1-shift; 118 | #X obj 126 288 r \$1-vol; 119 | #X obj 175 532 r \$1-pan; 120 | #X obj 175 330 r \$1-depth; 121 | #X obj 175 566 unpack f f f; 122 | #X obj 106 633 pack s f f f f f; 123 | #X msg 106 666 \; \$1 \$2 \$3 \$4 \$5 \$6; 124 | #X connect 0 0 52 0; 125 | #X connect 1 0 33 0; 126 | #X connect 2 0 41 0; 127 | #X connect 3 0 2 0; 128 | #X connect 4 0 53 0; 129 | #X connect 4 1 72 1; 130 | #X connect 5 0 53 2; 131 | #X connect 12 0 13 0; 132 | #X connect 13 0 42 0; 133 | #X connect 14 0 13 0; 134 | #X connect 15 0 14 0; 135 | #X connect 16 0 28 0; 136 | #X connect 17 0 44 0; 137 | #X connect 17 1 30 0; 138 | #X connect 18 0 40 0; 139 | #X connect 19 0 63 5; 140 | #X connect 20 0 63 0; 141 | #X connect 27 0 63 1; 142 | #X connect 28 0 5 0; 143 | #X connect 29 0 0 0; 144 | #X connect 30 0 18 0; 145 | #X connect 31 0 32 0; 146 | #X connect 32 0 46 0; 147 | #X connect 35 0 19 1; 148 | #X connect 36 0 63 4; 149 | #X connect 37 0 63 3; 150 | #X connect 38 0 63 2; 151 | #X connect 39 0 72 0; 152 | #X connect 43 0 32 0; 153 | #X connect 44 0 29 0; 154 | #X connect 44 1 45 0; 155 | #X connect 44 2 1 0; 156 | #X connect 45 0 52 1; 157 | #X connect 46 0 28 0; 158 | #X connect 46 1 14 0; 159 | #X connect 46 2 17 0; 160 | #X connect 46 3 1 0; 161 | #X connect 47 0 48 0; 162 | #X connect 50 0 51 0; 163 | #X connect 51 0 48 0; 164 | #X connect 52 0 59 0; 165 | #X connect 52 1 3 0; 166 | #X connect 53 0 39 0; 167 | #X connect 58 0 63 6; 168 | #X connect 59 0 20 0; 169 | #X connect 59 1 27 0; 170 | #X connect 59 2 38 0; 171 | #X connect 59 3 37 0; 172 | #X connect 59 4 36 0; 173 | #X connect 59 5 19 0; 174 | #X connect 59 6 58 0; 175 | #X connect 60 0 33 0; 176 | #X connect 61 0 64 0; 177 | #X connect 62 0 64 1; 178 | #X connect 63 0 60 0; 179 | #X connect 64 0 55 0; 180 | #X connect 64 1 56 0; 181 | #X connect 66 0 64 2; 182 | #X connect 67 0 4 0; 183 | #X connect 68 0 72 2; 184 | #X connect 69 0 71 0; 185 | #X connect 70 0 65 0; 186 | #X connect 71 0 72 3; 187 | #X connect 71 1 72 4; 188 | #X connect 71 2 72 5; 189 | #X connect 72 0 73 0; 190 | -------------------------------------------------------------------------------- /lib/blocks/sampling/soundSample.pd: -------------------------------------------------------------------------------- 1 | #N canvas 161 59 1110 850 10; 2 | #X obj 100 447 soundfiler; 3 | #X msg 100 418 read -resize \$1 \$2; 4 | #X obj 100 396 pack s s; 5 | #X obj 182 282 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 6 | -1 -1; 7 | #X obj 142 231 loadbang; 8 | #X text 640 552 store our sample; 9 | #X text 99 528 synch phasor~ to sample length; 10 | #X obj 182 302 f \$0; 11 | #X obj 551 552 table \$0-loop; 12 | #X obj 100 501 s \$0-length; 13 | #X obj 187 479 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 14 | -1 -1; 15 | #X text 204 477 send to init speed; 16 | #X obj 187 501 s setSpeed; 17 | #X obj 182 323 makefilename %d-loop; 18 | #X obj 182 348 symbol; 19 | #X text 225 303 make local buffer; 20 | #X obj 100 282 symbol \$1; 21 | #X obj 142 255 t b b; 22 | #X obj 525 32 r \$2; 23 | #X obj 200 231 r \$4; 24 | #X obj 523 849 *~; 25 | #X obj 602 576 r \$2; 26 | #X obj 541 814 line~; 27 | #X text 684 781 set actual sample volume; 28 | #X msg 601 781 \$1 1; 29 | #X obj 636 781 pipe 2; 30 | #X msg 563 782 0 2; 31 | #X text 69 24 Sampler ( to be multiplied as many times as needed ) 32 | ; 33 | #X text 69 43 arguments:; 34 | #X text 132 60 < filename >; 35 | #X text 132 114 < volume >; 36 | #X text 131 133 < initialize >; 37 | #X obj 450 852 *~; 38 | #X text 131 76 < list to unique ID \, with trigger arguments >; 39 | #X text 174 93 trigger arguments: pitch / vol / pan; 40 | #X text 563 33 receive trigger; 41 | #X text 641 575 receive trigger; 42 | #X obj 553 843 r~ \$3; 43 | #X obj 449 883 *~; 44 | #X obj 530 884 *~; 45 | #X obj 389 659 *~; 46 | #X obj 428 627 vline~; 47 | #X obj 388 523 vline~; 48 | #X obj 368 280 * 1e+07; 49 | #X obj 525 157 pipe 5; 50 | #X obj 525 99 t f b; 51 | #X msg 581 132 0 5; 52 | #X obj 428 589 r \$0-cutoff; 53 | #X obj 581 157 s \$0-cutoff; 54 | #X obj 367 313 t f b; 55 | #X msg 426 393 1; 56 | #X obj 426 418 s \$0-cutoff; 57 | #X msg 367 338 1 \, 4.41e+08 \$1 \;; 58 | #X obj 525 418 * 1e+07; 59 | #X obj 525 313 /; 60 | #X msg 525 288 1 \$1; 61 | #X obj 590 418 r \$0-length; 62 | #X msg 525 467 \$2 \, -4.41e+08 \$1 \;; 63 | #X obj 525 182 moses 0; 64 | #X obj 525 261 abs; 65 | #X obj 526 338 t f b; 66 | #X obj 388 548 tabread4~ \$0-loop; 67 | #X obj 370 258 /; 68 | #X msg 370 232 1 \$1; 69 | #X obj 525 443 pack f f; 70 | #X text 645 467 44.1 Khz; 71 | #X text 464 340 44.1 Khz; 72 | #X obj 446 910 throw~ \$6-L; 73 | #X obj 539 910 throw~ \$6-R; 74 | #X obj 525 68 unpack f f f f f; 75 | #X text 634 67 (first element is pitch); 76 | #X obj 602 599 unpack f f f f f; 77 | #X text 714 614 third / fourth / fifth elements are pan; 78 | #X obj 449 723 ../../chains/pan/pan; 79 | #X text 712 598 second element is vol; 80 | #X connect 0 0 9 0; 81 | #X connect 0 0 10 0; 82 | #X connect 1 0 0 0; 83 | #X connect 2 0 1 0; 84 | #X connect 3 0 7 0; 85 | #X connect 4 0 17 0; 86 | #X connect 7 0 13 0; 87 | #X connect 10 0 12 0; 88 | #X connect 13 0 14 0; 89 | #X connect 14 0 2 1; 90 | #X connect 16 0 2 0; 91 | #X connect 17 0 16 0; 92 | #X connect 17 1 3 0; 93 | #X connect 18 0 69 0; 94 | #X connect 19 0 17 0; 95 | #X connect 20 0 39 0; 96 | #X connect 21 0 71 0; 97 | #X connect 22 0 20 1; 98 | #X connect 22 0 32 1; 99 | #X connect 24 0 22 0; 100 | #X connect 25 0 24 0; 101 | #X connect 26 0 22 0; 102 | #X connect 32 0 38 0; 103 | #X connect 37 0 38 1; 104 | #X connect 37 0 39 1; 105 | #X connect 38 0 67 0; 106 | #X connect 39 0 68 0; 107 | #X connect 40 0 73 0; 108 | #X connect 40 0 73 1; 109 | #X connect 41 0 40 1; 110 | #X connect 42 0 61 0; 111 | #X connect 43 0 49 0; 112 | #X connect 44 0 58 0; 113 | #X connect 45 0 44 0; 114 | #X connect 45 1 46 0; 115 | #X connect 46 0 48 0; 116 | #X connect 47 0 41 0; 117 | #X connect 49 0 52 0; 118 | #X connect 49 1 50 0; 119 | #X connect 50 0 51 0; 120 | #X connect 52 0 42 0; 121 | #X connect 53 0 64 0; 122 | #X connect 54 0 60 0; 123 | #X connect 55 0 54 0; 124 | #X connect 56 0 64 1; 125 | #X connect 57 0 42 0; 126 | #X connect 58 0 59 0; 127 | #X connect 58 1 63 0; 128 | #X connect 59 0 55 0; 129 | #X connect 60 0 53 0; 130 | #X connect 60 1 50 0; 131 | #X connect 61 0 40 0; 132 | #X connect 62 0 43 0; 133 | #X connect 63 0 62 0; 134 | #X connect 64 0 57 0; 135 | #X connect 69 0 45 0; 136 | #X connect 71 1 25 0; 137 | #X connect 71 1 26 0; 138 | #X connect 71 2 73 2; 139 | #X connect 71 3 73 3; 140 | #X connect 71 4 73 4; 141 | #X connect 73 0 32 0; 142 | #X connect 73 1 20 0; 143 | -------------------------------------------------------------------------------- /lib/blocks/synthesis/sinewave.pd: -------------------------------------------------------------------------------- 1 | #N canvas 422 234 830 577 12; 2 | #X obj 85 46 inlet; 3 | #X obj 105 333 outlet~; 4 | #X text 76 12 sine; 5 | #X obj 102 187 osc~; 6 | #X connect 0 0 3 0; 7 | #X connect 3 0 1 0; 8 | -------------------------------------------------------------------------------- /lib/blocks/synthesis/squarewave.pd: -------------------------------------------------------------------------------- 1 | #N canvas 422 234 1 1 12; 2 | #X obj 116 116 * -1; 3 | #X msg 190 115 0; 4 | #X obj 58 159 phasor~; 5 | #X obj 159 157 phasor~; 6 | #X text 296 53 phase synchronization; 7 | #X obj 85 46 inlet; 8 | #X obj 105 333 outlet~; 9 | #X text 76 12 square; 10 | #X msg 232 116 0.5; 11 | #X obj 222 85 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 12 | -1; 13 | #X obj 109 211 +~; 14 | #X obj 109 240 -~ 1; 15 | #X obj 220 54 loadbang; 16 | #X connect 0 0 3 0; 17 | #X connect 1 0 2 1; 18 | #X connect 2 0 10 0; 19 | #X connect 3 0 10 1; 20 | #X connect 5 0 0 0; 21 | #X connect 5 0 2 0; 22 | #X connect 8 0 3 1; 23 | #X connect 9 0 8 0; 24 | #X connect 9 0 1 0; 25 | #X connect 10 0 11 0; 26 | #X connect 11 0 6 0; 27 | #X connect 12 0 9 0; 28 | -------------------------------------------------------------------------------- /lib/blocks/synthesis/synth.pd: -------------------------------------------------------------------------------- 1 | #N canvas 895 124 1 1 10; 2 | #X obj 172 312 hsl 128 15 0 1 0 0 empty empty empty -2 -6 0 8 -262144 3 | -1 -1 0 1; 4 | #X obj 154 565 *~; 5 | #X obj 169 421 line~; 6 | #X obj 106 442 mtof; 7 | #X obj 106 332 loadbang; 8 | #X obj 169 332 * 0.2; 9 | #X msg 169 232 0.1 \$1; 10 | #X obj 169 253 -; 11 | #X obj 169 210 moses 0.1; 12 | #X msg 220 232 0; 13 | #X obj 169 288 * 10; 14 | #X msg 169 353 \$1 10; 15 | #X text 260 208 volume is based on a distance from a value; 16 | #X text 220 530 triangle wave; 17 | #X text 101 40 Octa; 18 | #X text 101 88 3rd argument: value the distance is measured from; 19 | #X text 100 103 4th argument: pitch to add to base pitch (should be 20 | mult. of 12 \, if using octaves); 21 | #X text 101 74 2nd argument: local send/receiver; 22 | #X text 103 132 5th argument: address to throw sound to; 23 | #X text 102 59 1st argument: base pitch ; 24 | #X obj 169 160 r \$3; 25 | #X obj 106 420 + \$5; 26 | #X obj 154 591 throw~ \$6; 27 | #X obj 106 530 \$1; 28 | #X obj 169 188 ../../utils/s-distance \$4; 29 | #X obj 106 381 ../../utils/s-char2Midi \$2; 30 | #X connect 0 0 5 0; 31 | #X connect 1 0 22 0; 32 | #X connect 2 0 1 1; 33 | #X connect 3 0 23 0; 34 | #X connect 4 0 25 0; 35 | #X connect 5 0 11 0; 36 | #X connect 6 0 7 0; 37 | #X connect 7 0 10 0; 38 | #X connect 8 0 6 0; 39 | #X connect 8 1 9 0; 40 | #X connect 9 0 10 0; 41 | #X connect 10 0 0 0; 42 | #X connect 11 0 2 0; 43 | #X connect 20 0 24 0; 44 | #X connect 21 0 3 0; 45 | #X connect 23 0 1 0; 46 | #X connect 24 0 8 0; 47 | #X connect 25 0 21 0; 48 | -------------------------------------------------------------------------------- /lib/blocks/synthesis/synthGenerator.pd: -------------------------------------------------------------------------------- 1 | #N canvas 315 155 909 712 10; 2 | #X obj 102 197 s \$0-value; 3 | #X obj 219 480 line~; 4 | #X msg 219 455 \$1 5; 5 | #X obj 188 504 *~; 6 | #X obj 188 554 throw~ outL; 7 | #X obj 262 503 *~; 8 | #X obj 329 555 throw~ outR; 9 | #X text 123 13 Arguments: 1st - base pitch (musical note: CAPITAL \, 10 | ending with '#' or 'b') 2nd - receiving address name 3rd - internal 11 | sound channel name; 12 | #X obj 191 256 catch~ \$4; 13 | #X text 124 61 1st: receiving address name; 14 | #X text 123 79 2nd: base pitch (musical note: CAPITAL \, ending w # 15 | or b); 16 | #X text 124 119 4th: internal channel name; 17 | #X msg 458 540 \; pd-synth.pd menusave; 18 | #X obj 435 346 synth \$2 \$3 \$0-value 0.8 84 \$4; 19 | #X obj 458 510 r saveSynths; 20 | #X obj 696 143 r \$1-dsp; 21 | #X obj 696 201 switch~; 22 | #X text 694 108 turn on / off dsp; 23 | #X obj 753 143 loadbang; 24 | #X msg 708 176 1; 25 | #X obj 436 366 synth \$2 \$3 \$0-value 0.9 96 \$4; 26 | #X obj 436 386 synth \$2 \$3 \$0-value 1 108 \$4; 27 | #X obj 432 206 synth \$2 \$3 \$0-value 0.1 0 \$4; 28 | #X obj 432 226 synth \$2 \$3 \$0-value 0.2 12 \$4; 29 | #X obj 433 246 synth \$2 \$3 \$0-value 0.3 24 \$4; 30 | #X obj 433 266 synth \$2 \$3 \$0-value 0.4 36 \$4; 31 | #X obj 433 286 synth \$2 \$3 \$0-value 0.5 48 \$4; 32 | #X obj 434 306 synth \$2 \$3 \$0-value 0.6 60 \$4; 33 | #X obj 435 326 synth \$2 \$3 \$0-value 0.7 72 \$4; 34 | #X obj 188 526 ../../chains/depth/depth; 35 | #X obj 177 196 s \$0-depth; 36 | #X obj 330 503 r \$0-depth; 37 | #X obj 101 175 r \$1-shift; 38 | #X obj 218 415 r \$1-vol; 39 | #X obj 280 256 r \$1-pan; 40 | #X obj 177 176 r \$1-depth; 41 | #X obj 168 357 ../../chains/pan/pan; 42 | #X obj 279 280 unpack f f f; 43 | #X text 124 99 3rd: type (triangleWave \, squareWave \, etc); 44 | #X connect 1 0 3 1; 45 | #X connect 1 0 5 1; 46 | #X connect 2 0 1 0; 47 | #X connect 3 0 29 0; 48 | #X connect 5 0 29 1; 49 | #X connect 8 0 36 0; 50 | #X connect 8 0 36 1; 51 | #X connect 14 0 12 0; 52 | #X connect 15 0 16 0; 53 | #X connect 18 0 19 0; 54 | #X connect 19 0 16 0; 55 | #X connect 29 0 4 0; 56 | #X connect 29 1 6 0; 57 | #X connect 31 0 29 2; 58 | #X connect 32 0 0 0; 59 | #X connect 33 0 2 0; 60 | #X connect 34 0 37 0; 61 | #X connect 35 0 30 0; 62 | #X connect 36 0 3 0; 63 | #X connect 36 1 5 0; 64 | #X connect 37 0 36 2; 65 | #X connect 37 1 36 3; 66 | #X connect 37 2 36 4; 67 | -------------------------------------------------------------------------------- /lib/blocks/synthesis/triwave.pd: -------------------------------------------------------------------------------- 1 | #N canvas 343 329 681 618 12; 2 | #X obj 116 116 * -1; 3 | #X msg 190 115 0; 4 | #X obj 58 159 phasor~; 5 | #X obj 159 157 phasor~; 6 | #X obj 59 199 *~ 2; 7 | #X obj 58 226 -~ 1; 8 | #X obj 57 254 clip~ 0 1; 9 | #X obj 159 202 *~ 2; 10 | #X obj 158 229 -~ 1; 11 | #X obj 157 257 clip~ 0 1; 12 | #X obj 105 308 +~; 13 | #X text 76 12 triangle; 14 | #X text 235 113 phase synchronization; 15 | #X obj 85 46 inlet; 16 | #X obj 105 333 outlet~; 17 | #X connect 0 0 3 0; 18 | #X connect 1 0 3 1; 19 | #X connect 1 0 2 1; 20 | #X connect 2 0 4 0; 21 | #X connect 3 0 7 0; 22 | #X connect 4 0 5 0; 23 | #X connect 5 0 6 0; 24 | #X connect 6 0 10 0; 25 | #X connect 7 0 8 0; 26 | #X connect 8 0 9 0; 27 | #X connect 9 0 10 1; 28 | #X connect 10 0 14 0; 29 | #X connect 13 0 0 0; 30 | #X connect 13 0 2 0; 31 | -------------------------------------------------------------------------------- /lib/blocks/texture/textureGenerator.pd: -------------------------------------------------------------------------------- 1 | #N canvas 328 153 885 696 10; 2 | #X obj 242 477 line~; 3 | #X msg 242 452 \$1 5; 4 | #X obj 209 512 *~; 5 | #X obj 215 576 throw~ outL; 6 | #X obj 283 511 *~; 7 | #X obj 356 575 throw~ outR; 8 | #X obj 86 178 noise~; 9 | #X msg 153 199 \$1 5; 10 | #X obj 153 227 sig~; 11 | #X obj 153 177 * 18000; 12 | #X obj 203 177 loadbang; 13 | #X obj 203 200 del; 14 | #X obj 203 224 \$2; 15 | #X obj 157 279 vcf~ 60 \$2; 16 | #X text 123 37 Argumenst: 1st: address for receiving 2nd : filter resonance 17 | ; 18 | #X obj 501 473 r \$1-dsp; 19 | #X obj 501 531 switch~; 20 | #X text 499 438 turn on / off dsp; 21 | #X obj 558 473 loadbang; 22 | #X msg 513 506 1; 23 | #X obj 363 143 s \$0-depth; 24 | #X obj 326 512 r \$0-depth; 25 | #X obj 215 554 ../../chains/depth/depth; 26 | #X obj 150 91 r \$1-shift; 27 | #X obj 269 83 r \$1-vol; 28 | #X obj 315 310 r \$1-pan; 29 | #X obj 397 82 r \$1-depth; 30 | #X obj 202 383 ../../chains/pan/pan; 31 | #X obj 316 334 unpack f f f; 32 | #X connect 0 0 2 1; 33 | #X connect 0 0 4 1; 34 | #X connect 1 0 0 0; 35 | #X connect 2 0 22 0; 36 | #X connect 4 0 22 1; 37 | #X connect 6 0 13 0; 38 | #X connect 7 0 8 0; 39 | #X connect 8 0 13 1; 40 | #X connect 9 0 7 0; 41 | #X connect 10 0 11 0; 42 | #X connect 11 0 12 0; 43 | #X connect 12 0 13 2; 44 | #X connect 13 0 27 0; 45 | #X connect 13 0 27 1; 46 | #X connect 15 0 16 0; 47 | #X connect 18 0 19 0; 48 | #X connect 19 0 16 0; 49 | #X connect 21 0 22 2; 50 | #X connect 22 0 3 0; 51 | #X connect 22 1 5 0; 52 | #X connect 23 0 9 0; 53 | #X connect 24 0 1 0; 54 | #X connect 25 0 28 0; 55 | #X connect 26 0 20 0; 56 | #X connect 27 0 2 0; 57 | #X connect 27 1 4 0; 58 | #X connect 28 0 27 2; 59 | #X connect 28 1 27 3; 60 | #X connect 28 2 27 4; 61 | -------------------------------------------------------------------------------- /lib/chains/depth/c_xfade.pd: -------------------------------------------------------------------------------- 1 | #N canvas 230 196 783 283 10; 2 | #X obj 76 87 inlet~; 3 | #X obj 142 87 inlet~; 4 | #X obj 77 198 outlet~; 5 | #X obj 201 87 inlet; 6 | #X obj 201 127 vline~; 7 | #X obj 141 136 -~; 8 | #X obj 141 156 *~; 9 | #X text 371 150 (1-x)*a + x*b; 10 | #X text 371 167 = a - x*a + x*b; 11 | #X text 371 184 = a + x*(b - a); 12 | #X text 366 119 x: fade factor (0-1); 13 | #X text 366 90 a: sig from inlet~ 0; 14 | #X text 339 50 Linear crossfade according to the following calculation: 15 | ; 16 | #X text 367 104 b: sig from inlet~ 1; 17 | #N canvas 172 83 586 377 LICENSE-GPL 0; 18 | #X text 57 88 This program is free software: you can redistribute it 19 | and/or modify it under the terms of the GNU General Public License 20 | as published by the Free Software Foundation \, either version 3 of 21 | the License \, or (at your option) any later version.; 22 | #X text 58 168 This program is distributed in the hope that it will 23 | be useful \, but WITHOUT ANY WARRANTY \; without even the implied warranty 24 | of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 25 | General Public License for more details.; 26 | #X text 57 261 You should have received a copy of the GNU General Public 27 | License along with this program. If not \, see . 28 | ; 29 | #X text 61 54 Copyright (C) 2009 \, Reality Jockey Ltd.; 30 | #X text 60 325 See the file LICENSE.txt for the full license text. 31 | ; 32 | #X restore 614 19 pd LICENSE-GPL; 33 | #X connect 0 0 5 1; 34 | #X connect 0 0 2 0; 35 | #X connect 1 0 5 0; 36 | #X connect 3 0 4 0; 37 | #X connect 4 0 6 1; 38 | #X connect 5 0 6 0; 39 | #X connect 6 0 2 0; 40 | -------------------------------------------------------------------------------- /lib/chains/depth/depth.pd: -------------------------------------------------------------------------------- 1 | #N canvas 429 79 1070 745 10; 2 | #X obj 724 98 r \$1-dsp; 3 | #X obj 724 156 switch~; 4 | #X text 722 63 turn on / off dsp; 5 | #X obj 781 98 loadbang; 6 | #X msg 736 131 1; 7 | #X text 134 35 This can be achieved with a plate reverb effect \, borrowed 8 | from the excellent rjlib: https://github.com/rjdj/rjlib; 9 | #X text 135 17 Add Depth to your sound block.; 10 | #X obj 837 207 inlet; 11 | #N canvas 0 23 1 1 depth-subPatch 1; 12 | #X obj 162 214 inlet~; 13 | #X obj 162 413 outlet~; 14 | #X obj 226 213 inlet~; 15 | #X obj 359 412 outlet~; 16 | #X obj 161 384 e_platereverb \$0-reverb; 17 | #X obj 430 206 loadbang; 18 | #X msg 430 230 dry 1 \, decay_diffusion2 0.68 \, decay_diffusion1 0.74 19 | \, input_diffusion2 0.779 \, excursion 0 \, input_diffusion1 0.685 20 | \, decay 0.98 \, damping 4637 \, bandwidth 10000 \, predelay 0 \,; 21 | #X obj 837 228 inlet; 22 | #X obj 900 442 switch~; 23 | #X msg 912 417 0; 24 | #X msg 838 321 dry \$1; 25 | #X obj 838 299 -; 26 | #X msg 838 279 1 \$1; 27 | #X obj 1022 314 sel -1; 28 | #X obj 975 314 >= 0; 29 | #X msg 877 418 1; 30 | #X obj 838 254 t f f f; 31 | #X obj 945 343 sel 1; 32 | #X connect 0 0 4 0; 33 | #X connect 2 0 4 1; 34 | #X connect 4 0 1 0; 35 | #X connect 4 1 3 0; 36 | #X connect 5 0 6 0; 37 | #X connect 6 0 4 2; 38 | #X connect 7 0 16 0; 39 | #X connect 9 0 8 0; 40 | #X connect 10 0 4 2; 41 | #X connect 11 0 10 0; 42 | #X connect 12 0 11 0; 43 | #X connect 13 0 9 0; 44 | #X connect 14 0 17 0; 45 | #X connect 15 0 8 0; 46 | #X connect 16 0 12 0; 47 | #X connect 16 1 14 0; 48 | #X connect 16 2 13 0; 49 | #X connect 17 0 15 0; 50 | #X restore 265 464 pd depth-subPatch; 51 | #X obj 232 263 inlet~; 52 | #X obj 384 265 inlet~; 53 | #X obj 237 562 outlet~; 54 | #X obj 395 555 outlet~; 55 | #X obj 722 331 sel -1; 56 | #X obj 213 399 *~; 57 | #X msg 721 363 1; 58 | #X obj 394 399 *~; 59 | #X msg 758 363 0; 60 | #X obj 753 260 t f f; 61 | #X connect 0 0 1 0; 62 | #X connect 3 0 4 0; 63 | #X connect 4 0 1 0; 64 | #X connect 7 0 18 0; 65 | #X connect 8 0 11 0; 66 | #X connect 8 1 12 0; 67 | #X connect 9 0 8 0; 68 | #X connect 9 0 14 0; 69 | #X connect 10 0 8 1; 70 | #X connect 10 0 16 0; 71 | #X connect 13 0 15 0; 72 | #X connect 13 1 17 0; 73 | #X connect 14 0 11 0; 74 | #X connect 15 0 14 1; 75 | #X connect 15 0 16 1; 76 | #X connect 16 0 12 0; 77 | #X connect 17 0 16 1; 78 | #X connect 17 0 14 1; 79 | #X connect 18 0 8 2; 80 | #X connect 18 1 13 0; 81 | -------------------------------------------------------------------------------- /lib/chains/depth/e_platereverb.pd: -------------------------------------------------------------------------------- 1 | #N canvas 423 233 521 453 10; 2 | #X obj 24 32 inlet~; 3 | #X obj 23 380 outlet~; 4 | #X obj 118 380 outlet~; 5 | #N canvas 0 166 634 506 input_diffusion 0; 6 | #X obj 30 60 inlet~; 7 | #X obj 29 295 outlet~; 8 | #X obj 337 79 r \$0-input_diffusion1; 9 | #X obj 336 170 r \$0-input_diffusion2; 10 | #N canvas 393 17 574 578 allpass 0; 11 | #X obj 56 127 inlet~; 12 | #X obj 56 400 +~; 13 | #X obj 427 232 loadbang; 14 | #X obj 417 286 t f f; 15 | #X obj 417 310 *; 16 | #X obj 253 364 *~; 17 | #X obj 232 394 +~; 18 | #X obj 114 177 * -1; 19 | #X obj 88 207 *~; 20 | #X obj 232 426 outlet~; 21 | #X obj 417 129 inlet; 22 | #X obj 114 117 loadbang; 23 | #X obj 75 365 *~ -1; 24 | #X obj 201 364 *~ -1; 25 | #X obj 114 149 f 0.75; 26 | #X obj 417 262 f 0.75; 27 | #X obj 56 491 delwrite~ \$0-tap_13_14 200; 28 | #X obj 252 262 *~ 0.75; 29 | #X obj 252 53 delread~ \$0-tap_13_14 4.77134; 30 | #X obj 417 336 swap 1; 31 | #X obj 417 360 -; 32 | #X connect 0 0 1 0; 33 | #X connect 0 0 8 0; 34 | #X connect 1 0 16 0; 35 | #X connect 2 0 15 0; 36 | #X connect 3 0 4 0; 37 | #X connect 3 1 4 1; 38 | #X connect 4 0 19 0; 39 | #X connect 5 0 6 1; 40 | #X connect 6 0 9 0; 41 | #X connect 7 0 8 1; 42 | #X connect 8 0 13 0; 43 | #X connect 10 0 14 0; 44 | #X connect 10 0 15 0; 45 | #X connect 10 0 17 1; 46 | #X connect 11 0 14 0; 47 | #X connect 12 0 1 1; 48 | #X connect 13 0 6 0; 49 | #X connect 14 0 7 0; 50 | #X connect 15 0 3 0; 51 | #X connect 17 0 5 0; 52 | #X connect 17 0 12 0; 53 | #X connect 18 0 17 0; 54 | #X connect 19 0 20 0; 55 | #X connect 19 1 20 1; 56 | #X connect 20 0 5 1; 57 | #X restore 30 99 pd allpass tap_13_14; 58 | #N canvas 314 10 579 582 allpass 0; 59 | #X obj 56 127 inlet~; 60 | #X obj 56 400 +~; 61 | #X obj 427 232 loadbang; 62 | #X obj 417 286 t f f; 63 | #X obj 417 310 *; 64 | #X obj 253 364 *~; 65 | #X obj 232 394 +~; 66 | #X obj 114 177 * -1; 67 | #X obj 88 207 *~; 68 | #X obj 232 426 outlet~; 69 | #X obj 417 129 inlet; 70 | #X obj 114 117 loadbang; 71 | #X obj 75 365 *~ -1; 72 | #X obj 201 364 *~ -1; 73 | #X obj 114 149 f 0.75; 74 | #X obj 417 262 f 0.75; 75 | #X obj 252 262 *~ 0.75; 76 | #X obj 56 491 delwrite~ \$0-tap_19_20 200; 77 | #X obj 252 53 delread~ \$0-tap_19_20 3.5953; 78 | #X obj 417 336 swap 1; 79 | #X obj 417 360 -; 80 | #X connect 0 0 1 0; 81 | #X connect 0 0 8 0; 82 | #X connect 1 0 17 0; 83 | #X connect 2 0 15 0; 84 | #X connect 3 0 4 0; 85 | #X connect 3 1 4 1; 86 | #X connect 4 0 19 0; 87 | #X connect 5 0 6 1; 88 | #X connect 6 0 9 0; 89 | #X connect 7 0 8 1; 90 | #X connect 8 0 13 0; 91 | #X connect 10 0 14 0; 92 | #X connect 10 0 15 0; 93 | #X connect 10 0 16 1; 94 | #X connect 11 0 14 0; 95 | #X connect 12 0 1 1; 96 | #X connect 13 0 6 0; 97 | #X connect 14 0 7 0; 98 | #X connect 15 0 3 0; 99 | #X connect 16 0 5 0; 100 | #X connect 16 0 12 0; 101 | #X connect 18 0 16 0; 102 | #X connect 19 0 20 0; 103 | #X connect 19 1 20 1; 104 | #X connect 20 0 5 1; 105 | #X restore 30 135 pd allpass tap_19_20; 106 | #N canvas 238 0 570 590 allpass 0; 107 | #X obj 56 127 inlet~; 108 | #X obj 56 400 +~; 109 | #X obj 427 232 loadbang; 110 | #X obj 417 286 t f f; 111 | #X obj 417 310 *; 112 | #X obj 253 364 *~; 113 | #X obj 232 394 +~; 114 | #X obj 114 177 * -1; 115 | #X obj 88 207 *~; 116 | #X obj 232 426 outlet~; 117 | #X obj 417 129 inlet; 118 | #X obj 114 117 loadbang; 119 | #X obj 75 365 *~ -1; 120 | #X obj 201 364 *~ -1; 121 | #X obj 114 149 f 0.625; 122 | #X obj 252 262 *~ 0.625; 123 | #X obj 417 262 f 0.625; 124 | #X obj 56 491 delwrite~ \$0-tap_15_16 200; 125 | #X obj 252 53 delread~ \$0-tap_15_16 12.7348; 126 | #X obj 417 336 swap 1; 127 | #X obj 417 360 -; 128 | #X connect 0 0 1 0; 129 | #X connect 0 0 8 0; 130 | #X connect 1 0 17 0; 131 | #X connect 2 0 16 0; 132 | #X connect 3 0 4 0; 133 | #X connect 3 1 4 1; 134 | #X connect 4 0 19 0; 135 | #X connect 5 0 6 1; 136 | #X connect 6 0 9 0; 137 | #X connect 7 0 8 1; 138 | #X connect 8 0 13 0; 139 | #X connect 10 0 14 0; 140 | #X connect 10 0 15 1; 141 | #X connect 10 0 16 0; 142 | #X connect 11 0 14 0; 143 | #X connect 12 0 1 1; 144 | #X connect 13 0 6 0; 145 | #X connect 14 0 7 0; 146 | #X connect 15 0 5 0; 147 | #X connect 15 0 12 0; 148 | #X connect 16 0 3 0; 149 | #X connect 18 0 15 0; 150 | #X connect 19 0 20 0; 151 | #X connect 19 1 20 1; 152 | #X connect 20 0 5 1; 153 | #X restore 30 190 pd allpass tap_15_16; 154 | #N canvas 238 0 566 586 allpass 0; 155 | #X obj 56 127 inlet~; 156 | #X obj 56 400 +~; 157 | #X obj 427 232 loadbang; 158 | #X obj 417 286 t f f; 159 | #X obj 417 310 *; 160 | #X obj 253 364 *~; 161 | #X obj 232 394 +~; 162 | #X obj 114 177 * -1; 163 | #X obj 88 207 *~; 164 | #X obj 232 426 outlet~; 165 | #X obj 417 129 inlet; 166 | #X obj 114 117 loadbang; 167 | #X obj 75 365 *~ -1; 168 | #X obj 201 364 *~ -1; 169 | #X obj 114 149 f 0.625; 170 | #X obj 252 262 *~ 0.625; 171 | #X obj 417 262 f 0.625; 172 | #X obj 56 491 delwrite~ \$0-tap_21_22 200; 173 | #X obj 252 53 delread~ \$0-tap_21_22 9.30748; 174 | #X obj 417 336 swap 1; 175 | #X obj 417 360 -; 176 | #X connect 0 0 1 0; 177 | #X connect 0 0 8 0; 178 | #X connect 1 0 17 0; 179 | #X connect 2 0 16 0; 180 | #X connect 3 0 4 0; 181 | #X connect 3 1 4 1; 182 | #X connect 4 0 19 0; 183 | #X connect 5 0 6 1; 184 | #X connect 6 0 9 0; 185 | #X connect 7 0 8 1; 186 | #X connect 8 0 13 0; 187 | #X connect 10 0 14 0; 188 | #X connect 10 0 15 1; 189 | #X connect 10 0 16 0; 190 | #X connect 11 0 14 0; 191 | #X connect 12 0 1 1; 192 | #X connect 13 0 6 0; 193 | #X connect 14 0 7 0; 194 | #X connect 15 0 5 0; 195 | #X connect 15 0 12 0; 196 | #X connect 16 0 3 0; 197 | #X connect 18 0 15 0; 198 | #X connect 19 0 20 0; 199 | #X connect 19 1 20 1; 200 | #X connect 20 0 5 1; 201 | #X restore 30 230 pd allpass tap_21_22; 202 | #X connect 0 0 4 0; 203 | #X connect 2 0 4 1; 204 | #X connect 2 0 5 1; 205 | #X connect 3 0 6 1; 206 | #X connect 3 0 7 1; 207 | #X connect 4 0 5 0; 208 | #X connect 5 0 6 0; 209 | #X connect 6 0 7 0; 210 | #X connect 7 0 1 0; 211 | #X restore 25 208 pd input_diffusion; 212 | #N canvas 38 72 501 476 reverberation_tank 0; 213 | #X obj 168 85 inlet~; 214 | #X obj 43 120 +~; 215 | #X obj 255 121 +~; 216 | #N canvas 0 0 458 308 z^-4217 0; 217 | #X obj 106 55 inlet~; 218 | #X obj 105 120 delwrite~ \$0-tap_48_54 141.695; 219 | #X text 358 135 4217; 220 | #X obj 105 147 delread~ \$0-tap_48_54 141.695; 221 | #X obj 106 223 outlet~; 222 | #X connect 0 0 1 0; 223 | #X connect 3 0 4 0; 224 | #X restore 255 190 pd z^-4217; 225 | #N canvas 0 0 458 308 z^-4453 0; 226 | #X obj 41 104 delwrite~ \$0-tap_24_30 149.625; 227 | #X obj 42 128 delread~ \$0-tap_24_30 149.625; 228 | #X text 287 119 4453; 229 | #X obj 43 60 inlet~; 230 | #X obj 43 168 outlet~; 231 | #X connect 1 0 4 0; 232 | #X connect 3 0 0 0; 233 | #X restore 43 192 pd z^-4453; 234 | #N canvas 0 0 466 316 damping 0; 235 | #X obj 74 53 inlet~; 236 | #X obj 70 222 outlet~; 237 | #X obj 73 137 lop~ 22050; 238 | #X obj 162 137 r \$0-damping; 239 | #X connect 0 0 2 0; 240 | #X connect 2 0 1 0; 241 | #X connect 3 0 2 1; 242 | #X restore 44 221 pd damping; 243 | #N canvas 0 0 470 320 damping 0; 244 | #X obj 74 53 inlet~; 245 | #X obj 70 222 outlet~; 246 | #X obj 73 137 lop~ 22050; 247 | #X obj 162 137 r \$0-damping; 248 | #X connect 0 0 2 0; 249 | #X connect 2 0 1 0; 250 | #X connect 3 0 2 1; 251 | #X restore 256 221 pd damping; 252 | #N canvas 0 0 470 320 decay 0; 253 | #X obj 71 66 inlet~; 254 | #X obj 71 220 outlet~; 255 | #X obj 140 139 r \$0-decay; 256 | #X obj 70 140 *~ 0.5; 257 | #X connect 0 0 3 0; 258 | #X connect 2 0 3 1; 259 | #X connect 3 0 1 0; 260 | #X restore 43 249 pd decay; 261 | #N canvas 0 0 470 320 decay 0; 262 | #X obj 71 66 inlet~; 263 | #X obj 71 220 outlet~; 264 | #X obj 140 139 r \$0-decay; 265 | #X obj 70 140 *~ 0.5; 266 | #X connect 0 0 3 0; 267 | #X connect 2 0 3 1; 268 | #X connect 3 0 1 0; 269 | #X restore 257 250 pd decay; 270 | #N canvas 0 0 466 316 decay 0; 271 | #X obj 71 66 inlet~; 272 | #X obj 71 220 outlet~; 273 | #X obj 140 139 r \$0-decay; 274 | #X obj 70 140 *~ 0.5; 275 | #X connect 0 0 3 0; 276 | #X connect 2 0 3 1; 277 | #X connect 3 0 1 0; 278 | #X restore 43 87 pd decay; 279 | #N canvas 0 0 466 316 decay 0; 280 | #X obj 71 66 inlet~; 281 | #X obj 71 220 outlet~; 282 | #X obj 140 139 r \$0-decay; 283 | #X obj 70 140 *~ 0.5; 284 | #X connect 0 0 3 0; 285 | #X connect 2 0 3 1; 286 | #X connect 3 0 1 0; 287 | #X restore 273 85 pd decay; 288 | #N canvas 0 0 498 348 decay_diffusion1 0; 289 | #N canvas 232 298 494 344 excursion 0; 290 | #X obj 64 192 outlet~; 291 | #X obj 62 90 osc~ 1; 292 | #X obj 63 143 *~ 0.53761; 293 | #X obj 130 109 r \$0-excursion; 294 | #X connect 1 0 2 0; 295 | #X connect 2 0 0 0; 296 | #X connect 3 0 2 1; 297 | #X restore 133 120 pd excursion; 298 | #X obj 43 32 inlet~; 299 | #X obj 44 250 outlet~; 300 | #X obj 88 84 r \$0-decay_diffusion1; 301 | #N canvas 409 74 612 523 allpassvd 0; 302 | #X obj 48 83 inlet~; 303 | #X obj 48 296 +~; 304 | #X obj 285 142 loadbang; 305 | #X obj 285 196 t f f; 306 | #X obj 285 220 *; 307 | #X obj 229 277 *~; 308 | #X obj 216 300 +~; 309 | #X obj 94 138 * -1; 310 | #X obj 80 163 *~; 311 | #X obj 217 401 outlet~; 312 | #X obj 392 30 inlet~; 313 | #X obj 447 56 sig~; 314 | #X obj 447 10 loadbang; 315 | #X obj 390 78 +~; 316 | #X obj 255 45 inlet; 317 | #X obj 94 60 loadbang; 318 | #X text 9 6 arguments: delay(ms) feedback(mult); 319 | #X text 10 20 inlets: signal feedback(mult) excursion; 320 | #X obj 94 114 f 0.7; 321 | #X obj 230 152 *~ 0.7; 322 | #X obj 285 172 f 0.7; 323 | #X obj 391 404 +~; 324 | #X text 372 428 excursion; 325 | #X obj 48 327 delwrite~ \$0-tap_23_24 100; 326 | #X obj 283 101 vd~ \$0-tap_23_24; 327 | #X obj 447 33 f 22.5599; 328 | #X obj 285 244 swap 1; 329 | #X obj 285 268 -; 330 | #X connect 0 0 1 0; 331 | #X connect 0 0 8 0; 332 | #X connect 1 0 23 0; 333 | #X connect 2 0 20 0; 334 | #X connect 3 0 4 0; 335 | #X connect 3 1 4 1; 336 | #X connect 4 0 26 0; 337 | #X connect 5 0 6 1; 338 | #X connect 6 0 9 0; 339 | #X connect 7 0 8 1; 340 | #X connect 8 0 6 0; 341 | #X connect 10 0 13 0; 342 | #X connect 11 0 13 1; 343 | #X connect 12 0 25 0; 344 | #X connect 13 0 21 0; 345 | #X connect 13 0 24 0; 346 | #X connect 14 0 18 0; 347 | #X connect 14 0 19 1; 348 | #X connect 14 0 20 0; 349 | #X connect 15 0 18 0; 350 | #X connect 18 0 7 0; 351 | #X connect 19 0 1 1; 352 | #X connect 19 0 5 0; 353 | #X connect 20 0 3 0; 354 | #X connect 24 0 19 0; 355 | #X connect 25 0 11 0; 356 | #X connect 26 0 27 0; 357 | #X connect 26 1 27 1; 358 | #X connect 27 0 5 1; 359 | #X restore 43 150 pd allpassvd; 360 | #X connect 0 0 4 2; 361 | #X connect 1 0 4 0; 362 | #X connect 3 0 4 1; 363 | #X connect 4 0 2 0; 364 | #X restore 44 156 pd decay_diffusion1; 365 | #N canvas 0 0 529 394 decay_diffusion1 0; 366 | #N canvas 232 298 482 332 excursion 0; 367 | #X obj 65 192 outlet~; 368 | #X obj 63 81 osc~ 1; 369 | #X obj 64 134 *~ 0.53761; 370 | #X obj 139 104 r \$0-excursion; 371 | #X connect 1 0 2 0; 372 | #X connect 2 0 0 0; 373 | #X connect 3 0 2 1; 374 | #X restore 138 92 pd excursion; 375 | #X obj 49 25 inlet~; 376 | #X obj 49 200 outlet~; 377 | #X obj 93 60 r \$0-decay_diffusion1; 378 | #N canvas 348 52 608 519 allpassvd 0; 379 | #X obj 48 83 inlet~; 380 | #X obj 48 296 +~; 381 | #X obj 285 142 loadbang; 382 | #X obj 285 196 t f f; 383 | #X obj 285 220 *; 384 | #X obj 229 277 *~; 385 | #X obj 216 300 +~; 386 | #X obj 94 138 * -1; 387 | #X obj 80 163 *~; 388 | #X obj 217 401 outlet~; 389 | #X obj 392 30 inlet~; 390 | #X obj 447 56 sig~; 391 | #X obj 447 10 loadbang; 392 | #X obj 390 78 +~; 393 | #X obj 255 45 inlet; 394 | #X obj 94 60 loadbang; 395 | #X text 9 6 arguments: delay(ms) feedback(mult); 396 | #X text 10 20 inlets: signal feedback(mult) excursion; 397 | #X obj 48 327 delwrite~ \$0-tap_46_48 100; 398 | #X obj 283 101 vd~ \$0-tap_46_48; 399 | #X obj 447 33 f 30.5097; 400 | #X obj 94 114 f 0.7; 401 | #X obj 230 152 *~ 0.7; 402 | #X obj 285 172 f 0.7; 403 | #X obj 391 404 +~; 404 | #X text 372 428 excursion; 405 | #X obj 285 244 swap 1; 406 | #X obj 285 268 -; 407 | #X connect 0 0 1 0; 408 | #X connect 0 0 8 0; 409 | #X connect 1 0 18 0; 410 | #X connect 2 0 23 0; 411 | #X connect 3 0 4 0; 412 | #X connect 3 1 4 1; 413 | #X connect 4 0 26 0; 414 | #X connect 5 0 6 1; 415 | #X connect 6 0 9 0; 416 | #X connect 7 0 8 1; 417 | #X connect 8 0 6 0; 418 | #X connect 10 0 13 0; 419 | #X connect 11 0 13 1; 420 | #X connect 12 0 20 0; 421 | #X connect 13 0 19 0; 422 | #X connect 13 0 24 0; 423 | #X connect 14 0 21 0; 424 | #X connect 14 0 22 1; 425 | #X connect 14 0 23 0; 426 | #X connect 15 0 21 0; 427 | #X connect 19 0 22 0; 428 | #X connect 20 0 11 0; 429 | #X connect 21 0 7 0; 430 | #X connect 22 0 1 1; 431 | #X connect 22 0 5 0; 432 | #X connect 23 0 3 0; 433 | #X connect 26 0 27 0; 434 | #X connect 26 1 27 1; 435 | #X connect 27 0 5 1; 436 | #X restore 48 135 pd allpassvd; 437 | #X connect 0 0 4 2; 438 | #X connect 1 0 4 0; 439 | #X connect 3 0 4 1; 440 | #X connect 4 0 2 0; 441 | #X restore 256 155 pd decay_diffusion1; 442 | #N canvas 327 329 552 336 decay_diffusion2 0; 443 | #X obj 37 63 inlet~; 444 | #X obj 37 220 outlet~; 445 | #N canvas 393 17 582 586 allpass 0; 446 | #X obj 56 127 inlet~; 447 | #X obj 56 400 +~; 448 | #X obj 427 232 loadbang; 449 | #X obj 417 286 t f f; 450 | #X obj 417 310 *; 451 | #X obj 253 364 *~; 452 | #X obj 232 394 +~; 453 | #X obj 114 177 * -1; 454 | #X obj 88 207 *~; 455 | #X obj 232 426 outlet~; 456 | #X obj 417 129 inlet; 457 | #X obj 114 117 loadbang; 458 | #X obj 75 365 *~ -1; 459 | #X obj 201 364 *~ -1; 460 | #X obj 252 52 delread~ \$0-tap_31_33 60.4818; 461 | #X obj 56 491 delwrite~ \$0-tap_31_33 200; 462 | #X obj 114 149 f 0.5; 463 | #X obj 252 262 *~ 0.5; 464 | #X obj 417 262 f 0.5; 465 | #X obj 417 334 swap 1; 466 | #X obj 417 358 -; 467 | #X connect 0 0 1 0; 468 | #X connect 0 0 8 0; 469 | #X connect 1 0 15 0; 470 | #X connect 2 0 18 0; 471 | #X connect 3 0 4 0; 472 | #X connect 3 1 4 1; 473 | #X connect 4 0 19 0; 474 | #X connect 5 0 6 1; 475 | #X connect 6 0 9 0; 476 | #X connect 7 0 8 1; 477 | #X connect 8 0 13 0; 478 | #X connect 10 0 16 0; 479 | #X connect 10 0 17 1; 480 | #X connect 10 0 18 0; 481 | #X connect 11 0 16 0; 482 | #X connect 12 0 1 1; 483 | #X connect 13 0 6 0; 484 | #X connect 14 0 17 0; 485 | #X connect 16 0 7 0; 486 | #X connect 17 0 5 0; 487 | #X connect 17 0 12 0; 488 | #X connect 18 0 3 0; 489 | #X connect 19 0 20 0; 490 | #X connect 19 1 20 1; 491 | #X connect 20 0 5 1; 492 | #X restore 36 143 pd allpass tap_31_33; 493 | #X obj 191 114 r \$0-decay_diffusion2; 494 | #X connect 0 0 2 0; 495 | #X connect 2 0 1 0; 496 | #X connect 3 0 2 1; 497 | #X restore 43 277 pd decay_diffusion2; 498 | #N canvas 0 0 553 336 decay_diffusion2 0; 499 | #X obj 52 38 inlet~; 500 | #X obj 54 171 outlet~; 501 | #X obj 210 85 r \$0-decay_diffusion2; 502 | #N canvas 393 17 586 590 allpass 0; 503 | #X obj 56 127 inlet~; 504 | #X obj 56 400 +~; 505 | #X obj 427 232 loadbang; 506 | #X obj 417 286 t f f; 507 | #X obj 417 310 *; 508 | #X obj 253 364 *~; 509 | #X obj 232 394 +~; 510 | #X obj 114 177 * -1; 511 | #X obj 88 207 *~; 512 | #X obj 232 426 outlet~; 513 | #X obj 417 129 inlet; 514 | #X obj 114 117 loadbang; 515 | #X obj 75 365 *~ -1; 516 | #X obj 201 364 *~ -1; 517 | #X obj 114 149 f 0.5; 518 | #X obj 252 262 *~ 0.5; 519 | #X obj 417 262 f 0.5; 520 | #X obj 56 491 delwrite~ \$0-tap_55_59 200; 521 | #X obj 252 52 delread~ \$0-tap_55_59 89.2443; 522 | #X obj 417 334 swap 1; 523 | #X obj 417 358 -; 524 | #X connect 0 0 1 0; 525 | #X connect 0 0 8 0; 526 | #X connect 1 0 17 0; 527 | #X connect 2 0 16 0; 528 | #X connect 3 0 4 0; 529 | #X connect 3 1 4 1; 530 | #X connect 4 0 19 0; 531 | #X connect 5 0 6 1; 532 | #X connect 6 0 9 0; 533 | #X connect 7 0 8 1; 534 | #X connect 8 0 13 0; 535 | #X connect 10 0 14 0; 536 | #X connect 10 0 15 1; 537 | #X connect 10 0 16 0; 538 | #X connect 11 0 14 0; 539 | #X connect 12 0 1 1; 540 | #X connect 13 0 6 0; 541 | #X connect 14 0 7 0; 542 | #X connect 15 0 5 0; 543 | #X connect 15 0 12 0; 544 | #X connect 16 0 3 0; 545 | #X connect 18 0 15 0; 546 | #X connect 19 0 20 0; 547 | #X connect 19 1 20 1; 548 | #X connect 20 0 5 1; 549 | #X restore 55 114 pd allpass tap_55_59; 550 | #X connect 0 0 3 0; 551 | #X connect 2 0 3 1; 552 | #X connect 3 0 1 0; 553 | #X restore 256 278 pd decay_diffusion2; 554 | #N canvas 0 0 454 304 feedback 0; 555 | #X obj 43 118 outlet~; 556 | #X obj 44 55 delread~ \$0-tap_59_63 106.28; 557 | #X connect 1 0 0 0; 558 | #X restore 43 49 pd feedback; 559 | #N canvas 0 0 454 304 feedback 0; 560 | #X obj 81 188 outlet~; 561 | #X obj 81 134 delread~ \$0-tap_33_39 124.996; 562 | #X connect 1 0 0 0; 563 | #X restore 274 51 pd feedback; 564 | #N canvas 0 0 458 308 to_left 0; 565 | #X obj 48 52 inlet~; 566 | #X obj 48 95 delwrite~ \$0-tap_59_63 106.28; 567 | #X connect 0 0 1 0; 568 | #X restore 255 306 pd to_left; 569 | #N canvas 0 0 454 304 to_right 0; 570 | #X obj 53 173 delwrite~ \$0-tap_33_39 124.996; 571 | #X obj 56 100 inlet~; 572 | #X connect 1 0 0 0; 573 | #X restore 44 305 pd to_right; 574 | #X text 344 190 48_54; 575 | #X text 136 193 24_30; 576 | #X obj 170 357 outlet~; 577 | #X text 242 358 dummy; 578 | #X connect 0 0 1 1; 579 | #X connect 0 0 2 0; 580 | #X connect 1 0 11 0; 581 | #X connect 2 0 12 0; 582 | #X connect 3 0 6 0; 583 | #X connect 4 0 5 0; 584 | #X connect 5 0 7 0; 585 | #X connect 6 0 8 0; 586 | #X connect 7 0 13 0; 587 | #X connect 8 0 14 0; 588 | #X connect 9 0 1 0; 589 | #X connect 10 0 2 1; 590 | #X connect 11 0 4 0; 591 | #X connect 12 0 3 0; 592 | #X connect 13 0 18 0; 593 | #X connect 14 0 17 0; 594 | #X connect 15 0 9 0; 595 | #X connect 16 0 10 0; 596 | #X restore 25 238 pd reverberation_tank; 597 | #N canvas 58 172 593 487 predelay 0; 598 | #X obj 97 19 inlet~; 599 | #X obj 97 317 outlet~; 600 | #X obj 393 56 sel 0; 601 | #X obj 96 209 *~ 1; 602 | #X obj 110 178 f 1; 603 | #X obj 140 179 f 0; 604 | #X obj 428 106 t a b; 605 | #X obj 377 222 *~ 1; 606 | #X obj 402 191 f 0; 607 | #X obj 433 191 f 1; 608 | #X text 17 210 no delay; 609 | #X text 237 212 delay; 610 | #N canvas 294 159 273 227 predelay 0; 611 | #X obj 35 52 inlet~; 612 | #X obj 94 54 inlet; 613 | #N canvas 345 153 450 300 dw 0; 614 | #X obj 35 52 inlet~; 615 | #X obj 35 101 delwrite~ \$0-predelay 1000; 616 | #X obj 34 140 outlet~; 617 | #X connect 0 0 1 0; 618 | #X restore 34 84 pd dw; 619 | #N canvas 326 259 416 179 dr 0; 620 | #X obj 126 29 inlet; 621 | #X obj 49 28 inlet~; 622 | #X obj 126 65 delread~ \$0-predelay 1; 623 | #X obj 126 88 outlet~; 624 | #X connect 0 0 2 0; 625 | #X connect 2 0 3 0; 626 | #X restore 33 116 pd dr; 627 | #X obj 33 138 outlet~; 628 | #X connect 0 0 2 0; 629 | #X connect 1 0 3 1; 630 | #X connect 2 0 3 0; 631 | #X connect 3 0 4 0; 632 | #X restore 297 190 pd predelay; 633 | #X obj 393 25 r \$0-predelay; 634 | #X connect 0 0 3 0; 635 | #X connect 0 0 12 0; 636 | #X connect 2 0 4 0; 637 | #X connect 2 0 8 0; 638 | #X connect 2 1 6 0; 639 | #X connect 3 0 1 0; 640 | #X connect 4 0 3 1; 641 | #X connect 5 0 3 1; 642 | #X connect 6 0 12 1; 643 | #X connect 6 1 5 0; 644 | #X connect 6 1 9 0; 645 | #X connect 7 0 1 0; 646 | #X connect 8 0 7 1; 647 | #X connect 9 0 7 1; 648 | #X connect 12 0 7 0; 649 | #X connect 13 0 2 0; 650 | #X restore 25 145 pd predelay; 651 | #X obj 85 32 inlet~; 652 | #X obj 223 35 inlet; 653 | #N canvas 0 0 458 308 bandwidth 0; 654 | #X obj 66 22 inlet~; 655 | #X obj 65 183 outlet~; 656 | #X obj 65 107 lop~; 657 | #X obj 92 74 r \$0-bandwidth; 658 | #X connect 0 0 2 0; 659 | #X connect 2 0 1 0; 660 | #X connect 3 0 2 1; 661 | #X restore 25 177 pd bandwidth; 662 | #N canvas 0 0 458 308 1/2 0; 663 | #X obj 102 56 inlet~; 664 | #X obj 182 56 inlet~; 665 | #X obj 103 138 *~ 0.5; 666 | #X obj 103 102 +~; 667 | #X obj 103 175 outlet~; 668 | #X connect 0 0 3 0; 669 | #X connect 1 0 3 1; 670 | #X connect 2 0 4 0; 671 | #X connect 3 0 2 0; 672 | #X restore 25 112 pd 1/2; 673 | #N canvas 120 111 856 498 output_taps 0; 674 | #X obj 28 409 outlet~; 675 | #X obj 30 267 -~; 676 | #X obj 31 109 +~; 677 | #X obj 30 215 +~; 678 | #X obj 29 369 -~; 679 | #X text 30 26 left; 680 | #X obj 32 55 delread~ \$0-tap_48_54 8.93787; 681 | #X obj 51 82 delread~ \$0-tap_48_54 99.9294; 682 | #X obj 50 134 delread~ \$0-tap_55_59 64.2787; 683 | #X obj 31 163 -~; 684 | #X obj 49 188 delread~ \$0-tap_59_63 67.0676; 685 | #X obj 50 240 delread~ \$0-tap_24_30 66.866; 686 | #X obj 50 293 delread~ \$0-tap_31_33 6.28339; 687 | #X obj 30 317 -~; 688 | #X obj 49 342 delread~ \$0-tap_33_39 35.8187; 689 | #X obj 371 407 outlet~; 690 | #X obj 370 105 +~; 691 | #X obj 371 261 -~; 692 | #X obj 370 208 +~; 693 | #X obj 371 365 -~; 694 | #X text 370 20 right; 695 | #X obj 371 51 delread~ \$0-tap_24_30 11.8612; 696 | #X obj 390 78 delread~ \$0-tap_24_30 121.871; 697 | #X obj 390 130 delread~ \$0-tap_31_33 41.2621; 698 | #X obj 390 181 delread~ \$0-tap_33_39 89.8155; 699 | #X obj 391 234 delread~ \$0-tap_48_54 70.9317; 700 | #X obj 372 313 -~; 701 | #X obj 392 286 delread~ \$0-tap_55_59 11.2563; 702 | #X obj 390 338 delread~ \$0-tap_59_63 4.06572; 703 | #X obj 370 154 -~; 704 | #X obj 161 15 inlet~; 705 | #X text 222 15 dummy; 706 | #X connect 1 0 13 0; 707 | #X connect 2 0 9 0; 708 | #X connect 3 0 1 0; 709 | #X connect 4 0 0 0; 710 | #X connect 6 0 2 0; 711 | #X connect 7 0 2 1; 712 | #X connect 8 0 9 1; 713 | #X connect 9 0 3 0; 714 | #X connect 10 0 3 1; 715 | #X connect 11 0 1 1; 716 | #X connect 12 0 13 1; 717 | #X connect 13 0 4 0; 718 | #X connect 14 0 4 1; 719 | #X connect 16 0 29 0; 720 | #X connect 17 0 26 0; 721 | #X connect 18 0 17 0; 722 | #X connect 19 0 15 0; 723 | #X connect 21 0 16 0; 724 | #X connect 22 0 16 1; 725 | #X connect 23 0 29 1; 726 | #X connect 24 0 18 1; 727 | #X connect 25 0 17 1; 728 | #X connect 26 0 19 0; 729 | #X connect 27 0 26 1; 730 | #X connect 28 0 19 1; 731 | #X connect 29 0 18 0; 732 | #X restore 24 268 pd output_taps; 733 | #N canvas 366 327 496 480 dispatchers 0; 734 | #X obj 40 43 inlet; 735 | #X obj 107 106 u_dispatch \$0 predelay; 736 | #X obj 107 128 u_dispatch \$0 bandwidth; 737 | #X obj 107 150 u_dispatch \$0 damping; 738 | #X obj 107 172 u_dispatch \$0 decay; 739 | #X obj 107 194 u_dispatch \$0 input_diffusion1; 740 | #X obj 107 282 u_dispatch \$0 excursion; 741 | #X obj 107 216 u_dispatch \$0 input_diffusion2; 742 | #X obj 107 238 u_dispatch \$0 decay_diffusion1; 743 | #X obj 107 260 u_dispatch \$0 decay_diffusion2; 744 | #X obj 107 318 u_dispatch \$0 dry; 745 | #X obj 40 379 u_loader e_platereverb-\$1 \$0; 746 | #X obj 40 403 outlet; 747 | #X obj 40 78 route save; 748 | #X connect 0 0 13 0; 749 | #X connect 1 0 2 0; 750 | #X connect 2 0 3 0; 751 | #X connect 3 0 4 0; 752 | #X connect 4 0 5 0; 753 | #X connect 5 0 7 0; 754 | #X connect 6 0 10 0; 755 | #X connect 7 0 8 0; 756 | #X connect 8 0 9 0; 757 | #X connect 9 0 6 0; 758 | #X connect 11 0 12 0; 759 | #X connect 13 0 11 0; 760 | #X connect 13 1 1 0; 761 | #X restore 223 117 pd dispatchers; 762 | #N canvas 83 39 896 374 defaults 0; 763 | #X msg 491 174 predelay 0 \, bandwidth 22050 \, damping 22050 \, decay 764 | 0.5 \, input_diffusion1 0.75 \, input_diffusion2 0.625 \, decay_diffusion1 765 | 0.7 \, decay_diffusion2 0.5 \, excursion 0.53761; 766 | #X obj 53 144 samplerate~; 767 | #X obj 53 166 * 0.5; 768 | #X msg 53 187 bandwidth \$1 \, damping \$1; 769 | #X text 532 142 This is the original default; 770 | #X obj 53 300 outlet; 771 | #X obj 53 61 t b b; 772 | #X text 241 186 but we use SR/2 for bw and damp.; 773 | #X obj 53 33 inlet; 774 | #X msg 97 33 bang; 775 | #X connect 0 0 5 0; 776 | #X connect 1 0 2 0; 777 | #X connect 2 0 3 0; 778 | #X connect 3 0 5 0; 779 | #X connect 6 0 1 0; 780 | #X connect 6 1 0 0; 781 | #X connect 8 0 6 0; 782 | #X connect 9 0 6 0; 783 | #X restore 234 89 pd defaults; 784 | #X obj 234 66 loadbang; 785 | #X obj 24 347 c_xfade; 786 | #X obj 118 349 c_xfade; 787 | #X obj 164 268 r \$0-dry; 788 | #X obj 164 293 pack 0 10; 789 | #X obj 223 142 outlet; 790 | #X text 278 141 for saving.; 791 | #N canvas 228 198 627 317 LICENSE-BSD 0; 792 | #X text 121 56 This software is copyrighted by Miller Puckette \, Reality 793 | Jockey Ltd. and others. The terms (the "Standard Improved BSD License") 794 | apply to all files associated with the software unless explicitly disclaimed 795 | in individual files.; 796 | #X text 123 148 See the file LICENSE.txt for the full license text. 797 | ; 798 | #X restore 373 40 pd LICENSE-BSD; 799 | #X connect 0 0 9 0; 800 | #X connect 0 0 14 1; 801 | #X connect 3 0 4 0; 802 | #X connect 4 0 10 0; 803 | #X connect 5 0 8 0; 804 | #X connect 6 0 9 1; 805 | #X connect 6 0 15 1; 806 | #X connect 7 0 11 0; 807 | #X connect 8 0 3 0; 808 | #X connect 9 0 5 0; 809 | #X connect 10 0 14 0; 810 | #X connect 10 1 15 0; 811 | #X connect 11 0 18 0; 812 | #X connect 12 0 11 0; 813 | #X connect 13 0 12 0; 814 | #X connect 14 0 1 0; 815 | #X connect 15 0 2 0; 816 | #X connect 16 0 17 0; 817 | #X connect 17 0 15 2; 818 | #X connect 17 0 14 2; 819 | -------------------------------------------------------------------------------- /lib/chains/depth/u_dispatch.pd: -------------------------------------------------------------------------------- 1 | #N canvas 303 323 759 261 10; 2 | #X obj 131 28 inlet; 3 | #X obj 182 185 outlet; 4 | #X obj 131 122 route \$2; 5 | #X obj 131 155 s \$1-\$2; 6 | #X obj 131 98 list trim; 7 | #X obj 273 121 select help; 8 | #X obj 273 158 list append \$2; 9 | #X obj 273 182 list trim; 10 | #X obj 273 205 print dispatcher; 11 | #X obj 273 94 route symbol; 12 | #X obj 273 70 list; 13 | #X obj 470 104 u_sssad \$2 \$1; 14 | #X obj 470 131 s \$1-\$2; 15 | #X obj 544 73 r \$1-\$2; 16 | #X text 447 73 state saves:; 17 | #N canvas 228 198 627 317 LICENSE-BSD 0; 18 | #X text 121 56 This software is copyrighted by Miller Puckette \, Reality 19 | Jockey Ltd. and others. The terms (the "Standard Improved BSD License") 20 | apply to all files associated with the software unless explicitly disclaimed 21 | in individual files.; 22 | #X text 123 148 See the file LICENSE.txt for the full license text. 23 | ; 24 | #X restore 553 30 pd LICENSE-BSD; 25 | #X connect 0 0 4 0; 26 | #X connect 0 0 10 0; 27 | #X connect 2 0 3 0; 28 | #X connect 2 1 1 0; 29 | #X connect 4 0 2 0; 30 | #X connect 5 0 6 0; 31 | #X connect 6 0 7 0; 32 | #X connect 7 0 8 0; 33 | #X connect 9 0 5 0; 34 | #X connect 10 0 9 0; 35 | #X connect 11 0 12 0; 36 | #X connect 13 0 11 1; 37 | -------------------------------------------------------------------------------- /lib/chains/depth/u_loader.pd: -------------------------------------------------------------------------------- 1 | #N canvas 0 0 797 492 10; 2 | #X obj 151 86 route persist; 3 | #X obj 151 117 list prepend \$1; 4 | #X obj 150 196 list trim; 5 | #X obj 150 222 route \$1; 6 | #X msg 150 328 setonly \$1; 7 | #X obj 150 248 t a a; 8 | #X obj 150 306 list; 9 | #X obj 150 174 r RJ_SCENE_LOAD; 10 | #X obj 151 144 s RJ_SCENE; 11 | #X obj 305 98 r RJ_SCENE_SAVE; 12 | #X obj 151 54 r \$2-SSSAD_ADMIN; 13 | #X obj 150 352 s \$2-SSSAD_ADMIN; 14 | #X obj 182 270 s \$2-SSSAD; 15 | #X obj 305 137 s \$2-SSSAD_ADMIN; 16 | #X msg 429 97 save; 17 | #X obj 429 71 inlet; 18 | #X obj 57 131 outlet; 19 | #X text 35 94 Store presets; 20 | #N canvas 228 198 627 317 LICENSE-BSD 0; 21 | #X text 121 56 This software is copyrighted by Miller Puckette \, Reality 22 | Jockey Ltd. and others. The terms (the "Standard Improved BSD License") 23 | apply to all files associated with the software unless explicitly disclaimed 24 | in individual files.; 25 | #X text 123 148 See the file LICENSE.txt for the full license text. 26 | ; 27 | #X restore 523 60 pd LICENSE-BSD; 28 | #X connect 0 0 1 0; 29 | #X connect 0 0 16 0; 30 | #X connect 1 0 8 0; 31 | #X connect 2 0 3 0; 32 | #X connect 3 0 5 0; 33 | #X connect 4 0 11 0; 34 | #X connect 5 0 6 0; 35 | #X connect 5 1 12 0; 36 | #X connect 6 0 4 0; 37 | #X connect 7 0 2 0; 38 | #X connect 9 0 13 0; 39 | #X connect 10 0 0 0; 40 | #X connect 14 0 13 0; 41 | #X connect 15 0 14 0; 42 | -------------------------------------------------------------------------------- /lib/chains/depth/u_sssad.pd: -------------------------------------------------------------------------------- 1 | #N canvas 144 48 1039 564 10; 2 | #X obj 159 26 inlet; 3 | #X obj 233 55 list prepend \$1; 4 | #X obj 233 160 list trim; 5 | #X obj 233 25 inlet; 6 | #X obj 22 308 b; 7 | #X obj 159 53 b; 8 | #X obj 233 223 route \$1; 9 | #X obj 543 358 b; 10 | #X obj 543 250 spigot; 11 | #X obj 669 72 loadbang; 12 | #X obj 669 250 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 13 | 1; 14 | #X obj 669 194 select 0; 15 | #X obj 701 141 + 1; 16 | #X obj 669 120 t a a; 17 | #X obj 669 216 f 1; 18 | #X obj 226 476 outlet; 19 | #X obj 159 450 route bang; 20 | #X text 243 449 filter out empty lists; 21 | #X obj 610 474 list prepend persist \$1; 22 | #X obj 159 421 list append; 23 | #X text 231 110 on SSSAD we eavesdrop the communication; 24 | #X text 692 249 <- only the first instance responds to "save"; 25 | #X text 165 540 2007/2008 fbar; 26 | #X text 829 95 Enhancement by Enrique Erne; 27 | #X obj 543 425 list append; 28 | #X obj 543 448 route bang; 29 | #X text 627 447 filter out empty lists here \, too.; 30 | #X obj 22 226 route set setonly; 31 | #X obj 80 273 route \$1; 32 | #X obj 80 251 list trim; 33 | #X obj 608 324 route \$1; 34 | #X obj 608 302 list trim; 35 | #X obj 543 277 route save saveonly; 36 | #X obj 610 498 list trim; 37 | #N canvas 513 284 322 286 s-SSSAD 0; 38 | #X obj 63 38 inlet; 39 | #X obj 63 176 s SSSAD; 40 | #X obj 123 176 s \$2-SSSAD; 41 | #X obj 123 39 loadbang; 42 | #N canvas 0 0 450 300 demux2 0; 43 | #X obj 114 91 == 0; 44 | #X obj 190 115 spigot; 45 | #X obj 61 43 inlet; 46 | #X obj 229 46 inlet; 47 | #X obj 61 113 spigot 1; 48 | #X obj 61 156 outlet; 49 | #X obj 190 157 outlet; 50 | #X connect 0 0 4 1; 51 | #X connect 1 0 6 0; 52 | #X connect 2 0 4 0; 53 | #X connect 2 0 1 0; 54 | #X connect 3 0 0 0; 55 | #X connect 3 0 1 1; 56 | #X connect 4 0 5 0; 57 | #X restore 63 137 pd demux2; 58 | #X obj 123 81 select 0; 59 | #X msg 123 103 0; 60 | #X msg 176 102 1; 61 | #X obj 123 59 list append \$2; 62 | #X obj 123 39 loadbang; 63 | #X obj 123 81 select 0; 64 | #X msg 123 103 0; 65 | #X msg 176 102 1; 66 | #X obj 123 59 list append \$2; 67 | #X connect 0 0 4 0; 68 | #X connect 3 0 8 0; 69 | #X connect 4 0 1 0; 70 | #X connect 4 1 2 0; 71 | #X connect 5 0 6 0; 72 | #X connect 5 1 7 0; 73 | #X connect 6 0 4 1; 74 | #X connect 7 0 4 1; 75 | #X connect 8 0 5 0; 76 | #X connect 9 0 13 0; 77 | #X connect 10 0 11 0; 78 | #X connect 10 1 12 0; 79 | #X connect 13 0 10 0; 80 | #X restore 233 84 pd s-SSSAD; 81 | #N canvas 539 183 330 246 r-SSSAD 0; 82 | #N canvas 0 0 450 300 mux2 0; 83 | #X obj 114 121 == 0; 84 | #X obj 190 145 spigot; 85 | #X obj 61 43 inlet; 86 | #X obj 229 66 inlet; 87 | #X obj 61 143 spigot 1; 88 | #X obj 61 186 outlet; 89 | #X obj 190 45 inlet; 90 | #X connect 0 0 4 1; 91 | #X connect 1 0 5 0; 92 | #X connect 2 0 4 0; 93 | #X connect 3 0 0 0; 94 | #X connect 3 0 1 1; 95 | #X connect 4 0 5 0; 96 | #X connect 6 0 1 0; 97 | #X restore 63 167 pd mux2; 98 | #X obj 63 16 r SSSAD; 99 | #X obj 86 41 r \$2-SSSAD; 100 | #X obj 63 201 outlet; 101 | #X obj 109 74 loadbang; 102 | #X obj 109 116 select 0; 103 | #X msg 109 138 0; 104 | #X msg 162 137 1; 105 | #X obj 109 94 list append \$2; 106 | #X connect 0 0 3 0; 107 | #X connect 1 0 0 0; 108 | #X connect 2 0 0 1; 109 | #X connect 4 0 8 0; 110 | #X connect 5 0 6 0; 111 | #X connect 5 1 7 0; 112 | #X connect 6 0 0 2; 113 | #X connect 7 0 0 2; 114 | #X connect 8 0 5 0; 115 | #X restore 233 136 pd r-SSSAD; 116 | #N canvas 539 183 330 246 r-SSSAD_ADMIN 0; 117 | #N canvas 0 0 450 300 mux2 0; 118 | #X obj 114 121 == 0; 119 | #X obj 190 145 spigot; 120 | #X obj 61 43 inlet; 121 | #X obj 229 66 inlet; 122 | #X obj 61 143 spigot 1; 123 | #X obj 61 186 outlet; 124 | #X obj 190 45 inlet; 125 | #X connect 0 0 4 1; 126 | #X connect 1 0 5 0; 127 | #X connect 2 0 4 0; 128 | #X connect 3 0 0 0; 129 | #X connect 3 0 1 1; 130 | #X connect 4 0 5 0; 131 | #X connect 6 0 1 0; 132 | #X restore 63 177 pd mux2; 133 | #X obj 63 211 outlet; 134 | #X obj 63 16 r SSSAD_ADMIN; 135 | #X obj 86 41 r \$2-SSSAD_ADMIN; 136 | #X obj 109 75 loadbang; 137 | #X obj 109 117 select 0; 138 | #X msg 109 139 0; 139 | #X msg 162 138 1; 140 | #X obj 109 95 list append \$2; 141 | #X connect 0 0 1 0; 142 | #X connect 2 0 0 0; 143 | #X connect 3 0 0 1; 144 | #X connect 4 0 8 0; 145 | #X connect 5 0 6 0; 146 | #X connect 5 1 7 0; 147 | #X connect 6 0 0 2; 148 | #X connect 7 0 0 2; 149 | #X connect 8 0 5 0; 150 | #X restore 543 190 pd r-SSSAD_ADMIN; 151 | #N canvas 513 284 322 286 s-SSSAD_ADMIN 0; 152 | #X obj 63 39 inlet; 153 | #N canvas 0 0 450 300 demux2 0; 154 | #X obj 114 91 == 0; 155 | #X obj 190 115 spigot; 156 | #X obj 61 43 inlet; 157 | #X obj 229 46 inlet; 158 | #X obj 61 113 spigot 1; 159 | #X obj 61 156 outlet; 160 | #X obj 190 157 outlet; 161 | #X connect 0 0 4 1; 162 | #X connect 1 0 6 0; 163 | #X connect 2 0 4 0; 164 | #X connect 2 0 1 0; 165 | #X connect 3 0 0 0; 166 | #X connect 3 0 1 1; 167 | #X connect 4 0 5 0; 168 | #X restore 63 137 pd demux2; 169 | #X obj 63 206 s SSSAD_ADMIN; 170 | #X obj 123 176 s \$2-SSSAD_ADMIN; 171 | #X obj 123 39 loadbang; 172 | #X obj 123 81 select 0; 173 | #X msg 123 103 0; 174 | #X msg 176 102 1; 175 | #X obj 123 59 list append \$2; 176 | #X connect 0 0 1 0; 177 | #X connect 1 0 2 0; 178 | #X connect 1 1 3 0; 179 | #X connect 4 0 8 0; 180 | #X connect 5 0 6 0; 181 | #X connect 5 1 7 0; 182 | #X connect 6 0 1 1; 183 | #X connect 7 0 1 1; 184 | #X connect 8 0 5 0; 185 | #X restore 610 522 pd s-SSSAD_ADMIN; 186 | #X obj 669 95 value \$1.\$2.SSSAD.req; 187 | #X obj 701 164 value \$1.\$2.SSSAD.req; 188 | #N canvas 539 183 330 246 r-SSSAD_ADMIN 0; 189 | #N canvas 0 0 450 300 mux2 0; 190 | #X obj 114 121 == 0; 191 | #X obj 190 145 spigot; 192 | #X obj 61 43 inlet; 193 | #X obj 229 66 inlet; 194 | #X obj 61 143 spigot 1; 195 | #X obj 61 186 outlet; 196 | #X obj 190 45 inlet; 197 | #X connect 0 0 4 1; 198 | #X connect 1 0 5 0; 199 | #X connect 2 0 4 0; 200 | #X connect 3 0 0 0; 201 | #X connect 3 0 1 1; 202 | #X connect 4 0 5 0; 203 | #X connect 6 0 1 0; 204 | #X restore 63 177 pd mux2; 205 | #X obj 63 211 outlet; 206 | #X obj 63 16 r SSSAD_ADMIN; 207 | #X obj 86 41 r \$2-SSSAD_ADMIN; 208 | #X obj 109 75 loadbang; 209 | #X obj 109 117 select 0; 210 | #X msg 109 139 0; 211 | #X msg 162 138 1; 212 | #X obj 109 95 list append \$2; 213 | #X connect 0 0 1 0; 214 | #X connect 2 0 0 0; 215 | #X connect 3 0 0 1; 216 | #X connect 4 0 8 0; 217 | #X connect 5 0 6 0; 218 | #X connect 5 1 7 0; 219 | #X connect 6 0 0 2; 220 | #X connect 7 0 0 2; 221 | #X connect 8 0 5 0; 222 | #X restore 22 187 pd r-SSSAD_ADMIN; 223 | #N canvas 228 198 627 317 LICENSE-BSD 0; 224 | #X text 121 56 This software is copyrighted by Miller Puckette \, Reality 225 | Jockey Ltd. and others. The terms (the "Standard Improved BSD License") 226 | apply to all files associated with the software unless explicitly disclaimed 227 | in individual files.; 228 | #X text 123 148 See the file LICENSE.txt for the full license text. 229 | ; 230 | #X restore 833 30 pd LICENSE-BSD; 231 | #X connect 0 0 5 0; 232 | #X connect 1 0 34 0; 233 | #X connect 2 0 6 0; 234 | #X connect 3 0 1 0; 235 | #X connect 4 0 19 0; 236 | #X connect 5 0 19 0; 237 | #X connect 6 0 19 1; 238 | #X connect 6 0 24 1; 239 | #X connect 7 0 24 0; 240 | #X connect 8 0 32 0; 241 | #X connect 9 0 38 0; 242 | #X connect 11 0 14 0; 243 | #X connect 12 0 39 0; 244 | #X connect 13 0 11 0; 245 | #X connect 13 1 12 0; 246 | #X connect 14 0 8 1; 247 | #X connect 14 0 10 0; 248 | #X connect 16 1 15 0; 249 | #X connect 18 0 33 0; 250 | #X connect 19 0 16 0; 251 | #X connect 24 0 25 0; 252 | #X connect 25 1 18 0; 253 | #X connect 27 0 4 0; 254 | #X connect 27 1 29 0; 255 | #X connect 28 0 4 0; 256 | #X connect 29 0 28 0; 257 | #X connect 30 0 7 0; 258 | #X connect 31 0 30 0; 259 | #X connect 32 0 7 0; 260 | #X connect 32 1 31 0; 261 | #X connect 33 0 37 0; 262 | #X connect 35 0 2 0; 263 | #X connect 36 0 8 0; 264 | #X connect 38 0 13 0; 265 | #X connect 40 0 27 0; 266 | -------------------------------------------------------------------------------- /lib/chains/pan/binaural.pd: -------------------------------------------------------------------------------- 1 | #N canvas 360 129 830 663 10; 2 | #X text 431 379 elevation: -40 / 90; 3 | #X text 318 381 direction: 0 - 360; 4 | #X obj 255 348 line; 5 | #X msg 252 287 \$1 1; 6 | #X floatatom 348 266 5 0 0 0 - - -, f 5; 7 | #X obj 211 382 earplug~ 270 -35; 8 | #X obj 197 229 *~; 9 | #X obj 277 215 line~; 10 | #X msg 279 188 \$1 5; 11 | #X obj 348 242 * 360; 12 | #X text 406 90 azimuth / distance / elevation between 0 -1; 13 | #X obj 445 209 - 40; 14 | #X obj 445 232 * 130; 15 | #X obj 444 270 line; 16 | #X msg 445 251 \$1 1; 17 | #X obj 222 93 inlet~; 18 | #X obj 215 554 outlet~; 19 | #X obj 303 553 outlet~; 20 | #X obj 411 121 inlet; 21 | #X obj 457 122 inlet; 22 | #X obj 506 123 inlet; 23 | #X connect 2 0 5 1; 24 | #X connect 3 0 2 0; 25 | #X connect 4 0 3 0; 26 | #X connect 5 0 16 0; 27 | #X connect 5 1 17 0; 28 | #X connect 6 0 5 0; 29 | #X connect 7 0 6 1; 30 | #X connect 8 0 7 0; 31 | #X connect 9 0 4 0; 32 | #X connect 11 0 12 0; 33 | #X connect 12 0 14 0; 34 | #X connect 13 0 5 2; 35 | #X connect 14 0 13 0; 36 | #X connect 15 0 6 0; 37 | #X connect 18 0 9 0; 38 | #X connect 19 0 8 0; 39 | #X connect 20 0 11 0; 40 | -------------------------------------------------------------------------------- /lib/chains/pan/pan.pd: -------------------------------------------------------------------------------- 1 | #N canvas 363 172 1 1 10; 2 | #X obj 460 257 inlet; 3 | #X obj 131 263 inlet~; 4 | #X obj 317 261 inlet~; 5 | #X obj 136 562 outlet~; 6 | #X obj 294 555 outlet~; 7 | #X obj 112 399 *~; 8 | #X msg 513 320 1; 9 | #X obj 293 399 *~; 10 | #X msg 558 323 0; 11 | #X text 34 17 Normal panning / binaural filtering; 12 | #N canvas 629 120 1 1 pan-subPatch 1; 13 | #X obj 162 214 inlet~; 14 | #X obj 162 413 outlet~; 15 | #X obj 225 410 outlet~; 16 | #X obj 467 245 inlet; 17 | #X obj 370 415 switch~; 18 | #X msg 382 390 0; 19 | #X obj 492 287 sel -1; 20 | #X obj 445 287 >= 0; 21 | #X msg 347 391 1; 22 | #X obj 415 316 sel 1; 23 | #X obj 161 384 binaural; 24 | #X obj 333 241 inlet; 25 | #X obj 577 247 inlet; 26 | #X connect 0 0 10 0; 27 | #X connect 3 0 7 0; 28 | #X connect 3 0 6 0; 29 | #X connect 3 0 10 2; 30 | #X connect 5 0 4 0; 31 | #X connect 6 0 5 0; 32 | #X connect 7 0 9 0; 33 | #X connect 8 0 4 0; 34 | #X connect 9 0 8 0; 35 | #X connect 10 0 1 0; 36 | #X connect 10 1 2 0; 37 | #X connect 11 0 10 1; 38 | #X connect 12 0 10 3; 39 | #X restore 164 464 pd pan-subPatch; 40 | #X obj 541 292 sel -1; 41 | #X obj 505 255 inlet; 42 | #X obj 567 254 inlet; 43 | #X text 305 308 set pan; 44 | #X obj 193 310 -; 45 | #X msg 156 310 1 \$1; 46 | #X obj 163 340 line~; 47 | #X msg 225 311 \$1 2; 48 | #X obj 246 339 line~; 49 | #X msg 263 312 \$1 2; 50 | #X obj 112 360 *~; 51 | #X obj 293 360 *~; 52 | #X connect 0 0 16 0; 53 | #X connect 0 0 20 0; 54 | #X connect 0 0 10 1; 55 | #X connect 1 0 10 0; 56 | #X connect 1 0 21 0; 57 | #X connect 2 0 22 0; 58 | #X connect 5 0 3 0; 59 | #X connect 6 0 5 1; 60 | #X connect 6 0 7 1; 61 | #X connect 7 0 4 0; 62 | #X connect 8 0 7 1; 63 | #X connect 8 0 5 1; 64 | #X connect 10 0 3 0; 65 | #X connect 10 1 4 0; 66 | #X connect 11 0 6 0; 67 | #X connect 11 1 8 0; 68 | #X connect 12 0 11 0; 69 | #X connect 12 0 10 2; 70 | #X connect 13 0 10 3; 71 | #X connect 15 0 18 0; 72 | #X connect 16 0 15 0; 73 | #X connect 17 0 21 1; 74 | #X connect 18 0 17 0; 75 | #X connect 19 0 22 1; 76 | #X connect 20 0 19 0; 77 | #X connect 21 0 5 0; 78 | #X connect 22 0 7 0; 79 | -------------------------------------------------------------------------------- /lib/main-help.pd: -------------------------------------------------------------------------------- 1 | #N canvas 219 23 1327 929 10; 2 | #X text 40 95 Licensed under GPLv3; 3 | #X text 43 126 ____________________________________________________________ 4 | ; 5 | #X text 37 22 ____________________________________________________________ 6 | ; 7 | #X text 43 154 Initialize:; 8 | #X obj 1035 145 loadbang; 9 | #X msg 1035 170 \; pd dsp 1; 10 | #X obj 892 402 pack f f f; 11 | #X obj 892 308 vsl 15 50 0 1 0 0 empty empty empty 0 -9 0 10 -262144 12 | -1 -1 0 1; 13 | #X obj 921 308 vsl 15 50 0 1 0 0 empty empty empty 0 -9 0 10 -262144 14 | -1 -1 0 1; 15 | #X obj 950 308 vsl 15 50 0 1 0 0 empty empty empty 0 -9 0 10 -262144 16 | -1 -1 0 1; 17 | #X obj 68 871 s pd-Object-Pool; 18 | #X text 644 193 Soda Generator Patch. Load and communicate with this 19 | if using Soda with libPd from other environments.; 20 | #X text 934 427 custom address of generated object; 21 | #X text 932 445 (there can be generated many from client code); 22 | #X obj 106 722 s genSample; 23 | #X obj 106 635 del 1; 24 | #X msg 106 615 bang; 25 | #X text 181 726 (needed for updating \$0-vars); 26 | #X obj 900 381 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 27 | -1 -1; 28 | #X obj 90 466 s saveSynths; 29 | #X obj 82 418 del 1; 30 | #X msg 82 396 bang; 31 | #X text 464 178 ___________________; 32 | #X text 465 224 ___________________; 33 | #X obj 893 428 s s1; 34 | #X msg 70 359 obj 10 10 blocks/synthesis/synthGenerator s1 triwave 35 | D s1-ch \;; 36 | #X msg 47 206 clear; 37 | #X text 45 173 1: clear existing blocks; 38 | #X text 47 814 3: save blocks for next time; 39 | #X msg 68 845 menusave; 40 | #X obj 47 228 s pd-Object-Pool; 41 | #X obj 70 495 s pd-Object-Pool; 42 | #X text 47 299 2: create blocks; 43 | #X text 69 337 Synthesizer (octave-differenced soundwaves); 44 | #X obj 71 747 s pd-Object-Pool; 45 | #X text 67 547 Sampler (polyphonic audio file); 46 | #X obj 471 407 s pd-Object-Pool; 47 | #X msg 470 362 obj 10 10 blocks/texture/textureGenerator s1 100 \; 48 | ; 49 | #X text 467 335 Texture Object (filtered noise); 50 | #X text 474 656 Custom Object (empty \, use this to extend); 51 | #X obj 476 744 s pd-Object-Pool; 52 | #X text 1034 209 turn dsp on; 53 | #X text 159 300 (see readme file for message list structure); 54 | #X text 46 260 ____________________________________________________________ 55 | ; 56 | #X text 47 776 ____________________________________________________________ 57 | ; 58 | #X obj 175 495 s computeAudio; 59 | #X msg 175 464 s1 1; 60 | #X text 581 807 turn on / off dsp for each module; 61 | #X obj 155 440 t b b; 62 | #X obj 578 429 s computeAudio; 63 | #X msg 578 410 s1 1; 64 | #X msg 579 386 bang; 65 | #X obj 582 786 s computeAudio; 66 | #X msg 582 767 s1 1; 67 | #X msg 582 745 bang; 68 | #X obj 180 701 s computeAudio; 69 | #X msg 180 670 s1 1; 70 | #X obj 160 646 t b b; 71 | #X msg 476 719 obj 10 10 blocks/custom/customObjectGenerator s1 \; 72 | ; 73 | #X text 475 679 Duplicate patch in "custom" folder \, give it a new 74 | name \, change accordingly in the following message box..; 75 | #X text 605 46 Note: object generation is easier to maintain from other 76 | client apps \, since opening / closing patches are hard with only Pd 77 | Vanilla. This patch is for demonstration purposes only \, for real 78 | usage \, please see the client app examples; 79 | #X obj 471 553 s pd-Object-Pool; 80 | #X obj 577 595 s computeAudio; 81 | #X msg 577 576 s1 1; 82 | #X msg 577 554 bang; 83 | #X text 471 474 Player Object (for long \, streaming audio files); 84 | #X msg 471 501 obj 10 10 blocks/playback/playerGenerator s1 sounds/sound.wav 85 | 1 \;; 86 | #X text 994 293 use this formula for:; 87 | #X text 1043 308 - synthetiser; 88 | #X text 1044 323 - sampler; 89 | #X text 1046 340 - texture; 90 | #X text 38 74 stc@binaura.net / 2016 / www.binaura.net; 91 | #X msg 69 571 obj 10 10 blocks/sampling/samplerGenerator s1 sounds/sound.wav 92 | 10 44100 \;; 93 | #X text 38 54 Sonificating Data (Soda) Library / Helper for main patch 94 | ; 95 | #X obj 482 204 ../lib/main; 96 | #X text 968 399 shift / volume / pan; 97 | #X text 892 274 4: Send test data to generated objects; 98 | #X connect 4 0 5 0; 99 | #X connect 6 0 24 0; 100 | #X connect 7 0 6 0; 101 | #X connect 8 0 6 1; 102 | #X connect 8 0 18 0; 103 | #X connect 9 0 6 2; 104 | #X connect 9 0 18 0; 105 | #X connect 15 0 57 0; 106 | #X connect 16 0 15 0; 107 | #X connect 18 0 6 0; 108 | #X connect 20 0 48 0; 109 | #X connect 21 0 20 0; 110 | #X connect 25 0 21 0; 111 | #X connect 25 0 31 0; 112 | #X connect 26 0 30 0; 113 | #X connect 29 0 10 0; 114 | #X connect 37 0 36 0; 115 | #X connect 37 0 51 0; 116 | #X connect 46 0 45 0; 117 | #X connect 48 0 46 0; 118 | #X connect 48 1 19 0; 119 | #X connect 50 0 49 0; 120 | #X connect 51 0 50 0; 121 | #X connect 53 0 52 0; 122 | #X connect 54 0 53 0; 123 | #X connect 56 0 55 0; 124 | #X connect 57 0 56 0; 125 | #X connect 57 1 14 0; 126 | #X connect 58 0 40 0; 127 | #X connect 58 0 54 0; 128 | #X connect 63 0 62 0; 129 | #X connect 64 0 63 0; 130 | #X connect 66 0 61 0; 131 | #X connect 66 0 64 0; 132 | #X connect 72 0 16 0; 133 | #X connect 72 0 34 0; 134 | -------------------------------------------------------------------------------- /lib/main.pd: -------------------------------------------------------------------------------- 1 | #N canvas 262 86 1 1 10; 2 | #X obj 116 727 dac~; 3 | #X obj 115 688 catch~ outL; 4 | #X obj 190 688 catch~ outR; 5 | #X text 119 81 Licensed under GPLv3; 6 | #X text 115 568 Objects generated by client:; 7 | #X text 269 688 Collect all audio & send to speakers; 8 | #N canvas 932 355 1 1 Object-Pool 0; 9 | #X obj 10 0 blocks/texture/textureGenerator soda-0 40; 10 | #X obj 10 0 blocks/texture/textureGenerator soda-1 40; 11 | #X obj 10 0 blocks/texture/textureGenerator soda-2 40; 12 | #X obj 10 0 blocks/texture/textureGenerator soda-3 40; 13 | #X obj 10 0 blocks/texture/textureGenerator soda-4 40; 14 | #X obj 10 0 blocks/texture/textureGenerator soda-5 40; 15 | #X obj 10 0 blocks/texture/textureGenerator soda-6 40; 16 | #X obj 10 0 blocks/texture/textureGenerator soda-7 40; 17 | #X obj 10 0 blocks/texture/textureGenerator soda-8 40; 18 | #X obj 10 0 blocks/texture/textureGenerator soda-9 40; 19 | #X obj 10 0 blocks/texture/textureGenerator soda-10 40; 20 | #X obj 10 0 blocks/texture/textureGenerator soda-11 40; 21 | #X obj 10 0 blocks/texture/textureGenerator soda-12 40; 22 | #X obj 10 0 blocks/texture/textureGenerator soda-13 40; 23 | #X obj 10 0 blocks/texture/textureGenerator soda-14 40; 24 | #X obj 10 0 blocks/texture/textureGenerator soda-15 40; 25 | #X obj 10 0 blocks/texture/textureGenerator soda-16 40; 26 | #X obj 10 0 blocks/texture/textureGenerator soda-17 40; 27 | #X obj 10 0 blocks/texture/textureGenerator soda-18 40; 28 | #X obj 10 0 blocks/texture/textureGenerator soda-19 40; 29 | #X obj 10 0 blocks/texture/textureGenerator soda-20 40; 30 | #X obj 10 0 blocks/texture/textureGenerator soda-21 40; 31 | #X obj 10 0 blocks/texture/textureGenerator soda-22 40; 32 | #X obj 10 0 blocks/texture/textureGenerator soda-23 40; 33 | #X obj 10 0 blocks/texture/textureGenerator soda-24 40; 34 | #X obj 10 0 blocks/texture/textureGenerator soda-25 40; 35 | #X obj 10 0 blocks/texture/textureGenerator soda-26 40; 36 | #X restore 117 614 pd Object-Pool; 37 | #X obj 123 325 s pd-Object-Pool; 38 | #X obj 123 276 r clearObjects; 39 | #X obj 179 301 r saveObjects; 40 | #X msg 292 298 obj 10 0 \$1 \$2 \$3 \$4 \$5; 41 | #X msg 472 297 obj 10 0 \$1 \$2 \$3 \$4 \$5; 42 | #X text 312 237 synthesis; 43 | #X text 497 239 sampling; 44 | #X text 118 235 utilities; 45 | #X text 843 239 custom object (extend this if you wish); 46 | #X obj 292 275 r createSynth; 47 | #X obj 472 274 r createSampler; 48 | #X obj 842 278 r createCustomObject; 49 | #X text 680 239 filtered texture; 50 | #X obj 655 274 r createTexture; 51 | #X msg 655 297 obj 10 0 \$1 \$2 \$3; 52 | #X text 119 148 ------------------------------------------------------------ 53 | ; 54 | #X text 119 40 Sonificating Data (Soda) Library / PD Sound Engine Generator 55 | ; 56 | #X text 220 609 all update messages (from client app) are sent into 57 | the objects in there; 58 | #X text 118 114 This patch generates the building blocks \, based on 59 | messages received from the client applications.; 60 | #X obj 292 322 s pd-Object-Pool; 61 | #X obj 472 321 s pd-Object-Pool; 62 | #X obj 655 320 s pd-Object-Pool; 63 | #X obj 842 323 s pd-Object-Pool; 64 | #X obj 121 410 r computeAudio; 65 | #X text 166 506 A dynamic \, addressable [send]; 66 | #X obj 121 474 pack s f; 67 | #X msg 121 499 \; \$1 \$2; 68 | #X obj 122 432 unpack s f; 69 | #X obj 122 452 makefilename %s-dsp; 70 | #X text 122 379 turn on/off dsp for each module; 71 | #X text 115 544 ------------------------------------------------------------ 72 | ; 73 | #X msg 842 301 obj 10 0 \$1 \$2; 74 | #N canvas 697 181 1 1 init 0; 75 | #X obj 56 39 loadbang; 76 | #X obj 56 84 print; 77 | #X msg 56 62 SodaLib :: Loaded; 78 | #X connect 0 0 2 0; 79 | #X connect 2 0 1 0; 80 | #X restore 373 60 pd init; 81 | #X text 119 60 stc@binaura.net / 2016 / www.binaura.net; 82 | #X text 117 202 Messages from client apps:; 83 | #X text 482 379 spectral freezer; 84 | #X obj 471 452 s pd-Object-Pool; 85 | #X obj 471 405 r createFreezer; 86 | #X msg 471 428 obj 10 0 \$1 \$2 \$3; 87 | #X connect 1 0 0 0; 88 | #X connect 2 0 0 1; 89 | #X connect 8 0 7 0; 90 | #X connect 9 0 7 0; 91 | #X connect 10 0 26 0; 92 | #X connect 11 0 27 0; 93 | #X connect 16 0 10 0; 94 | #X connect 17 0 11 0; 95 | #X connect 18 0 38 0; 96 | #X connect 20 0 21 0; 97 | #X connect 21 0 28 0; 98 | #X connect 30 0 34 0; 99 | #X connect 32 0 33 0; 100 | #X connect 34 0 35 0; 101 | #X connect 34 1 32 1; 102 | #X connect 35 0 32 0; 103 | #X connect 38 0 29 0; 104 | #X connect 44 0 45 0; 105 | #X connect 45 0 43 0; 106 | -------------------------------------------------------------------------------- /lib/utils/s-char2midi.pd: -------------------------------------------------------------------------------- 1 | #N canvas 461 324 742 476 10; 2 | #X obj 192 309 outlet; 3 | #X text 189 72 convert a musical character to its midi representative 4 | (starts at first octave); 5 | #X obj 192 121 inlet; 6 | #X obj 192 177 sel C C# D D# E F F# G G# A A# H; 7 | #X obj 192 155 symbol \$1; 8 | #X msg 192 244 24; 9 | #X msg 225 244 25; 10 | #X msg 258 244 26; 11 | #X msg 292 244 27; 12 | #X msg 324 244 28; 13 | #X msg 356 243 29; 14 | #X msg 387 243 30; 15 | #X msg 418 243 31; 16 | #X msg 448 243 32; 17 | #X msg 479 245 33; 18 | #X msg 511 245 34; 19 | #X msg 543 244 35; 20 | #X obj 398 176 sel Db Eb Gb Ab Hb Cb; 21 | #X connect 2 0 4 0; 22 | #X connect 3 0 5 0; 23 | #X connect 3 1 6 0; 24 | #X connect 3 2 7 0; 25 | #X connect 3 3 8 0; 26 | #X connect 3 4 9 0; 27 | #X connect 3 5 10 0; 28 | #X connect 3 6 11 0; 29 | #X connect 3 7 12 0; 30 | #X connect 3 8 13 0; 31 | #X connect 3 9 14 0; 32 | #X connect 3 10 15 0; 33 | #X connect 3 11 16 0; 34 | #X connect 4 0 3 0; 35 | #X connect 4 0 17 0; 36 | #X connect 5 0 0 0; 37 | #X connect 6 0 0 0; 38 | #X connect 7 0 0 0; 39 | #X connect 8 0 0 0; 40 | #X connect 9 0 0 0; 41 | #X connect 10 0 0 0; 42 | #X connect 11 0 0 0; 43 | #X connect 12 0 0 0; 44 | #X connect 13 0 0 0; 45 | #X connect 14 0 0 0; 46 | #X connect 15 0 0 0; 47 | #X connect 16 0 0 0; 48 | #X connect 17 0 6 0; 49 | #X connect 17 1 8 0; 50 | #X connect 17 2 10 0; 51 | #X connect 17 3 12 0; 52 | #X connect 17 4 14 0; 53 | #X connect 17 5 16 0; 54 | -------------------------------------------------------------------------------- /lib/utils/s-counter.pd: -------------------------------------------------------------------------------- 1 | #N canvas 474 228 598 307 10; 2 | #X obj 172 118 int; 3 | #X obj 172 154 + 1; 4 | #X obj 172 201 sel 1; 5 | #X obj 203 96 loadbang; 6 | #X obj 172 66 inlet; 7 | #X obj 209 201 outlet; 8 | #X msg 203 118 0; 9 | #X obj 172 178 > \$1; 10 | #X obj 334 202 outlet; 11 | #X text 331 162 outlet to reset metro; 12 | #X text 331 180 (count once); 13 | #X obj 376 63 inlet; 14 | #X obj 281 67 inlet; 15 | #X text 289 42 reset; 16 | #X connect 0 0 1 0; 17 | #X connect 0 0 5 0; 18 | #X connect 1 0 0 1; 19 | #X connect 1 0 7 0; 20 | #X connect 2 0 6 0; 21 | #X connect 3 0 6 0; 22 | #X connect 4 0 0 0; 23 | #X connect 6 0 0 1; 24 | #X connect 6 0 8 0; 25 | #X connect 7 0 2 0; 26 | #X connect 11 0 7 1; 27 | #X connect 12 0 6 0; 28 | -------------------------------------------------------------------------------- /lib/utils/s-distance.pd: -------------------------------------------------------------------------------- 1 | #N canvas 0 0 450 300 10; 2 | #X obj 80 47 inlet; 3 | #X obj 150 49 inlet; 4 | #X obj 80 129 abs; 5 | #X obj 80 195 outlet; 6 | #X obj 80 95 - \$1; 7 | #X connect 0 0 4 0; 8 | #X connect 1 0 4 1; 9 | #X connect 2 0 3 0; 10 | #X connect 4 0 2 0; 11 | -------------------------------------------------------------------------------- /src/SodaObject.cpp: -------------------------------------------------------------------------------- 1 | #include "SodaObject.h" 2 | #include "ofxSodaLib.h" 3 | 4 | SodaObject::SodaObject(string name) { 5 | mName = name; 6 | mShift = 1; 7 | mVolume = 1; 8 | mDepth = -1; // disabled by default to save cpu 9 | mPan.push_back(0.5); 10 | // disable binaural panning by default to save cpu 11 | mPan.push_back(-1); 12 | mPan.push_back(-1); 13 | } 14 | 15 | SodaObject::SodaObject(string name, bool objNotFoundError) { 16 | cout << "Error, could not find Soda Object with name: " + name << endl; 17 | } 18 | 19 | SodaObject * SodaObject::shift(float shift) { 20 | mShift = ofClamp(shift,0,1); 21 | return this; 22 | } 23 | 24 | SodaObject * SodaObject::volume(float volume) { 25 | mVolume = ofClamp(volume,0,1); 26 | if(volume == 0) { 27 | play(); 28 | } 29 | return this; 30 | } 31 | 32 | SodaObject * SodaObject::pan(float pan) { 33 | mPan[0] = ofClamp(pan,0,1); 34 | mPan[1] = -1; 35 | mPan[2] = -1; 36 | return this; 37 | } 38 | 39 | SodaObject * SodaObject::pan(float azimuth, float distance, float elevation) { 40 | mPan[0] = ofClamp(azimuth,0,1); 41 | mPan[1] = ofClamp(distance,0,1); 42 | mPan[2] = ofClamp(elevation,0,1); 43 | return this; 44 | } 45 | 46 | SodaObject * SodaObject::depth(float depth) { 47 | mDepth = ofClamp(depth,0,1); 48 | return this; 49 | } 50 | 51 | void SodaObject::play() { 52 | ofxSodaLib::pd.sendFloat(mName + "-depth", mDepth); 53 | List mList; 54 | for( auto e : mPan) mList.addFloat(e); 55 | ofxSodaLib::pd.sendList(mName + "-pan", mList); 56 | ofxSodaLib::pd.sendFloat(mName + "-vol", mVolume); 57 | ofxSodaLib::pd.sendFloat(mName + "-shift", mShift); 58 | } 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/SodaObject.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ofMain.h" 3 | 4 | class SodaObject { 5 | public: 6 | SodaObject(string name); 7 | SodaObject(string name, bool objNotFoundError); 8 | 9 | string mName; 10 | float mShift; 11 | float mVolume; 12 | vector< float > mPan; 13 | float mDepth; 14 | 15 | SodaObject * shift(float shift); 16 | SodaObject * pan(float pan); 17 | SodaObject * pan(float azimuth, float distance, float elevation); 18 | SodaObject * volume(float volume); 19 | SodaObject * depth(float depth); 20 | 21 | void play(); 22 | }; 23 | -------------------------------------------------------------------------------- /src/externals/earplug~.c: -------------------------------------------------------------------------------- 1 | /* RT binaural filter: earplug~ */ 2 | /* based on KEMAR impulse measurement */ 3 | /* Pei Xiang, summer 2004 */ 4 | /* Revised in Fall 2006 by Jorge Castellanos */ 5 | /* Revised in Spring 2009 by Hans-Christoph Steiner to compile in the data file */ 6 | 7 | #include 8 | #include 9 | #include "m_pd.h" 10 | #include "earplug~.h" 11 | #ifdef _MSC_VER /* Thes pragmas only apply to Microsoft's compiler */ 12 | #pragma warning( disable : 4244 ) 13 | #pragma warning( disable : 4305 ) 14 | #endif 15 | 16 | /* elevation degree: -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 */ 17 | /* index array: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 */ 18 | /* impulse reponse number: 29 31 37 37 37 37 37 31 29 23 19 13 7 1 */ 19 | /* 0 degree reponse index: 0 29 60 97 134 171 208 245 276 305 328 347 360 367 */ 20 | 21 | static t_class *earplug_class; 22 | 23 | typedef struct _earplug 24 | { 25 | t_object x_obj; 26 | t_outlet *left_channel ; 27 | t_outlet *right_channel ; 28 | 29 | t_float azimuth ; /* from 0 to 360 degrees */ 30 | t_float elevation ; /* from -40 to 90 (degrees) */ 31 | t_float azi ; 32 | t_float ele ; 33 | 34 | t_float crossCoef[8192] ; 35 | t_float azimScale[13] ; 36 | t_int azimOffset[13] ; 37 | 38 | t_float previousImpulse[2][128] ; 39 | t_float currentImpulse[2][128] ; 40 | t_float convBuffer[128] ; 41 | t_float (*impulses)[2][128]; /* a 3D array of 368x2x128 */ 42 | t_float f ; /* dummy float for dsp */ 43 | t_int bufferPin; 44 | } t_earplug; 45 | 46 | static t_int *earplug_perform(t_int *w) 47 | { 48 | t_earplug *x = (t_earplug *)(w[1]) ; 49 | t_float *in = (t_float *)(w[2]); 50 | t_float *right_out = (t_float *)(w[3]); 51 | t_float *left_out = (t_float *)(w[4]); 52 | int blocksize = (int)(w[5]); 53 | 54 | unsigned ch_L, ch_R, i; 55 | 56 | x->azi = x->azimuth ; 57 | x->ele = x->elevation ; 58 | 59 | if (x->ele < -40) 60 | x->ele = -40; 61 | if (x->ele > 90) 62 | x->ele = 90; 63 | if (x->azi < 0 || x->azi > 360) 64 | x->azi = 0; 65 | if (x->azi <= 180) 66 | { 67 | ch_L = 0; 68 | ch_R = 1; 69 | } 70 | else 71 | { 72 | ch_L = 1; 73 | ch_R = 0; 74 | x->azi = 360.0 - x->azi; 75 | } 76 | 77 | x->ele *= 0.1; /* divided by 10 since each elevation is 10 degrees apart */ 78 | 79 | if (x->ele < 8.) // if elevation is less than 80 degrees... 80 | { 81 | int elevInt = (int)floor(x->ele); // A quantized version of the elevation 82 | unsigned elevGridIndex = elevInt + 4; // Used as the index to the array of scaling factors for the azimuth (adding 4 because the lowest elevation is -4, so it starts at 0) 83 | unsigned azimIntUp = (unsigned)(x->azi * x->azimScale[elevGridIndex+1]); // 84 | float azimFracUp = azimIntUp + 1.0 - x->azi * x->azimScale[elevGridIndex+1]; 85 | float azimFracUpInv = 1.0 - azimFracUp; 86 | float elevFracUp = x->ele - elevInt * 1.0; 87 | unsigned azimIntDown = (unsigned)(x->azi * x->azimScale[elevGridIndex]); 88 | float azimFracDown = azimIntDown + 1.0 - x->azi * x->azimScale[elevGridIndex]; 89 | float azimFracDownInv = 1.0 - azimFracDown; 90 | float elevFracDown = 1.0 - elevFracUp; 91 | unsigned lowerIdx = x->azimOffset[elevGridIndex] + azimIntDown; 92 | unsigned upperIdx = x->azimOffset[elevGridIndex + 1] + azimIntUp; 93 | 94 | for (i = 0; i < 128; i++) 95 | { 96 | x->currentImpulse[ch_L][i] = elevFracDown * // Interpolate the lower two HRIRs and multiply them by their "fraction" 97 | (azimFracDown * x->impulses[lowerIdx][0][i] + 98 | azimFracDownInv * x->impulses[lowerIdx + 1][0][i]) + 99 | elevFracUp * // Interpolate the upper two HRIRs and multiply them by their "fraction" 100 | (azimFracUp * x->impulses[upperIdx][0][i] + 101 | azimFracUpInv * x->impulses[upperIdx + 1][0][i]); 102 | 103 | x->currentImpulse[ch_R][i] = elevFracDown * 104 | (azimFracDown * x->impulses[lowerIdx][1][i] + 105 | azimFracDownInv * x->impulses[lowerIdx + 1][1][i]) + 106 | elevFracUp * 107 | (azimFracUp * x->impulses[upperIdx][1][i] + 108 | azimFracUpInv * x->impulses[upperIdx + 1][1][i]); 109 | } 110 | 111 | } 112 | else // if elevation is 80 degrees or more the interpolation requires only three points (because there's only one HRIR at 90 deg) 113 | { 114 | unsigned azimIntDown = (unsigned)(x->azi * 0.033333); // Scale the azimuth to 12 (the number of HRIRs at 80 deg) discreet points 115 | float azimFracDown = azimIntDown + 1.0 - x->azi * 0.033333; 116 | float elevFracUp = x->ele - 8.0; 117 | float elevFracDown = 9.0 - x->ele; 118 | for (i = 0; i < 128; i++) { 119 | 120 | x->currentImpulse[ch_L][i] = elevFracDown * 121 | ( azimFracDown * x->impulses[360+azimIntDown][0][i] + // These two lines interpolate the lower two HRIRs 122 | (1.0 - azimFracDown) * x->impulses[361+azimIntDown][0][i] ) 123 | + elevFracUp * x->impulses[367][0][i]; // multiply the 90 degree HRIR with its corresponding fraction 124 | x->currentImpulse[ch_R][i] = elevFracDown * 125 | (azimFracDown * x->impulses[360+azimIntDown][1][i] + 126 | (1.0 - azimFracDown) * x->impulses[361+azimIntDown][1][i]) 127 | + elevFracUp * x->impulses[367][1][i]; 128 | } 129 | 130 | } 131 | 132 | float inSample; 133 | float convSum[2]; // to accumulate the sum during convolution. 134 | int blockScale = 8192 / blocksize; 135 | 136 | // Convolve the - interpolated - HRIRs (Left and Right) with the input signal. 137 | while (blocksize--) 138 | { 139 | convSum[0] = 0; 140 | convSum[1] = 0; 141 | 142 | inSample = *(in++); 143 | 144 | x->convBuffer[x->bufferPin] = inSample; 145 | unsigned scaledBlocksize = blocksize * blockScale; 146 | unsigned blocksizeDelta = 8191 - scaledBlocksize; 147 | for (i = 0; i < 128; i++) 148 | { 149 | convSum[0] += (x->previousImpulse[0][i] * x->crossCoef[blocksizeDelta] + 150 | x->currentImpulse[0][i] * x->crossCoef[scaledBlocksize]) * 151 | x->convBuffer[(x->bufferPin - i) &127]; 152 | convSum[1] += (x->previousImpulse[1][i] * x->crossCoef[blocksizeDelta] + 153 | x->currentImpulse[1][i] * x->crossCoef[scaledBlocksize]) * 154 | x->convBuffer[(x->bufferPin - i) &127]; 155 | 156 | x->previousImpulse[0][i] = x->currentImpulse[0][i]; 157 | x->previousImpulse[1][i] = x->currentImpulse[1][i]; 158 | } 159 | x->bufferPin = (x->bufferPin + 1) & 127; 160 | 161 | *left_out++ = convSum[0]; 162 | *right_out++ = convSum[1]; 163 | } 164 | return (w+6); 165 | } 166 | 167 | static void earplug_dsp(t_earplug *x, t_signal **sp) 168 | { 169 | // callback, params, userdata, in_samples, out_L, out_R, blocksize. 170 | dsp_add(earplug_perform, 5, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[0]->s_n); 171 | } 172 | 173 | static void *earplug_new(t_floatarg azimArg, t_floatarg elevArg) 174 | { 175 | t_earplug *x = (t_earplug *)pd_new(earplug_class); 176 | x->left_channel = outlet_new(&x->x_obj, gensym("signal")); 177 | x->right_channel = outlet_new(&x->x_obj, gensym("signal")); 178 | floatinlet_new(&x->x_obj, &x->azimuth) ; /* 0 to 360 degrees */ 179 | floatinlet_new(&x->x_obj, &x->elevation) ; /* -40 to 90 degrees */ 180 | 181 | x->azimuth = azimArg ; 182 | x->elevation = elevArg ; 183 | 184 | int i, j; 185 | FILE *fp; 186 | char buff[1024], *bufptr; 187 | int filedesc; 188 | 189 | filedesc = open_via_path(canvas_getdir(canvas_getcurrent())->s_name, "earplug_data.txt", "", buff, &bufptr, 1024, 0 ); 190 | 191 | if (filedesc >= 0) // If there was no error opening the text file... 192 | { 193 | post("[earplug~] found impulse reponse file, overriding defaults:") ; 194 | post("let's try loading %s/earplug_data.txt", buff); 195 | fp = fdopen(filedesc, "r") ; 196 | for (i = 0; i < 368; i++) 197 | { 198 | while(fgetc(fp) != 10) ; 199 | for (j = 0 ; j < 128 ; j++) { 200 | fscanf(fp, "%f %f ", &earplug_impulses[i][0][j], &earplug_impulses[i][1][j]); 201 | } 202 | } 203 | fclose(fp) ; 204 | } 205 | x->impulses = earplug_impulses; 206 | 207 | post(" earplug~: binaural filter with measured reponses\n") ; 208 | post(" elevation: -40 to 90 degrees. azimuth: 360") ; 209 | post(" dont let blocksize > 8192\n"); 210 | 211 | for (i = 0; i < 128 ; i++) 212 | { 213 | x->convBuffer[i] = 0; 214 | x->previousImpulse[0][i] = 0; 215 | x->previousImpulse[1][i] = 0; 216 | } 217 | 218 | x->bufferPin = 0; 219 | 220 | for (i = 0; i < 8192 ; i++) 221 | { 222 | x->crossCoef[i] = 1.0 * i / 8192; 223 | } 224 | 225 | // This is the scaling factor for the azimuth so that it corresponds to an HRTF in the KEMAR database 226 | x->azimScale[0] = 0.153846153; x->azimScale[8] = 0.153846153; /* -40 and 40 degree */ 227 | x->azimScale[1] = 0.166666666; x->azimScale[7] = 0.166666666; /* -30 and 30 degree */ 228 | x->azimScale[2] = 0.2; x->azimScale[3]=0.2; x->azimScale[4]=0.2; x->azimScale[5]=0.2; x->azimScale[6]=0.2; /* -20 to 20 degree */ 229 | x->azimScale[9] = 0.125; /* 50 degree */ 230 | x->azimScale[10] = 0.1; /* 60 degree */ 231 | x->azimScale[11] = 0.066666666; /* 70 degree */ 232 | x->azimScale[12] = 0.033333333; /* 80 degree */ 233 | 234 | x->azimOffset[0] = 0 ; 235 | x->azimOffset[1] = 29 ; 236 | x->azimOffset[2] = 60 ; 237 | x->azimOffset[3] = 97 ; 238 | x->azimOffset[4] = 134 ; 239 | x->azimOffset[5] = 171 ; 240 | x->azimOffset[6] = 208 ; 241 | x->azimOffset[7] = 245 ; 242 | x->azimOffset[8] = 276 ; 243 | x->azimOffset[9] = 305 ; 244 | x->azimOffset[10] = 328 ; 245 | x->azimOffset[11] = 347 ; 246 | x->azimOffset[12] = 360 ; 247 | 248 | return (x); 249 | } 250 | 251 | void earplug_tilde_setup(void) 252 | { 253 | earplug_class = class_new(gensym("earplug~"), (t_newmethod)earplug_new, 0, 254 | sizeof(t_earplug), CLASS_DEFAULT, A_DEFFLOAT, A_DEFFLOAT, 0); 255 | 256 | CLASS_MAINSIGNALIN(earplug_class, t_earplug, f); 257 | 258 | class_addmethod(earplug_class, (t_method)earplug_dsp, gensym("dsp"), 0); 259 | } 260 | -------------------------------------------------------------------------------- /src/externals/lrshift~.c: -------------------------------------------------------------------------------- 1 | #include "m_pd.h" 2 | 3 | /* ------------------------ lrshift~ ----------------------------- */ 4 | 5 | static t_class *lrshift_tilde_class; 6 | 7 | typedef struct _lrshift_tilde 8 | { 9 | t_object x_obj; 10 | int x_n; 11 | t_float x_f; 12 | } t_lrshift_tilde; 13 | 14 | static t_int *leftshift_perform(t_int *w) 15 | { 16 | t_sample *in = (t_sample *)(w[1]); 17 | t_sample *out= (t_sample *)(w[2]); 18 | int n = (int)(w[3]); 19 | int shift = (int)(w[4]); 20 | in += shift; 21 | n -= shift; 22 | while (n--) 23 | *out++ = *in++; 24 | while (shift--) 25 | *out++ = 0; 26 | return (w+5); 27 | } 28 | 29 | static t_int *rightshift_perform(t_int *w) 30 | { 31 | t_sample *in = (t_sample *)(w[1]); 32 | t_sample *out= (t_sample *)(w[2]); 33 | int n = (int)(w[3]); 34 | int shift = (int)(w[4]); 35 | n -= shift; 36 | in -= shift; 37 | while (n--) 38 | *--out = *--in; 39 | while (shift--) 40 | *--out = 0; 41 | return (w+5); 42 | } 43 | 44 | static void lrshift_tilde_dsp(t_lrshift_tilde *x, t_signal **sp) 45 | { 46 | int n = sp[0]->s_n; 47 | int shift = x->x_n; 48 | if (shift > n) 49 | shift = n; 50 | if (shift < -n) 51 | shift = -n; 52 | if (shift < 0) 53 | dsp_add(rightshift_perform, 4, 54 | sp[0]->s_vec + n, sp[1]->s_vec + n, n, -shift); 55 | else dsp_add(leftshift_perform, 4, 56 | sp[0]->s_vec, sp[1]->s_vec, n, shift); 57 | } 58 | 59 | static void *lrshift_tilde_new(t_floatarg f) 60 | { 61 | t_lrshift_tilde *x = (t_lrshift_tilde *)pd_new(lrshift_tilde_class); 62 | x->x_n = f; 63 | x->x_f = 0; 64 | outlet_new(&x->x_obj, gensym("signal")); 65 | return (x); 66 | } 67 | 68 | void lrshift_tilde_setup(void) 69 | { 70 | lrshift_tilde_class = class_new(gensym("lrshift~"), 71 | (t_newmethod)lrshift_tilde_new, 0, sizeof(t_lrshift_tilde), 0, 72 | A_DEFFLOAT, 0); 73 | CLASS_MAINSIGNALIN(lrshift_tilde_class, t_lrshift_tilde, x_f); 74 | class_addmethod(lrshift_tilde_class, (t_method)lrshift_tilde_dsp, 75 | gensym("dsp"), 0); 76 | } 77 | -------------------------------------------------------------------------------- /src/ofxSodaLib.cpp: -------------------------------------------------------------------------------- 1 | #include "ofxSodaLib.h" 2 | 3 | ofxPd ofxSodaLib::pd; 4 | 5 | extern "C" { 6 | void earplug_tilde_setup(); 7 | void lrshift_tilde_setup(); 8 | } 9 | 10 | void ofxSodaLib::init() { 11 | if(!pd.init( 2, 2, 44100, 8)) { 12 | OF_EXIT_APP(1); 13 | } 14 | earplug_tilde_setup(); 15 | lrshift_tilde_setup(); 16 | 17 | string path = ""; 18 | ofDirectory dir(path); 19 | pdFolder = dir.getAbsolutePath() + "/../../../lib/"; 20 | pd.addReceiver(*this); 21 | pd.start(); 22 | patch = pd.openPatch(pdFolder + "main.pd"); 23 | clear(); 24 | } 25 | 26 | void ofxSodaLib::createCustomObject(string objectName) { 27 | List myList; 28 | myList.addSymbol("blocks/custom/customObjectGenerator"); 29 | myList.addSymbol(objectName); 30 | pd.sendList("createCustomObject", myList); 31 | SodaObject* o = new SodaObject(objectName); 32 | objects.insert(make_pair(objectName,o)); 33 | save(); 34 | } 35 | 36 | void ofxSodaLib::createCustomObject(string objectName, string customPatchName) { 37 | List myList; 38 | myList.addSymbol("blocks/custom/" + customPatchName); 39 | myList.addSymbol(objectName); 40 | pd.sendList("createCustomObject", myList); 41 | SodaObject* o = new SodaObject(objectName); 42 | objects.insert(make_pair(objectName,o)); 43 | save(); 44 | 45 | } 46 | 47 | void ofxSodaLib::createSynth(string objectName, string type, string note) { 48 | List myList; 49 | myList.addSymbol("blocks/synthesis/synthGenerator"); 50 | myList.addSymbol(objectName); 51 | myList.addSymbol(type); 52 | myList.addSymbol(note); 53 | myList.addSymbol(objectName + "-ch"); 54 | pd.sendList("createSynth", myList); 55 | SodaObject* o = new SodaObject(objectName); 56 | objects.insert(make_pair(objectName,o)); 57 | save(); 58 | } 59 | 60 | void ofxSodaLib::createFreezer(string objectName, string fileName) { 61 | List myList; 62 | myList.addSymbol("blocks/freezing/freezeGenerator"); 63 | myList.addSymbol(objectName); 64 | myList.addSymbol(fileName); 65 | pd.sendList("createFreezer", myList); 66 | SodaObject* o = new SodaObject(objectName); 67 | objects.insert(make_pair(objectName,o)); 68 | save(); 69 | } 70 | 71 | void ofxSodaLib::createSampler(string objectName, string fileName, int numberOfPolyphony) { 72 | List myList; 73 | myList.addSymbol("blocks/sampling/samplerGenerator"); 74 | myList.addSymbol(objectName); 75 | myList.addSymbol(fileName); 76 | myList.addFloat(numberOfPolyphony); 77 | myList.addFloat(44100); 78 | pd.sendList("createSynth", myList); 79 | SodaObject* o = new SodaObject(objectName); 80 | objects.insert(make_pair(objectName,o)); 81 | save(); 82 | } 83 | 84 | void ofxSodaLib::createTexture(string objectName, float resonance) { 85 | List myList; 86 | myList.addSymbol("blocks/texture/textureGenerator"); 87 | myList.addSymbol(objectName); 88 | myList.addFloat(resonance); 89 | pd.sendList("createTexture", myList); 90 | SodaObject* o = new SodaObject(objectName); 91 | objects.insert(make_pair(objectName,o)); 92 | save(); 93 | } 94 | 95 | void ofxSodaLib::clear() { 96 | objects.clear(); 97 | List myList; 98 | pd.sendMessage("clearObjects", "clear", myList); 99 | } 100 | 101 | void ofxSodaLib::save() { 102 | List myList; 103 | pd.sendMessage("saveObjects", "menusave", myList); 104 | pd.closePatch(patch); 105 | patch = pd.openPatch(pdFolder + "main.pd"); 106 | } 107 | 108 | void ofxSodaLib::computeAudio(string objectName, int onOff){ 109 | List myList; 110 | myList.addSymbol(objectName); 111 | myList.addFloat(onOff); 112 | pd.sendList("computeAudio", myList); 113 | } 114 | 115 | SodaObject* ofxSodaLib::set(string objectName) { 116 | auto iter = objects.find(objectName); 117 | if (iter != objects.end() ) { 118 | SodaObject* o = objects.at(objectName); 119 | return o; 120 | } else { 121 | // handle if no object exists with name 122 | SodaObject* o = new SodaObject(objectName, true); 123 | return o; 124 | } 125 | } 126 | 127 | SodaObject* ofxSodaLib::get(string objectName) { 128 | auto iter = objects.find(objectName); 129 | if (iter != objects.end() ) { 130 | SodaObject* o = objects.at(objectName); 131 | return o; 132 | } else { 133 | // handle if no object exists with name 134 | SodaObject* o = new SodaObject(objectName, true); 135 | return o; 136 | } 137 | } 138 | 139 | void ofxSodaLib::audioReceived(float * input, int bufferSize, int nChannels) { 140 | pd.audioIn( input, bufferSize, nChannels ); 141 | } 142 | 143 | void ofxSodaLib::audioRequested(float * output, int bufferSize, int nChannels) { 144 | pd.audioOut(output, bufferSize, nChannels); 145 | } 146 | 147 | void ofxSodaLib::print(const std::string& message) { 148 | // cout << message << endl; 149 | } 150 | 151 | -------------------------------------------------------------------------------- /src/ofxSodaLib.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ofMain.h" 3 | #include "ofxPd.h" 4 | #include "SodaObject.h" 5 | 6 | using namespace pd; 7 | 8 | class ofxSodaLib : public PdReceiver, public PdMidiReceiver { 9 | public: 10 | void init(); 11 | void clear(); 12 | void save(); 13 | void computeAudio(string objectName, int onOff); 14 | SodaObject* set(string objectName); 15 | SodaObject* get(string objectName); 16 | 17 | void createSynth(string objectName, string type, string note); 18 | void createSampler(string objectName, string fileName, int numberOfPolyphony); 19 | void createTexture(string objectName, float resonance); 20 | void createFreezer(string objectName, string fileName); 21 | void createCustomObject(string objectName); 22 | void createCustomObject(string objectName, string customPatchName); 23 | 24 | void audioReceived(float * input, int bufferSize, int nChannels); 25 | void audioRequested(float * output, int bufferSize, int nChannels); 26 | void print(const std::string& message); 27 | 28 | static ofxPd pd; 29 | Patch patch; 30 | string pdFolder; 31 | map< string, SodaObject* > objects; 32 | }; 33 | --------------------------------------------------------------------------------