tornupnegatives / tms-express Goto Github PK
View Code? Open in Web Editor NEWLPC speech encoder for the TMS5220
License: GNU General Public License v3.0
LPC speech encoder for the TMS5220
License: GNU General Public License v3.0
TMS Express is a learning project for me. One new skill I have begun developing through it is GUI development, specifically using Qt. I am still unfamiliar with the odds and ends of managing memory when using Qt, so v2.0.0 is leaking quite a bit of memory. These leaks must be identified and fixed.
According to some seemingly knowledgable people on the Qt forums, Qt may allocate globally acquired resources which are freed automatically on program termination but will still make Valgrind upset. As long as there are no user-created leaks, those can (and will) remain.
Source: https://www.qtcentre.org/threads/14880-Memory-leaks-in-QT-apps?p=76242#post76242
Hi, are there any plans for a decoder?
Ensure conformity with the most important aspects of Google's C++ style guide.
This project started as a personal toy to learn C++. However, as the codebase gets larger, I would like for it to reflect the practices and style I've picked up from both hobby exploration as well as professional experience. It is a long and largely useless endeavor from a functional standpoint, but worthwhile nonetheless.
Originally, the intent was to provide GitHub Actions workflows which would automatically generate artifacts. Unfortunately, the process is less straightforward than expected. It it possible that this solution will be revisited, but for now build scripts should be provided instead, assuming a clean install for each operating system.
The eventual goal of TMS Express is to serve a one component in an embedded system for realtime LPC processing with a TMS5220. As such, it will be useful to include functionality to export bitstreams in a C-friendly format. This will also allow for compatibility with the Talkie library for Arduino, which is quite popular.
The ability to prefix hex bytes with a 0x
is already built-in. An additional function should be added to the FrameEncoder
which wraps the bitstream in a C-style struct or header.
Semi-related to #40, the AudioBuffer::reset()
and FramePostprocessor::reset()
functions encourage poor coding practices, and should be done away with.
Update the CLI to reflect the latest changes in structure and functionality. This may involve re-writing or removing the BitstreamGenerator class. If it is maintained, it is best to utilize it in both the CLI and GUI to avoid redundancy
Certain classes, namely the AudioBuffer
, may throw runtime exceptions. The GUI should catch these, display a dialog to the user, and then halt execution.
There are currently two command-line options which store boolean values: include-prefix
and include-stop-frame
. However, they require the user to supply them with an argument (true
/false
). Ideally, the user can simply include the flags with no argument to set them as true.
$ TMS-Express --input input.wav --output output.lpc --include-prefix true
$ TMS-Express --input input.wav --output output.lpc --include-prefix
The boost
library certainly supports the desired behavior. It must simply be discovered and implemented.
When a Frame's gain is the maximum value of the Tms5220CodingTable
, the signal may become unstable or silent
An easy workaround is to prevent the gain from ever becoming too high. This would involve ceilings in the Frame::setGain()
, Frame::setQuantizedGain()
, and FramePostprocessor::shiftGain()
functions.
It would be interesting to figure out why this happens rather than restrict the gain values.
Hi there! I've been playing around with your project for a few days now. It's very neat! I've been poking around seeing what I could do with it.
I noticed you had feature in the GUI called "Export" that allows a user to save a WAV file made by TMS-Express' built-in emulator.
I was wondering if it would be possible to add that same functionality when invoking TMS-Express from the command line? Having a subcommand to output a WAV instead of a bitstream seems like it would be really handy! In fact, after taking a few minutes to look around, I think that would make this not only an encoder, but possibly one of the only standalone LPC emulators around that doesn't require an Arduino.
At present, there are several instances of classes which hold instances of other classes-namely holding AudioBuffer
objects. This is confusing, and should be amended.
Ensure all functions have a detailed doc comment, and that these comments are consistent and uniform.
Currently, TMS Express can generate a single bitstream from a file, which can drive a TMS5220 Voice Synthesis Processor in "Speak External" mode. However, there is another way to drive the device: via a TMS6100 Voice Synthesis Memory IC (datasheet). It would be useful for TMS Express to encode several files in general: into a C header for Arduino talkie
, per #5; and into a binary file that could be flashed to a TMS6100 or equivalent device.
More realistically, these binary files would end up on an FPGA/MCU/CPLD clone of the TMS6100, which could be used to restore failing arcade machines which use the TMS5220, breathe new life into a dusty BBC Acorn, or add new words to a Speak and Spell—for example.
The datasheet linked above as well as this webpage by @furrtek have enough information to go off of. It seems that the issue can be broken down into the following milestones:
encode
command, which handles a single filebatch
command which allows users to encode several files at oncerom
command which builds upon batch
to configure and store a binary file for use in a TMS6100 equivalent. This will likely require Verilog clone of the TMS6100 for testingIf anyone out there is interested in collaborating on this with me, don't hesitate to reach out. Otherwise, I'll be tinkering away, one step at a time ;)
note: ‘std::bitset’ is defined in header ‘<bitset>’; did you forget to ‘#include <bitset>’?
I started to strip out the external libraries and then thought that it would be better if others could have a windows build and any updates.
Because the human vocal tract changes rather slowly, it is likely that adjacent Frames are similar enough that they do not each require their own set of parameters. Instead, the first one maintains a full parameter set, and subsequent Frames are marked as repeats and contain only energy and pitch.
The FramePostprocessor
should compare the reflector coefficients of all Frames and determine whether or not to classify them as repeats. Criteria must be established to determine what constitutes Frame similarity.
Increase the compiler warning level (-Wall -Wpedantic -Wextra...) and ensure code is clean
Hi, the MAME project has a much more accurate TMS5220 emulator.
Do you think it would be possible to integrate MAMe's TMS5220 emulator into your project?
Hi, are there any plans to include Windows builds in the releases?
When I am installing using Homebrew on MacOS 13.4, the build fails with the following error:
==> Installing tornupnegatives/tmsexpress/tms-express
==> cmake -S . -B build
==> make -C build
Last 15 lines from /Users/michael/Library/Logs/Homebrew/tms-express/02.make:
make[2]: *** [CMakeFiles/TMS-Express.dir/src/Interfaces/BitstreamGenerator.cpp.o] Error 1
/tmp/tms-express-20230611-22591-1tgnyn4/TMS-Express-1.1.2/src/main.cpp:6:10: fatal error: 'experimental/filesystem' file not found
#include <experimental/filesystem>
^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/TMS-Express.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/TMS-Express.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 48%] Linking CXX static library ../../../lib/libgtest.a
cd /tmp/tms-express-20230611-22591-1tgnyn4/TMS-Express-1.1.2/build/_deps/googletest-build/googletest && /usr/local/Cellar/cmake/3.26.4/bin/cmake -P CMakeFiles/gtest.dir/cmake_clean_target.cmake
cd /tmp/tms-express-20230611-22591-1tgnyn4/TMS-Express-1.1.2/build/_deps/googletest-build/googletest && /usr/local/Cellar/cmake/3.26.4/bin/cmake -E cmake_link_script CMakeFiles/gtest.dir/link.txt --verbose=1
/usr/bin/ar qc ../../../lib/libgtest.a "CMakeFiles/gtest.dir/src/gtest-all.cc.o"
/usr/bin/ranlib ../../../lib/libgtest.a
[ 48%] Built target gtest
make: *** [all] Error 2
If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):
https://github.com/tornupnegatives/homebrew-tmsexpress/issues
As of v2.0.0, the AudioBuffer
objects and Frame
vector (frame table) owned by the MainWindow
are pointers. While this makes initialization of the MainWindow
easy, ideally pointers (and references) should be used sparingly.
The process of encoding bitstreams for the TMS5220 involves LPC analysis and then frame packing. During frame packing, parameters found during LPC analysis are quantized to their closest value in the TMS5220 coding table.
For pitch period and the LPC reflector coefficients, this is pretty straightforward. However, I am having a difficult time figuring out how to handle the energy parameter. Computing energy as the sum of squares of the audio signal results in a value between zero and one, however the TMS5220 coding table contains only large integer values.
Does anyone know the algorithm used to compute/translate energy for the TMS5220?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.