arduino架子鼓_【EvilMK】“Orchid”像样的Arduino架子鼓

这是一个开源项目,展示了如何使用Arduino创建一个名为'Orchid'的架子鼓控制器。通过读取A0到A6引脚上的模拟输入,将打击力度映射到MIDI信号,模拟各种鼓的声音,包括军鼓、底鼓、高音桶鼓、低音桶鼓和踩镲。代码中包含了调试模式和MIDI速率设置。
摘要由CSDN通过智能技术生成

/*EvilMaker Orchid (Opensource) 2015 v1.00-d

by Virtualwiz

*/

void midiSend (int cmd, int pitch, int velocity) {

Serial.write(cmd);

Serial.write(pitch);

Serial.write(velocity);

}

const byte buzzer=50;

//Serial to MIDI or Native MIDI?

boolean debug_mode=true;

const unsigned char kick=36;

const unsigned char snare=38;

const unsigned char tom_high=50;

const unsigned char tom_low=45;

const unsigned char tom_bass=41;

const unsigned char crash_left=49;

const unsigned char crash_right=57;

const unsigned char hat_open=51;   //46

const unsigned char hat_close=42;

char adc_channel[7] ={

'A0','A1','A2','A3','A4','A5','A6'

};

void setup() {

pinMode(buzzer,OUTPUT);

pinMode(7,OUTPUT);

pinMode(6,INPUT);

pinMode(3,INPUT);

digitalWrite(3,HIGH);

digitalWrite(6,HIGH);

//3 is for Kick and 6 is for hi-hat

//Startup tone

tone(buzzer,1397,130);

delay(130);

tone(buzzer,1568,130);

delay(13

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值