添加一些关于midi播放的项目
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
#ifndef __SYNTH_CORE_H__
|
||||
#define __SYNTH_CORE_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define POLY_NUM 32
|
||||
|
||||
typedef struct _SoundUnit
|
||||
{
|
||||
uint32_t wavetablePos;
|
||||
uint32_t waveTableAddress;
|
||||
uint32_t waveTableLen;
|
||||
uint32_t waveTableLoopLen;
|
||||
uint32_t waveTableAttackLen;
|
||||
uint32_t envelopePos;
|
||||
uint32_t increment;
|
||||
int32_t val;
|
||||
int32_t sampleVal;
|
||||
uint32_t envelopeLevel;
|
||||
}SoundUnit;
|
||||
|
||||
|
||||
|
||||
typedef struct _Synthesizer
|
||||
{
|
||||
SoundUnit SoundUnitList[POLY_NUM];
|
||||
int32_t mixOut;
|
||||
uint32_t lastSoundUnit;
|
||||
}Synthesizer;
|
||||
|
||||
|
||||
extern void SynthInit(Synthesizer* synth);
|
||||
|
||||
//#ifdef RUN_TEST
|
||||
extern void NoteOnC(Synthesizer* synth,uint8_t note);
|
||||
extern void SynthC(Synthesizer* synth);
|
||||
extern void GenDecayEnvlopeC(Synthesizer* synth);
|
||||
//#endif
|
||||
|
||||
extern void NoteOnAsm(Synthesizer* synth,uint8_t note);
|
||||
extern void GenDecayEnvlopeAsm(Synthesizer* synth);
|
||||
extern void SynthAsm(Synthesizer* synth);
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user