shithub: leaf

ref: 99c38ddf6e7f4a82136000f02c66b6b1219de031
dir: /Examples/basic-oscillators.c/

View raw version
/*
  ==============================================================================

    basic-oscillators.c
    Created: 5 Mar 2020 2:56:24pm
    Author:  Matthew Wang

  ==============================================================================
*/

#include "basic-oscillators.h"

void exampleInit()
{
    LEAF_init(44100, 64, mempool, 1000, &exampleRandom);
    
    tCycle_init(&cycle);
    tCycle_setFreq(&cycle, 220);
}

void exampleFrame()
{
    
}

float exampleTick(float sampleIn)
{
    float sampleOut = tCycle_tick(&cycle);
    return sampleOut;
}

float exampleRandom()
{
    return ((float)rand()/(float)(RAND_MAX));
}