Ch. 1 .. Controller 4 .. it's going crazy

What kind of hardware do you have connected to pin A2? Is it floating?
Unrelated: It might not be a good idea to loop back all MIDI messages on your computer.
It's connected to a 1/4" socket for the pedal not connected to anything
ok how can I fix that ? I felt like this is the reason behind that but not sure
Well that explains the noise, the input is floating. You should either disable the input in software when nothing is connected, or use a pull-up/down resistor, or maybe use the switch in your jack to connect the input to ground if no external pedal is connected.
It's a software setting in the MIDI application you're using on your computer.
IT WORKED ![]()
![]()
![]()
![]()
![]()
![]()
I commented the pedal part of the code and it worked with no distortion FINALLY
I will connect a resistor to the pedal socket to eliminate that noise and I want the pitch bend wheel to work too I don't have any clue in Control Surface about how to code it and the octave buttons too
You can use the PBPotentiometer class instead of CCPotentiometer, they're really similar.
There's a Transposer example that comes with the library. The FAQ contains more information on “banks”.
#include <Control_Surface.h>
#include <MIDI_Outputs/Bankable/NoteButton.hpp>
// Instantiate a Transposer that can transpose from one octave down to one
// octave up
Transposer<-12, +12> transposer;
// Instantiate a Selector to change the transposition
IncrementDecrementSelector<transposer.getNumberOfBanks()> selector {
transposer,
{M2.pin(9), M2.pin(10)},
Wrap::Clamp,
};
// Instantiate an array of NoteButton objects
Bankable::NoteButton buttons[] {
{transposer, 2, 48}, {transposer, 3, 49},
{transposer, 4, 50}, {transposer, 5, 51},
{transposer, 6, 52}, {transposer, 7, 53},
{transposer, 8, 54}, {transposer, 9, 55},
};
The PBPotentiometer is working sooooooo goooooooood
but the transposition isn't functioning however the code is not giving any errors
and I want the two buttons on the right to switch between channels .. how can this be done ??
You're not using the correct pins for the NoteButtons, you should be using M1.pin(0) etc.
Still the same
Error message is
:72:30: error: conflicting declaration 'CS::Bankable::NoteButton buttons []'
Bankable::NoteButton buttons[] {
^
note: previous declaration as 'CS::NoteButton buttons [25]'
NoteButton buttons[] = {
^~~~~~~
exit status 1
conflicting declaration 'CS::Bankable::NoteButton buttons []'
You cannot have two variables with the same name in the same scope.
ok we can skip this step I just want the two buttons to work as a Octave + & Octave -
I typed the right pins and removed them from the CCButtons and it's still not functioning
Where's your code?
#include <Control_Surface.h>
#include <MIDI_Outputs/Bankable/PBPotentiometer.hpp>
#include <MIDI_Outputs/Bankable/NoteButton.hpp>
HairlessMIDI_Interface midi;
CD74HC4067 M1 = { 6, {5, 4, 3, 2} };
CD74HC4067 M2 = { 7, {5, 4, 3, 2} };
NoteButton buttons[] = {
{ M1.pin(0), {48, CHANNEL_1} },
{ M1.pin(1), {49, CHANNEL_1} },
{ M1.pin(2), {50, CHANNEL_1} },
{ M1.pin(3), {51, CHANNEL_1} },
{ M1.pin(4), {52, CHANNEL_1} },
{ M1.pin(5), {53, CHANNEL_1} },
{ M1.pin(6), {54, CHANNEL_1} },
{ M1.pin(7), {55, CHANNEL_1} },
{ M1.pin(8), {56, CHANNEL_1} },
{ M1.pin(9), {57, CHANNEL_1} },
{ M1.pin(10), {58, CHANNEL_1} },
{ M1.pin(11), {59, CHANNEL_1} },
{ M1.pin(12), {60, CHANNEL_1} },
{ M1.pin(13), {61, CHANNEL_1} },
{ M1.pin(14), {62, CHANNEL_1} },
{ M1.pin(15), {63, CHANNEL_1} },
{ M2.pin(0), {64, CHANNEL_1} },
{ M2.pin(1), {65, CHANNEL_1} },
{ M2.pin(2), {66, CHANNEL_1} },
{ M2.pin(3), {67, CHANNEL_1} },
{ M2.pin(4), {68, CHANNEL_1} },
{ M2.pin(5), {69, CHANNEL_1} },
{ M2.pin(6), {70, CHANNEL_1} },
{ M2.pin(7), {71, CHANNEL_1} },
{ M2.pin(8), {72, CHANNEL_1} },
};
CCPotentiometer Potentiometers[] = {
{ A0, {MIDI_CC::Modulation_Wheel , CHANNEL_1} }, //M Wheel
{ A2, {MIDI_CC::Foot_Controller , CHANNEL_1} }, //PEDAL
};
PBPotentiometer Potentiometer[] = {
{ A1, CHANNEL_1 }, //P Wheel
};
CCButton Buttons[] = {
// { M2.pin(9), {MIDI_CC::General_Purpose_Controller_1, CHANNEL_1} }, //Octav -
// { M2.pin(10), {MIDI_CC::General_Purpose_Controller_2, CHANNEL_1} }, //Octav +
{ M2.pin(11), {MIDI_CC::General_Purpose_Controller_3, CHANNEL_1} }, //REC
{ M2.pin(12), {MIDI_CC::General_Purpose_Controller_4, CHANNEL_1} }, //PLY
{ M2.pin(13), {MIDI_CC::General_Purpose_Controller_5, CHANNEL_1} }, //STP
{ M2.pin(14), {MIDI_CC::General_Purpose_Controller_6, CHANNEL_1} }, //Channel Left
{ M2.pin(15), {MIDI_CC::General_Purpose_Controller_7, CHANNEL_1} }, //Channel Right
};
// Instantiate a Transposer that can transpose from one octave down to one
// octave up
Transposer<-12, +12> transposer;
// Instantiate a Selector to change the transposition
IncrementDecrementSelector<transposer.getNumberOfBanks()> selector {
transposer,
{M2.pin(9), M2.pin(10)},
Wrap::Clamp,
};
void setup() {
Control_Surface.begin();
}
void loop() {
Control_Surface.loop();
}
You're not using the transposer anywhere, you have to define your buttons as instances of the Bankable::NoteButton class, and initialize them with a reference to the transposer, a pin number, and a base note number, as shown in the transposer example. In other words, delete the old NoteButton buttons[] array and replace it with an array of type Bankable::NoteButton, with the correct arguments.
I already did that and it gives me errors too
can you please help me with a code ?
any updates ?? I want to finish the Transposition buttons to flash the MIDI Firmware on the UNO
I tried so many ways as you told me and it doesn't work even after updating the library
You just take the Transposer example code and add your own pin numbers and addresses:
// Instantiate a Transposer that can transpose from one octave down to one
// octave up
Transposer<-12, +12> transposer;
// Instantiate a Selector to change the transposition
IncrementDecrementSelector<transposer.getNumberOfBanks()> selector {
transposer,
{M2.pin(9), M2.pin(10)},
Wrap::Clamp,
};
Bankable::NoteButton buttons[] {
{ transposer, M1.pin(0), {48, CHANNEL_1} },
{ transposer, M1.pin(1), {49, CHANNEL_1} },
{ transposer, M1.pin(2), {50, CHANNEL_1} },
// ...
};
If you want to increment by octave, you'll need:
Transposer<-2, +2> transposer {12};
Mr. Pieter I wanted to ask about how to make push buttons act like a Toggle switch in control surface (One click ON/One Click OFF) for a future project I'm working on currently
I couldn't send you a message sorry
what is the material of the keys?
