Pages: [1] 2   Go Down
Author Topic: openpipe with fluxamasynth  (Read 1385 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi again!  smiley smiley smiley

Remember my crying about the fluxamasynth bagpipe....well I am almost done with that project and it will be very simple fix
what I have for you all.

The openpipe works with the fluxamasynth, I programed the instrument to be set as 109 (bagpipe) but when I do some notes
it changes to 0 (piano).

this is what I think is the problem.

Code:
[
//byte note = 0; //The MIDI note value to be played
byte resetMIDI = 4; //Tied to VS1053 Reset line
byte ledPin = 13; //MIDI traffic inidicator
int instrument = 0;
/code]

the code was made for a music instrument shield from sparkfun dot com.
I had to change the rx (1) and tx (4) numbers for this code to get sound out of the fluxamasynth.
I think the problem lies in the VS1053 Reset line.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31462
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
this is what I think is the problem.
Nothing wrong with that code. Mind you it doesn't do anything either so that is little surprise.

If you want help you have to post all your code.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The code is too long for the forum.. smiley-mr-green

I will give you a link to the code.

https://github.com/openpipelabs/openpipe-breakout/tree/master/openpipe_breakout_music_instrument_shield

here is a better link.....sorry

https://github.com/openpipelabs/openpipe-breakout/blob/master/openpipe_breakout_music_instrument_shield/openpipe_breakout_music_instrument_shield.ino
« Last Edit: February 10, 2013, 06:11:40 pm by Trazman001 » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31462
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This code is wrong:-
Code:
int note_on(int note, int vel){
    t_midiMsg midiMsg;
   
    midiMsg.msg.command = MIDI_COMMAND_NOTE_ON;
    midiMsg.msg.channel = MIDI_DEFAULT_CHANNEL;
    midiMsg.msg.data2 = note;
    midiMsg.msg.data3 = vel; /* Velocity */
   
    Serial.write(midiMsg.raw, sizeof(midiMsg));
}
Because you are sending 4 bytes of data instead of three.
The midi channel should be merged with the midi command not sent as a separate byte.
This applies to all the functions you do like this.

Why do you have this method of sending MIDI when you have a perfectly good set of functions to do this in the sketch?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

????

I don't know what you mean.

should I get rid of

Code:
midiMsg.msg.data3 = vel; /* Velocity */

Or program the code to handle it.

How much of this code do I have to change?

Oh I see merge command with channel..... but how?

Maybe every part where command and channel is piece it two gether. I still don't know how.
« Last Edit: February 10, 2013, 09:32:25 pm by Trazman001 » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31462
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Oh I see merge command with channel..... but how?
By using the bit wise OR operation, then do not output all that structure but the first two bytes ORed together followed by the last two. Do that for all the routines that use that structure
I am guessing you did not write that code, point is do you understand it?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I didn't write the code but i have lillte or no understanding of the code.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31462
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Then look at every function that ends in
Code:
Serial.write(midiMsg.raw, sizeof(midiMsg));
And delete the whole of the function.

Any calls to these deleted functions should be replaced to the other set of midi out functions you have in that sketch.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:

Code:

Serial.write(midiMsg.raw, sizeof(midiMsg));
Quote
Then look at every function that ends in

did so... still don't know how to add a function that will work. I know you want me to learn this my self.
Can you give  me a link of functions that I can use?
Logged

Temple, Texas
Offline Offline
Sr. Member
****
Karma: 14
Posts: 354
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Then look at every function that ends in
Code:
Serial.write(midiMsg.raw, sizeof(midiMsg));
And delete the whole of the function.

Any calls to these deleted functions should be replaced to the other set of midi out functions you have in that sketch.

None of those three errant functions are actually being called in the sketch anyway...
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
[code   uint8_t raw[4];
} t_midiMsg;
]
should I delete this to?

the question really is, should I add any thing?

Code:
Serial.write(midiMsg.raw, sizeof(midiMsg));
every part where this was I deleted it and it still didn't work.
« Last Edit: February 11, 2013, 06:20:29 pm by Trazman001 » Logged

Temple, Texas
Offline Offline
Sr. Member
****
Karma: 14
Posts: 354
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


should I delete this to?

the question really is, should I add any thing?


I don't think that will matter.  Also, the instrument=0 will not matter because it is not being used anywhere either.

Sorry, I don't know anything about the shield or Midi.

And, what is your thinking about the "VS1053 reset line"?

Cheers,
John
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

grumpy mike

If you would please show me the right code to use. smiley-wink

this code was ment for the spark fun music instrument code.
« Last Edit: February 14, 2013, 03:52:10 pm by Trazman001 » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31462
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

These functions will work:-
Code:
void noteOn(byte channel, byte note, byte attack_velocity) {
  talkMIDI( (0x90 | channel), note, attack_velocity);
}

//Send a MIDI note-off message. Like releasing a piano key
void noteOff(byte channel, byte note, byte release_velocity) {
  talkMIDI( (0x80 | channel), note, release_velocity);
}

void soundsOff(byte channel){
  talkMIDI( (MIDI_COMMAND_SOUNDS_OFF | channel), 120, 0);
}

These functions will not work:-
Code:
int MIDI_sounds_off(void){
   t_midiMsg midiMsg;
   midiMsg.msg.command = MIDI_COMMAND_SOUNDS_OFF;
   midiMsg.msg.channel = MIDI_DEFAULT_CHANNEL;
   midiMsg.msg.data2 = 120;
   midiMsg.msg.data3 = 0; /* Velocity */
   
   Serial.write(midiMsg.raw, sizeof(midiMsg));
}

int note_on(int note, int vel){
    t_midiMsg midiMsg;
   
    midiMsg.msg.command = MIDI_COMMAND_NOTE_ON;
    midiMsg.msg.channel = MIDI_DEFAULT_CHANNEL;
    midiMsg.msg.data2 = note;
    midiMsg.msg.data3 = vel; /* Velocity */
   
    Serial.write(midiMsg.raw, sizeof(midiMsg));
}

int note_off(int note, int vel){
    t_midiMsg midiMsg;
   
    midiMsg.msg.command = MIDI_COMMAND_NOTE_OFF;
    midiMsg.msg.channel = MIDI_DEFAULT_CHANNEL;
    midiMsg.msg.data2 = note;
    midiMsg.msg.data3 = vel; /* Velocity */
   
    Serial.write(midiMsg.raw, sizeof(midiMsg));
}
Replace calls to the latter with the former with the appropriate calling parameters.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

will some of these work??
Code:
void noteOn(byte channel, byte pitch, byte velocity);
  void noteOff(byte channel, byte pitch);
  void programChange (byte bank, byte channel, byte value);
  void pitchBend(byte channel, int value);
  void pitchBendRange(byte channel, byte value);
  void midiReset();
  void setChannelVolume(byte channel, byte level);
  void allNotesOff(byte channel);
  void setMasterVolume(byte level);
  void setReverb(byte channel, byte program, byte level, byte delayFeedback);
  void setChorus(byte channel, byte program, byte level, byte feedback, byte chorusDelay);

Please please pretty please. tell me what to enter.
« Last Edit: February 16, 2013, 06:31:19 pm by Trazman001 » Logged

Pages: [1] 2   Go Up
Jump to: