Giter VIP home page Giter VIP logo

Comments (6)

tttapa avatar tttapa commented on May 24, 2024

Hi Paul,

I added the necessary classes and a simple example. The four buttons select four piano voices when the first bank is selected, four organ voices when the second bank is selected, and four guitar/bass voices when the third bank is selected. Did I understand your question correctly?

from control-surface.

pauldev20 avatar pauldev20 commented on May 24, 2024

Hi tttapa,
thank you very much for making that possible and for the fast response. So thats almost what I was looking for. The only other thing now what I don't understand is, how can I send a serial PC command? I understood how to Set the Midi Output to serial but I didn't understand how to send a PC Command in Serial and how to Set the MIDI Channel for that PC command. Sorry for asking so silly questions.

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

You can change the channel like this:

Bankable::ManyAddresses::PCButton<3> pcbuttons[]{
  {bank,
   2, // pin
   {{
     {Acoustic_Grand_Piano, CHANNEL_7},
     {Church_Organ, CHANNEL_4},
     {Acoustic_Guitar_Nylon, CHANNEL_11},
   }}},
  {bank,
   3, // pin
   {{
     {HonkyTonk_Piano, CHANNEL_13},
     {Rock_Organ, CHANNEL_1},
     {Distortion_Guitar, CHANNEL_16},
   }}},
  // ...
};

To manually send PC commands, you can do the following:

#include <Control_Surface.h>

HardwareSerialMIDI_Interface midi(Serial1, MIDI_BAUD);

using namespace MIDI_PC;

const uint8_t programs[] = { 
  Acoustic_Grand_Piano, 
  Church_Organ, 
  Electric_Bass_Pick, 
};

void setup() {
  midi.begin();
}

void loop() {
  for (uint8_t program : programs) {
    midi.sendPC(CHANNEL_1, program);
    delay(500);
  }
}

from control-surface.

pauldev20 avatar pauldev20 commented on May 24, 2024

Thank you again for the quick response. I don't know if you understood my second question. I want to use the PCButton command to send a PC (0,1,2,3...) on a specific Channel over Serial Midi. I tried to change the code that way. Will that code work ?

#include <Control_Surface.h>

HardwareSerialMIDI_Interface midi(Serial, MIDI_BAUD);

Bank<3> bank(4);
IncrementDecrementSelector<3> bankSelector = {bank, {A0, A1}, Wrap::Wrap};

using namespace MIDI_PC;

Bankable::ManyAddresses::PCButton<3> pcbuttons[] = {
  {bank,
   2, // pin
   {{
     {0, CHANNEL_1},
     {1, CHANNEL_1},
     {2, CHANNEL_1},
   }}},
  {bank,
   3, // pin
   {{
     {3, CHANNEL_1},
     {4, CHANNEL_1},
     {5, CHANNEL_1},
   }}},
  {bank,
   4, // pin
   {{
     {6, CHANNEL_1},
     {7, CHANNEL_1},
     {8, CHANNEL_1},
   }}},
  {bank,
   5, // pin
   {{
     {9, CHANNEL_1},
     {10, CHANNEL_1},
     {11, CHANNEL_1},
   }}},
};

void setup() {
  Control_Surface.begin();
}

void loop() {
  Control_Surface.loop();
}

from control-surface.

tttapa avatar tttapa commented on May 24, 2024

That looks fine, at first glance.

from control-surface.

pauldev20 avatar pauldev20 commented on May 24, 2024

Okay, thank you for your help.

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.