Go Down

Topic: Control MIDI note velocity via potentiometer (Read 165 times) previous topic - next topic

Hey guys, I'm making a laser harp and was wondering if someone could help me out with the code for this. I want to control the MIDI note velocity (volume) by a 5k pot and need help. I've already established a MIDI serial channel and note velocity.

Thanks, Shane

UKHeliBob

Sounds easy. 
Read a value from the pot using analog.Read() and map() the value returned to the range required.  For more detailed advice I suggest that you post your current code so that we can see how it is structured.
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

#2
Aug 01, 2014, 09:14 am Last Edit: Aug 01, 2014, 09:28 am by shanemachine Reason: 1

I knowwww using global variables are frowned upon, but I'm a newbie so that's my excuse  XD

UKHeliBob

#4
Aug 01, 2014, 11:33 am Last Edit: Aug 01, 2014, 11:36 am by UKHeliBob Reason: 1

I knowwww using global variables are frowned upon, but I'm a newbie so that's my excuse  XD

No need to apologise.  Global variables are very handy and as long as they are sensibly named and kept to a minimum they work well in the Arduino environment.

I will look at you program when I get a chance.

EDIT: or I would do but all I get from your link is an empty document.  Please attach your program to a post here using the Additional Options link at the bottom left of the message edit window.
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

#5
Aug 01, 2014, 11:58 am Last Edit: Aug 01, 2014, 12:20 pm by shanemachine Reason: 1
Here's the .txt of the code and the .ino file. Please excuse some of the comments between the 14th and 18th "strings" I got lazy and didn't update them. I will now.

EDIT: I updated and replaced the .ino file but not the .txt.

Go Up