Is the following doable using Linux?

paul3531

New Member
Joined
Apr 17, 2022
Messages
9
Reaction score
0
Credits
98
Hi,

Is the following doable using Linux code?

A text to speech kind of problem:
Play the unique musical tone which was assigned by me to each letter of the alphabet as the individual letters are read aloud from left to right from a text file.

For example,
"B V G C T S L" , etc.,

Letter ..........Actual Musical Tone generated
B ........................ C4
V ........................ D4
G ........................ E4
C ........................ F4
T ........................ G4
S ........................ A5
L ........................ B5
etc.,
 


I’m sure it’s probably doable.
You could probably use something like csound to generate the sound for the musical notes. There are a few other applications, but csound is the only one I can remember of the top of my head.

The way I see it, you could write a script in bash, or Python, or some other language, to read a text file, which you could translate to MIDI notes, as per your specification. Write that out to a MIDI-file. Then you can get csound to play the generated MIDI file. Perhaps?!
 
I’ve just seen the speech to text requirements….. That complicates things a lot more. There are some speech to text libraries available, but I’ve never really tried using them for anything…
That means the text to speech module would need to recognise the letters read aloud by a human, then you’d need to translate the letters to a musical note and then play the note…. Hmmmm!
 
Thank you. Then I have a lot of learning to do. Because I only took a couple classes in c programming about 20 years ago.
 
I’ve just seen the speech to text requirements….. That complicates things a lot more. There are some speech to text libraries available, but I’ve never really tried using them for anything…
That means the text to speech module would need to recognise the letters read aloud by a human, then you’d need to translate the letters to a musical note and then play the note…. Hmmmm
I learned a very small amount of Synthetic Speech Markup Language SSML from my use of the @Voice Aloud Reader (TTS Reader) by Hyperionics Technology Android app's "edit speech" option in its settings.
 
Last edited:
I’ve just seen the speech to text requirements….. That complicates things a lot more. There are some speech to text libraries available, but I’ve never really tried using them for anything…
That means the text to speech module would need to recognise the letters read aloud by a human, then you’d need to translate the letters to a musical note and then play the note…. Hmmmm!
For the sake of clarification, I only mentioned text to speech because the desired effect of the Linux code would be to have it read each individual letter in a string not as a letters but rather as an assigned audible musical tone. I had hoped to do it without using any text to speech engine. I had imagined that Linux could do it, by itself, without having to use any text to speech engine, such as the free text to speech engines offered by Google and others.
 
I had imagined that Linux could do it, by itself, without having to use any text to speech engine, such as the free text to speech engines offered by Google and others.

That sort of stuff isn't likely to ever end up in Linux (the kernel). In the Unix Philosophy, to which Linux is sometimes an adherent, it'd make no sense to include that in the kernel.

When you say you imagined it could do it by itself, without any additional libraries, that's what you're referring to - the kernel - regardless of your intentions. I'm not quite sure if that's what you meant, but it's not likely something you'll ever see as part of the kernel.
 
Yes, I have a lot to learn. I thought Linux was a programming language. I guess I do not understand how a programming language relates to a kernel. Maybe that is where I should begin my learning.
 
Ah ok, it looks like I mis-interpreted your post. Ignore my second post regarding text to speech. But my first post would be relevant!

All you need to do is write a script that can read a text file and convert the letters to whatever notes you require, then it’s just a case of playing back the notes.
You could do it by calculating the frequencies of each note and generating a sine-wave at the required frequency and playing it back using some kind of sound library. Or you could convert the letters to MIDI notes and have some other module play back the MIDI file.
From what I recall csound is a standalone executable/library that can be used to generate computerised music.
I don’t think you need to know C to be able to use it. There are some other programs available, but I can’t remember them offhand. And I’m not near my PC this weekend!
 
Ah ok, it looks like I mis-interpreted your post. Ignore my second post regarding text to speech. But my first post would be relevant!

All you need to do is write a script that can read a text file and convert the letters to whatever notes you require, then it’s just a case of playing back the notes.
You could do it by calculating the frequencies of each note and generating a sine-wave at the required frequency and playing it back using some kind of sound library. Or you could convert the letters to MIDI notes and have some other module play back the MIDI file.
From what I recall csound is a standalone executable/library that can be used to generate computerised music.
I don’t think you need to know C to be able to use it. There are some other programs available, but I can’t remember them offhand. And I’m not near my PC this weekend!
Wow! Thank you for sketching out how I might do it. I believe my technical background will make it possible for me to figure out how to implement what you outlined, provided I have links to the Internet sites which would give me a rough idea of how to do each thing you suggested. The following are some thoughts which came to my mind as I tried to imagine how I might do what you say.

1.) "All you need to do is write a script that can read a text file and convert the letters to whatever notes you require, then it’s just a case of playing back the notes."
A.) Okay I'm thinking, first I will Google or YouTube something like, "script convert", without the quotes. I wish I knew what you know because then I would know what words would be best Googled to put me in the info ballpark where I might learn to write such a script to convert the letters to whatever notes I require.
B.) Also, I'm wondering if a plain old script could play back those notes.

2.) "You could do it by calculating the frequencies of each note and generating a sine-wave at the required frequency and playing it back using some kind of sound library. "
A.) I think I know what a sine wave looks like. And I think there is a mathematical function which, if plotted, gives the graphical representation of a sine wave. So, I'm thinking if I send a specific frequency sine waved voltage to an audio speaker, it will produce a simple pure musical tone. So, I need a sine wave generator which will send it's output as discrete actual voltage values to my device's audio speaker or an MP3 file.
B.) I'm not sure what a sound library is but I am imagining that if I were to ask the sound library to play the middle c frequency, it would ask me whether I want to play the pure tone or do I want to play it as a piano or some other instrument. So, I input the desired frequency into the sound library which then outputs the audible musical tone of the same frequency. Or does some other program have to retrieve and then play the desired frequency that is housed in the sound library?

3.) "Or you could convert the letters to MIDI notes and have some other module play back the MIDI file."
A.) I'm thinking I should Google or YouTube, "midi notes", and study the web pages linked in the search results. Likewise for, "midi file playback module".

4.) "From what I recall csound is a standalone executable/library that can be used to generate computerised music. I don’t think you need to know C to be able to use it."
A.) I'll Google or YouTube csound for web pages to explain it to me.
 

Members online


Top