|
Post by Admin on Sept 15, 2015 6:48:20 GMT
HI,
It would nice if you can show us your build...
Regards,' Lawrence
|
|
kel
New Member
Posts: 4
|
Post by kel on Sept 17, 2015 1:27:12 GMT
Hi Lawrence, Congrats to you with this neat site. Question about the schematic of your midi controller, how do i implement this part of the circuit? Cheers!
|
|
|
Post by Admin on Sept 17, 2015 6:16:32 GMT
HI, S6 is actually another one like the s1 - s5 but since no special processing is needed to show if it ON/OFF I directly connected it to a switch which would switch two channels at the same time hence the term DPDT (Double pole double throw). This switch not only pulls S6 high or Low but also switches the LED ON and OFF (thus freeing one output port on the Arduino). This is DPDT switch.
|
|
kel
New Member
Posts: 4
|
Post by kel on Sept 17, 2015 7:52:43 GMT
Great!
Will post my build once i get hold with that specific switch.
Cheers!
|
|
|
Post by jpadua on Sept 20, 2015 1:06:12 GMT
finished basic enclosure no paint yet . still have to finish the wiring used momentary switches for changing presets and used a 3pdt switch to change to bank2. Planning on programming a long press on switch one to access the tuner with mute turned on
|
|
|
Post by jpadua on Sept 20, 2015 7:41:38 GMT
Hi lawrence it works! Although i noticed a delay of about 2seconds when pressing the different momentary switches. Any idea?
|
|
|
Post by Admin on Sept 20, 2015 11:04:26 GMT
Jay.. Awesome job on the build.
To fix the issue of the delay -
There was fix sent by Antonio... void loop() {
if(!(Usb.getUsbTaskState() == USB_STATE_RUNNING)) { digitalWrite(LED,HIGH); delay(500); digitalWrite(LED,LOW); delay(500); Usb.Task(); byte Start[2]; Start[0]=0xFA; Start[1]=0x00; Midi.SendData(Start); delay(10); } else ..... ..... .....
|
|
|
Post by jpadua on Sept 20, 2015 15:07:15 GMT
hi lawrence, thanks for the fix ill try to update the code tomorrow. just a quick video of the midi switch in action youtu.be/5MrbwKKmgLg
|
|
|
Post by Admin on Sept 21, 2015 1:41:43 GMT
Awesome work Jay....
|
|
|
Post by jpadua on Sept 21, 2015 4:05:32 GMT
Thanks Lawrence! By the way I'm using a sparkfun USB Host Shield. Maybe this is why there is that 2 second delay when changing patches in the beginning. It's possible that the USB host shield im using may have not initialized yet. I found this bit of code. //Revision 1.2 (DEV-09628) - for sparkfun host shield to work #define MAX_RESET 8 //MAX3421E pin 12 #define MAX_GPX 7 //MAX3421E pin 17 Revision 1.3 (DEV-09947) #define MAX_RESET 7 //MAX3421E pin 12 #define MAX_GPX 8 //MAX3421E pin 17 //initialization needed by sparkfun usb host pinMode(MAX_GPX, INPUT); pinMode(MAX_RESET, OUTPUT); digitalWrite(MAX_RESET, LOW); delay(20); //wait 20ms digitalWrite(MAX_RESET, HIGH); delay(20); //wait 20ms I'll also try that delay fix you posted. What exactly would it address? check USB connection to the Zoom? Although since my usb programming port broke, I can't upload to the board until I replace the USB port on the arduino It would have to wait.
|
|
|
Post by jpadua on Sept 21, 2015 4:13:43 GMT
Hi Lawrence,
I tried to compile the code fix for the delay, but I'm getting an error because LED is not defined. What do I define under LED?
void loop() {
if(!(Usb.getUsbTaskState() == USB_STATE_RUNNING)) { digitalWrite(LED,HIGH); delay(500); digitalWrite(LED,LOW); delay(500); Usb.Task(); byte Start[2]; Start[0]=0xFA; Start[1]=0x00; Midi.SendData(Start); delay(10); } else ..... ..... .....
|
|
|
Post by Admin on Sept 21, 2015 4:19:14 GMT
You can change it to outPinErr
|
|
|
Post by jpadua on Sept 28, 2015 7:11:21 GMT
You can change it to outPinErr Thank Lawrence, will try that! By the way, I'm trying to add a long press function on switch 1 and send tuner on and tuner off in mute mode. How do I create a long press function and where should I place it? does it have to be in the loop routine of the regular foot switch or I can just create a completely new function for long press? will this interfere with the existing if statements for the regular switching? Ex. //Tuner Setup long press = 2000; // long press time in milliseconds (2 seconds) int tunerstate = 0; // tuner off state 0 on state 1 byte TunerOn = 0x7F; // set the value for tuner on (127) byte TunerOff = 0x0; // set the value for tuner off (0) if (reading1 == HIGH && tunerstate == 0 && millis() - time > press) { // Send program change for tunerOn SendMIDITuner(TunerOn); tunerstate = 1; time = millis(); } else { if (reading1 == HIGH && tunerstate == 1 && millis() - time > press { // Send program change for tunerOff SendMIDITuner(TunerOff); tunerstate = 0; time = millis(); } void SendMIDITuner(byte number) { Usb.Task(); if( Usb.getUsbTaskState() == USB_STATE_RUNNING ) { byte Message[2]; // Construct the midi message (2 bytes) Message[0] = 0x4a; //control change mode (74) tuner with mute (75) for tuner with bypass Message[1] = number; //value Midi.SendData(Message); // Send the message delay(10); } else { digitalWrite(outPinErr, HIGH); delay (500); digitalWrite(outPinErr, LOW); delay (500); digitalWrite(outPinErr, HIGH); delay (500); digitalWrite(outPinErr, LOW); delay (500); digitalWrite(outPinErr, HIGH); delay (500); digitalWrite(outPinErr, LOW); } }
|
|
|
Post by jpadua on Sept 28, 2015 7:54:08 GMT
Added For loop to blink the LED 1 on and off during tuner operation
if (reading1 == HIGH && tunerstate == 0 && millis() - time > press) { // Send program change for tunerOn //to Send Tuner on SendMIDITuner(TunerOn); tunerstate = 1; for (tunerstate = 1){ digitalWrite(outPin1, HIGH); delay(500); digitalWrite(outPin1, Low); delay(500); } time = millis(); } else { if (reading1 == HIGH && tunerstate == 1 && millis() - time > press { //to send tuner off SendMIDITuner(TunerOff); tunerstate = 0; for (tunerstate = 0){ digitalWrite(outPin1, Low); delay(500); } time = millis(); }
|
|
kel
New Member
Posts: 4
|
Post by kel on Sept 28, 2015 21:32:45 GMT
Thanks Lawrence! By the way I'm using a sparkfun USB Host Shield. Maybe this is why there is that 2 second delay when changing patches in the beginning. It's possible that the USB host shield im using may have not initialized yet. I found this bit of code. //Revision 1.2 (DEV-09628) - for sparkfun host shield to work #define MAX_RESET 8 //MAX3421E pin 12 #define MAX_GPX 7 //MAX3421E pin 17 Revision 1.3 (DEV-09947) #define MAX_RESET 7 //MAX3421E pin 12 #define MAX_GPX 8 //MAX3421E pin 17 //initialization needed by sparkfun usb host pinMode(MAX_GPX, INPUT); pinMode(MAX_RESET, OUTPUT); digitalWrite(MAX_RESET, LOW); delay(20); //wait 20ms digitalWrite(MAX_RESET, HIGH); delay(20); //wait 20ms I'll also try that delay fix you posted. What exactly would it address? check USB connection to the Zoom? Although since my usb programming port broke, I can't upload to the board until I replace the USB port on the arduino It would have to wait. Hi Jpadua, Having the same problem you just fixed. Can you please share on what part of the code did you put the initialization? Really appreciate it if you can provide the whole code. Cheers!
|
|