Yuu Kobayashi / Mbed 2 deprecated NuFM401

Dependencies:   AOTTrigon I2CEEPROM MCP4922 AQM0802A mbed

Fork of NuMidi401 by Yuu Kobayashi

FMOscillator/FMAlgorithm.h

Committer:
kb10uy
Date:
2015-01-29
Revision:
21:e3014c1bdf9c
Parent:
19:f0dcf591c5dd
Child:
23:deb76bdf6f03

File content as of revision 21:e3014c1bdf9c:

#pragma once
#include "mbed.h"
#include "FMOperator.h"

class FMAlgorithmConnection
{
public:
    FMAlgorithmConnection() {
        target = 0;
        source = 0;
        allocated = false;
    }
    int target;
    int source;
    bool allocated;
};

class FMAlgorithm
{
public:
    FMAlgorithm();
    FMAlgorithm(int opc, int cnc);
    ~FMAlgorithm();
    void setOperator(int num, FMOperator *op);
    void setConnection(int num, int t, int s);
    float calculate();
    void noteOn(float freq, double time);
    void noteOff(double time);
    
private:
    int opcount;
    int cncount;
    FMOperator **operators;
    FMAlgorithmConnection *connections;

    float calculate(int opn);
};