VGuitar Wireless Midi Controller project

Started by gumtown, February 24, 2013, 05:32:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gumtown

continued as a spin off from this discussion..
https://www.vguitarforums.com/smf/index.php?topic=7946.0

As part of the GK-IO project and also stand alone in it's own right is the Wireless guitar controller project.
A micro controller (pic16f687) which gives 6 push-buttons, 6 analog variable controls (knobs, joystick, or motion sensor), and a fender style 5 way or Gibson style 3 way pickup selector switch, all which will send wireless to a small floorbox receiver.
The floorbox will have options for more push-button/foot switch and analog/EXP pedal controls, and all outputting (cc#) continuous controlller data to your GR or VG (or any other midi device) via a stansard 5 pin midi output.

The floorbox receiver for the GK-IO project will be an optional plug-in internal card, then both projects can utilise the same standard hardware controller in the guitar.
Being wireless saves the user from having to modify any GK equipment.

The guitar sender unit will be of minimal component count (3 components- pic, tx module, and 5v regulator)

allowing users to add their own wiring to push buttons, pots, and switches.
The beauty of the pic16f687 is the crystal, pull-up resistors, A/D converters, UART, etc are all internal.

They (switches/pb's etc) will all be ground referenced, allowing a common wire between them all, switches and push-buttons switching to ground, and all the pots +5 volt/ground referenced.

With a bit of optimism, the floor unit will have a midi input and be able to interface with a editor software to set up cc# assignments and substitute cc# values with system exclusive (sysx) data to save the use a assigns in your GR/VG.

More to come....
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

musicman65

That's a pretty innovative and ambitious project scope!...I like it. :) I'll be watching with interest.

bd

Elantric

I like it.
Maybe I can contribute by designing a pc board set.

gumtown

#3
Hopefully most of the parts will arrive today for a prototype build on stripboard (veroboard).
I have pretty much done the code for the transmitter unit,
with 13 controllers, the unit starts up, sends all the controllers at the current status, then senses if a change has occured in any of the 13 controllers, if not do nothing or else send that controller data.

Here is the guitar controller code, included is an 8bit "keycode" to prevent spurious controller activity from random noise and interferance.
data sent is keycode+controller number+data value.

###############################################################################

/*****************************************************************
/*** Wireless guitar midi controller transmitter
/*****************************************************************

#include <htc.h>
#include <pic.h>
#define   XTAL_FREQ 4MHZ      /* Crystal frequency in MHz */
#include "delay.h"

// ============================================================
// I/O definitions
// ============================================================
#define _PB_1       RA0   //push button 1
#define _PB_2       RA1   //push button 2
#define _PB_3       RA2   //push button 3
#define _PB_4       RA3   //push button 4
#define _PB_5       RA4   //push button 5
#define _PB_6       RA5   //push button 6
#define _5WAY_SW_1  RB4   //5 way PU selector switch - neck
#define _5WAY_SW_2  RB5   //5 way PU selector switch - mid
#define _5WAY_SW_3  RB6   //5 way PU selector switch - bridge
#define _Analog_1   AN4 //Analog 1 input 0~5v
#define _Analog_2   AN5 //Analog 2 input 0~5v
#define _Analog_3   AN6 //Analog 3 input 0~5v
#define _Analog_4   AN7 //Analog 4 input 0~5v
#define _Analog_5   AN8 //Analog 5 input 0~5v
#define _Analog_6   AN9 //Analog 6 input 0~5v
#define TX_Power    RC4 //power switch for Tx module to save power draw

/**************************************************************
|                   Initialise System
***************************************************************/

void System_init(void){
   
   PORTA = 0x00;      //init port latches prior to switching to output mode
   PORTB = 0x00;
   PORTC = 0x00;

   GIE = 0;      // Global interrupt disable
   TRISA = 0b111111;
   TRISB = 0b01111111;
   TRISC = 0b11101111;    //set portc as in & out port
   RABPU = 0;           // enable port A/B weak pullups
   WPUA0 = 1;
   WPUA1 = 1;
   WPUA2 = 1;
   ANSEL = 0b11110000;  // port A & B all digital I/O port C analogs enabled
   ANSELH = 0b1111;     // port C analogs enabled
   ADCON1 = 0b01010000; // select Fosc/16
   ADCON0 = 0;            // select left justify result. A/D port configuration 0
   ADON = 1;           // turn on the A2D conversion module
   
   SPBRG = 51;   // Setup the UART 1200 baud rate   
   BRGH = 0;     // High speed baud rate
   BRG16 = 0;    // Not using 16 bit mode
    SYNC = 0;     // Synch or Async
   TX9 = 0;      // 8bit transmission   
   SPEN = 1;     // Enable serial output   
   TXEN = 1;     // Enable UART out

}

/**************************************************************
                      Main Program
**************************************************************/
int status_check;
int _5WAY_SW_check;
int _PB_1_check;
int _PB_2_check;
int _PB_3_check;
int _PB_4_check;
int _PB_5_check;
int _PB_6_check;
unsigned int _Analog_1_value;
unsigned int _Analog_2_value;
unsigned int _Analog_3_value;
unsigned int _Analog_4_value;
unsigned int _Analog_5_value;
unsigned int _Analog_6_value;
void button_scan();
void analog_scan();
unsigned char read_a2d(int channel);
void send_data(int controller, int value);
void uart_out(int data);


void main(void)
{
   System_init();
   double time;
   
   while(1){   
      //DelayMs(500);
      //TX_Power = 1;      //switch on Tx module
      //DelayMs(500);
   //   TX_Power = 0;    // switch off Tx module   
            button_scan();
            time=time+1;
            if(time > 200 ){time=0; analog_scan(); };
         }
}

void button_scan()
{
   int x;
   int y;
   int z;
   int sw_value;
   x=_PB_1;      // copy the push button value of _PB_1
      if(_PB_1_check!=x){ _PB_1_check=x; if(x>0){x=127; }; send_data(1, x); };
   x=_PB_2;      // copy the push button value of _PB_2
      if(_PB_2_check!=x){ _PB_2_check=x; if(x>0){x=127; }; send_data(2, x); };
   x=_PB_3;      // copy the push button value of _PB_3
      if(_PB_3_check!=x){ _PB_3_check=x; if(x>0){x=127; }; send_data(3, x); };
   x=_PB_4;      // copy the push button value of _PB_4
      if(_PB_4_check!=x){ _PB_4_check=x; if(x>0){x=127; }; send_data(4, x); };
   x=_PB_5;      // copy the push button value of _PB_5
      if(_PB_5_check!=x){ _PB_5_check=x; if(x>0){x=127; }; send_data(5, x); };
   x=_PB_6;      // copy the push button value of _PB_6
      if(_PB_6_check!=x){ _PB_6_check=x; if(x>0){x=127; }; send_data(6, x); };
   x=_5WAY_SW_1;
   y=_5WAY_SW_2;
   z=_5WAY_SW_3;   
   if(x==1 && y==0 && z==0) {sw_value = 1; };
   if(x==1 && y==1 && z==0) {sw_value = 2; };   
   if(x==0 && y==1 && z==0) {sw_value = 3; };   
   if(x==0 && y==1 && z==1) {sw_value = 4; };
   if(x==0 && y==0 && z==1) {sw_value = 5; };
  if(sw_value!= _5WAY_SW_check) { _5WAY_SW_check=sw_value; send_data(13, sw_value); };
}

void analog_scan()
{
   int x;
   x=read_a2d(4)/2;      // sample the analog value of AN4 - Analog_1
      if(_Analog_1_value!=x){ _Analog_1_value=x; send_data(7, _Analog_1_value); };
   x=read_a2d(5)/2;      // sample the analog value of AN5 - Analog_2
      if(_Analog_2_value!=x){ _Analog_2_value=x; send_data(8, _Analog_2_value); };
   x=read_a2d(6)/2;      // sample the analog value of AN6 - Analog_3
      if(_Analog_3_value!=x){ _Analog_3_value=x; send_data(9, _Analog_3_value); };
   x=read_a2d(7)/2;      // sample the analog value of AN7 - Analog_4
      if(_Analog_4_value!=x){ _Analog_4_value=x; send_data(10, _Analog_4_value); };
   x=read_a2d(8)/2;      // sample the analog value of AN8 - Analog_5
      if(_Analog_5_value!=x){ _Analog_5_value=x; send_data(11, _Analog_5_value); };
   x=read_a2d(9)/2;      // sample the analog value of AN9 - Analog_6
      if(_Analog_6_value!=x){ _Analog_6_value=x; send_data(12, _Analog_6_value); };
}

unsigned char read_a2d(int channel){
   if(channel>7) { CHS3 = 1; } else {CHS3 = 0; };     // apply the new channel select
   if(channel<8) { CHS2 = 1; } else {CHS2 = 0; };
   if((channel==6)||(channel==7)) { CHS1 = 1; } else {CHS1 = 0; };
   if((channel==5)||(channel==7)||(channel==9)) { CHS0 = 1; } else {CHS0 = 0; };
   /*CHS0 = channel,0;     // apply the new channel select
   CHS1 = channel,1;
   CHS2 = channel,2;
   CHS3 = channel,3;*/
   GODONE =1;  // initiate conversion on the selected channel
   DelayMs(5);
   while(GODONE)continue;
   return(ADRESH);   // return 8 MSB of the result
}

void send_data(int controller, int value)
{
   TX_Power = 1;      //switch on Tx module
   DelayMs(20);
   int keycode = 178; //10110010 prevent random triggers from noise
   uart_out(keycode);
   uart_out(controller);
   uart_out(value);
   DelayMs(5);
   TX_Power = 0;    // switch off Tx module
}   

void uart_out(int data)
{
   TXREG = data;
   DelayMs(5);
   while(!TXIF);
}   

*******************************************************************************

Note: the code will be updated as changes are made..
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

gumtown

#4
Here is something interesting as an onboard guitar joystick controller

http://nz.mouser.com/ProductDetail/ALPS/RKJXP1224002/?qs=sGAEpiMZZMsFLoxuNbFfpZShZwK%2fk0zKNkNMXy5dhhA%3d
Full 360 degrees variable 2 x potentiometers plus centre click button, and it's really small and finally one with no center return (it stays where you leave it).


Now wouldn't it be funny to add wireless hexaphonic pitch to 5-pin midi as well, (just kidding), but it is possible, I think the results would not be that great (probably compared to a GR700 - but then i have done it before as monophonic).
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

cell7

wow i want this! not sure if there is any way i can contribute.. perhaps in the logo/branding? :o)

Machh_2

Quote from: gumtown on February 25, 2013, 02:05:45 AM
Here is something interesting as an onboard guitar joystick controller

http://nz.mouser.com/ProductDetail/ALPS/RKJXP1224002/?qs=sGAEpiMZZMsFLoxuNbFfpZShZwK%2fk0zKNkNMXy5dhhA%3d
Full 360 degrees variable 2 x potentiometers plus centre click button, and it's really small and finally one with no center return (it stays where you leave it).


Now wouldn't it be funny to add wireless hexaphonic pitch to 5-pin midi as well, (just kidding), but it is possible, I think the results would not be that great (probably compared to a GR700 - but then i have done it before as monophonic).

Video games controles uses this devices...easy to find...

Elantric


musicman65

I am really digging the micro joystick idea. Wow, the practical possibilities that would provide instead of 2 expression pedals (which I am hesitant to assign on my pedalboard for controllers since I use Volume/Wah/CC#7 all the time)

bd

Elantric

#9
QuoteI am really digging the micro joystick idea.

Me too!

Seems the Micro-Robotics guys from Robotshop, ADAFruit and SparkFun (and Create Magazine) have sources for these.
http://www.robotshop.com/2-axis-playstation-joystick-2.html

This one is $1.99 includes Joystick button cap.







The PowerGig guitar might be another good source of parts too

https://www.vguitarforums.com/smf/index.php?topic=3115.0



(Already has a Gibson PAF Size Hex divided PU too)


They move up and down by $50 each week at Amazon- watch this link time to time, but wait and get one for $40
http://www.amazon.com/gp/product/B003N13ZRI/ref=olp_product_details?ie=UTF8&me=&seller=

and
http://www.amazon.com/Power-Gig-SixString-Guitar-Playstation-3/dp/B003N1639A/ref=pd_sim_vg_1

ploveday

One of the things I was intending to do with my similar (but wired) project was play with capacitive controllers.

I think this particular PIC does also have capacitive touch sensing, which would give us some possibilities to play with those.. perhaps a touch strip (like a ribbon controller, but not quite..), or whatever really.

Should be fun, I think.

- Peter

vanceg

This looks like a really great project! 

I would seriously consider investing in a system like this.

Are you familiar with these boards?
http://infusionsystems.com/catalog/product_info.php/products_id/98

This product is one I considered placing in one of my last guitar designs but I opted for a wired solution.  One reason was that I didn't want to commit to using Blutooth and having to have a laptop on stage with me at the time.  Your concept is quite compelling as it doesn't necessarily rely on a standard being kept up by other parties (like the makers of laptops...who will undoubtedly drop Blutooth at some point) since your system communicates guitar to pedal-board unit. 

For joysticks, I was very please with using the one that Visionary is using on this gutiar:
http://www.controllerism.com/moldover-and-visionary-instruments-team-up-for-the-robocaster

I can ask them what unit this is....


Elantric

QuoteOne reason was that I didn't want to commit to using Blutooth and having to have a laptop on stage with me at the tim
Get 2 of these and be platform independent.
Avantree® Saturn Bluetooth Audio Converter Adapter Transceiver - A2DP apt-x
https://www.vguitarforums.com/smf/index.php?topic=7019.0

gumtown

#13
****EDIT NOTE **** The receiver code below is continuously updated with the latest tweaks.
code updated 29/03/2013 - it is too large now to post in a thread, so it is now attached as a file...


Thanks for the suggestions and all, i think for now, just concentrate on making the basic plan 'work'.
Keep this open ended where the user can add their own buttons, joystick or or pots.

The receiver/floor box code is a little more involved, what i want it to do is receive the basic controller data from the guitar transmitter module,
then have the floor unit re-map the controller to a pre programmed control type (cc#, note, aftertouch, patch), midi channel, and controller number for each spearate controller.
The floor box will also have options to add 6 push buttons and 6 analog controls (pots or EXP pedals), again being software mapped to separate midi controllers.
The floor box will have 5 pin midi in and midi out, the midi in will echo midi data through, so other units can be chained (this is how all midi devices are supposed to work - but don't), the difficulty is constructing a circular FIFO buffer to merge the wireless and midi in data.
The box will also respond to it's own system exclusive data for controller setup via external midi editor software.
I have even built in it's own midi sysx ID request/reply system.
The code is far from finished, yet to do the input interupts, but here it is at the moment





//*************************************************************
//*** Wireless Guitar Receiver
//*** PIC16F689
//*** Colin Willcocks 
//*** Copyright 2013
//*************************************************************
#include <htc.h>
#include <pic.h>
#include <stdio.h>
#define   XTAL_FREQ 4MHZ      /* Crystal frequency in MHz to define delay timing */
#include "delay.h"

// ============================================================
// I/O definitions
// ============================================================
#define _PB_7        RA0   //push button 7
#define _PB_8        RA1   //push button 8
#define _PB_9        RA3   //push button 9
#define _PB_10       RA4   //push button 10
#define _PB_11       RA5   //push button 11
#define _PB_12       RB4   //push button 12
#define _PB_13       RB6   //push button 13
#define _PB_14       RC5   //push button 14
#define _Analog_7    AN4 //Analog 1 input 0~5v
#define _Analog_8    AN5 //Analog 2 input 0~5v
#define _Analog_9    AN6 //Analog 3 input 0~5v
#define _Analog_10   AN7 //Analog 4 input 0~5v
#define _Analog_11   AN8 //Analog 5 input 0~5v
#define _Analog_12   AN9 //Analog 6 input 0~5v
#define _Rx_in       RA2 //receiver mode on interupt pin
#define LED          RC4 //test switch for LED

//User data to preload to EEProm
  __EEPROM_DATA(0x30,0x50,0x30,0x51,0x30,0x52,0x30,0x53);    //PB1,    PB2,    PB3,    PB4,
  __EEPROM_DATA(0x30,0x54,0x30,0x55,0x30,0x56,0x30,0x57);    //PB5,    PB6,    AN1,    AN2,
  __EEPROM_DATA(0x30,0x58,0x30,0x59,0x30,0x5A,0x30,0x5B);    //AN3,    AN4,    AN5,    AN6,
  __EEPROM_DATA(0x30,0x5C,0x30,0x14,0x30,0x15,0x30,0x16);    //5WAY,   PB7,    PB8,    PB9,
  __EEPROM_DATA(0x30,0x17,0x30,0x18,0x30,0x19,0x30,0x1A);    //PB10,   PB11,   PB12,   PB13,
  __EEPROM_DATA(0x30,0x1B,0x30,0x1C,0x30,0x1D,0x30,0x1E);    //PB14,   AN7,    AN8,    AN9,   
  __EEPROM_DATA(0x30,0x1F,0x30,0x20,0x30,0x21,0x00,0x00);    //AN10,   AN11,   AN12,   toggle 
  __EEPROM_DATA(0x03,0x7F,0x04,0x01,0x00,0x00,0xFF,0xFF);    //P/Bk,   Pdl/ch, ch
 
  __CONFIG(FOSC_INTRCIO & BOREN_OFF & WDTE_ON & CP_ON & CPD_OFF & PWRTE_ON & MCLRE_OFF & FCMEN_OFF & IESO_OFF);
  __IDLOC7(0x43,0x6F,0x6C,0x7A);

/**************************************************************
|                   Initialise System
***************************************************************/

void System_init(void){
   
   PORTA = 0x00;      //init port latches prior to switching to output mode
//   PORTB = 0xFF;
   PORTC = 0x00;
   PSA = 0b0011;       // prescaler divide by 16
   T0CS = 0;         // select internal clock
   T0IE = 0;         //Timer 0 interupt enabled
   RCIE = 1;         //USART receive byte interupt enabled
   PEIE = 1;         //Periphiral interupt enabled (USART)
   GIE = 1;           // Global interrupt 1=enable
   TRISA = 0b111111;    //set port A as inputs
   TRISB = 0b01111111;  //set port B as inputs & uart output
   TRISC = 0b11101111;    //set port C as inputs & led out
   nRABPU = 0;          // enable port A/B weak internal pullup resistors
   WPUA2 = 0;
   ANSEL = 0b11110000;  // port A & B all digital I/O's and port C analogs enabled
   ANSELH = 0b0011;     // port C analogs enabled
   ADCON1 = 0b01100000; // select Fosc/64 for A/D sampling rate
   ADCON0 = 0;            // select left justify result. A/D port configuration 0
   ADON = 1;           // turn on the A2D conversion module
   
   SPBRG = 32;   // Setup the USART 31250 hz baud rate @ 4MHz clock
   BRGH = 1;     // High speed USART baud rate
   BRG16 = 1;    // using 16 bit mode for USART baud rate
    SYNC = 0;     // USART Async mode
   TX9 = 0;      // USART 8bit transmission   
   RX9 = 0;     // USART 8bit reception
   SPEN = 1;     // USART Enable serial output
   CREN = 1;     // USART continuous receive   
   TXEN = 1;     // Enable USART out
   ABDEN = 0;
   LED = 0;
}


/**************************************************************
       Main Program - initialise program variables
**************************************************************/
volatile unsigned char _Buffer1[34];
volatile unsigned char _Buffer2[34];
bit _PB_7_check;
bit _PB_8_check;
bit _PB_9_check;
bit _PB_10_check;
bit _PB_11_check;
bit _PB_12_check;
bit _PB_13_check;
bit _PB_14_check;
unsigned int _Analog_7_value;
unsigned int _Analog_8_value;
unsigned int _Analog_9_value;
unsigned int _Analog_10_value;
unsigned int _Analog_11_value;
unsigned int _Analog_12_value;

unsigned int Rx_index;
int controller_check;
int value_check;
unsigned char receive_byte();
void button_scan();
void analog_scan();
unsigned char read_a2d(unsigned char channel);
void send_midi(int command, int controller, int value);
void send_sysx();
void send_id();
void uart_out(int data);
void int_EEPROM_putc(unsigned char address, unsigned char data);
unsigned char int_EEPROM_getc(unsigned char address);
void midi_in();
void flash_led();
unsigned int led_rate;


void main(void)
{
   System_init();
   led_rate=10;   //flash led 10 times on startup
   while(1){   
         LED=RB5;   //led mirrors wireless data input
              if(Rx_index>0)   //if something was received at midi input
              {
              if(_Buffer1[0]==0xF0) //if received midi is system exclusive - continue
                 PEIE = 0;  //disable peripheral interupts while processing received data
              {
               if((_Buffer1[1]==0x7E)&&(_Buffer1[3]==0x06)&&(_Buffer1[4]==0x01)&&(_Buffer1[5]==0xF7)) { send_id(); led_rate=1; }; // if sysx is id request
                if(_Buffer1[1]==0x7D) // if sysx is VGWC data
                {
                    if((_Buffer1[2]==0x11)&&(_Buffer1[3]==0x00)&&(_Buffer1[4]==0x3A)/*&&(_Buffer1[5]==0x46)*/&&(_Buffer1[6]==0xF7)) { send_sysx(); led_rate=2; }; //if patch request, send eeprom data
                     if(_Buffer1[2]==0x12)  // if VGWC sysx data write command
                     {
                        if((_Buffer1[6]==0xF7))  //if VGWC data write is a single parameter
                     {
                      int_EEPROM_putc(_Buffer1[3], _Buffer1[4]);  //write data byte to eeprom at address received
                      led_rate=1;
                     };
                        if((_Buffer1[3]==0x00)&&(_Buffer2[33]==0xF7))  //if a 68byte patch write patch data to eeprom
                        {   
                           for(unsigned int x=0; x<30; ++x) { int_EEPROM_putc(x, _Buffer1[x+4]); };  //write first 30 bytes of patch data from buffer1
                           for(unsigned int x=30; x<61; ++x){ int_EEPROM_putc(x, _Buffer2[x-30]); };   //write second 32 bytes from buffer2                  
                           led_rate=3;      
                     };
                  };
                };
            
              };
            if(_Buffer1[0]!=0xF0) // if received midi data is not system exclusive, mirror data to midi out (midi thru)
              {
                      for(int x=0; x<Rx_index+1; ++x)
                      {
                          if(x<30) { uart_out(_Buffer1
  • ); } else { uart_out(_Buffer2[x-30]); };         
                         };
                            led_rate=1;
                  };
                   PEIE = 1;   //enable the periphiral interupts again   
                 };
                    if(led_rate>0) {flash_led(led_rate); }; //if useful data was received flash the led, flush the buffers and clear the watchdog timer flag
                          
                if(_Rx_in==1){  //if the wireless recever detects a data signal, see if valid data is received with bit banging
                              unsigned char buff1 = receive_byte();
                              unsigned char buff2 = receive_byte();
                              unsigned char buff3 = receive_byte();
                        
                         /*       int bt = 1;
                                T0IF = 0;
                                int t=810;      
                                while(_Rx_in==1 && !T0IF) continue;
                                DelayUs(t/2);
                                for(int w=0; w<8; w++)
                                {
                                   if(_Rx_in==1)buff1 |=bt;   // load up byte 1
                                    DelayUs(t);
                                    bt=bt*2;
                                 };
                                    
                                bt = 1;   
                                T0IF = 0;            
                                while(_Rx_in==1 && !T0IF) continue;
                                DelayUs(t/2);
                                for(int w=0; w<8; w++)
                                {
                                   if(_Rx_in==1)buff2 |=bt;   // load up byte 2
                                    DelayUs(t);
                                    bt=bt*2;
                                 };
                                       
                                bt = 1;   
                                T0IF = 0;   
                                while(_Rx_in==1 && !T0IF) continue;
                                DelayUs(t/2);
                                for(int w=0; w<8; w++)
                                {
                                   if(_Rx_in==1)buff3 |=bt;   // load up byte 3
                                    DelayUs(t);
                                    bt=bt*2;
                                 };       */            
                                  if(buff1==0xB2 && buff2<14) // if the predefined key byte is receveid and byte 2 is one of the 13 controllers
                                     {    
                                          send_midi(int_EEPROM_getc((buff2*2)-2)+128, int_EEPROM_getc((buff2*2)-1), buff3);   //send midi defined by the eeprom mapped data   
                                       };                              
                };
                button_scan();   //scan the button inputs for a change of state
                analog_scan();   //scan the analog inputs for a change in data
                CLRWDT();        //clear the watchdog timer
             };      
             
    }

    unsigned char receive_byte()
    {
       unsigned char buff = 0;       //start with nothing
       T0IF = 0;                 //clear Timer 0 interupt flag
       int bt = 1;      
       while(_Rx_in==1 && !T0IF) continue; //wait for the start bit, but not too long to time out
       DelayUs(405);                       // offset to mid cycle for accurate bit detection
       for(int w=0; w<8; w++)
       {
          if(_Rx_in==1)buff |=bt;   // load up byte one bit at a time with binary XOR mask
          DelayUs(810);             //delay time for each cycle = 1200bps
          bt=bt*2;              //increment binary mask count
       };
       return buff;              //return received byte
    };      

Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

Elantric

Wonderful -

Thanks for posting Gumtown,
Hopefully we can build (and learn) along the way.

gumtown

#15
Here is a working prototype of the wireless guitar midi guitar controller transmitter.

the small board to the left is the micro controller and transmitter,
the plug in the middle is the microchip pickit-3 programming port,
the board to the right is my simulated guitar controls, with 6 push buttons and 6 potentiometers.

Here is a close up of the controller, this is what would fit under the pickguard with a 9v battery,
I would imagine a production item would have wire tails on plugs much like an internal GK-Kit board, so you could wire on any sort of button or pot/joystick/sensor.

the led only exists for testing puposes.
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

DF400

This is so impressive Gumtown, I'm blown away that you have the skills, insight and talent to put something like this together. Mad respect...

Elantric

#17
Impressive start Gumtown!

I would request find a Microchip port expander to support driving guitar mounted switch status LEDs, or clone the led rotary indicators on a behringer BCR-2000 for each of the rotary pots, or support 8 continuous encoders, so you can have MIDI controlled presets for programmable switches and rotary encoders.

Also love to see a path for stealth Touch controls with led feedback mounted in a modified Roland Ready Strat / GC-1 pickguard assembly.

tekrytor

Quote from: DF400 on March 03, 2013, 09:13:14 PM
This is so impressive Gumtown, I'm blown away that you have the skills, insight and talent to put something like this together. Mad respect...

Double ditto! Kudos Collin!
SY-300/BeatBuddy/VoiceLive 3/GR-55(v1.50)/33/1/50/700/VGA-7/V-Bass, Yam-G10, GPK-4, DIY X-Bee HighlyLiquidCPU "Cozy-Lil-Footie", FCB-1010, other MIDI stuff, Godin Freeway SA and various other GK equipped controllers, Sonar X1, Audacity, KXstudio, Misc devices

MCK

This is amazing. Keep up the great work.

gumtown

As once said in the famous Frankenstein movie "IT'S ALIVE !!"
The receiver part is now working and sending midi cc# from it's own buttons,
which means even if you didn't want the whole wireless controller thing,
the receiver part willl work on it's own as a cc# sending floor controller with 8 buttons and 6 EXP pedals or knobs.

It also is receiving data from the 6 buttons and 6 potentiometers on the transmitter board, via 433mHz wireless link.
The receiver so far has it's own internal midi implimentation system, which will respond to a midi sequencer or computer's request for midi Identity, and system exclusive patch data request, and will be able to be remotely programmed via a midi editor software.
The biggest issue at the moment is having exceeded the flash memory and ram space, need to stream line the programming or use a larger capacity chip.

Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

shawnb

I've been wondering...

What's the target form factor?  How would it be accessed?   Something you clip onto your guitar strap?  Around your wrist like an NFL QB's cheat sheet?  (A necktie?  ;D)

I REALLY like the idea of the little joystick.  Might even be more practical than the ribbon/striptease controller.   If you could get exp pedal functionality without being stuck to your stompbox, that'd be downright liberating!

Shawn
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

gumtown

#22
The transmitter controller is the size of a 9 volt battery, so can fit under a pickguard and be powered either by a 9v battery of tapped off an internal GK kit. From there you would install (typically into a pickguard) and buttons or control hardware you want to use (rotay pots, 5way strat switch, joystck controller etc...).
The receiving part would be typically a floorbox with midi in & midi out, and any combination of 8 footswitches and 6 variable controls like knobs and EXP pedals (or what ever you could imagine - DIY D-Beam?).
The project is opensource, so you could use the design to make your own, and maybe the boards will be available either pre-assembled shortboards or as kitset.

Quote from: shawnb on March 06, 2013, 07:08:39 PM
I've been wondering...

What's the target form factor?  How would it be accessed?   Something you clip onto your guitar strap?  Around your wrist like an NFL QB's cheat sheet?  (A necktie?  ;D)

I REALLY like the idea of the little joystick.  Might even be more practical than the ribbon/striptease controller.   If you could get exp pedal functionality without being stuck to your stompbox, that'd be downright liberating!

Shawn
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

gumtown

#23
Here is the system exclusive data structure

patch file/sysx data
   F0   66   12   00   B0   50   B0   51   B0   52   B0   53   B0   54   B0   55   B0   56   B0   57   B0   58   B0   59   BO   5A   B0   5B   B0   5C   B0   5D   B0   14   B0   15   B0   16   B0   17   B0   18   B0   19   B0   1A   B0   1B   B0   1C   B0   1D   B0   1E   B0   1F   B0   20   00   F7


Patch data request
F0   66   11   00   36   00   F7

system exclusive ID request
F0   7E   7F   06   01   F7

system exclusive ID reply
F0   7E   7F   06   02   66   00   F7
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

gumtown

Yeeha !!
got the midi receive system working too now,
so I can send via a midi adapter, device ID requests and it sends back it's system midi ID,
I send it patch request midi data and it sends back patch data.

Now to get working on a graphical editing software, so the user can enter your own cc# commands for each button or knob controller.


Here is a midi dump from repeated data requests to the pic micro controller..
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
F0 66 11 00 76 00 F7
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
F0 66 11 00 76 00 F7
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
F0 66 12 00 10 50 10 51 10 52 10 53 10 54 10 55 10 56 10 57 10 58 10 59 10 5A 10 5B 10 5C 10 14 10 15 10 16 10 17 10 18 10 19 10 1A 10 1B 10 1C 10 1D 10 1E 10 1F 10 20 7F F7
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/