-
Hello, I need someone to tell me if this is working code for a midi controller with 16 note buttons, plus 2 extra buttons for incrementing or decrementing the transposer so i have access to more octaves. It also has 4 CCpots for fx. im using the cd74hc4067 mux, so pay particular attention to that part of the code because i need to know if i have that coded right. Am i supposed to sequentially program the buttons in order according to the mux input channels as i have done? or am i supposed to just go from pins 0-24 sequentially to set the notes instead? Thank you! (Arduino Uno) #include <Control_Surface.h>
USBMIDI_Interface midi;
#include <Arduino_Helpers.h>
using namespace MIDI_Notes;
#include <AH/Hardware/ExtendedInputOutput/AnalogMultiplex.hpp>
CD74HC4067 mux1 = { 6, {2, 3, 4, 5} };
Transposer<-12, +12> transposer;
IncrementDecrementSelector<transposer.getNumberOfBanks()> selector = {
transposer, {7, 8},
Wrap::Clamp,
};
Bankable::NoteButton buttons[] {
{transposer, mux1.pin(8), {note(C, 3), CHANNEL_1}},
{transposer, mux1.pin(7), {note(Db, 3), CHANNEL_1}},
{transposer, mux1.pin(6), {note(D, 3), CHANNEL_1}},
{transposer, mux1.pin(5), {note(Eb, 3), CHANNEL_1}},
{transposer, mux1.pin(4), {note(E, 3), CHANNEL_1}},
{transposer, mux1.pin(3), {note(F, 3), CHANNEL_1}},
{transposer, mux1.pin(2), {note(Gb, 3), CHANNEL_1}},
{transposer, mux1.pin(1), {note(G, 3), CHANNEL_1}},
{transposer, mux1.pin(22), {note(Ab, 3), CHANNEL_1}},
{transposer, mux1.pin(21), {note(A, 3), CHANNEL_1}},
{transposer, mux1.pin(20), {note(Bb, 3), CHANNEL_1}},
{transposer, mux1.pin(19), {note(B, 3), CHANNEL_1}},
{transposer, mux1.pin(18), {note(C, 4), CHANNEL_1}},
{transposer, mux1.pin(17), {note(Db, 4), CHANNEL_1}},
{transposer, mux1.pin(16), {note(D, 4), CHANNEL_1}},
{transposer, mux1.pin(15), {note(Eb, 4), CHANNEL_1}},
};
CCPotentiometer potentiometers[] = {
{A0, 0x10},
{A1, 0x11},
{A2, 0x12},
{A3, 0x13},
};
void setup() {
// put your setup code here, to run once:
Control_Surface.begin();
mux1.begin();
mux1.pinMode(0, INPUT_PULLUP);
}
void loop() {
Control_Surface.loop();
} -Greg |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
The pin numbers you're using are not correct. A 4-bit multiplexer has 16 channels, which you can access using The order of the declarations doesn't matter, only which address is associated with each pin. |
Beta Was this translation helpful? Give feedback.
-
Okay thank you and yeah last time I checked it used 76% memory and threw me a warning but I figure if I remove the headers and that other thing u told me to that should free up some space, thank you!!
…-------- Original message --------
From: Pieter P <[email protected]>
Date: 2/28/21 5:52 PM (GMT-05:00)
To: tttapa/Control-Surface <[email protected]>
Cc: "Broseker, Gregory S" <[email protected]>, Author <[email protected]>
Subject: Re: [tttapa/Control-Surface] 16 button 4 potentiometer midi controller transposer (#412)
[EXTERNAL EMAIL]
Please report any suspicious attachments, links, or requests for sensitive information to [email protected]
It should work on an Uno if you have enough RAM. Control Surface requires quite a bit of memory. The Arduino IDE will tell you how much RAM your sketch uses, Control Surface doesn't use any heap allocation in most cases, so checking the static memory gives a good estimate of the actual memory usage. You will need at least some free RAM for the stack, though.
The Arduino Uno is listed in the supported boards<https://github.com/tttapa/Control-Surface#supported-boards>, if an example supports the AVR architecture, it supports the Arduino Uno.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#412 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIPUHUVXUPIB32SEADHPXQDTBLCMDANCNFSM4YKSNTFQ>.
|
Beta Was this translation helpful? Give feedback.
-
Your transposer class is great many props to u!! I've been stressing over these midi banks for a month haha
…-------- Original message --------
From: Pieter P <[email protected]>
Date: 2/28/21 5:52 PM (GMT-05:00)
To: tttapa/Control-Surface <[email protected]>
Cc: "Broseker, Gregory S" <[email protected]>, Author <[email protected]>
Subject: Re: [tttapa/Control-Surface] 16 button 4 potentiometer midi controller transposer (#412)
[EXTERNAL EMAIL]
Please report any suspicious attachments, links, or requests for sensitive information to [email protected]
It should work on an Uno if you have enough RAM. Control Surface requires quite a bit of memory. The Arduino IDE will tell you how much RAM your sketch uses, Control Surface doesn't use any heap allocation in most cases, so checking the static memory gives a good estimate of the actual memory usage. You will need at least some free RAM for the stack, though.
The Arduino Uno is listed in the supported boards<https://github.com/tttapa/Control-Surface#supported-boards>, if an example supports the AVR architecture, it supports the Arduino Uno.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#412 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIPUHUVXUPIB32SEADHPXQDTBLCMDANCNFSM4YKSNTFQ>.
|
Beta Was this translation helpful? Give feedback.
-
The warning just says low memory stability issues may occur but its 76% so hopefully its fine
Sent via the Samsung Galaxy S9, an AT&T 5G Evolution capable smartphone
…-------- Original message --------
From: Pieter P <[email protected]>
Date: 2/28/21 6:30 PM (GMT-05:00)
To: tttapa/Control-Surface <[email protected]>
Cc: "Broseker, Gregory S" <[email protected]>, Author <[email protected]>
Subject: Re: [tttapa/Control-Surface] 16 button 4 potentiometer midi controller transposer (#412)
[EXTERNAL EMAIL]
Please report any suspicious attachments, links, or requests for sensitive information to [email protected]
Unfortunately, removing the headers and the extra code won't save any RAM.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#412 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AIPUHUUDIKFQPCV4K7ILSCLTBLGYZANCNFSM4YKSNTFQ>.
|
Beta Was this translation helpful? Give feedback.
The pin numbers you're using are not correct. A 4-bit multiplexer has 16 channels, which you can access using
mux1.pin(0)
throughmux1.pin(15)
. If you haven't already, have a look at the Getting Started guide.The order of the declarations doesn't matter, only which address is associated with each pin.