I'm using the Musical Instrument Shield from sparkfun. For some reason, I can't get it to play specific instruments, even when i set the bank to 0x00. Specifically I want to choose the guitars but only seem limited to a few electronic-sounding instruments unless I happen upon percussion ones.
Here's a snipit of my code that addresses the instrument selection though.
#include <SoftwareSerial.h>
// Connect to the VS1053 on TX pin 3. RX pin 2 is not used.
SoftwareSerial midi( 2, 3 );
unsigned int prevStates[13] = {
0};
// Sound-banks available on the VS1053.
// 0x00 : GM1 (default)
// 0x78 : Drums
// 0x79 : GM2
byte SOUND_BANK = 0x00;
// Constant used to control channel volume.
// Range : 0 - 127
int VOLUME = 90;
// Constant used to control attack and sustain velocity.
// Range : 0 - 127
int ATK_VELOCITY = 60; //peak
int REL_VELOCITY = 60; //sustain
// Constants used to start or stop note playback.
byte PLAY = 0x90;
byte STOP = 0x80;
// Constant used to map Arduino pin to VS1053 reset.
int VS1053_RESET = 4;
// Constant used to supress serial debugging.
boolean DEBUG = true;
// Variable used to navigate instrument selection.
int instrument = 0;
// Variable used to control note playback.
byte note = 0;
//-------------------------------button & LED parameters below-----------------
const int buttonPin = 5; // the number of the pushbutton pin
const int buttonPin2 = 6; // the number of the pushbutton pin
const int ledPin = A5; // the number of the LED pin
int currentState = 0; // variable for reading the pushbutton status
int previousState = 0;
/**
* Initialize debugging, connect to the VS1053, init the VS1053, and
* set initial sound-bank and volume.
*/
void setup()
{
Serial.begin( 57600 ); // For debug messages
midi.begin( 31250 ); // MIDI control via SoftwareSerial
pinMode( VS1053_RESET, OUTPUT ); // Reset VS1053
digitalWrite( VS1053_RESET, LOW ); // ..
delay( 100 ); // ..
digitalWrite( VS1053_RESET, HIGH ); // ..
delay( 100 ); // ..
setBank( SOUND_BANK ); // Set sound-bank via constant
setVolume( VOLUME ); // Set channel volume via constant
//-------------------------------button & LED setup below-----------------
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
pinMode(buttonPin2, INPUT);
DDRB = (DDRB | B00000000);
//**Gives access to PORT B as input which is digital pins 8-13... only 6 bits
DDRC = (DDRC | B00001111);
//**Sets first 4 bits of port C (1st 4 of 6 analog pins) to write
// DDRD = (DDRD | B00000000);
//**Gives access to PORT D as input Only 5,6,7 available
}
/**
* Some applications run forever.
*/
void loop()
{
//-------------------------------button & LED handling -----------------
// note = 30;
instrument = 35;
setInstrument( instrument );
// read the state of the pushbutton value: