[LCWO LOGO]  

Login

User name:
Password:


Language
Български Português brasileiro
Bosanski Català
繁體中文 Česky
Dansk Deutsch
English Español
Suomi Français
Ελληνικά Hrvatski
Magyar Italiano
日本語 Bahasa Melayu
Nederlands Norsk
Polski Português
Română Русский
සිංහල Slovenščina
Srpski Svenska
ภาษาไทย Türkçe
Українська 简体中文
Who is online? (19)


LCWO Discussion Forum [Atom LCWO Forum Feed]

This is a simple discussion forum for LCWO users. Feel free to use it for any kind of discussion related to this website.

Thread: jscwlib: Experimental CW player

Back to the Forum

AuthorText
Administrator


Posted: 2020-05-10 12:41
Hello,

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).

Cons (currently):
* No umlauts and accented characters
* Extra word space not implemented yet.

Pros:
* 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.

73
Fabian

Demo:





Posted: 2020-05-10 12:59
The demo works fine on
Chromium Version 81.0.4044.138
Opera Version:68.0.3618.63
on OpenSUSE LEAP (64).


Firefox quantum 68.8.0esr (64-bit) openSUSE LEAP
doesn't play anything - but I can see activity in the volume control , .


I'd like to tweak rise/fall times - its easier on my ears . .

cb

https://fkurz.net/ham/jscwlib/example/pileup.html

HaHa


Posted: 2020-05-10 13:11
The behaviour is a bit erratic on my Firefox (Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0).

The applet doesn't always show up in "Code Groups". I have to go to "Plain Text Training" and then back to "Code Groups" to make it appear, see screenshot:

https://i.imgur.com/qPZifFt.png

EDIT: refreshing the page seems to work.
Administrator


Posted: 2020-05-10 13:31
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!
Administrator


Posted: 2020-05-10 13:34
cb:
The demo works fine on
Chromium Version 81.0.4044.138
Opera Version:68.0.3618.63
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.

cb:

https://fkurz.net/ham/jscwlib/example/pileup.html
HaHa


That was the real reason I looked into using the WebAPI... build a MorseRunner like tool for the browser :-)

73
Fabian


Posted: 2020-05-10 13:44
myself:

Firefox quantum 68.8.0esr (64-bit) openSUSE LEAP
doesn't play anything - but I can see activity in the volume control


The mp3 download "plays" ( in the browser ) but no sound.

Youtube plays with sound and mp3 from elsewhere
play with sound in the ( firefox ) browser . .

Administrator


Posted: 2020-05-10 16:19
cb:
The mp3 download "plays" ( in the browser ) but no sound.

Interesting. Do you get sound with the same browser if you switch to the "HTML5" player option?

tnx
Fabian


Posted: 2020-05-10 16:34
No, nor from flash

https://html5test.com/

says 498 out of 555 but some codecs missing, so I'll have another look at what the latest updates did to packman . . .


Posted: 2020-05-10 17:30
myselfagain:

No, nor from flash

https://html5test.com/

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 . .

https://cgi2.lcwo.net/cgi-bin/cw.mp3?s=35&e=35&f=688&t=|s4112%20dj1yfk%20%20%20%20%5E
nor this
http://www.arrl.org/files/file/Morse/Archive/30%20WPM/200114_30WPM.mp3
but this does
https://file-examples.com/wp-content/uploads/2017/11/file_example_MP3_700KB.mp3






Posted: 2020-05-10 19:47
windoze 10 Home Edition(1903) Chrome 81 and FireFox 75/76 all ply ok, volume i the played download probably 3db less. Should sliders update the values in real time? Click and try not too granular.

ur off to a great start.
Administrator


Posted: 2020-05-10 20:47
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.

Thanks for all the feedback, again!

Fabian


Posted: 2020-05-11 10:52
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?

SNIP

Fabian



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 !

cb


Posted: 2020-05-11 11:20
Tried code groups on Macos 10.15.4 / Safari 13.1

Played 3 times code groups, all played until the end.

Seems to work nicely!

Gerd.


Posted: 2020-05-11 15:13
Just tried it in MAcOs 10.1.5.4 on Tor Browser 9.0.10 (based on Mozilla Firefox 68.8.0esr):

1) CW sound less hard as compared to Safari, wouldn't have expected that
2) Code groups started without "VVV" (although in settings)
3) Code groups stopped prematurely (no .-.-. although in settings)

This just for info, I agree there is no practical reason to insist on using Tor browser for LCWO.

Gerd.


Posted: 2020-05-11 17:27
is this demo with the lowpass? it seems to have a 'clicky' (rise fall?) sound. on studio headphones.

looks amazing as a feature though!!
Administrator


Posted: 2020-05-11 18:22
Gerd: Thanks for the info.

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.

73
Fabian


Posted: 2020-05-11 20:05
Wow thanks!
Administrator


Posted: 2020-05-11 20:13
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.
Administrator


Posted: 2020-05-11 21:56
I just corrected an error that cut the code groups down to max one minute when using the new Experimental player. Now you can request 5 minutes (or even more if you're crazy enough :-).

The legacy player will stay for sure.

LCWO is open source and you can easily run it locally in a docker container (or on a local Apache server + MySQL, but docker is a lot easier): https://git.fkurz.net/dj1yfk/lcwo/

73
Fabian


Posted: 2020-05-11 22:16
dj1yfk:
I just corrected an error that cut the code groups down to max one minute when using the new Experimental player. Now you can request 5 minutes (or even more if you're crazy enough :-).

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


dj1yfk:

LCWO is open source and you can easily run it locally in a docker container (or on a local Apache server + MySQL, but docker is a lot easier): https://git.fkurz.net/dj1yfk/lcwo/

73
Fabian

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.



Posted: 2020-05-12 08:04
Timing seems ok on MacOS & Safari. 28 x PARIS at 28/28 takes a minute quite exactly, and so does 56/28.


Posted: 2020-05-12 18:45
Q20 for me, less get the snappy edges

IMHO

wa2nfn
Administrator


Posted: 2020-05-12 21:31
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.
Administrator


Posted: 2020-05-12 21:33
stillAtIt:
Q20 for me, less get the snappy edges


Thanks.

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.

73
Fabian



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).


This is the file generated by the javascript player:
https://cgi2.lcwo.net/cgi-bin/cw.mp3?s=20&e=4&f=680&t=u-5%22x%20|f610%20,6-7d%20|f834%20h1zs%20|f630%20(0-(7a%20|f815%20)(ng%20|f773%20gx=:%22m%20|f547%201i;syg%20|f560%20l+(cydf%20|f620%20pt,zd%20|f527%209xtf%20|f686%200))8o%20|f588%20qm%20|f737%20z+y?f1%20|f509%20vh%27@:%20|f804%20=xv44g%20|f549%205d%20|f767%20;ioxd%20|f738%20cf%2284%27%20|f858%20fb:5%27%20|f587%20yc)v?%20%20%20%20%5E

And this is the one generated by the standard html player:
https://cgi2.lcwo.net/cgi-bin/cw.mp3?s=20&e=4&f=680&t=%7CS2000%20%7CW0%2020R72%2B7%20%7Cf533%20Q0%3AI%20%7Cf601%20QU%20%7Cf504%20.%40%40F%28%3D%20%7Cf893%20MAX%20%7Cf761%20D4TV%3F%20%7Cf620%20%28%2F%3FH4X7%20%7Cf633%20YR-%2B4G%20%7Cf646%20QE%40OX%20%7Cf784%20%2888P4%3F%20%7Cf824%20%29.S%20%7Cf680%20JJ%20%7Cf733%20FQ%2B.SH%20%7Cf827%209Y7%27%28%20%7Cf711%20-7%28OVW%20%7Cf554%20C1LOH%20%7Cf707%20%3F%2B%3A%2F%20%7Cf725%20FQ%2B%3F9%20%7Cf595%20M%29PCA%20%7Cf573%20L4%20%7Cf731%202O5%2CH%20%7Cf717%20DJJ0L%20%7Cf531%20%2B%22.CIU%20%7Cf680%20%3D%2F%27%2FE%20%7Cf505%20%3F4IB3%20%7Cf591%20MAG56%222%20%7Cf891%2052XF%20%7Cf894%20XXV%2C8%20%7Cf512%20E%2CF%3D%28%20%7Cf595%206L%40%27%20%7Cf522%20RVZ3%20%7Cf586%20.GY3U%3B%20%20%20%20%5E

As you can see one is 3:11 and the other is 4:57
Administrator


Posted: 2020-05-13 06:47
oc: Now I see!

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...

73
Fabian
Administrator


Posted: 2020-05-13 09:47
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.

Edit 2020-05-14: This is fixed now.

73
Fabian


Posted: 2020-05-21 20:34
In word training, the settings of the new controls doesn't take the speed value of the lead page but instead defaults to 99WPM (I only wish LOL)

also even though wpm and eff. when set to the same value (as indicated on the RHS) the bars on the sliders always has eff. ahead (to the right) by the full width of the slider.

Of course these are non-blocking, and we know its a work in progeess.

73
wa2nfn
Administrator


Posted: 2020-05-22 13:05
wa2nfn:
In word training, the settings of the new controls doesn't take the speed value of the lead page but instead defaults to 99WPM (I only wish LOL)

:-)

As soon as the first call is sent, this is set to the correct speed.

wa2nfn:
also even though wpm and eff. when set to the same value (as indicated on the RHS) the bars on the sliders always has eff. ahead (to the right) by the full width of the slider.

Of course these are non-blocking, and we know its a work in progeess.

Cosmetics are also important :-)

Fixed, except for the effective speed slider, which always shows the right value but is sometimes at a wrong position... will look into that later.

73
Fabian


Posted: 2020-05-22 17:11
Code Groups - custom, clicked the User real speed box, then the setting gear.

the speed shows with about 16 decimal places.

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?

73 Bill
Administrator


Posted: 2020-05-22 18:13
wa2nfn:
Code Groups - custom, clicked the User real speed box, then the setting gear.

the speed shows with about 16 decimal places.


Fixed, thanks.

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.

73
Fabian


Posted: 2020-05-22 23:43


the speed shows with about 16 decimal places.

Fix confirmed tnx


I see you add char truncation faster than I added url.PathEscape ;-) belt and suspenders, its covered now at both ends! tnx

Tnx fer speed explanation. I hope you haven't caused yourself a lot of work with this in terms of scoring.

73
Bill
Administrator


Posted: 2020-05-23 08:10
Scores that were made with "Real" will simply count for their Paris equivalent speed; I think that's fair :)

73
Fabian


Posted: 2020-05-23 10:16
The effective speed of the new experimental player seems slower. I toke my lessons at 20/5 but now configured at 20/8 for about the same speed experience.
Administrator


Posted: 2020-05-23 13:16
Yes, the old player is quite inaccurate with Farnsworth timing.


Posted: 2020-05-23 13:40
So actually I was faster all the time :)
Thank you for the upgrade Fabian. Also that its working for iOS / Safari!


Posted: 2020-05-26 11:29
New (experimental) player still gives me a 2:47 min file instead of the requested 5 minutes, regardless of which exercise I choose (Code Groups, lessons, etc).

These are my settings:
https://i.imgur.com/Gf1StVd.png
Administrator


Posted: 2020-05-26 12:21
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.

73
Fabian



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).



Posted: 2020-05-29 03:31
placing "|W2 " at start of text shows correctly in the converted buffer but plays as if it were given
|w2 not |W2 i.e. 2 wpm instead of 2x word spacing at the wpm given by the drop down

Bill
Administrator


Posted: 2020-05-29 12:35
Fixed. Internally jscwlib converts everything to lowercase first, so my bad design decision to have the two commands |W for Extra Word Space and |w for wpm now backfires :-)

|W is now converted to |z for internal use within the library...


Posted: 2020-05-29 14:53
Tnx fer quick remediation.

I've suffered the pain of too many options, and trying to make them logical.

Back to the Forum

You must be logged in to post a message.