Thank you! Yeah, no milling machine were abused during this project ) Only oldsKool drill&file method, some DIY brackets and countersunk head screws.
Basically this is norbim1 http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Fplayground%2Fnorbim1%2FSD+card+sample+player%2F branch with minor changes in Read_Switch, APP_MIDI_NotifyPackage, Read_Config routines, and 2 global vars added. Toggle switches ON-OFF-ON style: Bank Select - connects PE2 or PC15 to GND, Part Select - connects PC13 or PC14 to GND.
//globals
…
u8 avlg_hw=0; // set to enable scanning of AVLG bank&part switches on J10
u8 bank_part_offset=0; //bank part offset for Arturia Beatstep Pro
...
u8 Read_Switch(void) // Lee's temp hardware: Set up inputs for bank switch as input with pullups, and find if any lines pulled low to select bank
{
u16 bank_val;
if (lee_hw) {
bank_val=(u16)MIOS32_BOARD_J10_Get(); // Read all pins, if all pins high, val=0 meaning bank 1, otherwise one pin should be pulled low eg bank_index 0 = bank_val=1 so bank 2
if(bank_val==0xFF7F) { return 9; } // D7 = 128 low
if(bank_val==0xFFBF) { return 8; } // D6 = 64 low
if(bank_val==0xFFDF) { return 7; } // D5 = 32 low
if(bank_val==0xFFEF) { return 6; } // D4 = 16 low
if(bank_val==0xFFF7) { return 5; } // D3 = 8 low
if(bank_val==0xFFFB) { return 4; } // D2 = 4 low
if(bank_val==0xFFFD) { return 3; } // D1 = 2 low
if(bank_val==0xFFFE) { return 2; } // D0 = 1 low
if(bank_val==0x7FFF) { return 1; } // D15 = 128*256 low
return 0; // default to bank 0 (bank val FFFF)
}
if (avlg_hw) {
bank_val=(u16)MIOS32_BOARD_J10_Get();
if(bank_val==0xF6FF) { bank_part_offset=0; return 0; } //Bank1 Part1 0xF6FF
if(bank_val==0xF7FF) { bank_part_offset=16; return 0; } //Bank1 Part2 0xF7FF
if(bank_val==0xF5FF) { bank_part_offset=32; return 0; } //Bank1 Part3 0xF5FF
if(bank_val==0xFEFF) { bank_part_offset=0; return 1; } //Bank2 Part1 0xFEFF
if(bank_val==0xFFFF) { bank_part_offset=16; return 1; } //Bank2 Part2 0xFFFF
if(bank_val==0xFDFF) { bank_part_offset=32; return 1; } //Bank2 Part3 0xFDFF
if(bank_val==0xFAFF) { bank_part_offset=0; return 2; } //Bank3 Part1 0xFAFF
if(bank_val==0xFBFF) { bank_part_offset=16; return 2; } //Bank3 Part2 0xFBFF
if(bank_val==0xF9FF) { bank_part_offset=32; return 2; } //Bank3 Part3 0xF9FF
// default:
bank_part_offset=0;
return 0;
}
return sample_bank_no; // no change
}
void APP_MIDI_NotifyPackage(mios32_midi_port_t port, mios32_midi_package_t midi_package)
{
…
// replace two occurences of this code:
if((midi_package.note)==sample_to_midinote[samp_no])
// with
if((midi_package.note+bank_part_offset)==sample_to_midinote[samp_no])
...
}
void Read_Config()
{
…
if(!strcmp(param_name,"lee_hw")) { lee_hw=(int)strtol((char *)(param_value),NULL,10); } // Set lee_hw param
if(!strcmp(param_name,"avlg_hw")) { avlg_hw=(int)strtol((char *)(param_value),NULL,10); lee_hw=0;} // Set avlg_hw param AND reset lee_hw
...
}
Tell me if you need complete code or precompiled project.hex