Uploaded July 2025 | Updated December 2026, 1 day ago
C++ software Morse Code CW Keyboard runs smooth on a raspberry pi 4
with much lower CPU use and DSP LOAD use than trying to the run the same keyboard written in python.
(NOTE: all software code for this CW KEYBOARD, is from free ai engines)
MAIN FEATURES
1. multiple RAMP FUNCTIONS, raised cosine, sigmoid, PSWF, Kaiser
2. TAB feature stops audio and move to end of buffer ready to type again for fast break in
3. CLEAR ALL TEXT to remove all text from typing screen
4. every cw timing setting is adjustable
5. can change colors and sizes of text
6. can copy paste text and have it play, and change cw timings on the fly to find the ideal sound you are looking for...
7. backspace over unsent text still in your type ahead buffer to correct typos, and start retyping ... color change from UNSENT TEXT to SENT TEXT stays in sync with actual current sending audio
8. save any ramp function and its cw timing settings once you find your ideal combo
Here is the main.cpp file, make sure to change the name from what it is at this link, to only say on its name main.cpp after you download it, etc... https://u.pcloud.link/publink/show?code=XZpzc25ZIYo4wBDM8sJTTo6dK3Cit4piEsty
Here is the MorseApp.pro contents to use with your qmake compile...
place what is below into its own file, call it MorseApp.pro, alongside the main.cpp file from the link above
###########################
# Project metadata
QT += core gui widgets
CONFIG += c++17 console warn_on
# Build both debug & release
CONFIG += debug_and_release
# Avoid Qt macro keyword clashes
CONFIG += no_keywords
DEFINES += QT_NO_KEYWORDS
# Sources
SOURCES += main.cpp
# Include paths
INCLUDEPATH += \
/usr/include/eigen3 \
/usr/include/jack
# Libraries
unix {
JACK_CFLAGS = $$system(pkg-config --cflags jack)
JACK_LIBS = $$system(pkg-config --libs jack)
QMAKE_CXXFLAGS += $$JACK_CFLAGS
LIBS += $$JACK_LIBS
}
# Boost libraries
LIBS += -lboost_math_tr1 -lboost_math_c99 -lboost_thread -lboost_system
# Compiler flags
QMAKE_CXXFLAGS_RELEASE += -O2
QMAKE_CXXFLAGS_DEBUG += -g
# Target executable
TARGET = MorseApp
#########################
attach both files to your AI of choice and ask it what other dependencies you need on your pi to get this compiled...and help you build this on your pi or change it to your preference
then run
1. qmake MorseApp.pro
2 make
3. ./MorseApp
if all goes well, the app will appear on the desktop
you must have JACK AUDIO CONNECTION KIT setup for this C++ audio engine that is coded into the CW KEYBOARD main.cpp code to work...
C++ software Morse Code CW Keyboard runs smooth on a raspberry pi 4
with much lower CPU use and DSP LOAD use than trying to the run the same keyboard written in python.
(NOTE: all software code for this CW KEYBOARD, is from free ai engines)
MAIN FEATURES
1. multiple RAMP FUNCTIONS, raised cosine, sigmoid, PSWF, Kaiser
2. TAB feature stops audio and move to end of buffer ready to type again for fast break in
3. CLEAR ALL TEXT to remove all text from typing screen
4. every cw timing setting is adjustable
5. can change colors and sizes of text
6. can copy paste text and have it play, and change cw timings on the fly to find the ideal sound you are looking for...
7. backspace over unsent text still in your type ahead buffer to correct typos, and start retyping ... color change from UNSENT TEXT to SENT TEXT stays in sync with actual current sending audio
8. save any ramp function and its cw timing settings once you find your ideal combo
Here is the main.cpp file, make sure to change the name from what it is at this link, to only say on its name main.cpp after you download it, etc... https://u.pcloud.link/publink/show?code=XZpzc25ZIYo4wBDM8sJTTo6dK3Cit4piEsty
Here is the MorseApp.pro contents to use with your qmake compile...
place what is below into its own file, call it MorseApp.pro, alongside the main.cpp file from the link above
###########################
# Project metadata
QT += core gui widgets
CONFIG += c++17 console warn_on
# Build both debug & release
CONFIG += debug_and_release
# Avoid Qt macro keyword clashes
CONFIG += no_keywords
DEFINES += QT_NO_KEYWORDS
# Sources
SOURCES += main.cpp
# Include paths
INCLUDEPATH += \
/usr/include/eigen3 \
/usr/include/jack
# Libraries
unix {
JACK_CFLAGS = $$system(pkg-config --cflags jack)
JACK_LIBS = $$system(pkg-config --libs jack)
QMAKE_CXXFLAGS += $$JACK_CFLAGS
LIBS += $$JACK_LIBS
}
# Boost libraries
LIBS += -lboost_math_tr1 -lboost_math_c99 -lboost_thread -lboost_system
# Compiler flags
QMAKE_CXXFLAGS_RELEASE += -O2
QMAKE_CXXFLAGS_DEBUG += -g
# Target executable
TARGET = MorseApp
#########################
attach both files to your AI of choice and ask it what other dependencies you need on your pi to get this compiled...and help you build this on your pi or change it to your preference
then run
1. qmake MorseApp.pro
2 make
3. ./MorseApp
if all goes well, the app will appear on the desktop
you must have JACK AUDIO CONNECTION KIT setup for this C++ audio engine that is coded into the CW KEYBOARD main.cpp code to work...


![Raspberry Pi 4 Pulse Density Modulated CW Transmitter for THROUGH THE EARTH Cave Radio Comms at 8Khz
using this PDM-CW TRANSMITTER PYTHON PROGRAM:
https://u.pcloud.link/publink/show?code=XZsdt45ZB74hUtmVwMYakpGj6aapdSP0xgry
GROK3 wrote this PDM-CW TRANSMITTER user manual PDF
https://u.pcloud.link/publink/show?code=XZhb645Z2DL9sqlUnPFPoa3bOPhscVvBTIIX
a morse code keyboard is brought up to the raspberry pi 4 desktop that when text is entered, according to the speed of wpm set by the user, two well timed signals are sent to control a Capacitive Discharge Circuits POWER supply and SCR/HV Pulse Capacitor which creates a TRANSMIT Pulse Density Modulated CW signal... the setup is as follows, for each dit the program sends one 50 μS pulse width output to Trigger the PDM-CWs SCRs GATE, releasing the stored PULSE CAP energy into the TRANSMIT COIL ANTENNA, creating a self resonant DAMPED SINE WAVE VLF signal output at around 8Khz... to preserve portable battery power, PULSE DENSITY MODULATION is used so that only 1 pulse at zero point is used for a dit, and for a DAH, only 3 pulses, spaced 1 dit length apart, at ZERO, 1D, and 2D, at whatever speed is set by the user, however, each DAH and dit timing is still preserved by the python TRANSMIT CW KEYBOARDs internal timing math so that when just one dit length of time is added to every pulse at the receiver, and used to key a midi cw software keyer, the original CW ELEMENT LENGTHS are reproduced at the receive site the first thing that happens when text is entered into the cw keyboard, is that the python program turns on GPIO pin 19 for a certain amount of time according to the current WPM speed, this time charges the HV PULSE CAP of the PDM-CW transmitter(low DC TO high DC inverter) then 1 ms before the DIT or DAH pulse is keyed by the SCR signal on GPIO PIN 18, pin 19 turns off , turning off the power to the PDM-CW transmitter so that the SCR will STOP right after it fires and the damped sine wave 8khz output drops to zero(this pin 19 cycle helps to commutate the SCR in the case of using a too low of inductance EMF kick back from the coil antenna that does not contain enough ooomph to commutate the SCR itself etc) each pulse gets the same amount of charging time so that the joules collected in the pulse capacitor are the same for each pulse according to the WPM speed being used and the length of one dit minus 1 ms.... so at slower speeds, there is more charging time for each pulse and thus more VLF magnetic EMF signal at 8khz is released per pulse
NOTE: both GPIO pins activate LEDs inside SOLID STATE RELAYs one SSR can handle 6 amps and has a TURN OFF time of .1 to 1 ms, and a TURN ON time of 2 to 4 ms the other SSR is used by pin 18 with a much faster turn on time of around 30 to 50 μS so that the SCR GATE is only triggered by the least amount of pulse width possible from pin 18
NOTE: this python GPIO pdm-cw transmitter code was written by GROK3
you can attach the linked above python code in a file and feed it to GROK3 to ask more questions about this setup and how the code works on a pi4/s GPIO pins
RECEIVER SETUP
a pick up magnetic field VLF ANTENNA is connected to the LAPTOPs mic input jack... ( NOTE, you can strengthen the RX signal substantially at the receiver if you put a cap in parallel with the antenna to resonate at the TRANSMIT VLF FREQ [8Khz] ) for each pulse received, a sidechain gate adds 1 dits worth of time to each pulse and creates a CW MIDI note output restoring the original dit length that the TRANSMITTER is using... for a dah, then, since the dah sent by the transmitter is using 3 pulses sent at ZERO, 1D, AND 2D each pulse gets 1 dit worth of time added to it by the sidechain settings and at the end of 3 dits at 1d time each, = 1 dah etc..
goes to the MIDI sidechains midi output port and keys the midi input of RECRI KEYERs CW KEYER module https://github.com/recri/keyer Raspberry Pi 4 Pulse Density Modulated CW Transmitter for THROUGH THE EARTH Cave Radio Comms at 8Khz](https://i.ytimg.com/vi/hW8iGwB9C8g/mqdefault.jpg)







![Advanced High Performance QRQ CW Keyboard written in the RUST language by Gemini A.i. - LiVE DEMO
Advanced High Performance QRQ CW software CW Keyboard written in the RUST language by the A.I. Gemini , has many optimum features and functions that are demoD in this video show & tell
the 1st working version as demod in this video, RUST main.rs file is here:
https://u.pcloud.link/publink/show?code=XZjHVB5Zk32BR3jX3oHmkRW9b57gLFVjiknk
its Cargo.toml file contents are below:
# Cargo.toml
[package]
name = Rust_CW_Keyboard_Filtered
version = 0.1.0
edition = 2024
[dependencies]
jack = 0.13.3
gtk4 = { version = 0.9.7, package = gtk4 }
glib = 0.20.12
num-complex = 0.4
uuid = { version = 1.10.0, features = [v4] } # For unique JACK client and GTK app IDs
similar = 2.7.0
crossbeam = 0.8.4
pango = 0.20
crossbeam-channel = 0.5.15
lazy_static = 1.5.0
serde = { version = 1.0, features = [derive] } # Added for serialization
serde_json = 1.0 # Added for JSON handling
log = 0.4 # Added for logging facade
# Dependencies from the Bandpass Filter
realfft = 3.4
statrs = 0.16 # Used for Bessel I0 in the filter, though a custom one is provided. Keeping for completeness.
UPDATE: JULY 19, 2025
here is an improved version of this RUST CW KEYBOARDs main.rs here
https://u.pcloud.link/publink/show?code=XZgUwB5Z8yIbaU8FL18ygGVxqP4KnH8mGaQX
CLAUDE SONNET 3.5 says these are the improvements:
Key Improvements in mainrs18.txt:
Better error handling using thiserror
More efficient memory management
Better thread safety with proper mutex handling
More comprehensive documentation
Better separation of concerns
Follows Rusts official style guide
The changes are verifiable in the code and supported by official Rust documentation.
mainrs18.txt represents the most mature and production-ready version of the codebase.
here is the CARGO TOML FILE CONTENTS to go along with the improved mainrs18.txt(main.rs)
# Cargo.toml
[package]
name = Rust_CW_Keyboard_Filtered
version = 0.1.0
edition = 2024
[dependencies]
jack = 0.13.3
gtk4 = { version = 0.9.7, package = gtk4 }
glib = 0.20.12
num-complex = 0.4
uuid = { version = 1.10.0, features = [v4] } # For unique JACK client and GTK app IDs
similar = 2.7.0
crossbeam = 0.8.4
pango = 0.20
crossbeam-channel = 0.5.15
lazy_static = 1.5.0
serde = { version = 1.0, features = [derive] } # Added for serialization
serde_json = 1.0 # Added for JSON handling
log = 0.4 # Added for logging facade
# Dependencies from the Bandpass Filter
realfft = 3.4
statrs = 0.16 # Used for Bessel I0 in the filter, though a custom one is provided. Keeping for completeness.
thiserror = 1.0.69
for more info on QRQ CW, please see our website here:
https://qrqcwnet.ning.com/ Advanced High Performance QRQ CW Keyboard written in the RUST language by Gemini A.i. - LiVE DEMO](https://i.ytimg.com/vi/n9yra2jVWtc/mqdefault.jpg)