those who are adventurous may want to go to their CW settings and select the new "Experimental" CW player based on the "jscwlib", a small library that generates Morse code entirely locally in the browser (https://fkurz.net/ham/jscwlib.html).
* No umlauts and accented characters
* Extra word space not implemented yet.
* Every player has a small "settings" icon which allows changing some parameters on the fly.
* Timing calculations are now quite precise (also for Farnsworth)
* The player allows selecting PARIS or REAL character speed (can be selected in the code groups training)
* No network delays, all code is generated locally
It will fall back to the HTML5 player if the browser doesn't support the Web Audio API (e.g. Internet Explorer).
There's still a lot to do, like fine tuning the shaping of the CW characters (rise and fall times), but I like to share these things with the public as soon as possible to get feedback.
If you're having some trouble with this new player, please kindly let me know which browser and operating system you're using.
oc: Thanks for the feedback. I am quite sure I see the problem: You're using custom characters and I am not properly escaping the " character. Any text that includes a " will break the site... I can reproduce this. Will fix it!
cb: The demo works fine on
Chromium Version 81.0.4044.138
on Open SUSE 64.
I'd like to tweak rise/fall times - its easier on my ears . .
OK. I am just switching the tone on and off without any rise-time but then use a simple low-pass filter behind it to shape it. There are many parameters to play with... In a later stage this should be an user defined setting.
says 498 out of 555 but some codecs missing, so I'll have another look at what the latest updates did to packman . . .
Well packman updated - funny - some stuff rolled back a version, but still nothing out of the speakers . .
I can see activity in the "output device" in Volume control.
Almost as if its playing "loud silence . . ."
The browser mp3 player is strange - not much to go wrong there and it plays mp3 from test sites . .
This doesn't make a sound . .
but this does
cb: Thanks. That's strange... not exactly sure how to debug this, but it's a little comforting that also (some) other MP3s don't play. Maybe there's some message on the console (press F12 to open it) that may shed some light on it?
wa2nfn: Only the volume slider works while it is playing, the others are disabled. In Chrome the other sliders are greyed out while it's playing, but e.g. in Firefox there's no visual indication. I'll check if I can improve that.
The files you can download are generated with the same method as ever (on the server side) - for now. Prio 1 is to get this player running smoothly and implement the remaining functions to make it a full replacement.
dj1yfk: cb: Thanks. That's strange... not exactly sure how to debug this, but it's a little comforting that also (some) other MP3s don't play. Maybe there's some message on the console (press F12 to open it) that may shed some light on it?
It's probably a combination of firefox and linux codexs ( and will have a small user base )
Prob better to fix other things first . .
I'll have another look . . I already tried consoles , developer etc but I don't know much about it so need to read
good stuff anyway. Hope it isn't taking too much of your time !
daemonix: Yes, this demo uses one of the pre-defined filters that the Audio API offers, in low-pass mode (https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode). The corner frequency is set to the tone frequency and I am using the default Q value. It has a 12dB/octave roll-off.
It may very well be that different browsers implement this filter slightly different, resulting in more or less pleasant sound depending on your browser (and of course headphones).
There's an IIR filter implementation (https://developer.mozilla.org/en-US/docs/Web/API/IIRFilterNode) that I will have a look at. I need to figure out the filter coefficients myself, but then I can shape it arbitrarily.
I'll play around with the different options (maybe cascading two filters will already do the job). A better filter will also be needed at a later stage when I activate the background noise feature, which should generate a noise that's shaped more or less like that of a real radio's CW filter, rather than white noise or so.
OK. I made some changes to the filter Q and it already looks a lot better. The default is 10 now (it was 1), and it gives a nice rise and fall time. Below you will see a demo of the different Q values, both by audio and visual (the library has a built-in oscilloscope tool now!):
Change filter Q on the fly:
Let me know which Q values you like best.
Posted: 2020-05-11 21:32
dj1yfk: oc: Thanks for the feedback. I am quite sure I see the problem: You're using custom characters and I am not properly escaping the " character. Any text that includes a " will break the site... I can reproduce this. Will fix it!
Hi, even selecting only letters or numbers, I still get a total length of the file of about 32-35 seconds max, not 5 or 10 minutes.
In any case, please leave the legacy hmtl5 player option available.
In the past, you said your were going to release an offline version. Is this available yet? I'd really like to have a standalone LCWO application for Linux.
oc: Still broken for me. I requested 5 minutes but it gives me only 3 minutes. And I requested 4wpm but it's definitely slower, probably 2 wpm
I cannot figure out what may be wrong. I requested 5 minutes at 20wpm char speed/4wpm effective and the resulting file with jscwlib was 300.5 seconds long (+ 1 second start delay).
oc: I haven't had much time to look at the code, but is it possbile to run it natively without docker? I'm not a big fan of docker. I'd also like to run it on NetBSD, where docker cannot run. Thanks.
Yes, it's absolutely possible. Just have a look at the Dockerfile, which you can use as a guide what to set up on your system. Apache2 + PHP + MySQL (or MariaSQL), and if you use the "classic" CGI solution for CW tone generation, you have to compile ebook2cw yourself. That's it.
I personally prefer 5 or 10. Different people obviously have different preferences (and it sounds different depending on your speaker or headphone's frequency response), so I will make it a configuration option that every user can set to their linking.
Posted: 2020-05-13 00:43
dj1yfk: I cannot figure out what may be wrong. I requested 5 minutes at 20wpm char speed/4wpm effective and the resulting file with jscwlib was 300.5 seconds long (+ 1 second start delay).
And this is the one generated by the standard html player:
The problem is this: When you select the standard HTML5 player, LCWO knows that the CW generator (ebook2cw) doesn't get Farnsworth quite right. At 20wpm/4wpm, the generated text would be too short (because it uses word spaces that correspond to 4wpm PARIS and characters that are 20wpm, but to make it actual 4wpm effective then, the word spaces would have to be even longer to account for the shorter characters. So LCWO simply extends the text to what comes out as the desired length, e.g. 5 minutes. That's the 2nd link. It contains 32 groups for 5 minutes, which actually is 6.4wpm effective!
The new player gets the Farnsworth timing right. It generates 20 groups (4wpm effective), and when played with the new player itself, it ends up at almost exactly 5 minutes. However if you click the download link, the MP3 will still be generated by the old CW generator, and then of course the timing is off.
So, it's about time to fix the old CW generator, too, to make these two equal...
To make the play time more obvious (with the new player), I changed it to show both the current time and the total time in the UI (e.g. 0:23/5:32).
I still need to adjust the number of groups created to match the requested time a bit better; currently (with the new player) the generated text will be rather too long because random letters are longer than PARIS, and figures even more so.
wa2nfn: Code Groups - custom, clicked the User real speed box, then the setting gear.
the speed shows with about 16 decimal places.
wa2nfn: also I has set my speed in CW settings to 14wpm, with the use real speed check box it claims its over 19 - is the disparity really that much? or is that on going tuning?
Yes, the difference can be very big. For example if you select figures only, at 14wpm Real, the Paris speed will be about 25 WpM. Figures are simply "so long" compared to the characters of PARIS that you need to crank up the speed in order to put 14 * 5 = 70 of them into one minute. For letter groups this effect is not so big, but still you'll end up with more than 14 WpM Paris because randomly chosen characters are longer than P A R I S.
The downloaded MP3 file may be 2:47, but not what the player itself generates, right?
The player tries to get as close to 5 minutes as it can, with the settings, and rather a little shorter than longer (it ends up at around 4:30-4:40 when I tried it a few times; an additional group would be above 5 minutes).
The download link leads to the "old" CW generator (ebook2cw) which still has significantly wrong timing and therefore the generated files are too short (pauses too short). I will fix this eventually, although the new player will become the default soon and that's what I am currently focusing my development efforts on.
Posted: 2020-05-26 15:33
dj1yfk: The downloaded MP3 file may be 2:47, but not what the player itself generates, right?
True, but the speed is definitely not 3wpm as requested; probably only 1 wpm. The total number of characters varies between 57 and 67 for 5 minutes, which is not what I'd expect (usually between 135 and 145).
I notice that jscwlib is now recommended. I find that switching to jscwlib causes the CW output to be noticeably slower than HTML5. Is that to be expected? Specifically there is more time between characters than with HTML5. I'm using Chrome on a MAC if that matters.
The old CW generator indeed generated inter-character spaces in Farnsworth mode that were not correct, i.e. too short. jscwlib on the other hand is relatively precise. If you feel that the speed you get with jscwlib is too slow, increase it! I may increase the default effective speed to make up for the difference...
Posted: 2020-06-16 10:14
whegardt: I find that switching to jscwlib causes the CW output to be noticeably slower than HTML5. Is that to be expected? Specifically there is more time between characters than with HTML5.
I started with the old player and it doesn't make sense for me to switch to the new player.
Better text case
Below plays in HTML5 but not new player
If a space is inserted after |S400 it works,
will the new behavior require the space on both sides of dynamic options? I thought your parsing of option detected either a pipe or a space as the terminator.
Thanks for this marvelous addition, particularly useful for those of us far removed from Europe.
I tried it out Firefox 78.ob7 64bit running on an iMac and it works just fine.
The Cw sounds a bit "puffy" for lack of a better description: there is a funny little puff between one character and the next. It seems to drop, but doesn't quite disappear, when I increase word space.