-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathYM2151.h
45 lines (40 loc) · 1.24 KB
/
YM2151.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#if !defined( YM2151_H_INCLUDED )
#define YM2151_H_INCLUDED
#include "Arduino.h"
#include <avr/pgmspace.h>
class YM2151_Class{
public:
YM2151_Class();
void begin();
void initLFO();
uint8_t read();
void write(uint8_t addr,uint8_t data);
void setTone(uint8_t ch,uint8_t keycode,int16_t kf);
void setVolume(uint8_t ch,uint8_t volume,uint16_t offset);
void noteOn(uint8_t ch);
void noteOff(uint8_t ch);
void loadTimbre(uint8_t ch,uint16_t prog_addr);
void loadSeparationTimbre(uint8_t ch,uint16_t prog_addr);
void dumpTimbre(uint16_t prog_addr);
void setPanpot(uint8_t ch,uint8_t pan);
private:
static const uint8_t YM_PIN_D0=2;
static const uint8_t YM_PIN_D1=3;
static const uint8_t YM_PIN_D2=4;
static const uint8_t YM_PIN_D3=5;
static const uint8_t YM_PIN_D4=6;
static const uint8_t YM_PIN_D5=7;
static const uint8_t YM_PIN_D6=8;
static const uint8_t YM_PIN_D7=9;
static const uint8_t YM_PIN_RD=10;
static const uint8_t YM_PIN_WR=11;
static const uint8_t YM_PIN_A0=12;
static const uint8_t YM_PIN_IC=13;
uint8_t RegFLCON[8];
uint8_t RegSLOTMASK[8];
uint8_t CarrierSlot[8];
uint8_t RegTL[8][4];
void wait(uint8_t loop);
};
extern YM2151_Class YM2151;
#endif //YM2151H_INCLUDED