Pages: [1] 2   Go Down
Author Topic: Ist there any public project to build a MIDI file player from an Arduino?  (Read 3717 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 2
Posts: 123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I wonder if there is any project going on here or somewhere or wherever that turns an Arduino into a midi file player. I have seen a video on Youtube or so, where someone shows a solution with an sd-card and a 16x2 display, but unfortunately this is only a demonstration that it can be done, not how.

So I was wondering if someone saw a project like this is developing here somewhere in public? I would love to have a really small midi file player with the possibility to alter the midi-stream in realtime...

Thanks a lot! Martin...
Logged

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

Hello, I wonder if there is any project going on here or somewhere or wherever that turns an Arduino into a midi file player. I have seen a video on Youtube or so, where someone shows a solution with an sd-card and a 16x2 display, but unfortunately this is only a demonstration that it can be done, not how.

So I was wondering if someone saw a project like this is developing here somewhere in public? I would love to have a really small midi file player with the possibility to alter the midi-stream in realtime...

Thanks a lot! Martin...

I doubt the arduino has enough processing power to decode realtime midi and generate the audio output as well. Besides you will need the memory to store the samples for piano, drums etc.
It would be easier to use a MIDI/mp3 decoder like the VS1053 http://www.vlsi.fi/en/products/vs1053.html
The arduino can be used to send the MIDI data to the Vs1053 which will decode it and generate the audio output.

I created a mp3 player based on the arduino and vs1053 which can be seen at http://kalum.posterous.com/50759184
The same method would apply for MIDI decoding, just send the file/MIDI data and the vs1053 will decode it.....
 
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot for your reply, but I did not mean to make the Arduino produce any sound at all, I just want it to send the midi events from midi files on the sd-card to a midi-out, thats all...

Actually I found a complete ATMEGA8 and ATMEGA168-based solution, which is unfortunately NOT for Arduino, but it might be possible for me to solder the stuff together. The biggest problem I have is that I have no clue how to program the bare ATMega-Chip... Yet...

Have a look at this (german) page: It seems not toooo hard to build up such a thing... I will try...

Thanks for your kind post! Martin...



« Last Edit: May 13, 2011, 08:16:32 pm by clockdivider » Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmmmm, thank you very much. Actually I searched a lot, but I did not see that there is an old forum. Nevertheless one thread I had found by searching on Google, it is this one. Unfortunately it shows only that it can be done, but not how, it is this one:

It works!

Here someone is brainstroming...

Here again someone announces such a project, and in October 2010 in the third post "god member Grumpy_Mike" says: "Lots of MIDI projects about but I have not seen anything like this, but it shouldn't be too hard, but you will probably end up writing it yourself. " This was not so long ago...

Here someone built such a thing, as far as I understand, but it is quite much oversized and I am not sure if it really is a standalone midi file player...

In the end there is no complete project I could find, where everything is put together with display and sd-card and so on... Seems I have to, well not start from scratch, but...  smiley-roll-sweat
Logged

Portugal
Offline Offline
God Member
*****
Karma: 6
Posts: 962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot for your reply, but I did not mean to make the Arduino produce any sound at all, I just want it to send the midi events from midi files on the sd-card to a midi-out, thats all...

Actually I found a complete ATMEGA8 and ATMEGA168-based solution, which is unfortunately NOT for Arduino, but it might be possible for me to solder the stuff together. The biggest problem I have is that I have no clue how to program the bare ATMega-Chip... Yet...

Have a look at this (german) page: It seems not toooo hard to build up such a thing... I will try...

Thanks for your kind post! Martin...





The Atmega168 was indeed used in the inicial Arduino boards, so I dont know why you say it doesnt work in a regular arduino..
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmmmm. Wait, just to make sure I understand...

Do you want to say, that once one has the AtMega168 programmed, one can plug it onto the Arduino-Board. Maybe you have seen, that the ATMEga168-Project was completely written in pure C, so it won´t fit into the Arduino IDE...

Maybe I can understand, that the ATMega168 might run the prog while on the Arduino-Board, but still I have to adjust a lot of code to make the SD-Card run and so on, no?

Sorry for my maybe stupid questions, I am an absolute beginner in programming micro processors...
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you find this?: http://arduino.cc/en/Tutorial/Midi Surely that is the starting point. I typically use the main Google search and use arduino as the first word.  For example, I go to www.google.com and search on:  arduino midi which returns over 1 million hits. There is absolutely several spot-on answers to your questions there in the first several pages of hits.

If you go to http://arduino.cc/forum/ and scroll down you will see "Forum 2005-2010 (read only)" where there is yet more content than here in the current version.  I assure you that there are MANY spot-on discussions. Work on your search skills.

Thanks a lot, yes I have seen the tutorial... I suppose I can search together all the small components of codes and snippets and ideas and hardware and so on, but I was simply wondering if ever someone built a midi file player for Arduino. Yet I have NOT seen any. I have seen solutions, where midi-notes are hardcoded into the source, I have seen a lot of midi-out, have seen the USB-To-Midi thing and so on.

But I have NOT seen a Arduino project yet, that reads a midi-file from anywhere and simply send the midi-data to an out... And believe me, I have been searching quite a lot.

Yes, the Midi tutorial is a good starting point, and the lcd-display-shield-examples are a good starting point too and so are the examples for reading from an sd-card. But all in all these are all good starting point, so all in all they are a "start".

I am quite sure, that when digging into the field it would take me a month or so to build up a complete player based on an Arduino, but I appreciate it very much, if already someone else sweat for me...  smiley-mr-green

Nevertheless, if I cannot find any solutions, I will try my own in some future...

Thanks a lot! Martin...
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well I want EXACTLY the thing that is shown here: Click It could be even somewhat simpler, I don´t need recording capabilities... This is really all I want...

All I need (and a lot of live performers do) is a device that sends standard midi-files to a midi-out, on demand, thats all. A plugged in synth makes the sound out of it. But as you stated: Things become complex when having to program the complete menu structure, the lcd-display, to examine the midi file structure, convert it to midi-notes and so on.

As you can see in the link above, a complete project is documented from absolute beginning to its success, but it is not for Arduino. I have just started programming the Arduino, so I was wondering if such a complete projects exists somewhere...

Thanks a lot! Martin...
« Last Edit: May 14, 2011, 12:42:56 pm by clockdivider » Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, that´s the problem I was afraid of. I thought that there maybe already someone made a midi-file-player. Putting the things together sounds easy, but I know that it everytime takes much longer than it sounds...

Okay... Then I have to decide whether to build the player I have the complete code and the printed circuit for or to "port" the code to the Arduino, or to plug the code together from all the blocks...

Thanks a lot for your advices! I´ll be back here when I´ll start the project....
Logged

Portugal
Offline Offline
God Member
*****
Karma: 6
Posts: 962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You dont need to translate anything, the Atmega168P is functional equivalent to the Atmega328p found in the Duemilanove and Uno Arduinos.
Yes, you can replace the lcd.c and .h files with the lcd.write and whatever but its just a matter off adding all the .h and .c all inside the same folder as the sketch, the functions of the main.c will go to you skecth, the defines are toghether in the top with the #includes, them in the main there is a real main() function, everything outside the while(1) goes to setup() in the Arduino IDE, and what is inside the while(1) goes inside the loop() in the IDE, them compile and upload.
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, if it is that simple, this will be my first approach then. This is the "porting-approach", okay...

It seems you know about the "Arduino-wrap" around the ATMega-family then?! May I ask you a more general question?

The guy that made the "pure" AtMega168-version coded the prog in C. But if one has no "connection" like USB or something to put the code into the ATMega, how is it done then? Do I need one of theses ultra-expensive programming machine as one can buy it here?

I mean, one has to plug the chip into something, then upload the code with something, and also one needs sort of IDE or so, no?

I am very interested in that, I built some gear for Arduino, but in the end I don´t need all the "surroundings". Ok, I was already putting one of the project onto a "Mini Pro", but nevertheless, I´d like to know what is going on when coding the ATMega directly...

Thanks for answering OT! And thanks for your post!
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry for asking too fast, I found that Atmel offers their own IDE. Incredible...

But nevertheless I cannot see how the chip itself is "plugged" to the programming computer...
Logged

Portugal
Offline Offline
God Member
*****
Karma: 6
Posts: 962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Read my blog, it teachs you how to use AvrStudio and Arduino wihtout the Arduino bloat:
http://hekilledmywire.wordpress.com/

The next tutorial, about Timers is almost finished.
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 123
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh man, I have to learn so much... www.mikrocontroller.net has a tutorial on the page... One of the hardware requirements is a "evaluation board". Among a lot of others, one of the is the Arduino. Okay, So I learned right now, that I already have a board to program an Arduino "directly"...  smiley-eek-blue smiley-red smiley-eek smiley-roll-sweat smiley-roll

Hmmmm. Okay then... Now breaking my thoughts down to undefined guesses: The Arduino IDE calls a compiler that translates the "Arduino code" to assembler, I suppose?

Okay,  you already answered, I´ll dig into your page! :-D

Hell this stuff makes me crazy. It so great... What a discovery... I´d only wish I had seen als this great stuff earlier...
Logged

Portugal
Offline Offline
God Member
*****
Karma: 6
Posts: 962
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Arduino IDE uses avr-gcc a special part of GCC mande to compile C code for AVR's, it also uses Avr-libc for all the C librarys and that libs where writen for avr in mind so they are very efficient, this is the very same compiler used in WinAvr that can be used inside the AvrStudio IDE to program your Arduino directly without all the Arduino libs and withtout all the magic, in AvrStudio you deal with the guts of the micro, so you know exactly what it will do and how it will do it.
The Arduino IDE in specific uses the avr-g++, that is the special compiler for the C++ code, this compiler is not as efficient as the C compiler, and in micro-controller using C++ is half a mistake because it produces bloated code, and because micro-controllers have very very little RAM memory and C++ loves to hog RAM to do simple things that C does  in a much smarter way.

As I said, read my blog and you will see that you dont need anything more than the Arduino board, the Atmega 8, 168, and 328p are the same, they only differ in flash, ram and eeprom sizes, but the program for one will run in the other.
Logged

Pages: [1] 2   Go Up
Jump to: