celticpure / katbox-midi Goto Github PK
View Code? Open in Web Editor NEWBLE Midi Controller for Katana Librarian.
License: GNU General Public License v3.0
BLE Midi Controller for Katana Librarian.
License: GNU General Public License v3.0
Hi Rory
This compiles - no idea if it will work!
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Fonts/FreeSans9pt7b.h>
// Control Surface:
#include <Control_Surface.h>
#include <AH/Hardware/MultiPurposeButton.hpp> //FOR USING MULTIPURPOSE BUTTON FUNCTION
BluetoothMIDI_Interface midi; //TYPE OF INTERFACE USED TO COMMUNICATE
// DISPLAY:
Adafruit_SSD1306 display(-1);
MultiPurposeButton btn1{15}; //BTN No.1
MultiPurposeButton btn2{19}; //BTN No.2
MultiPurposeButton btn3{4}; //BTN No.3
MultiPurposeButton btn4{5}; //BTN No.4
int new_button, old_button;
char str_buf[30];
void btn_disp(){
if (new_button != old_button) {
old_button = new_button;
display.fillRect(0, 40, 100, 40, BLACK);
sprintf(str_buf, "PATCH %d", new_button);
display.setCursor(0, 40);
display.print(str_buf);
display.display();
}
}
void multibtn()
{
switch (btn1.update()) { //BTN No.1
case btn1.PressStart:
Control_Surface.sendControlChange({MIDI_CC::General_Purpose_Controller_1, CHANNEL_1}, 0);
new_button = 1;
break;
case btn1.LongPress:
Control_Surface.sendControlChange({MIDI_CC::General_Purpose_Controller_2, CHANNEL_1}, 0);
new_button = 1;
break;
}
switch (btn2.update()) { //BTN No.2
case btn2.PressStart:
Control_Surface.sendControlChange({MIDI_CC::General_Purpose_Controller_3, CHANNEL_2}, 0);
new_button = 2;
break;
case btn2.LongPress:
Control_Surface.sendControlChange({MIDI_CC::General_Purpose_Controller_4, CHANNEL_2}, 0);
new_button = 2;
break;
}
switch (btn3.update()) { //BTN No.3
case btn3.PressStart:
Control_Surface.sendControlChange({MIDI_CC::General_Purpose_Controller_5, CHANNEL_3}, 0);
new_button = 3;
break;
case btn3.LongPress:
Control_Surface.sendControlChange({MIDI_CC::General_Purpose_Controller_6, CHANNEL_3}, 0);
new_button = 3;
break;
}
switch (btn4.update()) { //BTN No.4
case btn4.PressStart:
Control_Surface.sendControlChange({MIDI_CC::General_Purpose_Controller_7, CHANNEL_4}, 0);
new_button = 4;
break;
case btn4.LongPress:
Control_Surface.sendControlChange({MIDI_CC::General_Purpose_Controller_8, CHANNEL_4}, 0);
new_button = 4;
break;
}
}
void setup() {
Serial.begin (9600); // initialize serial communication:
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C
display.clearDisplay(); // Clear the buffer.
display.setFont(&FreeSans9pt7b); // Set Font
Control_Surface.begin(); // Set Control Surface
btn1.setLongPressDelay(1000);
btn2.setLongPressDelay(1000);
btn3.setLongPressDelay(1000);
btn4.setLongPressDelay(1000);
btn1.setMultiPressDelay(400);
btn2.setMultiPressDelay(400);
btn3.setMultiPressDelay(400);
btn4.setMultiPressDelay(400);
btn1.begin();
btn2.begin();
btn3.begin();
btn4.begin();
display.setTextColor(WHITE, BLACK);
display.setCursor(0, 15);
display.println("KATBOX MIDI");
display.display();
old_button = 0;
new_button = 0;
}
void loop() {
Control_Surface.loop();
multibtn();
btn_disp();
}
Open to develop.......
I want to explore the option of having a particular button press - say hold a button down for a defined period. To activate another function for the patch buttons to change MOD, BOOST and REVERB on the Katana by Midi Commands.
However, ideally what would be great, if the KATBOX-MIDI could read the Boss Katana amp for its initial settings. From what I can determine that can be only done via Midi over USB.
If the Control Surface Library could read the Boss Katana Librarian app for its settings that it reads from the Katana amp then this could be an option. But I cannot find any reference that this can be done.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.