Coder Social home page Coder Social logo

Comments (4)

tttapa avatar tttapa commented on June 3, 2024 2

Note that your code has several errors:

  • Your multiplexers have only 4 address pins, so use multiple AnalogMultiplex objects.
  • Use Digital objects for buttons, not Analog.
  • You can't use the same pins for rotary encoders.
#include <MIDI_Controller.h>

const int speedMultiply = 1;

//BUTTONS
AnalogMultiplex multiplexers[] = {
  {A0, {10, 11, 12, 13}},
  {A1, {10, 11, 12, 13}},
  {A2, {10, 11, 12, 13}},
  // ...
};

Digital buttons[] = {
  { multiplexers[0].pin(0), 0x1, 1 },
  { multiplexers[0].pin(1), 0x2, 1 },
  { multiplexers[0].pin(2), 0x3, 1 },
  // ...
  { multiplexers[1].pin(0), 0x11, 1 },
  { multiplexers[1].pin(1), 0x12, 1 },
  // ...
  { multiplexers[2].pin(0), 0x21, 1 },
  // ...
};
//FADERS
AnalogMultiplex multiplexerF(A3, {10, 11, 12, 13} );
Analog potentiometersF[] = {
  { multiplexerF.pin(0), 0x1, 3 },
  { multiplexerF.pin(1), 0x2, 3 },
  { multiplexerF.pin(3), 0x4, 3 },
  { multiplexerF.pin(4), 0x5, 3 },
  { multiplexerF.pin(5), 0x6, 3 },
  { multiplexerF.pin(6), 0x7, 3 },
  { multiplexerF.pin(7), 0x8, 3 },
  { multiplexerF.pin(8), 0x9, 3 },
  { multiplexerF.pin(9), 0xA, 3 },
  { multiplexerF.pin(10), 0xB, 3 },
  { multiplexerF.pin(11), 0xC, 3 },
  { multiplexerF.pin(12), 0xD, 3 },
  { multiplexerF.pin(13), 0xE, 3 },
  { multiplexerF.pin(14), 0xF, 3 },
  { multiplexerF.pin(15), 0x10, 3 },
};

//ENCODERS
RotaryEncoder enc0 = {0, 1, 0x1, 4, speedMultiply, NORMAL_ENCODER, TWOS_COMPLEMENT};
RotaryEncoder enc1 = {2, 3, 0x2, 4, speedMultiply, NORMAL_ENCODER, TWOS_COMPLEMENT};
// ...

void setup() {}
void loop() {
  MIDI_Controller.refresh();
}

from midi_controller.

tttapa avatar tttapa commented on June 3, 2024

An advantage of the MIDI Controller library is that it's easy to use and very flexible. This comes at a cost, of course: it uses more memory.

You can either write your own code from scratch, or you could use a board that has more RAM, like a Teensy.

from midi_controller.

userdsp avatar userdsp commented on June 3, 2024

I love teensy 3.6 <3

Archiving built core (caching) in: C:\Users*\AppData\Local\Temp\arduino_cache_336804\core\core_teensy_avr_teensy36_usb_serialmidi,speed_180,opt_o2std,keys_en-us_4939f5412a75a8560acb0f9e98268f02.a
Opening Teensy Loader...

Sketch uses 34528 bytes (3%) of program storage space. Maximum is 1048576 bytes.
Global variables use 15764 bytes (6%) of dynamic memory, leaving 246380 bytes for local variables. Maximum is 262144 bytes.

from midi_controller.

mkothencz avatar mkothencz commented on June 3, 2024

Thanks for the comments.
I decided to buy a Tennsy 3.5. With Tennsy I don't have to use double-level multiplexer system, because it has lot of input pins.

from midi_controller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.