It is currently Mon Apr 12, 2021 8:35 am

All times are UTC + 1 hour

Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: how to create midifile from text
PostPosted: Tue Sep 08, 2020 4:47 pm 
New User
New User

Joined: Fri Jan 17, 2020 8:20 pm
Posts: 6
I would like to be able to create a music editing program for the blind, as what exists is very complex and inaccessible.
I already have libraries, and even scripts that don't need a library to play instruments in real time.
I created a structure to play notes on the respective channels, with their instruments.
No intention of using vst's or plugins, as this would require a learning time that I don't have at the moment. And even ... One step at a time.
But I need to export these variables and expressions to a mid file.
I searched here on the forum, but I couldn't find something that works as I need it.
Would anyone know how to do this?
I am grateful now.


Gostaria de poder criar programa de edição de músicas para cegos, pois o que existem são muito complexos e inacessíveis.
Já tenho bibliotecas, e até scripts que não precisam de biblioteca para executar instrumentos em tempo real.
criei estrutura para tocar notas em respectivos canais, com seus instrumentos.
Sem pretenção de usar vst's ou plugins, pois isso demandaria um tempo de aprendizado que não tenho no momento. E até... Um passo de cada vez.
Mas preciso exportar essas variáveis e expressões para um arquivo mid.
Pesquisei aqui no forum, mas não consegui encontrar algo que funcione como eu preciso.
Alguém saberia como fazer isso?
Fico grato desde já.

Reply with quote  
 Post subject: Re: how to create midifile from text
PostPosted: Thu Sep 10, 2020 10:48 am 
Always Here
Always Here

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 5341
Location: Germany
Hi Marcos,

I think you asked in the wrong category.
You should ask such questions in 'Coding questions'.

In general the format of the midi file format is created of at least 2 parts.
A header and one or multiple tracks.

The easisest way is a file with one track (0) or with synchronous tracks (1)

The header looks always like

4D 54 68 64 00 00 00 06 ff ff nn nn dd dd


ff ff : Fileformat 0 one track, 1 synchronous tracks, 2 asynchronous tracks
nn nn : count of the tracks
dd dd : delta time ticks per quarter note

This is followed by the track(s)

They always starts with
4D 54 72 6B xx xx xx xx

xx xx xx xx : length of the following track data
followed by the midi commands.
But in front of each midi command is a delta time which tells after how many delta ticks the command is executed.
This delta time is length encoded and can be up to 4 bytes. The highest bit tells if an other byte is following.
So there are only 7 databits for the length.

It really depends on your data which you want to save as midi.

Reply with quote  
 Post subject: Re: how to create midifile from text
PostPosted: Thu Sep 10, 2020 3:02 pm 
New User
New User

Joined: Fri Jan 17, 2020 8:20 pm
Posts: 6
I downloaded a PDF that has this information, but I didn't understand it. I am studying more deeply.
But from what you wrote, I see that I am on the right track.
However, I'm not sure how to write this in a midi file.

I found in another basic language, a creation of a simple midi file, and I'm trying to transcribe it to PureBasic.

Language works very similar to PB, except for a few small details.
But before I continue, I need to know if I need to delete the post here, and ask the question again in the appropriate place.
And right now, sorry for the confusion, because for not speaking English well, I misinterpreted the place of posting.


Eu baixei um PDF que tem essas informações, mas não compreendi. Estou estudando mais profundamente.
Mas pelo que você escreveu, vejo que estou no caminho certo.
Porém, não sei bem como escrever isso em um arquivo midi.

Eu encontrei em uma outra linguagem basic, uma criação de um arquivo midi simples, e estou tentando transcrever para o PureBasic.

Funciona naquela linguagem bem parecida com PB, exceto por alguns pequenos detalhes.
Mas antes de continuar, preciso saber se é necessário que eu apague a postagem aqui, e refaça a pergunta no local adequado.
E desde já, desculpe a confusão, pois por não falar bem o inglês, interpretei errado o local de postagem.

Reply with quote  
 Post subject: Re: how to create midifile from text
PostPosted: Thu Sep 24, 2020 10:38 pm 

Joined: Mon Dec 24, 2012 9:07 am
Posts: 42
Location: Ukraine, Donetck
Hello Marcos
You can find in google qws, it's midi editor special for the blind.
Or use Cockos Reaper DAW with plugin Osara.

In this forum you can search midi library with all midi parse commands.

Sory my bad english

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour

Who is online

Users browsing this forum: No registered users and 6 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye