Coder Social home page Coder Social logo

Comments (27)

tttapa avatar tttapa commented on July 20, 2024

The MIDI controller doesn't support this, but you can use the Control Surface library.

Be sure to use the revision-4 branch until further notice.
It's not finished yet, but it should compile and work.

https://github.com/tttapa/Control-Surface/blob/revision-4/examples/MIDIOutput/PushButtonsLEDs/PushButtonsLEDs.ino

from control-surface.

pandeagus avatar pandeagus commented on July 20, 2024

IM SORRY IM ASKING YOU AGAIN..
I GET ERROR WHEN COMPILE THIS CODE

image

from control-surface.

pandeagus avatar pandeagus commented on July 20, 2024

Sorry
after I enter several libraries from the adafruit error the compile is gone. i try code from you but the leds still don't turn on. did I make a mistake? I've led the series to ground.

from control-surface.

tttapa avatar tttapa commented on July 20, 2024

I'm sorry about the error, I have to remove the Adafruit depenencies when I do an official release.

The LED relies on the software on the other side to turn it on or off. For example, if you have a DJ or digital audio workstation on your computer, the LED will also turn on if you click the button on your computer.

What software are you using?

from control-surface.

pandeagus avatar pandeagus commented on July 20, 2024

from control-surface.

tttapa avatar tttapa commented on July 20, 2024

Sadly, Amplitube doesn't support MIDI feedback. (source)
This means that the Arduino can never know the state of the effects.
The only thing you can do is keep the state on the Arduino, but if you enable the effect using your computer, or when it was already on when you plugged in the Arduino, the LED will always be wrong.

If you want the LED to work correctly, you'll have to wait for Amplitube to fully support MIDI controllers, or use different software.

from control-surface.

tttapa avatar tttapa commented on July 20, 2024

I updated the Control Surface library, there's now an example that shows how to keep the states of the LEDs on the Arduino only.

It compiles successfully on Arduino 1.8.5, but I haven't tested it yet.

https://github.com/tttapa/Control-Surface/blob/master/examples/MIDIOutput/PushButtonsLEDsNoMIDIFeedback/PushButtonsLEDsNoMIDIFeedback.ino

from control-surface.

pandeagus avatar pandeagus commented on July 20, 2024

from control-surface.

pandeagus avatar pandeagus commented on July 20, 2024

midi ox result

from control-surface.

tttapa avatar tttapa commented on July 20, 2024

According to the Bias FX documentation, using just Control Change should work.

Did you manage to get the LEDs working?

from control-surface.

tttapa avatar tttapa commented on July 20, 2024

I have an exam tomorrow, so I can't really help you today.
Feel free to post any questions you have, but I won't be able to answer before tomorrow 17:00 CET.

from control-surface.

pandeagus avatar pandeagus commented on July 20, 2024

Thank for the bias fx documentation.. I tried it using an example from the ProgramChanger from library but it didn't work. and i dont know why. can you give me clue ?

and for the LED i just try make new function code like this . its working but sometime little slow respons
for On LEd. and i dont why.. but its okay

void LEDswitch1 (){
int val1 = 0;
int ledOn1 = 0;
int pushed1 = 0;

val1 = digitalRead(switch1);

if (val1 == HIGH && ledOn1 == LOW){
pushed1 = 1-pushed1;
delay(5);
}
ledOn1 = val1;
if(pushed1 == HIGH){
Serial.println("led1 OFF");
digitalWrite(led1, LOW);
} else{
Serial.println("led1 ON");
digitalWrite(led1, HIGH);
}
delay(5);

}

from control-surface.

tttapa avatar tttapa commented on July 20, 2024

I don't know why the ProgramChanger doesn't work, last time I tested it, it worked, but I've made some changes after that, so I could have messed it up somehow. (The channel could be wrong, I think.)

Does the program changer show anything in MIDIOX? Did you connect the push buttons correctly (pins 5 & 6 via a push button to ground)?

I'll write you a better LED sketch tomorrow.

from control-surface.

tttapa avatar tttapa commented on July 20, 2024

466a0e9

from control-surface.

pandeagus avatar pandeagus commented on July 20, 2024

image

hello brother i get error when try your example PushButtonsLEDsNoMIDIFeedback.ino.
how to solve?

from control-surface.

tttapa avatar tttapa commented on July 20, 2024

I'm sorry, I later added another commit where I used the standard library, which is not available on AVR, and I forgot to exclude it when compiling for AVR.

It should be fixed now: dd8e138

from control-surface.

pandeagus avatar pandeagus commented on July 20, 2024

hello.. can you give me example using 74HC4051 multiplexer with 8 button
change MIDI CC and MIDI NOTE using your library.
im sorry i ask many thing to you.
thank you..

from control-surface.

tttapa avatar tttapa commented on July 20, 2024

Did you see the Getting Started page and the example that goes with it?

from control-surface.

pandeagus avatar pandeagus commented on July 20, 2024

image

i get error when getting start using 8 button.. i just want make usb midi with multiplexer 4051 control
8 button can MIDI CC - MIDI NOTE together and 8 potentiometer and 8 led indicator switch..

im sorry bother you...
thanks

from control-surface.

tttapa avatar tttapa commented on July 20, 2024

Digital has been replaced by NoteButton. You cannot use the old MIDI Controller classe, they have been replaced by improved versions with a different name.

The documentation for all of these classes can be found here: https://tttapa.github.io/Control-Surface/Doc/Doxygen/d7/dcd/group__MIDIOutputElements.html

from control-surface.

tttapa avatar tttapa commented on July 20, 2024

If you really want to send both notes and CC at the same time (I still don't understand why it's necessary), you can instantiate a NoteButton and a CCButton on the same pin.

Alternatively, use this with the latest version of the library:

// Include the Control Surface library
#include <Control_Surface.h>

class DigitalNoteAndCCSender {
  public:
    static void sendOn(MIDICNChannelAddress address) {
      Control_Surface.MIDI().sendNoteOn(address, velocity);
      Control_Surface.MIDI().sendCC(address, onValue);

    }
    static void sendOff(MIDICNChannelAddress address) {
      Control_Surface.MIDI().sendNoteOff(address, velocity);
      Control_Surface.MIDI().sendCC(address, offValue);
    }
    constexpr static uint8_t velocity = 0x7F;
    constexpr static uint8_t onValue = 127;
    constexpr static uint8_t offValue = 0;
};

using NoteAndCCButton = MIDIButton<DigitalNoteAndCCSender::sendOn, 
                                   DigitalNoteAndCCSender::sendOff>;

// Instantiate a MIDI over USB interface.
USBMIDI_Interface midi;

using namespace MIDI_Notes;

// Instantiate the momentary push buttons that send out 
// MIDI Note and CC events.
NoteAndCCButton buttons[] = {
  {2, note(C, 4)}, // digital input pin, note number
  {3, note(Db, 4)},

  // If you want to set the channel specifically, you can use:
  // {2, {note(C, 4), CHANNEL_1}},
};

void setup() {
  // Initialize everything
  Control_Surface.begin();
}

void loop() {
  // Update the control surface
  Control_Surface.loop();
}

from control-surface.

pandeagus avatar pandeagus commented on July 20, 2024

I am very lucky because you helped me in working on this project. and for that I thank you. and you are the best teacher in teaching me about midi controllers. and about MIDI CC and MIDI NOTE it's complete thanks to all your help. maybe later I will ask you more about the midi controller and I hope you don't get bored by answering my questions.

from control-surface.

tttapa avatar tttapa commented on July 20, 2024

No worries. Glad to hear you got it working!

from control-surface.

guillecip avatar guillecip commented on July 20, 2024

In the example of button with led once you push the button the led is always on.
Can we turn off the led in a toggle funcion? For example in Traktor if a turn on a FX a light in the screen turn on. When I turn off the FX the screen turn off. Can I do these with an external LED?

from control-surface.

masydoblig avatar masydoblig commented on July 20, 2024

from control-surface.

guillecip avatar guillecip commented on July 20, 2024

Yes, just like that.

from control-surface.

masydoblig avatar masydoblig commented on July 20, 2024

from control-surface.

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.