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
- Control Change Potentiometer Example doesn't compile for Teensy 4.1 HOT 1
- Compilation error: expected template-name before '<' token HOT 2
- Arduino UNO R4 support and testing HOT 3
- Arduino Yun HOT 2
- Trying to setVelocity for all notebutton values in mux with piezo device HOT 1
- External app/webpage to change CC and Channel values HOT 1
- Hi, I would like to see the USBMIDI_Interface adapted so that you can specify the fixed cablenumber. This would it make possible to use pipes and filters connecting serial ports with virtual usb ports
- Support for MCP23S17 SPI
- error: 'SelectorPC' does not name a type HOT 2
- Switching presets Roland FP-30X HOT 2
- TYPO IN DOCUMENTATION HOT 1
- Error running on M1 Mac Sonoma with Teensy 4.0 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 2
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.