Using int to define midi channel #551
Replies: 3 comments 6 replies
-
Please see https://tttapa.github.io/Control-Surface-doc/Doxygen/da/dc1/FAQ.html#faq-change-address-runtime. |
Beta Was this translation helpful? Give feedback.
-
Excuse my lack of knowledge, but how can I now use this to modify an integer in order to set the midi channel address? In my menu code, this selection field allows me to select and change an integer value. How can I direct this to change the global channel setting?
Correct me if I am wrong, but I assume I just need to integrate the code above "// NoteButton alternative that allows you to select any address." and change my int name from selMIDIch to global_channel_setting? Thanks |
Beta Was this translation helpful? Give feedback.
-
If we discard the "On/Off channels" for which issues can understandably arise easily. /**
* reads midi channel on A0
* reads midi value on A1
*/
#include <Control_Surface.h>
USBMIDI_Interface midi;
FilteredAnalog<> analog = A1;
void setup() {
Serial.begin(9600);
FilteredAnalog<>::setupADC();
}
void loop() {
int sensorValue = analogRead(A0);
midiChannel = map(sensorValue, 0, 1023, 0, 127);
static Timer<millis> timer = 1; // ms
if (timer && analog.update())
Serial.println(analog.getValue());
midi.sendCC(midiChannel,analog.getValue());
} right ? |
Beta Was this translation helpful? Give feedback.
-
Hey Pieter,
I would like to be able to change a note's midi channel on the fly. Is this possible and how can I achieve this?
something along the lines of the code above
Beta Was this translation helpful? Give feedback.
All reactions