Author Topic: Soundtrakker player in JavaScript  (Read 2207 times)

0 Members and 1 Guest are viewing this topic.

Offline norbert_kehrer

  • CPC464
  • **
  • Posts: 7
  • Country: at
    • Norbert's Emulators
  • Liked: 48
  • Likes Given: 8
Soundtrakker player in JavaScript
« on: 10: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


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


Have fun!


Norbert
« Last Edit: 10:17, 14 February 21 by norbert_kehrer »

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.402
  • Country: fr
  • Liked: 1331
  • Likes Given: 195
Re: Soundtrakker player in JavaScript
« Reply #1 on: 11: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.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.794
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1300
  • Likes Given: 3031
Re: Soundtrakker player in JavaScript
« Reply #2 on: 18:29, 14 February 21 »
Super Sache!
http://futureos.de --> Get the revolutionary FutureOS (Update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)

Offline BSC

  • 464 Plus
  • *****
  • Posts: 349
  • Country: de
  • CPC 464 aspirant
    • my (Android) mobile game
  • Liked: 494
  • Likes Given: 461
Re: Soundtrakker player in JavaScript
« Reply #3 on: 20:25, 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.

Offline norecess

  • CPC6128
  • ****
  • Posts: 258
  • Country: ca
  • Liked: 525
  • Likes Given: 271
Re: Soundtrakker player in JavaScript
« Reply #4 on: 02:50, 15 February 21 »
Wwwooooaaahhhhh so much love for the CPC on valentine day !!!  :-* :-* :-* :-* :-*

Offline norbert_kehrer

  • CPC464
  • **
  • Posts: 7
  • Country: at
    • Norbert's Emulators
  • Liked: 48
  • Likes Given: 8
Re: Soundtrakker player in JavaScript
« Reply #5 on: 08:44, 15 February 21 »
Thank you all for your nice comments.


@Targhan, thanks, most of the files are from Grim's page here https://www.grimware.org/doku.php/documentations/software/soundtrakker/start. At the bottom there is a song repository.


@BSC, 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

Offline Skunkfish

  • Supporter
  • 6128 Plus
  • *
  • Posts: 706
  • Country: gb
  • Editor of Colour Personal Computing
    • CPCSTORE.CO.UK - Dedicated to the Amstrad CPC
  • Liked: 522
  • Likes Given: 1409
Re: Soundtrakker player in JavaScript
« Reply #6 on: 10: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
An expanding array of hardware available at www.cpcstore.co.uk (and issue 3 of CPC Fanzine!)

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.402
  • Country: fr
  • Liked: 1331
  • Likes Given: 195
Re: Soundtrakker player in JavaScript
« Reply #7 on: 10:27, 15 February 21 »
Soundtrakker'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.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline BSC

  • 464 Plus
  • *****
  • Posts: 349
  • Country: de
  • CPC 464 aspirant
    • my (Android) mobile game
  • Liked: 494
  • Likes Given: 461
Re: Soundtrakker player in JavaScript
« Reply #8 on: 21:59, 15 February 21 »
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.

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

Offline BSC

  • 464 Plus
  • *****
  • Posts: 349
  • Country: de
  • CPC 464 aspirant
    • my (Android) mobile game
  • Liked: 494
  • Likes Given: 461
Re: Soundtrakker player in JavaScript
« Reply #9 on: 22:04, 15 February 21 »
I 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

Offline norbert_kehrer

  • CPC464
  • **
  • Posts: 7
  • Country: at
    • Norbert's Emulators
  • Liked: 48
  • Likes Given: 8
Re: Soundtrakker player in JavaScript
« Reply #10 on: 03: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

Offline norbert_kehrer

  • CPC464
  • **
  • Posts: 7
  • Country: at
    • Norbert's Emulators
  • Liked: 48
  • Likes Given: 8
Re: Soundtrakker player in JavaScript
« Reply #11 on: 10: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.


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


Have fun!


Norbert

Offline norecess

  • CPC6128
  • ****
  • Posts: 258
  • Country: ca
  • Liked: 525
  • Likes Given: 271
Re: Soundtrakker player in JavaScript
« Reply #12 on: 15:02, 19 February 21 »
Yes I confirm it sounds much better! Great work!

Offline norbert_kehrer

  • CPC464
  • **
  • Posts: 7
  • Country: at
    • Norbert's Emulators
  • Liked: 48
  • Likes Given: 8
Re: Soundtrakker player in JavaScript
« Reply #13 on: 08: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


Here is a screen shot showing the piano roll display:



Online Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 17.009
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 4085
  • Likes Given: 7382
Re: Soundtrakker player in JavaScript
« Reply #14 on: 15:44, 23 February 21 »
My underlings coworkers here at the office surprisingly liked the tunes I played over lunch.


I think.

Offline BSC

  • 464 Plus
  • *****
  • Posts: 349
  • Country: de
  • CPC 464 aspirant
    • my (Android) mobile game
  • Liked: 494
  • Likes Given: 461
Re: Soundtrakker player in JavaScript
« Reply #15 on: 16:56, 06 March 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:

Online Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 17.009
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 4085
  • Likes Given: 7382
Re: Soundtrakker player in JavaScript
« Reply #16 on: 10:52, 08 March 21 »

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

When we get back form corona isolation, sure.