Giter Site home page Giter Site logo

pampanelson / ofxtonic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tonicaudio/ofxtonic

0.0 2.0 0.0 238 KB

Open Frameworks Addon for the Tonic audio synthesis Library. Tonic is an efficient, pure C++ patching tool with a refreshingly crisp and simple syntax.

License: The Unlicense

Makefile 0.01% C++ 95.24% C 0.83% Objective-C 3.91%

ofxtonic's Introduction

ofxTonic

The Tonic audio synthesis Library, wrapped for openFrameworks. Tonic is a high performance, pure C++ audio patching tool with a refreshingly crisp and simple syntax.

For info on Tonic, see: https://github.com/TonicAudio/Tonic

Watch a video tutorial at https://www.youtube.com/watch?v=ppf3b8BC6yU

The code contained in the src/ folder of this repository is copied directly from this commit in the main Tonic repository: a2c2546ec9923ad79296b06e181a2b6fff69394d

Note: we are currently reviving and updating Tonic. We need to update the examples here to make them work in openFrameworks 0.9.3. We have tested this fork on XCode (OSX) and QtCreator (Linux) and the examples were running fine: https://github.com/jeonghopark/ofxTonic/tree/a292ea983b4f22f0e2e33c3b4d19b54ada7daf28 We will port back those changes soon.

Supported Platforms

XCode projects for now. Full PC, Linux support should be easy and arriving soon (hopefully), but hasn't been tested yet.

Example

// ofApp.h

#pragma once

#include "ofMain.h"
#include "ofxTonic.h"

using namespace Tonic;

class ofApp : public ofBaseApp{

    ofxTonicSynth synth;

public:
    void setup();
    void update();
    void draw();
    void audioRequested (float * output, int bufferSize, int nChannels);
};

// ofApp.cpp

#include "ofApp.h"

void ofApp::setup() {
    // set up a stereo output in oF
    ofSoundStreamSettings settings;
    settings.numOutputChannels = 2;
    settings.setOutListener(this);
    ofSoundStreamSetup(settings);

    // create a sine wave we'll use for some vibrato
    SineWave vibratoOsc = SineWave().freq(10);

    // plug that frequency generator into the frequency slot of the main audio-producing sine wave
    SineWave tone = SineWave().freq(400 + 20 * vibratoOsc);

    // set the synth's final output generator
    synth.setOutputGen( tone );
}

void ofApp::update() { }

void ofApp::draw() { }

void ofApp::audioRequested (float * output, int bufferSize, int nChannels) {
    synth.fillBufferOfFloats(output, bufferSize, nChannels);
}

ofxtonic's People

Contributors

admsyn avatar hamoid avatar mat-loz avatar morganpackard avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.