Comments (6)
CCPotentiometer pots[] = {
{A0, MIDI_CC::General_Purpose_Controller_1},
{A1, MIDI_CC::General_Purpose_Controller_2},
{A2, MIDI_CC::General_Purpose_Controller_3},
{A3, MIDI_CC::General_Purpose_Controller_4},
};
analog_t invertPot(analog_t val) {
return 1023 - val;
}
void setup () {
for (auto &pot : pots)
pot.map(invertPot);
Control_Surface.begin();
}
I can't test it right now, and I've been changing some things about the mapping function lately, so please let me know if it works.
from control-surface.
That works perfectly! Thanks so much.
from control-surface.
Glad to hear!
from control-surface.
hi, I got the same problem, I made my pcb and inverted the way they should work, and on top and vcc on bottom :-(
could you tell me how I could invert it
Bankable::CCPotentiometer fader [] = { //ici on déclare les faders avec comme vu plus haut le numéro de CC et le canal
{{bank3, BankType::CHANGE_CHANNEL}, mux3.pin(8), {7, CHANNEL_1}},
{{bank3, BankType::CHANGE_CHANNEL}, mux3.pin(9), {7, CHANNEL_2}},
{{bank3, BankType::CHANGE_CHANNEL}, mux3.pin(10), {7, CHANNEL_3}},
{{bank3, BankType::CHANGE_CHANNEL}, mux3.pin(11), {7, CHANNEL_4}},
{{bank3, BankType::CHANGE_CHANNEL}, mux3.pin(12), {7, CHANNEL_5}},
{{bank3, BankType::CHANGE_CHANNEL}, mux3.pin(13), {7, CHANNEL_6}},
{{bank3, BankType::CHANGE_CHANNEL}, mux3.pin(14), {7, CHANNEL_7}},
{{bank3, BankType::CHANGE_CHANNEL}, mux3.pin(15), {7, CHANNEL_8}},
};
from control-surface.
The changes to the mapping functions are mentioned in the readme:
- 31edaa6
The mapping function is now applied before applying hysteresis.
This means that the input and output values of the function should be
16 -ANALOG_FILTER_SHIFT_FACTOR
bits wide instead of 7. By default this is
14 bits.
The signature of the mapping function is nowanalog_t f(analog_t raw)
,
where the return value and raw are both numbers in [0, 16383].
For general mapping, see this example: CCPotentiometer-Map.ino
Inverting the potentiometer is supported directly using the CCPotentiometer::invert
function:
CCPotentiometer potentiometer = {
A0, {MIDI_CC::Channel_Volume, CHANNEL_1}
};
void setup() {
potentiometer.invert();
Control_Surface.begin();
}
Of if you have an array of potentiometers, use a for loop:
Bankable::CCPotentiometer faders[] = {
{{bank3, BankType::CHANGE_CHANNEL}, mux3.pin(8), {7, CHANNEL_1}},
{{bank3, BankType::CHANGE_CHANNEL}, mux3.pin(9), {7, CHANNEL_2}},
// ...
};
void setup() {
for (auto &fader : faders)
fader.invert();
Control_Surface.begin();
}
from control-surface.
Thanks a lot! With the for loop will it only invert my faders and let the other pots in the normal functionement?
from control-surface.
Related Issues (20)
- Bankable::ManyAddresses::CCAbsoluteEncoder HOT 2
- Time Display does not work.
- Does it's support ESP32-S3/C3 via USB port? HOT 7
- How to use 1 shift button to change bank:
- The sketch compiles, but doesn't work HOT 3
- Error when compiling for ESP32 S3 HOT 3
- Metronome Led HOT 3
- BANKS WITH MULTIPLE BUTTON FUNCTION HOT 1
- Using Control Surface with Teensy 4.1 board HOT 3
- BTstackBackgroundBackend connection issue HOT 6
- Map on Filtered Analog HOT 3
- Setting CCPotentiometer range HOT 3
- Piezoelectric velocity pads HOT 1
- Sticky On Note HOT 1
- Pitch Bend Doesn't Send Zero At Center (Sends +8) HOT 4
- Arduino Nano 33 BLE Support? HOT 3
- Пример CCIncrementDecrementButtons.ino HOT 10
- Select bank HOT 2
- MIDI-монитор-OLED HOT 3
- Arduino Giga R1 Wifi support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from control-surface.