How to generate crisp beep tones of varying frequency for a midi file

Joined
Feb 7, 2022
Messages
4
Reaction score
1
First off I just want to apologize if this is the wrong section.

So Basically I am trying to create music encoded from written text using MIDI files as they can range from 0-127 degrees meaning that I have a range of 128 characters.

However the issue I am running into is decoding this music back into text but more specifically is getting an accurate range of notes that I have used to produce the midi file.

I am using the python plugin MIDIUtil (as you can write the midi file in a series of notes - 50,60,70,20 ect which is the easiest way to convert the string of text into music running a python replace script. eg. "The boy was on the swing" becomes "46,08,05,00,02,15,25,00,23,01,19,00,15,14,00,20,08,05,00,19,23,09,08,07"
) to create the midi file and am then using ffmpeg to convert it into an mp3 file and the python plugin AudioSegment to further convert this into a wav

the reason for converting the audio into an mp3 and then a wav, is that I would hope the project could be used to send the music in a different number of ways, from a simple voice message to using a CB Radio. meaning that the audio file is not actually being transferred in the modern since but transmitted or broadcast and received which doesn't use an audio format

I am then using sonic visualiser with the polyphonic Transcription [university of alcante] Transform as it does a good job of picking out the exact midi notes that went into compiling the audio which will let me reverse replace the numbers with characters to turn the music back into the correct string of text.
(one test I ran using 99 notes shuffled into a random order had just 4 errors so you could say the best result I got was 95% accurate, however that was just one of multiple tests.) but the process is not 100% accurate and I believe the reason for this is that the length of tones used in the MIDI file vary depending on pitch and that there is not a solid audio gap between each note played. - think of the way low notes on a piano linger longer than the high notes.

there also seems to be an issue when jumping from certain frequency's to another frequency that sonic visualiser will miss read these two notes as one note of an intermediate pitch but i suspect this is down to the varying length depending on the note (a low note plays longer than a high note) and also a lack of an audio gap between the notes

So far I have tried running the midi file through MuseScore3 to alter the sound into something more reliable for decryption but cant find any suitable sounds.

Does anybody have any suggestions as to producing short crisp notes for a midi file where all the notes regardless of tone would play for the same duration and a way to add a fixed audio gap between the notes in order to allow for pitch perfect reading in audio visualiser.
 

Attachments

  • midi.png
    midi.png
    39 KB · Views: 10

SeaGtGruff

I meant to play that note!
Moderator
Joined
Jun 6, 2014
Messages
4,111
Reaction score
1,736
Wow, that sounds like the kind of thing that might need to be custom programmed by someone.

As I understand it, you're wanting to remove any legato notes by inserting breaks or brief periods of silence between each note to make it more noticeably distinct, as well as change the length of every note so it's of a uniform duration.

I think some of the more expensive DAWs might have functions which can analyze an audio track and cut it up into slices for each distinguishable note, chord, frequency, or waveform-- but I don't know whether they would also have functions or script commands which would set the length of each slice to some desired uniform duration-- say, to 3/16ths of a measure-- and quantize the beginning of each slice to start on some beat-- say, to the nearest quarter note-- such that there is a brief period of silence between each note or distinct combination of notes (chord).
 

happyrat1

Destroyer of Eardrums!!!
Joined
May 30, 2012
Messages
13,827
Reaction score
5,567
Location
GTA, Canada
I gotta say, this sounds like someone asking us to do his computer programming homework for him.

My main question is, if you are familiar with Python programming why aren't you using library functions to do all the heavy lifting for you?

Why so many third party utilities?

MP3 encoding introduces a certain amount of slop into the analogue signal output which when, redigitized introduces it's own digital and analogue slop into the mix.

If you're theorem is that D/A output != A/D input, then you get an A+. If you're trying to prove something else I can't possibly see a practical degree of success in it without bringing in some sort of AI code and teaching it to repair the file on the fly.

Gary ;)
 
Joined
Feb 7, 2022
Messages
4
Reaction score
1
@SeaGtGruff thank you for helping clarify what it is I am trying to achieve as I didn't quite have the language at hand to do it. and might save your answer If i need to repost this question elsewhere. :)

p.s. I was also enquiering to see if anyone knew of a specific soundfont that would achive this for me,
maybe something like this - https://www.pond5.com/sound-effects/item/58657795-electronic-warning-signal-beeps-03

@happyrat1 i'm actually not all that familiar with python, I'm just using it as it seems the easiest way to write a midi file based on specific musical notes that can be copy a pasted from a text file.
i'm not even studying computer programming . I'm simply just a dude who wants to change words into music based off a text cipher I found online to leave my friends encoded musical messages.
The fact I'm not a programmer would also be the reason I'm using all these third party utilities.

p.s. I might have found my a solution which is to create my own soundfont using polyphone -
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
14,046
Messages
86,666
Members
13,148
Latest member
sbmusichelp

Latest Threads

Top