CPCWiki forum

General Category => News & Events => Topic started by: norbert_kehrer on 09:14, 14 February 21

Title: Soundtrakker player in JavaScript
Post by: norbert_kehrer on 09:14, 14 February 21
I wrote a little music player in JavaScript for songs composed on the cool "Soundtrakker" program. It plays more than 300 music modules (all I could find) in the webbrowser. I did not (yet) include a full-fledged emulator for the AY-3-8910 soundchip of the CPC, but just used the standard oscillators of the browser's Web Audio API, so it will not sound as cool as on the real hardware, and sometimes be also a little bit out of tune. So, in such cases it is (mostly) not the song authors who are to blame, but my program. For most songs it seems to work quite OK, though.


You can try out the player directly right here: https://norbertkehrer.github.io/st_player/st_player.html (https://norbertkehrer.github.io/st_player/st_player.html)


I also published the complete source code of my JavaScript program on Github: https://github.com/norbertkehrer/soundtrakker_player (https://github.com/norbertkehrer/soundtrakker_player)


Have fun!


Norbert
(https://norbertkehrer.github.io/st_player/soundtrakker.png)
Title: Re: Soundtrakker player in JavaScript
Post by: Targhan on 10:09, 14 February 21
Ahah, this is really cool stuff :).

The sound quality is not excellent though (strangely enough, using a "high quality" filter sounds really bad), and the timing seems jittery. But it's very listenable nonetheless :).

Where did you get all those Soundtrakker files? I'd like to record some for the radio.
Title: Re: Soundtrakker player in JavaScript
Post by: GUNHED on 17:29, 14 February 21
Super Sache!
Title: Re: Soundtrakker player in JavaScript
Post by: BSC on 19:25, 14 February 21
Quote from: norbert_kehrer on 09:14, 14 February 21
You can try out the player directly right here: https://norbertkehrer.github.io/st_player/st_player.html


I also published the complete source code of my JavaScript program on Github: https://github.com/norbertkehrer/soundtrakker_player

This is awesome! I always wanted to do that myself, good that I don't have to do it anymore :)
I have just listened to one tune and you said it yourself: It does not yet sound like the real thing.
Are you already planning to add a full-fledged AY emulation?

In any case: Let me know if you need any input or help. I would love to support this project.
Title: Re: Soundtrakker player in JavaScript
Post by: norecess464 on 01:50, 15 February 21
Wwwooooaaahhhhh so much love for the CPC on valentine day !!!  :-* :-* :-* :-* :-*
Title: Re: Soundtrakker player in JavaScript
Post by: norbert_kehrer on 07:44, 15 February 21
Thank you all for your nice comments.


@Targhan (https://www.cpcwiki.eu/forum/index.php?action=profile;u=110), thanks, most of the files are from Grim's page here https://www.grimware.org/doku.php/documentations/software/soundtrakker/start (https://www.grimware.org/doku.php/documentations/software/soundtrakker/start). At the bottom there is a song repository.


@BSC (https://www.cpcwiki.eu/forum/index.php?action=profile;u=480), first of all, thank you for Soundtrakker! I am trying to build an AY-3-8910 emulator also, but I just started. A challenge I had already with the current version is the correct timing. It is almost unbelievable, but browsers still seem to have a problem to do something reliably at a rate of 50 times per second (probably due to the underlying OS, though). But, I just read the Soundtrakker manual again yesterday, and it seems, that Soundtrakker's minimum "delay" parameter is anyway 2, so sound parameter changes should only happen 25 times per second. So, it could be fine. I will keep you posted.


So long


Norbert
Title: Re: Soundtrakker player in JavaScript
Post by: Skunkfish on 09:23, 15 February 21
Wow, that's reallly nice!

Is there a way to mute individual channels?

Also, the speed goes crazy when I change tabs, but I kinda like the effect on some songs  ;D
Title: Re: Soundtrakker player in JavaScript
Post by: Targhan on 09:27, 15 February 21
Quote from: norbert_kehrer on 07:44, 15 February 21Soundtrakker's minimum "delay" parameter is anyway 2, so sound parameter changes should only happen 25 times per second.
Mmmh, this is wrong. The replay rate is still always 50 times per second, but the change of "line" is 25hz max. This does not change how much data you have to generate.
Title: Re: Soundtrakker player in JavaScript
Post by: BSC on 20:59, 15 February 21
Quote from: norbert_kehrer on 07:44, 15 February 21But, I just read the Soundtrakker manual again yesterday, and it seems, that Soundtrakker's minimum "delay" parameter is anyway 2, so sound parameter changes should only happen 25 times per second.

Well, delay 1 exists and is supported by the player. It's just the pattern display in the tracker is not fast enough, so there's no pattern display at delay 1.

Concerning the stable replay, I wonder if the solution described here would help mitigate the jitter?

https://stackoverflow.com/a/29972322
Title: Re: Soundtrakker player in JavaScript
Post by: BSC on 21:04, 15 February 21
Quote from: norbert_kehrer on 07:44, 15 February 21I am trying to build an AY-3-8910 emulator also, but I just started.

You might not have to re-invent the wheel. Someone already did the work:

https://github.com/alexanderk23/ayumi-js
Title: Re: Soundtrakker player in JavaScript
Post by: norbert_kehrer on 02:26, 16 February 21
Thank you for the links, BSC.


I already added the timing solution from stackoverflow you proposed. The AY emulator of Alexander Kovalenko looks (and sounds) cool also. I will include it into the player and keep you posted.


So long


Norbert
Title: Re: Soundtrakker player in JavaScript
Post by: norbert_kehrer on 09:23, 19 February 21
Hi,


I replaced the simple oscillators in my little Soundtrakker player by Alexander Kovalenko's AY emulator. Thanks again to BSC for the hint. It sounds much better now (at least on a fast computer).


If you want to try the new version with more than 300 cool CPC songs, just go to https://norbertkehrer.github.io/st_player/st_player.html (https://norbertkehrer.github.io/st_player/st_player.html).


I also released the full source code here https://github.com/norbertkehrer/soundtrakker_player (https://github.com/norbertkehrer/soundtrakker_player)


Have fun!


Norbert
Title: Re: Soundtrakker player in JavaScript
Post by: norecess464 on 14:02, 19 February 21
Yes I confirm it sounds much better! Great work!
Title: Re: Soundtrakker player in JavaScript
Post by: norbert_kehrer on 07:55, 21 February 21
I added a piano roll display to the Soundtrakker player to choose as an alternative to the classic note/instrument/effect display. I also included checkboxes to mute each channel individually.


If you want to try the new display variant and play around with channel muting, you can do so at https://norbertkehrer.github.io/st_player/st_player.html (https://norbertkehrer.github.io/st_player/st_player.html)


Here is a screen shot showing the piano roll display:


(https://norbertkehrer.github.io/st_player/soundtrakker_scroll.png)
Title: Re: Soundtrakker player in JavaScript
Post by: Gryzor on 14:44, 23 February 21
My underlings coworkers here at the office surprisingly liked the tunes I played over lunch.


I think.
Title: Re: Soundtrakker player in JavaScript
Post by: BSC on 15:56, 06 March 21
Quote from: Gryzor on 14:44, 23 February 21
My underlings coworkers here at the office surprisingly liked the tunes I played over lunch.

I think.


Then you probably didn't play too much of Kangaroos crappy songs  :laugh:
Title: Re: Soundtrakker player in JavaScript
Post by: Gryzor on 09:52, 08 March 21
Quote from: BSC on 15:56, 06 March 21

Then you probably didn't play too much of Kangaroos crappy songs  :laugh:

When we get back form corona isolation, sure.
Powered by SMFPacks Menu Editor Mod