Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: AOTTrigon I2CEEPROM MCP4922 AQM0802A mbed
Fork of NuMidi401 by
FMOscillator/FMAlgorithm.h
- Committer:
- kb10uy
- Date:
- 2015-01-31
- Revision:
- 23:deb76bdf6f03
- Parent:
- 21:e3014c1bdf9c
- Child:
- 24:f93b49b4cd66
File content as of revision 23:deb76bdf6f03:
#pragma once
#include "mbed.h"
#include "FMOperator.h"
#include "AOTTrigon.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, Timer *tm, AOTTrigon *tri);
~FMAlgorithm();
void setConnection(int t, int s);
void setConnectionIndex(int id);
void enableCurrentConnection();
void disableCurrentConnection();
float calculate();
void noteOn(float freq, double time);
void noteOff(double time);
private:
int opcount;
int cncount;
int cni;
FMOperator **operators;
FMAlgorithmConnection *connections;
float calculate(int opn);
};
