Code Monkey home page Code Monkey logo

ofxstk's Introduction

#ofxStk ofxStk lets you use The Synthesis Tool Kit inside openFrameworks. The offical repo for stk is here at https://github.com/thestk/stk. For features and issues you are better off posting there. I sync ofxStk with the offical Stk repo about once a month, or on demand

##Installation


Step 1 - Do what you normally do for an add-on (project generator works well)

Step 2 - Copy the 'rawwaves' folder from ofxStk/bin/data into bin/data of your project.

Note on Linux

if your are on linux and your system is little endian you have to complie with the following option

-D__LITTLE_ENDIAN__

##How to use


Stk already works well with openFrameworks so there is no need to wrap it onto a separate api. Your best resource would be the stk documentation. You can also ask me questions on the forum

####steps to create a custom instrument

  1. Subclass stk::Instrument
  2. Override all the pure virtual functions in stk::Instrmnt
  3. When overriding virtual StkFloat tick( unsigned int channel = 0 ) = 0 make sure you set lastFrame_ which is the last computed frame of audio, and return the output for the channel specified by the argument. Remember a frame is different than a sample- a Frame a set of samples that contains one sample from each channel in an audio data stream.
  4. When overriding StkFrames& tick( StkFrames& frames, unsigned int channel = 0 ) = 0,your job is to fill the specified frames starting at the specific channel. For example if your instrument is mono and tick(frames,1) is called, you fill the second channel of frames with your output. If your instrument is stereo and tick(frames,1) is called. you fill the second and third channel of frames with your output. Remember that lastFrame_ also has to be set in the function
  5. If your instrument is stereo, you will have to override the constructor of stk:Instrmnt to resize the lastFrame_. so in your constructor you should have the line lastFrame_.resize( 1, 2, 0.0 );

##Notes


I've tested on Mac OSX, IOS ,and linux so far. But getting it to work for other platforms should be just a matter of configuring the macros in the file "Stk.h"

ofxstk's People

Contributors

ahbee avatar jegun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ofxstk's Issues

Cannot compile any examples or projects on linux

Added the flag to generate -D__LITTLE_ENDIAN__

none of the example or projects with Stk compile with the following error

 /usr/bin/ld.gold: error: obj/linux64/Release/src/ofApp.o: multiple definition of 'stk::skini_msgs'
 /usr/bin/ld.gold: obj/linux64/Release/src/main.o: previous definition here
 /usr/bin/ld.gold: error: /home/ranjith/Documents/ofWorkspace/addons/obj/linux64/Release/ofxStk/libs/STK/src/Skini.o: multiple definition of 'stk::skini_msgs'
 /usr/bin/ld.gold: obj/linux64/Release/src/main.o: previous definition here

Please tell me what info to provide

Could not open or find file (rawwaves)

Hello Ahbee,
i'm currently looking into your example_simple as I want to use ofxStk in my project.
Upon starting, I am receiving a Fileread::open Error:

bildschirmfoto 2017-05-23 um 19 08 54

I have the files set up just as I downloaded them:

bildschirmfoto 2017-05-23 um 19 06 09

Can you tell me, if theres something missing?
Thanks in advance,
Elli

error compiling pitchshift example on linux

../../../addons/ofxStk/libs/STK/src/Mutex.cpp:18:1: error: ‘Mutex’ does not name a type
Mutex :: Mutex()
^~~~~
../../../addons/ofxStk/libs/STK/src/Mutex.cpp:37:1: error: ‘Mutex’ does not name a type
Mutex :: ~Mutex()
^~~~~
../../../addons/ofxStk/libs/STK/src/Mutex.cpp:52:6: error: ‘Mutex’ has not been declared
void Mutex :: lock()
^~~~~
../../../addons/ofxStk/libs/STK/src/Mutex.cpp:65:6: error: ‘Mutex’ has not been declared
void Mutex :: unlock()
^~~~~
../../../addons/ofxStk/libs/STK/src/Mutex.cpp:78:6: error: ‘Mutex’ has not been declared
void Mutex :: wait()
^~~~~
../../../addons/ofxStk/libs/STK/src/Mutex.cpp:91:6: error: ‘Mutex’ has not been declared
void Mutex :: signal()
^~~~~
make[1]: *** [../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:354: ../../../addons/obj/linux64/Release/ofxStk/libs/STK/src/Mutex.o] Error 1
make[1]: Leaving directory '/home/shank/of-workspace/addons/ofxStk/example_pitchShift'
make: *** [../../../libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:129: Release] Error 2

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.