Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Enclosing several audio objects in one library

  1. #1
    Junior Member
    Join Date
    Sep 2019
    Posts
    2

    Enclosing several audio objects in one library

    Hello

    My first post here, but I will introduce myself below question:

    How to enclose several synth objects in one class? It would be handy for constructing polysynths.

    And now introduction: I was interested with synths since 2008 (I was 13), and I always dreamed about building my own synth. This dream came true this year with PhatOne - fully analog synthesizer based on AS33xx series chips. Sounds very fat, and sometimes thin - better than I imagined. There is only one problem - tuning VCOs is good enough, but I want to design something easier to build.

    Last time I learned about Teensy board and it's audio capabilities. I decided to incorporate it into my project of synth, which I will design now, as I received teensy 3.2 and 4.0 boards.

    I must say that they are awesome and maybe they will become my basic devboards, instead Arduinos.

    Hope you'll like me on this forum

  2. #2
    I have done something like this as members of a class:

    Code:
    OscillatorTypeGoesHere *oscs[NUM_VOICES] = { &osc1, &osc2, &osc3, &osc4 };
    AudioEffectEnvelope *envelopes[NUM_VOICES] = { &env1, &env2, &env3, &env4 };
    Where osc1-4 and env1-4 come from the GUI tool. This allows you to iterate through all of your oscillators and envelopes and do any needed checks/updates, like so:

    Code:
    void setAttack(float A_) {
                A = A_;
                for(int i=0; i<NUM_VOICES; i++) {
                    envelopes[i]->attack(A);
                }
            }
    Hope that helps, good luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •