I’m always excited to learn new encodings.
“new” is a relative term when it comes to Baudot
@MarCNeT It might be doing a carriage return whenever it reaches X where X is the character limit of the screen. Could be memory limits too if the machine allows backspaces which i think i saw.
-edit- Actually, check if you have special chars. There might be procedure for things like question marks and periods that introduce “stops”. Not to mention you might have rogue whitespace in your input.
I’ve been using this as a reference → Baudot
So any special characters are already handled (like the shift to/from letters/numbers).
My checking process is to manually decode the part of the sound file manually, by using the spectrum view of audacity, and remembering that there is an initial 0 ‘sync’ bit at the start. Then use that site to look up what character/code the resultant value represents.
I might post a video, demoing the progress I’ve made so far. I don’t have a working mic at the moment, so it might be a silent video
So some progress
This is the first character in the audio from the baudot video above. I’ve ran the processing program I’m writing against it, and have successfully (I think) managed to process the entire audio.
The picture here is the processing of the first character → A
The pink represents the first part of the audio - the sync bit 0
The green is the next part of the audio, the 2 bits of 1
The blue is the last part, the 3 bits of zero
This converts into 000110 . Which is 6. Remove the padding bit, and you get 3.
I then convert this, using a hard-coded baudot table (from one of the links above), into the character “A”
Source code is here → Bitbucket
The project is not yet finished. There’s still the matter of Sound recording, feeding into and integration with MegaHAL, and tone generation.
I’ve made a bit of progress - the entire video that LMNC posted has been decoded.
I’ve made a short, but crap . video demo here → http://marcnetsystem.co.uk/baudot_1.mkv
It just shows the build process, the most important features, and it capturing and decoding the baudot characters from the LMNC video. With some background music I dug out of my personal archive.
I’ve managed to get MegaHAL working!! It’s only text interaction at the moment, but you can type something at it, and it will respond back on the console. It can also learn, and incorporate what you type into it’s brain!!
Umm… possibly not the best idea, but I’ve taken all the LMNC song lyrics, put that into a text file, and used that as the training data.
I’ll post a demo video, when I have time, to show the results, but here is a screenshot of my initial testing. The lines starting → are the ones generated by MegaHAL.
The results were a bit weird. Which is no suprise, considering the training data I gave .it!
Love the outputs.
hahahaha that is so funny love it. disjointed well good you can see lyrics that are sort of lyrics ha. is there anything you’d like me to type for you??? audio wise when its onto phase 2?
I wouldn’t mind a few phrases typed out on the Baudot machine and recorded and posted here (or somewhere I can download them)
There seems to be a ‘wakeup’ sound at the start, when you press a button (in that video, you can hear it when you push ‘A’, and it occurs before the actual ‘A’ tones are generated).
And also I need a mechanism to work out when you’ve stopped typing - is there some sort of ‘end’ sound that signals to the other end?
Perhaps I can detect a question mark or full stop, and wait 5 seconds (or some amount of time) before I have decided that it is the actual end of the user input. For example, if you were typing a decimal number, I don’t want to think that the decimal point was actually a full stop
Oh, and is there a backspace? Some example where you correct something would be good too
Perhaps I’m over-thinking this - lol
So I’ve got audio generation working - at least I think I do…
One problem I have is there is no way of verifying that the audio I’m generating is actually correct. I can, of course, pass the generated audio back into my program, (which works btw), but that isn’t really a good way to verify my work.
I’ve tried a few apps from the internet - TTYWavReader is one that seems to partially work, but it can’t correctly handle the audio from the video posted above : It manages a few characters, but misses a few out as well, - so I can’t really use that for verification. It also doesn’t output any diagnostic info, or provide the decoding source, so I can’t tell why it doesn’t work.
Any suggestions, as I’m a bit stuck here… ? (and I don’t really want to purchase a minicom machine myself - lol)
Nice work so far, I’ve been watching with interest. I did a quick search to see what I could find and came across this:
Maybe that could be of some use?
If you can’t build it or haven’t got a linux box I could install it on mine and we could exchange audio files for testing.
I’ll try it out later (I do have a linux box running openSuse), but I don’t think minimodem can handle the ITA2 character set?
While doing some quick Googling, I did find this-> RaspTTY: A WEB to TTY Interface . It seems to use minimodem, and mentions ITA2 - so I might see if I can get that to work
sorry on the delay on this! I kept forgetting. here we go! let me know if there is anything else you’d like
not sure what the thinking tone is first off when it starts transmitting but I dont think it matters, they will just be running all day so I think after the setup phase they run as they should
Thanks, I’ve made some good progress, but not yet finished the current stage.
My goal for this week (possibly next as well, depending on how busy I am) is to get two instances of my program talking at each other via baudot encoded audio, and using MegaHAL to process and generate a response back - on an infinite loop. That would be weird with just your lyrics as the training data, but I’m eager to see how it turns out - lol
Ideally I would like to have one of those machines to borrow for a few weeks - if that is at all a possibility??? That way I can iron out any problems (and do two-way communication) without having to bother you. Anyway, no worries if not
yeah that’s cool!!! all good man will figure it out for you!±!±!± may swell have the thing to see gif it works haha
I’ve not had much time recently to work on this, but more progress has been made!
My goal was to get two instances of MegaHAL talking to each other using baudot audio. My PC runs one instance, and the Raspberry Pi the other. I set the PC to generate a MegeHAL response, which gets converted to baudot and played into the Raspberry Pi. The Raspberry Pi takes the audio, decodes it back into text and feeds that text into it’s own instance of MegaHAL. Then a reply is generated and played back to the PC … etc etc etc
Here is a video to demo all the work I’ve done since last time
nice!!! looks like a lot of work! but cool. I have worked out a way of directly wiring audio into the exchange, what im going to do is record some through the exchange a direct and send to see if there isn’t any surprises??? as you say in the video with clipping etc, its not the neatest of signals through the exchange but simulating a direct recording might be a good idea. ill try to this today even
If you can grab a sample after it’s been through the exchange (as a .wav file), then I can run that through my Raspberry PI and see if it can decode it.
I will also,at some point, upload a sample of audio that the Raspberry PI has created, so you can play it back to the minicom for me
So I’ve done the GPIO stuff that @lookmumnocomputer requested. I think I’ve gone a bit overkill, but oh-well…
As usual, one of my crappy videos to demo it → http://www.marcnetsystem.co.uk/baudot_part3.mkv
I’ve basically used 15 output pins to show the different status values:
- Listening (capturing audio)
- Finding data in non-silence audio
- Data RX,
- Rx 0
- Rx 1
- End of audio block detected (pulses)
- Audio is too quiet, or is silent
- Clipping detected
- Transmitting audio
- Transmitting data (not padding, silence, etc)
- Tx 0
- Tx 1
- MegaHAL thinking
- MegaHAL saving
- MegaHAL running out of memory, so removing some stuff it’s learnt
There’s also a couple of input pins:
- Go to sleep (when set Low) / Wake up (when set high)
- Enable (high) / Disable (low) megaHAL learning.
Next step is to sort of the Raspberry PI booting and running the program automatically - then it’s done!