Pages: [1]   Go Down
Author Topic: Control MIDI note velocity via potentiometer  (Read 133 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4352
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

https://docs.google.com/document/d/1-lxn-0plPy92hnPqC37FIMdmCgQ6LpYrLnqd7A3_uuc/edit?usp=docslist_api Here's the code as its too large to copy and paste.
« Last Edit: August 01, 2014, 02:28:18 am by shanemachine » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I knowwww using global variables are frowned upon, but I'm a newbie so that's my excuse  smiley-lol
Logged

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4352
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I knowwww using global variables are frowned upon, but I'm a newbie so that's my excuse  smiley-lol
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.
« Last Edit: August 01, 2014, 04:36:38 am by UKHeliBob » Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

* fedfedfed.txt (47.3 KB - downloaded 7 times.)
* LASER HARP V 4.ino (47.1 KB - downloaded 12 times.)
« Last Edit: August 01, 2014, 05:20:33 am by shanemachine » Logged

Pages: [1]   Go Up
Jump to: