fbpx
Skip to main content

MIDI Forum

How to build an .mi...
 
Notifications
Clear all

How to build an .mid file

5 Posts
3 Users
0 Reactions
9,012 Views
janus
Posts: 2
New Member
Topic starter
 

I'm new in this forum and I think it is the very first time, that I am writing in a forum.

The case: I have a music robot project with 2 midi controlled robots an midi controlled daw and an midi controlled light.
The problem: Programming this robots is very boring.
The goal: build an little hardware sequencer/looper for those 4 things witch can !!!!export!!!! xxx.mid files for my daw ore seq24 ore what ever.
My question: I get midi out and back in. But how can I build this “xxx.mid” files. Does anyone have an tutorial about this.

(sorry for my bad english)

 
Posted : 27/02/2020 12:51 pm
Geoff
Posts: 1047
Noble Member
 

There are a few things you might look at.

If you're using a DAW or a sequencer package, then some (most ?) will allow you to save pieces/phrases/clips and then build a new file from pre-saved pieces. You could save the various actions you want, and then just build a new file from the chunks as required, looping/repeating as you need.

An alternative to working within a DAW (or whatever) would be to use a prog that allows the conversion of an existing midi file into text (editable in any text editor). Take any existing midi file containing the bits you plan to re-use and convert it to text, use the editor to separate out the various chunks that would be useful to have, and then use the text editor to bring chunks back together and add whatever as well. The prog that converts midi to text usually has a reverse option, i.e. to convert the text back to midi.

Going a bit further, if you're into a bit or programming and have the chunks, you could make a little prog to create a midi file from existing chunks, although this would have a complication that you'd need to rebuild the meta-times youself - the other options would take care of this automatically.

Geoff

 
Posted : 27/02/2020 2:45 pm
Dmitry
Posts: 27
Eminent Member
 

how can I build this “xxx.mid” files. Does anyone have an tutorial about this.

I'm not sure what do you mean by 'building' Standard MIDI Files - can you provide more details please?

If you want to visually 'draw' the notes (using either piano roll or musical staff notation) or enter your notes as a list (table) of MIDI events, you'd need MIDI sequencer software for the PC - for starters, full version of Cakewalk (formerly Sonar) for Windows is free to use.
Google has some tutorials on using Piano Roll editor and Event List editor.

If you need SMF file format specifications to construct these files programmatically, it's included with the Complete MIDI 1.0 Detailed Specification version 96.1 3rd edition on this website. There are quite a few SMF code samples on GitHub programmed in C/C++, C#, and JavaScript.

 
Posted : 27/02/2020 3:27 pm
janus
Posts: 2
New Member
Topic starter
 

Thanks Dmitry, thanks Geoff,
hear are the left Informations:

I want to make a program in c for the mc or an arduino. In the moment, I need 2 old mac mini and one old macbookair to make the (midi controlled) robots play. It workes quite well, but it takes much time to handle them.
To start a practice, takes half an hour. And jamming is hardly impossible. So I want to make something like a little midi loop station -(for the robots the (midi triggerd) video and the (midi controlled) DMX)-, that can export the midi at a storage that can be used from the mac minis.

Why I don't use a midi sequencer? → My Robots need a MIDI minus Delay. So the Robot has to get the signal 800ms before the Note is executed.

Thanks to Geoff for the tip with the Text. I think it is really possible to do it. I stored a .midi file with 1 Note in different positions. And after that I was looking what was changing in the txt editor. It was funny how easy it was to change notes and create new .mid files with the editor.

Thanks to Dmitry for the link to GitHub. I think it will take a while, to learn and understand this stuff.

 
Posted : 01/03/2020 3:34 pm
Dmitry
Posts: 27
Eminent Member
 

If you play pre-recorded tracks, you can use your MIDI sequencer software to implement the time delay - either by specifying a negative amount of time delay in MIDI track properties, or shifting/moving all events relatively to other tracks in the song. Typically only MIDI ticks are accepted as values, so the delay will be bound to the MIDI tempo, not absolute time in ms.

For a dedicated hardware solution, you may want to take a look at this Arduino-based MIDI loop box project and use it as a starting point. There is an assembly tutorial with schematics and parts list, and C++ software implementation is available on GitHub as well. It cannot save or load SMF files from external storage, but this should be relatively easy to implement using one of these SMF processing libraries from GitHub.

 
Posted : 02/03/2020 12:57 pm
Share: