drum

Dependencies:   mbed drum

Committer:
38
Date:
Sat Nov 28 15:35:41 2020 +0000
Revision:
1:52b83b268ebb
Parent:
0:cd5fcde85881
drum;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
38 0:cd5fcde85881 1 #ifndef NOTE_H
38 0:cd5fcde85881 2 #define NOTE_H
38 0:cd5fcde85881 3
38 0:cd5fcde85881 4 typedef enum hit {
38 0:cd5fcde85881 5 drum_1 = 0,//バスドラム
38 0:cd5fcde85881 6 drum_2 = 1,//スネアドラム_1
38 0:cd5fcde85881 7 drum_2_1 = 2,//スネアドラム_2
38 0:cd5fcde85881 8 drum_3 = 3,//ロータム
38 0:cd5fcde85881 9 drum_4 = 4,//ハイタム
38 0:cd5fcde85881 10 drum_5 = 5,//フロアタム_1
38 0:cd5fcde85881 11 drum_5_1 = 6,//フロアタム_2
38 0:cd5fcde85881 12 cymbal_1 = 7,//ハイハット_1
38 0:cd5fcde85881 13 cymbal_1_1 = 8,//ハイハット_2
38 0:cd5fcde85881 14 cymbal_2 = 9,//クラッシュシンバル_low
38 0:cd5fcde85881 15 cymbal_3 = 10,//クラッシュシンバル_hight
38 0:cd5fcde85881 16 cymbal_4 = 11, //ライドシンバル
38 0:cd5fcde85881 17 hihat_off = 12,//ハイハットclose
38 0:cd5fcde85881 18 hihat_middle = 13,//ハイハットmiddle
38 0:cd5fcde85881 19 rest
38 0:cd5fcde85881 20 } hit_t;
38 0:cd5fcde85881 21
38 0:cd5fcde85881 22 typedef struct {
38 0:cd5fcde85881 23 hit_t hit;
38 0:cd5fcde85881 24 double time;
38 0:cd5fcde85881 25 } note_t;
38 0:cd5fcde85881 26
38 0:cd5fcde85881 27
38 0:cd5fcde85881 28
38 0:cd5fcde85881 29
38 0:cd5fcde85881 30 double bpm_1=170;
38 0:cd5fcde85881 31 double note_4=60000000.0/bpm_1;//四分音符
38 0:cd5fcde85881 32 double note_2=note_4*2.0;//二分音符
38 0:cd5fcde85881 33 double note_8=note_4/2.0;//八分音符
38 0:cd5fcde85881 34 double note_16=note_8/2.0;//十六分音符
38 0:cd5fcde85881 35 double onemeasure=4.0*note_4;
38 0:cd5fcde85881 36
38 0:cd5fcde85881 37 double bpm_2=104;
38 0:cd5fcde85881 38 double note_4_2=60000000.0/bpm_2;//四分音符
38 0:cd5fcde85881 39 double note_2_2=note_4_2*2.0;//二分音符
38 0:cd5fcde85881 40 double note_8_2=note_4_2/2.0;//八分音符
38 0:cd5fcde85881 41 double note_16_2=note_8_2/2.0;//十六分音符
38 0:cd5fcde85881 42 double note_32_2=note_16_2/2.0;//三十二分音符
38 0:cd5fcde85881 43 double onemeasure_2=4.0*note_4_2;
38 0:cd5fcde85881 44
38 0:cd5fcde85881 45
38 0:cd5fcde85881 46 #endif