Go Down

Topic: openpipe with fluxamasynth (Read 2376 times) previous topic - next topic

johncc

Are they from the library provided by moderndevice?  Then they are supposed to...

Why don't you load the example sketch that comes with the library to find out?

Trazman001

instead of
Code: [Select]
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));
}


maybe just

Code: [Select]
void noteOn(byte channel, byte pitch, byte velocity);
  void noteOff(byte channel, byte pitch);
void midiReset();

think it will work?


Trazman001

#18
Feb 18, 2013, 01:23 am Last Edit: Feb 18, 2013, 01:51 am by Trazman001 Reason: 1
In this code I see methods for Fluxamasynth libraries but no relation to the code I am using
Code: [Select]
#include "Fluxamasynth.h" //will I need this?

Fluxamasynth synth; //will I need this?

#define c3 48                // define our notes to their midi values
#define e3 52
#define g3 55
#define c4 60

void setup() {
 Serial.begin(31250);
 synth.programChange(0, 0, 40);
 synth.programChange(0, 1, 0);
}

void loop()
{
 synth.noteOn(0, c4, 127);  // play 1 note (C4) on channel 0

 delay(1000);
 synth.noteOff(0, c4);

 synth.noteOn(1, c3, 127);
 synth.noteOn(1, e3, 127);  // play 3 notes (C3, E3, G3) on channel 1
 synth.noteOn(1, g3, 127);

 delay(1000);
 synth.noteOff(1, c3);
 synth.noteOff(1, e3);
 synth.noteOff(1, g3);
}


and does these work with synth.noteOn and synth.noteOff
Code: [Select]
#define MIDI_COMMAND_NOTE_OFF       0x80
#define MIDI_COMMAND_NOTE_ON        0x90
#define MIDI_COMMAND_SOUNDS_OFF     0xB0//I see no methods for these.

And This...how do I set it up as a instrumtent with out playing notes automaticaly and keeping the parameters.
Code: [Select]
synth.noteOn(0, c4, 127);  // play 1 note (C4) on channel 0

Grumpy_Mike

Quote
and does these work with synth.noteOn and synth.noteOff

Those are the bytes that consist of the MIDI messages, they are just ways of referring to those messages by name not number.

Quote
how do I set it up as a instrumtent with out playing notes automaticaly and keeping the parameters.

I have no idea what this means and I suspect you do not either.
What do you mean by "set up and instrument". Do you mean voice change? That is sent with a ProgramChange message.

Basically I don't think you know enough about MIDI to do what you want to do. You seem to be thrashing about trying to do things you do not understand by collecting together code you have found and hopping it will work. Then you ask questions but you are incapable of understanding the answers. It is like learning how to ask for directions to the train station in a foreign language with out learning enough of that language to understand the answer.

You need to read about the fundamentals of MIDI and MIDI messages. A good point of reference is here:-
http://www.midi.org/techspecs/index.php

Then start writing your code, not some code you found, very simply at first, adding a small bit at a time and testing it as you go. Learn to understand what you are doing.

Trazman001

sorry grumpy mike for annoying you.

my consin ben will help me now

Go Up