Pages: 1 [2]   Go Down
Author Topic: openpipe with fluxamasynth  (Read 1373 times)
0 Members and 1 Guest are viewing this topic.
Temple, Texas
Offline Offline
Sr. Member
****
Karma: 14
Posts: 354
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

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

instead of
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));
}

maybe just

Code:
void noteOn(byte channel, byte pitch, byte velocity);
  void noteOff(byte channel, byte pitch);
void midiReset();
think it will work?
Logged

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

think it will work?

Maybe!
Logged

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

In this code I see methods for Fluxamasynth libraries but no relation to the code I am using
Code:
#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:
#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:
synth.noteOn(0, c4, 127);  // play 1 note (C4) on channel 0
« Last Edit: February 17, 2013, 07:51:11 pm by Trazman001 » Logged

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

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.
Logged

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

sorry grumpy mike for annoying you.

my consin ben will help me now
Logged

Pages: 1 [2]   Go Up
Jump to: