Commit Briefs

40c37b5c53 Sven M. Hallberg

use arc4random (main)

While crappy old rand(3) is fine for this program and uses arc4random(3) on OpenBSD anyway, the linker spews a warning about it and the noise during compilation is annoying me. FWIW, Linux finally got arc4random(3) with glibc >= 2.36 (2022) so it could actually be considered fairly portable now. However, for the time being, I'd like to still support older systems. NB, the closest "native" alternative, getentropy(3), appears in glibc >= 2.25 (2017), so even it is not exactly ancient, yet. Thur, instead of mucking around with wrappers, feature flags and conditional compilation, rand() is still it for portable.


7100fec23e Sven M. Hallberg

add coefficient (basemul) for base weight


d01528a063 Sven M. Hallberg

use overall rate as baseline weight


7e15a2c893 Sven M. Hallberg

slightly reorder the code in cwinit


0f4e0bbca9 Sven M. Hallberg

clean up return latency code in cwstop


02b03fabec Sven M. Hallberg

remove debug output


237ea00efb Sven M. Hallberg

reset the clock in cwstart

This is a workaround to guard against the possibility that the onmove callback is not called at all. This happens if playback has not started before cwstop(), and hence sio_stop(), is called.


3f64dc1f60 Sven M. Hallberg

fix timing calculation

Measure and take into account the "return latency" of cwstop(), i.e. the time it took between playback stopping ang cwstop() returning, usually negative.


b232461a63 Sven M. Hallberg

try to figure out proper timing

This is an intermediate commit of some experimental changes: - playback in synchronous mode (par.xrun = SIO_SYNC) - tracking of play position via sio_onmove() and total frames written - (broken/ignored) reporting of "time remaining" from sound() and friends - debug instrumentation (#ifdef DEBUGTIME)


ed992560fb Sven M. Hallberg

UI styling


2a60333bac Sven M. Hallberg

fix two typos

Turns out my times were measured in centiseconds rather than milliseconds as advertised. Oops. Only discovered when looking to make them exact for the first time. Had mostly ignored the values as "probably way off anyway". That appears to have been an accurate assessment. X) It does show nicely how the algorithm doesn't care about absolute values. It operated just fine on centiseconds.


7feee87ca3 Sven M. Hallberg

mention MORSE_LEVEL again in README


658c8904c0 Sven M. Hallberg

fix default values in NOTES


4ff4e76f99 Sven M. Hallberg

add CW_AMPLITUDE variable


a7dafd6f19 Sven M. Hallberg

add toc section to README


5f021ff44f Sven M. Hallberg

mention portable branch


ecfbbf7a70 Sven M. Hallberg

integrate teacher mode in morse.c


1ae907d2e8 Sven M. Hallberg

add missing header


8694a77998 Sven M. Hallberg

remove unneeded header


abcddb8e72 Sven M. Hallberg

remove .boring

Artefact from darcs past, not used for git/got.


bb9909862e Sven M. Hallberg

expand notes on G4ILO version


e120e3077e Sven M. Hallberg

comment


ce0d6424ca Sven M. Hallberg

rename sound() <-> play()

The function sound(char) is now the audio hook required by teach.c and should "sound" the given character. The function play(char *) is internal to morse.c for "playing" a sequence of dits and dahs, given as a string of dots and dashes. The morseplay utility (as before) exposes the same functionality. This change also matches function name and signature of play() in the FreeBSD version of morse.c.


cce21a4d4f Sven M. Hallberg

change default shape to sin rise, exp fall

I don't know what I'm doing. Just going by ear and pictures of purportedly clean waveforms.


bd861c4e7a Sven M. Hallberg

add raised inverted cosine (ric) shape

This is the sigmoid function (1 - cos(pi t)) / 2. Also rename "icos" to "cos" to avoid confusion.