Hello, I sure could use a helping hand. Arduino code is Greek to me and although I’ve managed to decipher some things I’m still far from where I need to be.
Here’s my project in a nutshell… I’m in a band and my drummer triggers sound effects at various times through an Alesis Samplepad which has four drum pads on it and a MIDI out port. I want a stage prop to be actuated in sync with the sound effect.
The prop is a cannon equipped with a bright light and a fog machine to simulate a cannon shot. I have a grip on the 120v side of things but where I need help is in controlling the relays the way I need to.
I’ve gotten pretty far along but I still need a little help. Here’s my current status…. I have a MIDI shield, an Arduino Uno and an eight channel relay board. (see links below) This is my first attempt at any sort of Arduino project so keep in mind that I’m pretty new to this and I’ve been trying to feel my way through it. In hindsight I should have just built the MIDI input circuit because at this point I’m not able to plug the MIDI shield into the Arduino anyway but I’ve managed to make it work
I’ve done a lot of experimenting and trial and error and I’ve managed to get everything communicating somewhat. I’m currently using a sketch someone wrote to control a homemade MIDI Glockenspiel.
Video of someone using this sketch as I did with the keyboard.
Initially I used a MIDI keybord as a controller instead of the Alesis Samplepad and eventually I got it all working as well as possible with the sketch I’m using. With the keyboard I’m able to hit the white keys C5 through C6 and trigger each of the eight relays. I know that’s a lot of detail but I want you to know that my setup is working the way it should with regards to the sketch I’m using and that everything is connected properly.
My current sketch is giving me something close to what I need but it needs amended or replaced all together. As it is now, when I send a note on message with a key the relay actuates and holds in as long as I hold the key down and then releases when I release the key.
I need to be able to send a single note on message from the Alesis drum pad and automatically hold the relay on for a length of time ie: 1 to 3 seconds before releasing it. From what I understand I should be able to change a number in the code to indicate how many milliseconds I want it to hold in.
I may also want to hold either the light or the fog machine on for slightly different times to adjust the effect. In this case I would need to be able to assign two relays to one drum pad but control their durations separately. (Not sure if this can be done but it would be ideal)
So to sum it all up… Drummer hits pad – Sound goes to PA system – MIDI “Note On” message goes to Arduino – Arduino tells relay 1 to actuate for an adjustable duration - At the same time Arduino tells relay 2 to actuate for its own adjustable duration.
There should be plenty of time between hits especially since there are currently two cannons. Yes, relays 3&4 would be for cannon 2 and relays 5-8 could be for adding two more cannon props in the future.
Each of the four drum pads can be assigned one MIDI note number and the samplepad itself is fixed at MIDI channel 10.
I have replaced the keyboard with the Alesis Sample pad and I managed to change the code to reflect the fact that the Samplepad is set for MIDI channel 10. I have also programed each pad to its own MIDI note number 60, 62, 64 and 65 which corresponds notes C5, D5, E5 and F5.
I have one problem with the Samplepad communicating. When I hit a pad the pin 13 led on the Arduino blinks but it’s very dim and the relay does not operate. Each pad has a sensitivity setting of 1 to 8 and all of them are set to 8. I’ve tried it at all levels and the LED is still dim like it’s not a strong enough signal. I hope that’s something that can be adjusted in the code.
Here’s some info from the Samplepad’s MIDI Implementation Chart: Basic Channel – 10 Mode Messages – 0-127 Altered - ************** Velocity Note On – 99H,V=1 -127 Note Off - (99H,V=0)
I realize the sketch I’m using probably has many things I don’t need and lacks several things I do need. I’ve searched high and low and I can’t seem to find anyone who is doing the same thing I’m trying to do or a ready-made sketch containing all of my needs. Could anyone please help solve my problems or at least steer me in the right direction? Any help would be greatly appreciated! Thank you so much