SketchPad

Some web space to sketch, doodle and make notes. Made using these tools. See more of my work here.

Sketch 2015-07-07

Sketch renders using a projection mask

Sketch 2015-07-07

Sketch 2015-07-06

        void ofApp::setup(){
    ofSetWindowShape(1000, 900);
    bpm = 60;
    playing = false;

    utils.setup();
    manager.setup();
    manager.toggleDebugUI();
    setupAudioUnits();
    setupTimeline();
}

void ofApp::setupAudioUnits() {
    manager.add(&chain1, "tal-one", ofColor::blue);
    chain1.link(&noiseMaker1).toMixer();
    manager.loadPresets(&chain1);
}

void ofApp::setupTimeline() {
    timeline.setup();
    timeline.setLoopType(OF_LOOP_NORMAL);
    timeline.setShowBPMGrid(true);
    timeline.enableSnapToBPM(true);
    timeline.setBPM(bpm);
    timeline.setDurationInSeconds(36);
    timeline.setOffset(ofVec2f(10, 480));
    timeline.setWidth(ofGetWidth() - 400);
    timeline.addCurves("lfo rate");
    timeline.addCurves("delay wet");
    timeline.addCurves("env amount");
    timeline.addSwitches("midi events");
    ofAddListener(timeline.events().switched, this, &ofApp::switchFired);
}

void ofApp::update(){
    noiseMaker1.set(TALNoiseMaker_lfo2rate, timeline.getValue("lfo rate"));
    noiseMaker1.set(TALNoiseMaker_delaywet, timeline.getValue("delay wet"));
    noiseMaker1.set(TALNoiseMaker_envelopeeditoramount, timeline.getValue("env amount"));
}

void ofApp::switchFired(ofxTLSwitchEventArgs &args) {
    string command = args.switchName + (args.on ? " ON" : " OFF");
    cout << endl << ofGetTimestampString() << endl;
    cout << "switch fired: " << command << endl;
    utils.executeMidiCommand(command, chain1.midi());
}
    

A denser sound

Sketch 2015-07-06

Sketch 2015-07-05

        void ofApp::setup(){
    ofSetWindowShape(1000, 900);
    bpm = 60;
    playing = false;

    utils.setup();
    manager.setup();
    manager.toggleDebugUI();
    setupAudioUnits();
    setupTimeline();
}

void ofApp::setupAudioUnits() {
    manager.add(&chain1, "tal-one", ofColor::blue);
    chain1.link(&noiseMaker1).toMixer();
    manager.loadPresets(&chain1);
}

void ofApp::setupTimeline() {
    timeline.setup();
    timeline.setLoopType(OF_LOOP_NORMAL);
    timeline.setShowBPMGrid(true);
    timeline.enableSnapToBPM(true);
    timeline.setBPM(bpm);
    timeline.setDurationInSeconds(30);
    timeline.setOffset(ofVec2f(10, 480));
    timeline.setWidth(ofGetWidth() - 400);
    timeline.addCurves("lfo rate");
    timeline.addCurves("delay wet");
    timeline.addSwitches("midi events");
    ofAddListener(timeline.events().switched, this, &ofApp::switchFired);
}

void ofApp::update(){
    noiseMaker1.set(TALNoiseMaker_lfo2rate, timeline.getValue("lfo rate"));
    noiseMaker1.set(TALNoiseMaker_delaywet, timeline.getValue("delay wet"));
}

void ofApp::switchFired(ofxTLSwitchEventArgs &args) {
    string command = args.switchName + (args.on ? " ON" : " OFF");
    cout << endl << ofGetTimestampString() << endl;
    cout << "switch fired: " << command << endl;
    utils.executeMidiCommand(command, chain1.midi());
}
    

Dubstep wobble with echo

Sketch 2015-07-05

Sketch 2015-07-04

        void ofApp::setup(){
    ofSetWindowShape(1000, 900);
    utils.setup();
    manager.setup();
    manager.toggleDebugUI();
    setupAudioUnits();
    setupTimeline();

    playing = false;
}

void ofApp::setupAudioUnits() {
    manager.add(&chain1, "tal-one", ofColor::blue);
    manager.add(&chain2, "tal-two", ofColor::red);
    chain1.link(&noiseMaker1).toMixer();
    chain2.link(&noiseMaker2).toMixer();
    manager.loadPresets(&chain1);
    manager.loadPresets(&chain2);
}

void ofApp::setupTimeline() {
    timeline.setup();
    timeline.setLoopType(OF_LOOP_NORMAL);
    timeline.setDurationInSeconds(30);
    timeline.setOffset(ofVec2f(10, 480));
    timeline.setWidth(ofGetWidth() - 400);
    timeline.addCurves("portamento");
    timeline.addCurves("delay wet");
    timeline.addFlags("midi events");
    ofAddListener(timeline.events().bangFired, this, &ofApp::bang);
}

void ofApp::update(){
    noiseMaker1.set(TALNoiseMaker_portamento, timeline.getValue("portamento"));
    noiseMaker1.set(TALNoiseMaker_delaywet, timeline.getValue("delay wet"));
    noiseMaker2.set(TALNoiseMaker_portamento, timeline.getValue("portamento"));
    noiseMaker2.set(TALNoiseMaker_delaywet, timeline.getValue("delay wet"));
}

void ofApp::bang(ofxTLBangEventArgs &args) {
    cout << "bang fired: " << args.flag << endl;
    utils.executeMidiCommand(args.flag, chain1.midi());
    utils.executeMidiCommand(args.flag, chain2.midi());
}
    

Portamento, a warm tone and two identical synths

Sketch 2015-07-04

Sketch 2015-07-03

        void ofApp::setup(){
    ofSetWindowShape(1000, 800);
    manager.setup();
    manager.toggleDebugUI();
    setupAudioUnits();
    setupTimeline();

    playing = false;
    note = 60;
}

void ofApp::setupAudioUnits() {
    manager.add(&chain, "tal-one", ofColor::blue);
    chain.link(&noiseMaker).toMixer();
    manager.loadPresets(&chain);
}

void ofApp::setupTimeline() {
    timeline.setup();
    timeline.setLoopType(OF_LOOP_NORMAL);
    timeline.setDurationInSeconds(30);
    timeline.setOffset(ofVec2f(10, 480));
    timeline.setWidth(ofGetWidth() - 400);
    timeline.addFlags("midi events");
    ofAddListener(timeline.events().bangFired, this, &ofApp::bang);
}

void ofApp::update(){
    
}

void ofApp::bang(ofxTLBangEventArgs &args) {
    if(args.flag == "") {
        chain.midi()->sendNoteOn(1, note);
    } else {
        interpretMidiFlag(args.flag);
    }
}

void ofApp::interpretMidiFlag(string flag) {
    vector<string> args = ofSplitString(flag, " ");
    int note = ofToInt(args.at(0));
    bool onCommand = args.at(1) == "ON";
    if(onCommand) {
        chain.midi()->sendNoteOn(1, note);
    } else {
        chain.midi()->sendNoteOff(1, note);
    }
}
    

Time for MIDI event interpretation in the timeline

Sketch 2015-07-03

Sketch 2015-07-02

        void ofApp::setup(){
    ofSetWindowShape(1000, 800);
    manager.setup();
    manager.toggleDebugUI();
    setupAudioUnits();
    setupTimeline();

    playing = false;
    note = 60;
}

void ofApp::setupAudioUnits() {
    manager.add(&chain, "tal-one", ofColor::blue);
    chain.link(&noiseMaker).toMixer();
    manager.loadPresets(&chain);
}

void ofApp::setupTimeline() {
    timeline.setup();
    timeline.setLoopType(OF_LOOP_NORMAL);
    timeline.setDurationInSeconds(30);
    timeline.setOffset(ofVec2f(10, 480));
    timeline.setWidth(ofGetWidth() - 400);
    timeline.addCurves("LFO 1 rate", ofRange(0, 1));
    timeline.addCurves("filter cutoff", ofRange(0, 1));
    timeline.addBangs("midi events");
    ofAddListener(timeline.events().bangFired, this, &ofApp::bang);
}

void ofApp::update(){
    noiseMaker.set(TALNoiseMaker_lfo1rate, timeline.getValue("LFO 1 rate"));
    noiseMaker.set(TALNoiseMaker_cutoff, timeline.getValue("filter cutoff"));
}

void ofApp::bang(ofxTLBangEventArgs &args) {
    if(args.flag == "") {
        chain.midi()->sendNoteOn(1, note);
    } else {
        chain.midi()->sendNoteOn(1, ofToInt(args.flag));
    }
}
    

We are screwing with the LFO and the filter cutoff.

Sketch 2015-07-02

Sketch 2015-07-01

        void ofApp::setup(){
    ofSetWindowShape(500, 500);
    gif.setup(ofGetTimestampString("%Y-%m-%d"), 60);
    
    ofEnableSmoothing();
    shapeSystem.setup();
    masker.setup(8);

    for(int i = 0; i < 8; i++) {
        textures.push_back(texture);
        textures.at(i).setup("road" + ofToString(i % 4 + 1) + ".png", (i+1) * 0.3);
    }
    
    shapeSize = 100;
    thickness = 100;
    halfShapeSize = shapeSize * 0.5;
    
    for(int i = 0; i < gif.width; i += shapeSize) {
        for(int j = 0; j < gif.height; j += shapeSize) {
            shape.setupHollowArc(30, thickness, shapeSize, 180);
            shape.setColor(ofColor::fromHsb(ofRandom(255), ofRandom(100, 255), ofRandom(100, 255)));
            shape.setBlur(30);
            shape.setPosition(ofVec3f(i + halfShapeSize, j + halfShapeSize, 0));
            shape.rotateZ(ofRandom(360));
            shapes.push_back(shape);
        }
    }
    
    for(int i = 0; i < shapes.size(); i++) {
        shapeSystem.add(shapes.at(i));
    }
}

void ofApp::update(){
    for(int i = 0; i < shapes.size(); i++) {
        i % 2 == 0 ?
        shapes.at(i).incrementRotateZ(6) :
        shapes.at(i).incrementRotateZ(-6);
    }
    
    for(int i = 0; i < masker.numLayers(); i++) {
        textures.at(i % textures.size()).incrementTextureOffsetY(-0.03333333333);
        masker.beginLayer(i);
        {
            ofBackground(ofColor::black);
            ofEnableAlphaBlending();
            rotateScreen(90 * i);
            shapeSystem.draw();
            ofDisableAlphaBlending();
        }
        masker.endLayer(i);
        
        masker.beginMask(i);
        {
            ofEnableAlphaBlending();
            if(ofGetFrameNum() == 0) {
                ofBackground(ofColor::black);
            } else {
                ofSetColor(ofColor::black, 64);
                ofRect(0, 0, gif.width, gif.height);
            }

            ofSetColor(ofColor::white, 196);
            textures.at(i % textures.size()).draw();
            if(ofRandom(1) > 0.96) {
                for(int j = 0; j < 4; j++) {
                    ofSetColor(j % 2 == 0 ? ofColor(ofColor::white, ofRandom(64, 196)) : ofColor::black);
                    ofTriangle(ofRandom(-gif.width, 0), ofRandom(-gif.height, 0),
                               ofRandom(0, gif.width), ofRandom(0, gif.height),
                               ofRandom(gif.width, gif.doubleWidth), ofRandom(gif.height, gif.doubleHeight));
                    rotateScreen(90);
                }
            }
            ofDisableAlphaBlending();
        }
        masker.endMask(i);
    }
}

void ofApp::draw(){
    gif.begin();
    {
        ofBackground(ofColor::black);
        masker.draw();
    }
    gif.endAndCaptureFrame();
    gif.draw();
    
    masker.drawOverlay();
}

void ofApp::rotateScreen(float degrees) {
    ofTranslate(gif.halfWidth, gif.halfHeight, 0);
    ofRotate(degrees);
    ofTranslate(-gif.halfWidth, -gif.halfHeight, 0);
}
    

"You no longer require an internal model ... you simply need the ability to visually perceive ... and the experience to move" (source)

Daily sketch