Nucleo F401REでFM音源を実装するやつ の実装途中で32ポリ音源にしたやつ 外部DACとオペアンプを利用 現在はMCP4922とNJM2737

Dependencies:   AOTTrigon I2CEEPROM MCP4922 mbed

Operator.h

Committer:
kb10uy
Date:
2014-12-29
Revision:
11:62da91a1eaf1
Parent:
10:0ffdefe75566

File content as of revision 11:62da91a1eaf1:

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


class FMOperator {

public:
    FMOperator();
    FMOperator(Timer *tm, AOTTrigon *t);
    float calculate(float fmIn);
    void attackNote(float freq);
    void releaseNote();

    float attack;
    float delay;
    float sustain;
    float sustainRate;
    float release;

    float frequencyMultiple;
    float totalLevel;

private:
    Timer *master;
    AOTTrigon *tri;
    //時間だけdouble確保
    double startTime;
    double releaseTime;
    double baseFrequency;
};