Go Down

Topic: Help with geeetech VS1053 midi/mp3/wav shield (Read 9074 times) previous topic - next topic

Pitchoilcan

Sep 07, 2014, 02:29 am Last Edit: Sep 08, 2014, 06:22 am by Pitchoilcan Reason: 1
I'm trying to test a geetech vs1053 MP3 shield

trying to play middle C from the IDE serial window I send
noteOn(0,60,127) expecting to hear C with velocity of 127. but nothing plays.

Quote
* MIDI data can be sent with two different methods as well, controlled by USE_SPI_MIDI
*  (0) Through a (software) serial connection on pin 3, at 31250 baud
*  (1) Through SPI, at an arbitrary data rate. For SPI, each byte of MIDI data needs to be prefixed by a 0 byte
*      (The V1053b data sheet erroneously states that the padding should be a 0xFF byte).

Do I need to send 0xFFnoteOn(0,60,127) or something else.? I've tried so many things I've lost track
 
here's the code
https://gist.github.com/microtherion/2636608/download#file-mp3_shield_realtimemidi-ino

Any help would be greatly appreciated.
Thanks much
================================
http://twit.tv/floss61
Think different
Think UbuntuStudio
============================

Grumpy_Mike

Quote
trying to play middle C from the IDE serial window I send noteOn(0,60,127)

How are you doing that?
a value of 127 is a single byte but when you use the IDE serial monitor you are sending three bytes ASCII 1, 2 and 7, in hex that is 0x31, 0x32, 0x37 are you converting them into a single byte and sending them out through software serial like it said?

Pitchoilcan

#2
Sep 08, 2014, 12:19 am Last Edit: Sep 08, 2014, 01:24 am by Pitchoilcan Reason: 1
Thanks for the prompt response Mike, the docs says the midi message for middle C is "noteOn(0,60,127)" channel, note#, velocity. But to send via UART each byte of MIDI data needs to be prefixed by a 0 byte (not sure what that means or how it's done). Some sketches uses softserial but I don't want to use that as I don't have a midi in port setup yet. So I wanted to tested playing a note from the serial window. I was typing verbatim  "noteOn(0,60,127)". since that didn't work I was thinking it might have to include that padding they mentioned 0xxff 0r 0 after the noteOn part which as I understand is note the actual midi byte(s), 0, 60,127. Perhaps my thinking is off.  
Some further clarification need.

Quote
are you converting them into a single byte

Note sure how to do that. And No I want to send it via the TX pin not via NewSoftSerial.

Thanks much
================================
http://twit.tv/floss61
Think different
Think UbuntuStudio
============================

Grumpy_Mike

You can not send anything to a MIDI device through the USB serial port when you have got the IDE serial monitor open.

You can not write note on or anything like that.
The thing about the 0 is misleading you. You need to send three bytes, I have shown them here in hex, a hex number has 0x in front of it to show it is hex, it is not part of what is sent.
0x90 that means note on for miid channel one
0x41 that is the note number in this case it is 65 in decimal.
0x7F that is the velocity it is 127 in decimal.

so how are you connecting your VS1052 to the arduino? You need to send it those three bytes at the MIDI baud rate.
Note e serial monitor in the IDE will not work at the midi baud rate.

Pitchoilcan

#4
Sep 08, 2014, 01:13 am Last Edit: Sep 08, 2014, 06:23 am by Pitchoilcan Reason: 1
I have connected the shield to the arduino. but not the larger project for which it intended. Which is based on theMidiFootprint project in the playground. That sends midi. But I need to resolve pin conflicts between the mux and and vs1053 first. So I wanted to hear what the built in midi synths on the vs1053 sounds like. Also I was trying to figure out which is more feasible .mid .wav .mp3 etc as the chip on board can handle multiple codecs. So I was trying to mimic a midi key stroke via the serial window. Ok so no can do. The example of Rt midi I could find online(as the shield manufacturer's library is faulty and as no midi instruction oe examples)  uses newserial and I think once uploaded to the board is suppose to play some notes in sequence from the midi synth without in input meanwhile the Serial prints N30, N31, N32...... through the banks but no sound. Thats why I attempts to input data myself.     I must say I will never buy from geeetech again. Anyone who makes knockoffs like chinduino or cheapduino and a host of other faulty crap are douches.  
================================
http://twit.tv/floss61
Think different
Think UbuntuStudio
============================

Pitchoilcan

#5
Sep 08, 2014, 01:35 am Last Edit: Sep 08, 2014, 01:57 am by Pitchoilcan Reason: 1
I have a midi shield but I don't want to take it out of it's current project for this. But I may have to. That will give me midi in.  I'm sure one of the sketched I tried claims to play through a few note with just the shield.
==============================
Sketch to drive the SparkFun Music Instrument Shield (VS1053 MP3 and MIDI codec IC) from an Arduino UNO https://gist.github.com/rwinscot/1492432  

Quote
This example outputs some status statements to the terminal at 57600 baud. The actual MIDI statements use the NewSoftSerial library to communicate over pins 3 and 4 at 31250 baud. Once the example code is loaded onto your Arduino, plug in some headphones or active speakers to the audio jack on the shield, and reset the device. You should hear a string of seemingly random percussion sounds, kind of like an old sound-effects tape.

https://www.sparkfun.com/tutorials/302
================================
http://twit.tv/floss61
Think different
Think UbuntuStudio
============================

Pitchoilcan

#6
Sep 08, 2014, 02:21 am Last Edit: Sep 08, 2014, 06:23 am by Pitchoilcan Reason: 1
Starting Up the shield in realtime midi mode as opposed to mp3 mode required having some pins in a specific state. Different shield makers have those pins is different places. Without the proper info I'm only guessing and run the risk of damaging the shield and or my arduino. But geeetech has left me no the option. I need of manipulate GPIO-0 and GPIO-1. One to -3v and Zero to GND. GPIO-1 is pin 4. but I'm not sure about GPIO-0. I read somewhere that it's SD-CS pin 9 or maybe it's X-CS pin6 on this shield. LOL
Quote
One problem/confusion. The datasheet and your guides say that GPIO0 =0 and GPIO1=1, lead to midi mode in vs1053b. If that is true I should not pull up the GPIO1 pin, rather should pull it down. This is the CS pin for the SD card.
I also found today that when the SD card is plugged it, I can't play the Hello MP3 file from the SDI interface. On further inspection I found that the SD card tried to pull high it's CS pin, ie GPIO1 and hence, maybe the VS1053b is going into midi mode?

http://www.vsdsp-forum.com/phpbb/viewtopic.php?f=9&t=402&start=20

If I can't wire the pins HIGH and LOW then I'll have to do it in the code or via a library which geeetech does not provide.  :~  :0  :smiley-eek-blue: This is the shield in question.
http://www.geeetech.com/wiki/index.php/Arduino_MP3_shield_board_with_TF_card
by their own admission their library is no good http://www.geeetech.com/forum/viewtopic.php?f=16&t=15890&sid=15e7e87663c685e63f3678817b86e750#p20717
Stomped..........  
================================
http://twit.tv/floss61
Think different
Think UbuntuStudio
============================

Pitchoilcan

#7
Sep 08, 2014, 04:48 am Last Edit: Sep 08, 2014, 05:13 am by Pitchoilcan Reason: 1
On the sparkfun shield GPIO-1 is pin 4
On this shield I have pins 0,1,3 and 4 not in use
pin2 ==DREQ
pin6==x_CS
pin7==x_DCS
Pin8==X_Reset
pin9==CS

SCK=13
MISO=12
MOSI=11
=================
Taking a look at http://code.google.com/p/stream-radio/source/browse/trunk/TCP/VS1053/vs1053.h?r=6 to try an get a better understanding.
The search continues........................
Quote
The GPIO capabilities of VS1053 have been extended compared to VS1003 and VS1033. The state of most of the digital pins on VS1053 can now be read through the IDATA registers, and the state of the SO pin can be controlled somewhat by the software.

VS1053 GPIO registers are defined as follows:

IDATA[7:0] bits are connected to the inputs of GPIO[7:0] pins.
IDATA[8] is connected to the input of pin SCLK.
IDATA[9] is connected to the input of pin XCS.
IDATA[10] is connected to the input of pin SI.
IDATA[11] is connected to the input of pin XDCS.

ODATA[7:0] bits are connected to the output register of GPIO[7:0] pins.
DDR[7:0] bits are connected to the output enable controls of GPIO[7:0] pins.

ODATA[8] controls the output state of the SO pin when DDR[8] is set high. There is still a fixed 3-state buffer on the SO pin, which puts the SO pin in high impedance whenever XCS is high. This fixed 3-state buffer cannot be controlled by software.

Note: If you set DDR[8] high, the hardware SCI port controller cannot control the SO pin, so any SCI reads will fail.

http://www.vsdsp-forum.com/phpbb/viewtopic.php?f=10&t=214
================================
http://twit.tv/floss61
Think different
Think UbuntuStudio
============================

Pitchoilcan

#8
Sep 08, 2014, 05:37 am Last Edit: Sep 08, 2014, 06:20 am by Pitchoilcan Reason: 1
It's been a crazy week, but finally I think I'm making progress. Thanks again to Grumpy_Mike. So I'm thinking the pins that need "Change_State" are:
Quote
/*--- xCS pin ---*/

#define CS_GPIO                         LPC_GPIO0                                                       //xCS PORT
#define CS_BIT                          23                                                                      //xCS PIN
#define CS_SET_OUTPUT()         CS_GPIO->FIODIR |= (1<<CS_BIT);         //xCS dir = output
#define CS_LOW()                        CS_GPIO->FIOPIN &= ~(1<<CS_BIT)         //Set xCS low - enable command interface
#define CS_HIGH()                       CS_GPIO->FIOPIN |= (1<<CS_BIT)          //Set xCS high - disable command interface

/*--- xDSC pin ---*/

#define DSC_GPIO                        LPC_GPIO0                                                               //xDSC PORT
#define DSC_BIT                         25                                                                              //xDSC PIN
#define DSC_SET_OUTPUT()        DSC_GPIO->FIODIR |= (1<<DSC_BIT)                //xDSC dir = output
#define DSC_LOW()                       DSC_GPIO->FIOPIN &= ~(1<<DSC_BIT)               //Set xDSC low - enable data interface
#define DSC_HIGH()                      DSC_GPIO->FIOPIN |= (1<<DSC_BIT)                //Set xDSC high - disable data interface

/*--- DREQ pin ---*/

#define DREQ_GPIO                       LPC_GPIO0                                                               //DREQ PORT
#define DREQ_BIT                        24                                                                              //DREQ PIN
#define DREQ_SET_INPUT()        DREQ_GPIO->FIODIR &= ~(1<<DREQ_BIT)             //DREQ dir = input

*--- xCS pin ---* and /*--- xDSC pin ---*/ DREQ is always SET_INPUT i.e. doesn't change.
according to http://code.google.com/p/stream-radio/source/browse/trunk/TCP/VS1053/vs1053.h
Ok so atleast I know that the pins are diffrent from sparkfun's shield.
As a side note. I mentioned these different makers and shields is because when I bought the Geeetech vs1053 MP3 shield an Amazon reviewer said the sparkfun library worked with this geeetech product, they also said don't bother even trying geeetech library it doesn't work. So I took their advice. The mp3_Player_example worked, mid_example didn't. I don't want mp3_mode at this point (perhaps later). I want the synths on the chip, the reverb, effects etc in real time.  I did try to download geeetech's but the file wouldn't open on my linux box (which is strange) nor on my mac (which is a bad sign). Realizing that shield makers are free to rearrange pins is a bit of a shock to me. What can I say but pardon the newbie. All the more for geeetech to step up and do the right thing. Which in the very least means proper documents and/or examples please!.
Before that I did buy an adafruit wav shield, had to solder it myself and I guess the sd card weren't soldered well and I never got it working. Would of bought a pre assembled one but they don't sell them. So I found this geeetech board online. The selling point was midi and the various codecs are a  definite plus. Reading from the SD card I gather is the default state on the shield. i.e MP3. So need to change that before I move forward.
================================
http://twit.tv/floss61
Think different
Think UbuntuStudio
============================

Grumpy_Mike

There seems to be a lot of versions of this board all with the same name.
Have you tried the code at the bottom of this page?
http://www.geeetech.com/wiki/index.php/Arduino_Music_Shield_V2.0

Pitchoilcan

#10
Sep 08, 2014, 03:28 pm Last Edit: Sep 08, 2014, 05:00 pm by Pitchoilcan Reason: 1
No, I hadn't seen that page until now. Though my shield doesn't look like that. But I'll give it a shot.
Cheers
================================
http://twit.tv/floss61
Think different
Think UbuntuStudio
============================

Pitchoilcan

#11
Sep 08, 2014, 06:51 pm Last Edit: Sep 08, 2014, 06:58 pm by Pitchoilcan Reason: 1
Well I was ready to try the code but the download doesn't contain the midi demo.  :smiley-eek-blue:
Guess I have to copy it from the photo. lol
================================
http://twit.tv/floss61
Think different
Think UbuntuStudio
============================

Pitchoilcan

#12
Sep 08, 2014, 07:24 pm Last Edit: Sep 09, 2014, 05:15 am by Pitchoilcan Reason: 1
a google search other copies of the code returned this forum post
http://forum.arduino.cc/index.php?topic=226723.0
pondering...........

Thanks to Braton for sending me his edit modified library. Unfortunately even with the edited musicplayer.h the midi demo doesn't work
================================
http://twit.tv/floss61
Think different
Think UbuntuStudio
============================

Pitchoilcan

#13
Sep 08, 2014, 09:18 pm Last Edit: Sep 08, 2014, 09:32 pm by Pitchoilcan Reason: 1
This is what I tried
Code: [Select]
#include <SD.h>
#include <SPI.h>
#include <Arduino.h>
#include <MusicPlayer.h>

void setup(void)
{
 Serial.begin(9600);
 player.beginInMidiFmt();
}
void loop(void)
{
 player.midiDemoPlayer();
}
delay(500);
}

Didn't work
nor did
Code: [Select]
#include <SD.h>
#include <SPI.h>
#include <Arduino.h>
#include <MusicPlayer.h>

void setup(void)
{
 Serial.begin(31250 );
 player.beginInMidiFmt();
}
void loop(void)
{
 player.midiDemoPlayer();
}
delay(500);
}
================================
http://twit.tv/floss61
Think different
Think UbuntuStudio
============================

Pitchoilcan

#14
Sep 09, 2014, 04:00 am Last Edit: Sep 09, 2014, 04:27 am by Pitchoilcan Reason: 1
most informative doc on the VS1053b
https://drive.google.com/file/d/0B8OBj9xhe3okd290ZFhkM0JzeWc/edit?usp=sharing
real time midi on pg57 for anyone who cares of help.

my shield's wiring here
================================
http://twit.tv/floss61
Think different
Think UbuntuStudio
============================

Go Up