SketchPad

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

Daily Sketches

Sketch 2015-05-31

        void ofApp::setup(){
    manager.setup();
    manager.toggleDebugUI();
    manager.add(&chain1, "tal-one", ofColor::blue);
    manager.add(&chain2, "tal-two", ofColor::blue);

    playing = false;
    note = 60;
    
    ofAddListener(bpm.beatEvent, this, &ofApp::play);
    bpm.start();
    chain1.midi()->sendNoteOn(1, note);
    chain2.midi()->sendNoteOn(1, note);
}

void ofApp::play(void){
    if(playing) {
        if(currentChain == 1) {
            chain1.getSynth()->set(TALNoiseMaker_volume, -10);
            chain2.getSynth()->set(TALNoiseMaker_volume, 0);
            currentChain = 2;
        } else {
            chain1.getSynth()->set(TALNoiseMaker_volume, 0);
            chain2.getSynth()->set(TALNoiseMaker_volume, -10);
            currentChain = 1;
        }
    }
}

void ofApp::togglePlaying() {
    playing = !playing;
    if(!playing) {
        chain1.midi()->sendNoteOff(1, note);
    }
}

void ofApp::update(){
    manager.update();
    
    //Animate everythung based on sin()
    val = ofMap(sin(ofGetFrameNum() * 0.03), -1, 1, 0.4, 0.6);
    chain1.getSynth()->set(TALNoiseMaker_lfo2rate, val);
    
    val = ofMap(sin(ofGetFrameNum() * 0.06), -1, 1, 0.3, 0.8);
    chain1.getSynth()->set(TALNoiseMaker_envelopeeditoramount, val);
    
    val = ofMap(sin(ofGetFrameNum() * 0.45), -1, 1, 6900, 4000);
    chain1.getFilter()->set(kLowPassParam_CutoffFrequency, val);
    
    val = ofMap(sin(ofGetFrameNum() * 0.2), -1, 1, 10, 26);
    chain1.getFilter()->set(kLowPassParam_Resonance, val);
    
    //Exactly the same, but with cos()
    val = ofMap(cos(ofGetFrameNum() * 0.03), -1, 1, 0.4, 0.6);
    chain2.getSynth()->set(TALNoiseMaker_lfo2rate, val);
    
    val = ofMap(cos(ofGetFrameNum() * 0.06), -1, 1, 0.3, 0.8);
    chain2.getSynth()->set(TALNoiseMaker_envelopeeditoramount, val);
    
    val = ofMap(cos(ofGetFrameNum() * 0.45), -1, 1, 6900, 4000);
    chain2.getFilter()->set(kLowPassParam_CutoffFrequency, val);
    
    val = ofMap(cos(ofGetFrameNum() * 0.2), -1, 1, 10, 26);
    chain2.getFilter()->set(kLowPassParam_Resonance, val);
}
    

A simple adjustment, oscillating between two synths