Comments (12)
Another tip: could you connect just one pot to A3 and after to A4 to check these input ports? Maybe they are damaged
from midi_controller.
All inputs are independent objects in software, so that shouldn't be an issue.
Make sure all wires make good connection, even when wiggling them around. You could try soldering wires to everything, and use male header pins to plug them into the Arduino.
The outer terminals of the potentiometer go to ground and 5V respectively, the center pin (wiper) goes to the analog input. If you experience noise (values fluctuating up and down 1 or 2 values), you could try the master
version, which has improved filtering.
Other than that, I don't know what could cause it. I would suspect a hardware issue, though.
from midi_controller.
The breadboard has an interupted power rail which I didn't realize was a thing. First project. Sadly though when I figured this out I was bridging them and the board fried. I had an external 12V power supply, which I the leonardo is supposed to handle.
There's no other way this could have fried using just the 5v, gnd, inputs and a bunch of pots and faders, right?
from midi_controller.
You could have shorted out 5V to ground, which would probably destroy the 5V regulator when powering it from a 12V source.
What exactly fried? The MCU or some other part?
from midi_controller.
The ATmega32u4 is incredibly hot now, so I think that burned asking with some other things.
I'm sure I sorted the 5v to gnd because I wasn't cautious to avoid that and tried a million configurations during troubleshooting. I guess I just thought the gnd could handle it. Oh well 10 bucks.
So my pots are linear but my faders are logarithmic but there is code for mapping log sliders IIRC.
from midi_controller.
You can use the map function, together with the formula discussed here: #43 (comment).
from midi_controller.
So would the
value = (value < y_knee) ? (value * x_knee / y_knee) : ((value - y_knee) * (1023 - x_knee) / (1023 - y_knee) + x_knee);
come after the mapping function for that input? Will you do a sample code please?
from midi_controller.
#include <MIDI_Controller.h> // Include the library
// Create a new instance of the class 'Analog', called 'potentiometer', on pin A0,
// that sends MIDI messages with controller 7 (channel volume) on channel 1
Analog potentiometer(A0, MIDI_CC::Channel_Volume, 1);
const int x_knee = 512;
const int y_knee = 102;
int mapCalibrated(int value) {
value = (value < y_knee) ? (value * x_knee / y_knee) : ((value - y_knee) * (1023 - x_knee) / (1023 - y_knee) + x_knee);
return value;
}
void setup() {
potentiometer.map(mapCalibrated); // apply the 'mapCalibrated' function on the analog input of 'potentiometer'
}
void loop() {
// Refresh the MIDI controller (check whether the potentiometer's input has changed since last time, if so, send the new value over MIDI)
MIDI_Controller.refresh();
}
from midi_controller.
And to add linear would they be added at the end of map calibration aka
#include <MIDI_Controller.h> // Include the library
// Create a new instance of the class 'Analog', called 'potentiometer', on pin A0,
// that sends MIDI messages with controller 7 (channel volume) on channel 1
Analog potentiometer(A0, MIDI_CC::Channel_Volume, 1);
Analog potentiometer(A2, MIDI_CC::Channel_Volume, 3);
const int x_knee = 512;
const int y_knee = 102;
int mapCalibrated(int value) {
value = (value < y_knee) ? (value * x_knee / y_knee) : ((value - y_knee) * (1023 - x_knee) / (1023 - y_knee) + x_knee);
return value;
}
Analog potentiometer(A1, MIDI_CC::Channel_Volume, 2);
void setup() {
potentiometer.map(mapCalibrated); // apply the 'mapCalibrated' function on the analog input of 'potentiometer'
}
void loop() {
// Refresh the MIDI controller (check whether the potentiometer's input has changed since last time, if so, send the new value over MIDI)
MIDI_Controller.refresh();
}
Gives you log pots on 1 and 3 and linear on 2?
from midi_controller.
No, for the linear ones, you just don't use potentiometer.map(mapCalibrated)
at all. The position in the code doesn't matter.
from midi_controller.
For example:
#include <MIDI_Controller.h> // Include the library
Analog linearPots[] = {
{A0, MIDI_CC::Channel_Volume, 1},
{A1, MIDI_CC::Channel_Volume, 2},
{A2, MIDI_CC::Channel_Volume, 3},
{A3, MIDI_CC::Channel_Volume, 4},
};
Analog logPots[] = {
{A4, MIDI_CC::Channel_Volume, 5},
{A5, MIDI_CC::Channel_Volume, 6},
{A6, MIDI_CC::Channel_Volume, 7},
{A7, MIDI_CC::Channel_Volume, 8},
};
const int x_knee = 512;
const int y_knee = 102;
int mapLog(int value) {
value = (value < y_knee) ? (value * x_knee / y_knee) : ((value - y_knee) * (1023 - x_knee) / (1023 - y_knee) + x_knee);
return value;
}
void setup() {
for (Analog &potentiometer : logPots)
potentiometer.map(mapLog); // apply the 'mapLog' function on the analog input of this potentiometer
}
void loop() {
// Refresh the MIDI controller (check whether the potentiometer's input has changed since last time, if so, send the new value over MIDI)
MIDI_Controller.refresh();
}
from midi_controller.
Wow amazing, and it all makes sense.
from midi_controller.
Related Issues (20)
- Is the Nano Every board compatible? HOT 3
- How to Echo MIDI IN to MIDI OUT? HOT 2
- no response when change banks and instruments HOT 11
- USB host arduino uno HOT 1
- Use Momentary as Toggle HOT 2
- Potentiometer mapping - unable to use full range of potentiometer HOT 1
- Problem to reload the code HOT 19
- Documentation HOT 1
- Mapping logarithmic potentiometers to linear curve HOT 2
- Create 4 midi banks controlled by 1 potentiometer HOT 3
- [Feature request] Can you add support for piezo inputs? HOT 1
- Octave change for multiplexer buttons HOT 4
- Cant upload encoder exmple to arduino mega HOT 1
- Why return MidiUSB.read().header != 0 in USBMIDI_Interface::refresh class ? HOT 1
- Can I use the analog multiplexer library of 8, to connect one of 16? HOT 1
- Connecting multiple multiplexers to analog inputs for micro HOT 2
- Can the name of the board be changed? HOT 8
- Conect 2 or more buttons to a single led HOT 19
- How to send midi over serial HOT 2
- unsupported board: Adafruit Bluefruit Feather nRF52840 Express 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 midi_controller.