Mittwoch, 11. Januar 2012

Play MIDI files on an Arduino with a Fluxamasynth shield / MIDI to Fluxmasynth converter Version 1.0 is ready for download!

After getting some new ideas how to convert MIDI files for the Arduino/Fluxamashield I am very proud to present version 1.0 of a Perl converter. This one can read MIDI files in format 0 or 1 (it implicitly converts 1 to 0 before converting to Arduino C++ code).

Version 1.0 doesn't need midicsv-tools anymore. It uses the (very nice!) MIDI library of Perl. You can get it from CPAN or try to look for a package at your Linux distribution (e.g. "libmidi-perl" maybe the right search pattern). Also included is the Arduino sketch for playing the converted data.

You can download midi2fluxama-1.0 from Sourceforge.

If you have some right-free and/or "free" licensed MIDI files (or converted files) which sound amazing on the Fluxamaynth it would be nice if you will add them as examples for the converter.

The next steps will be the support of reading the Arduino-Byte-Data from a file on SD for supporting longer and more than one songs.

Kommentare:

  1. It's annoying consider how old the midi format is, how hard it is to get a decent and free program to convert effectively. I found some professional free midi files but now I can't find the resources to convert them =(

    AntwortenLöschen
  2. Sorry, but I don't understand what's the problem. My converter program is downloadable at Sourceforge (the direct link is http://sourceforge.net/projects/midi2fluxama/).

    If you like to convert MIDI to another data format than my simple Arduino-fluxamasynth-format you have to write it on your own :-(

    Yes, that's very bad but with the Perl MIDI module it is practicable if you can write programs in Perl. You also can use my converter as starting point for own converters.

    AntwortenLöschen
  3. Please forgive me for the little knowledge I have on Perl. What is the syntax for running the midifluxamagen.PL script? I get a message stating I need a name for the new sketch.

    AntwortenLöschen
    Antworten
    1. Dieser Kommentar wurde vom Autor entfernt.

      Löschen
    2. Figured it out. Fired up Ubuntu in VMWare and everything worked out. Sorry about that.

      Löschen
  4. I will answer your question (also you found out how to use the script). The Perl script is a "simple" Arduino-Code-Generator. You need to give a name for the generated code. After that you can put the generated code on your Arduino.

    AntwortenLöschen
  5. how do I generate data.h with midi2flux.pl

    AntwortenLöschen
  6. will i need linux for perl script?

    AntwortenLöschen
    Antworten
    1. David,

      to generate data.h you need a standard midi file. Try to search with google for your favorite song and the keyword "MID" (e.g. "Toto Hold the line MID") and download the file.

      After that you can run either midi2fluxama.pl (for only generating data.h) or midifluxamagen.pl for generating the whole sketch (including data.h).

      See the README inside the midi2fluxama-1.01.zip for more information.

      You don't need Linux - perl is also available for other operating systems. But you need a Fluxamasynth shield!

      Löschen
  7. Dieser Kommentar wurde vom Autor entfernt.

    AntwortenLöschen
  8. can you give me a link to the latest libraries for fluxamasynth. the ones on modern device
    are printed on the site and i can't download
    them.

    AntwortenLöschen
    Antworten
    1. David,

      I think they can be downloaded here: https://github.com/moderndevice/Fluxamasynth-Shield

      I haven't tried them because I worked with my Fluxama a yera ago (before Arduino-1.0) but I think they will work...

      Löschen
  9. Ok now I can write code for fluxamasynth!
    I need code that will turn it in to a real time instrument.
    I am making a midi bagpipe chanter.

    AntwortenLöschen
    Antworten
    1. No Problem: Use the MIDILibrary (http://playground.arduino.cc/Main/MIDILibrary) and send the received requests to your Fluxama shield.

      If you do not have a Mega, you can use the hardware Serial Pin for MIDI and the Fluxmasynth via Software-Serial on Pin 4. The needed library can be downloaded at https://github.com/moderndevice/Fluxamasynth-Shield

      Regards, Holger

      Löschen
  10. Thanks for creating this script. However, I am having some difficulty get the target Arduino sketch to work. I think that this is because it has been written for both older versions of the Fluxmanasynth library and of the Arduino IDE. Have you got anything more up-to-date?

    AntwortenLöschen
  11. Oh - sorry. I have no updated code... I am currently involved in many projects so I don't have time to look at Fluxamasynth. Perhaps I can find some more time for this at the end of the year.

    But I think it is not very difficult to "port" the sketch towards a newer library. You should give it a try! The effect of learning is extremly high when doing this!

    Regards, Holger

    AntwortenLöschen
    Antworten
    1. Understood. Am I really only using the Arduino as a quick way to get a few sample tunes playing. The real goal is to get this working with an 8-bit, 6502, vintage computer. So will be writing my own code in 6502-Assembler.

      Löschen