Pages: [1] 2   Go Down
Author Topic: fluxamasynth  (Read 1579 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

hello i am just trying to get a sound out of my fluxamasynth board. I have the right drivers for my computer "arduino uno r3"
the fluxamasynth is connect to the uno.

midi2fluxama-1.01

http://ardublog-codeman.blogspot.com/

i am using this guys code. and it won't compile.

it says

fluxamasynth does not name type


for this data

Fluxamasynth synth;




sorry all that I annoyed you all with the bagpipe chanter theroy
« Last Edit: January 06, 2013, 11:44:53 pm by Trazman001 » Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1257
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello again.

Do you have the fluxamasynth  library installed in the sketches/ libraries folder?
Do you have the library included at the top of your sketch?
Also, the names are all case sensitive, so check you are using the right case.

Maybe post the code you have so we can read that, even if it is the same as what is on the web site.
« Last Edit: January 07, 2013, 12:19:04 am by marco_c » Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

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

Code:
//
// SoftFluxaSynthSMF.pde: Simple player for byte code files which can be
//                        generated  from MIDI format 0 or 1 files with
//                        midi2fluxama.pl
//
// Copyrights:
// Copyright (C) 2012 Holger Wirtz <dcoredump@gmail.com>
//
// This program may be modified and distributed under the
// terms of the GNU General Public License v3. You should have received
// a copy of the GNU General Public License along with this
// program; if not, write to the Free Software Foundation, Inc.
// 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
// USE THIS PROGRAM AT YOUR OWN RISK!
//
// This program code uses "Fluxamasynth_NSS.h" which ca be found at
// http://wiki.moderndevice.com/uploads/MD/Fluxamasynth.zip
//
// The code is testet with Arduino-0.22 but should be easy
// portable to Arduino-1.0.
//
// PREREQUIREMENTS
// You also need the following libraries:
// NewSoftSerial.h http://arduiniana.org/libraries/newsoftserial/
// Flash.h http://www.pjrc.com/teensy/td_libs_MsTimer2.html
// FlexiTimer2.h http://arduiniana.org/libraries/flash/
//
// See http://arduino.cc where to get the libraries and how to install them.
//
// If someone has MIDI data which sounds amazing and is licensed "free" please
// drop me the MIDI oder header file for including in this distribution.
//

#include <Fluxamasynth_NSS.h>
#include <NewSoftSerial.h>   // for software serial (using pin 4)
#include <Flash.h>           // needed for storing the song data in PROG_MEM
#include <FlexiTimer2.h>     // for correct, interrupt based timing
#include "data.h"            // this is the file with the data generated by
                             // midi2fluxama.pl

#define MASTER_VOL_MAX 100    // the maximum volume

Fluxamasynth synth;
unsigned int sp;  // the song pointer
unsigned long tempo=500000L;
const int events=midi_data.count();

void setup()
{
  synth.midiReset();
  synth.setMasterVolume(MASTER_VOL_MAX);
  event();
}

void loop()
{
  ;
}

void event()
{
  unsigned long tmp_ulong=0UL;
  unsigned int tmp_uint=0,bend=0,wait=0,tmp_sp=0;
  byte i=0;

  // save the actual song pointer
  tmp_sp=sp;

  if(sp<events)
  {
    // special handling of command 7 (delay)
    if((midi_data[sp+1]&0x0f)==7)
    {
      // for delaying next event >255 ticks
      for(i=0;i<2;i++)
      {
        tmp_uint=(unsigned int)midi_data[sp+i+1];
        wait+=tmp_uint<<((1-i)*8);
      }
      sp+=4;
    }

    if(midi_data[tmp_sp]+wait>0)
    {
      // timer for the next event
      FlexiTimer2::set((((float)tempo/1000)*(((float)midi_data[tmp_sp]+wait)/ppqn)),event);
      FlexiTimer2::start();
    }

    // check the type of event
    switch(midi_data[sp+1]&0x0f)
    {
    case 0:  // NoteOn
      synth.noteOn(midi_data[sp+1]>>4,midi_data[sp+2],midi_data[sp+3]);
      sp+=4;
      break;
    case 1:  // NoteOff
      synth.noteOff(midi_data[sp+1]>>4,midi_data[sp+2]);
      sp+=3;
      break;
    case 2:  // Controller
      synth.setChannelController(midi_data[sp+1]>>4, midi_data[sp+2],midi_data[sp+3]);
      sp+=4;
      break;
    case 3:  // PitchBend
      for(i=0;i<2;i++)
      {
        tmp_uint=(unsigned int)midi_data[sp+i+1];
        bend+=tmp_uint<<((1-i)*8);
      }
      synth.pitchBend(midi_data[sp+1]>>4, bend);
      sp+=4;
      break;
    case 4:  // ProgramChange
      synth.programChange(0,midi_data[sp+1]>>4, midi_data[sp+2]);
      sp+=3;
      break;
    case 5:  // Aftertouch
      synth.setChannelAftertouch(midi_data[sp+1]>>4, midi_data[sp+2]);
      sp+=3;
      break;
    case 6:  // Tempo
      tempo=0UL;
      for(i=0;i<4;i++)
      {
        tmp_ulong=(unsigned long)midi_data[sp+i+2];
        tempo+=tmp_ulong<<((3-i)*8);
      }
      sp+=6;
      break;
    }

    if(midi_data[tmp_sp]==0)
      event();
  }
  else
  {
    // after the end of the song reset the Fluxamasynth
    synth.midiReset();
    FlexiTimer2::set(5000,event);
    FlexiTimer2::start();
    return;
  }
}
///i just put the fluxamasynth librarys in the audio librarys folder
thanks on that tip
 smiley smiley smiley smiley smiley smiley smiley smiley
after adding the librarys
says "byte not declarded."
« Last Edit: January 07, 2013, 01:25:28 am by Trazman001 » Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1257
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you please edit your post and add code tags (use the # button) around your code post, otherwise we get smiley faces and italics when the post is shown.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1257
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Replace byte with unit8_t.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

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

Unit8_t or 8_t
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1257
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

uint8_t.

The spell check corrected when it did not need to, sorry.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

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

Code:
const int events=midi_data.count();
"midi data" says not declared in this scope
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1257
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That look like something that would be in the the converted data file header that you called data.h. My guess is that the file is just one big array called midi_data with the data to be played out.

What is the content of data.h?
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

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

data.h?  smiley-red

i did'nt get any thing like this.
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1257
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Data.h is the last of the header files that you are including (see your sketch). from the use of "" it should be local to where the sketch is. The guy that did the blog has a program that creates data for this sketch from a midi file. I assume that this data array is what it creates. He called his include file something different on the web site sketch.
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

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

 smiley-red smiley-red smiley-red??????????
can't find data.h anywhere.


Code:
#include "data.h"            // this is the file with the data generated by
                             // midi2fluxama.pl

I don't know how to use midi2fluxama.pl in the arduino compiler

I didn't see it here.  http://ardublog-codeman.blogspot.com/2012/01/midi-fluxmasynth-converter-version-10.html

how do I generate data.h with midi2flux.pl



breaking news i have just paid for a midi controler board "arduino" i hope this works for my fluxamasynth
« Last Edit: January 07, 2013, 11:53:44 pm by Trazman001 » Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1257
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think that utility runs on the PC not the arduino.  Maybe you can ask the guy with the blog how to use it? This is not something we here can help with unless we have done this before.

What controller board did you pay for?
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

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

https://www.sparkfun.com/products/9595

this is alot like this one.
Logged

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

I think i know the problem. there are diffrent fluxamasynth librarys i may have downloaded the wrong one.h

oh... I have updataed the librarys and the compiler still says "byte  has not been declared" even with the program "mary had a little lamb"

 smiley-sad smiley-sad smiley-sad

in such a dumb way i forgot to move pin 4 to pin 1.
now it plays a scale. do i have to format the fluxamasynth or just reprogram it.
« Last Edit: January 09, 2013, 01:37:26 am by Trazman001 » Logged

Pages: [1] 2   Go Up
Jump to: