Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transposer+Change Channel #1106

Open
jeremydte opened this issue Jan 2, 2025 · 0 comments
Open

Transposer+Change Channel #1106

jeremydte opened this issue Jan 2, 2025 · 0 comments

Comments

@jeremydte
Copy link

Hello, I would like to add the transpose function to each note. I can't manage CHANGE_CHANNEL and transpose at the same time.

#include <Control_Surface.h>

HardwareSerialMIDI_Interface midi_ser {Serial1};

CD74HC4067 M1 = { 6, {2, 3, 4, 5} };
CD74HC4067 M2 = { 7, {2, 3, 4, 5} };
CD74HC4067 M3 = { 8, {2, 3, 4, 5} };
CD74HC4067 M4 = { 9, {2, 3, 4, 5} };
CD74HC4067 M5 = { A1, {2, 3, 4, 5} };
CD74HC4067 M6 = { A2, {2, 3, 4, 5} };

///MIDI CHANNEL//
Bank<8> bank(1);
ManyButtonsSelector<8> programSelector = {
bank,
{{M3.pin(7), M3.pin(6), M3.pin(5), M3.pin(4), M3.pin(3), M3.pin(2), M3.pin(1), M3.pin(0)}},
};

//OCTAVE SELECT//
Transposer<-2, +2> transposer {12};
IncrementDecrementSelector<transposer.getNumberOfBanks()> selector {
transposer,
{M1.pin(1), M1.pin(2)},
Wrap::Clamp,
};

Bankable::NoteButton buttons[] {

{{bank, BankType::CHANGE_CHANNEL}, M1.pin(15), 48}, //C
{{bank, BankType::CHANGE_CHANNEL}, M1.pin(14), 49}, //C#
{{bank, BankType::CHANGE_CHANNEL}, M1.pin(13), 50}, //D
{{bank, BankType::CHANGE_CHANNEL}, M1.pin(12), 51}, //D#
{{bank, BankType::CHANGE_CHANNEL}, M1.pin(11), 52}, //E
{{bank, BankType::CHANGE_CHANNEL}, M1.pin(10), 53}, //F
{{bank, BankType::CHANGE_CHANNEL}, M1.pin(9), 54}, //F#
{{bank, BankType::CHANGE_CHANNEL}, M1.pin(8), 55}, //G
{{bank, BankType::CHANGE_CHANNEL}, M1.pin(7), 56}, //G#
{{bank, BankType::CHANGE_CHANNEL}, M1.pin(6), 57}, //A
{{bank, BankType::CHANGE_CHANNEL}, M1.pin(5), 58}, //A#
{{bank, BankType::CHANGE_CHANNEL}, M1.pin(4), 59}, //B

{{bank, BankType::CHANGE_CHANNEL}, M1.pin(3), 60}, //C
{{bank, BankType::CHANGE_CHANNEL}, M2.pin(15), 61}, //C#
{{bank, BankType::CHANGE_CHANNEL}, M2.pin(14), 62}, //D
{{bank, BankType::CHANGE_CHANNEL}, M2.pin(13), 63}, //D#
{{bank, BankType::CHANGE_CHANNEL}, M2.pin(12), 64}, //E
{{bank, BankType::CHANGE_CHANNEL}, M2.pin(11), 65}, //F
{{bank, BankType::CHANGE_CHANNEL}, M2.pin(10), 66}, //F#
{{bank, BankType::CHANGE_CHANNEL}, M2.pin(9), 67}, //G
{{bank, BankType::CHANGE_CHANNEL}, M2.pin(8), 68}, //G#
{{bank, BankType::CHANGE_CHANNEL}, M2.pin(7), 69}, //A
{{bank, BankType::CHANGE_CHANNEL}, M2.pin(6), 70}, //A#
{{bank, BankType::CHANGE_CHANNEL}, M2.pin(5), 71}, //B

{{bank, BankType::CHANGE_CHANNEL}, M2.pin(4), 72}, //C
{{bank, BankType::CHANGE_CHANNEL}, M4.pin(11), 73}, //C#
{{bank, BankType::CHANGE_CHANNEL}, M4.pin(10), 74}, //D
{{bank, BankType::CHANGE_CHANNEL}, M4.pin(9), 75}, //D#
{{bank, BankType::CHANGE_CHANNEL}, M4.pin(8), 76}, //E
{{bank, BankType::CHANGE_CHANNEL}, M4.pin(7), 77}, //F
{{bank, BankType::CHANGE_CHANNEL}, M4.pin(6), 78}, //F#
{{bank, BankType::CHANGE_CHANNEL}, M4.pin(5), 79}, //G
{{bank, BankType::CHANGE_CHANNEL}, M4.pin(4), 80}, //G#
{{bank, BankType::CHANGE_CHANNEL}, M4.pin(3), 81}, //A
{{bank, BankType::CHANGE_CHANNEL}, M4.pin(2), 82}, //A#
{{bank, BankType::CHANGE_CHANNEL}, M4.pin(1), 83}, //B

{{bank, BankType::CHANGE_CHANNEL}, M4.pin(0), 84}, //C

};

Bankable::CCPotentiometer Potentiometers[] = {

{{bank, BankType::CHANGE_CHANNEL}, M5.pin(0), {MIDI_CC::Modulation_Wheel} }, //M Wheel

{{bank, BankType::CHANGE_CHANNEL}, M6.pin(0), {10} }, //Pot1
{{bank, BankType::CHANGE_CHANNEL}, M6.pin(1), {11} }, //Pot2
{{bank, BankType::CHANGE_CHANNEL}, M6.pin(2), {12} }, //Pot3
{{bank, BankType::CHANGE_CHANNEL}, M6.pin(3), {13} }, //Pot4
{{bank, BankType::CHANGE_CHANNEL}, M6.pin(4), {14} }, //Pot5
{{bank, BankType::CHANGE_CHANNEL}, M6.pin(5), {15} }, //Pot6
{{bank, BankType::CHANGE_CHANNEL}, M6.pin(6), {16} }, //Pot7
{{bank, BankType::CHANGE_CHANNEL}, M6.pin(7), {17} }, //Pot8
{{bank, BankType::CHANGE_CHANNEL}, M6.pin(8), {18} }, //Pot9

};

Bankable::PBPotentiometer Potentiometer[] = {
{{bank, BankType::CHANGE_CHANNEL}, M5.pin(1), CHANNEL_1 }, //P Wheel
};

Bankable::CCButton Buttons[] = {
{{bank, BankType::CHANGE_CHANNEL}, M3.pin(8), {20, CHANNEL_1} }, //PLY
};

void setup() {
Control_Surface.begin();
}

void loop() {
Control_Surface.loop();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant