Anyone to convert a Z80 music player?

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

FedePede04
Atari God
Atari God
Posts: 1014
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: Anyone to convert a Z80 music player?

Postby FedePede04 » Fri Apr 20, 2018 7:02 pm

ggn wrote:So for anyone that cares: I just finished a 2nd pass at the source code, tidying up things and taking care of loose ends. Which in practice means:

a) It's now ready for debugging (so far I've been writing code at blind, so tons of bugs expected!)
b) It is most certainly not optimal! For now it's simply mirroring the behaviour of the z80 routine in order to have a reference routine up and running
c) After (a) is done then the player can be reworked into something really optimal. At least that's my guess! Running the code under a debugger will also have the benefit of identifying lots of unneeded code and also enable doing things in a more 68000 friendly way

At least one musician apart from dma-sc expressed interest in it so hopefully this is not an exercise in futility :) (or at the very worst case the sndh archive will have some new tunes :))


btw which debugger are you using
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

User avatar
ggn
Atari God
Atari God
Posts: 1194
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Fri Apr 20, 2018 7:12 pm

FedePede04 wrote:
ggn wrote:So for anyone that cares: I just finished a 2nd pass at the source code, tidying up things and taking care of loose ends. Which in practice means:

a) It's now ready for debugging (so far I've been writing code at blind, so tons of bugs expected!)
b) It is most certainly not optimal! For now it's simply mirroring the behaviour of the z80 routine in order to have a reference routine up and running
c) After (a) is done then the player can be reworked into something really optimal. At least that's my guess! Running the code under a debugger will also have the benefit of identifying lots of unneeded code and also enable doing things in a more 68000 friendly way

At least one musician apart from dma-sc expressed interest in it so hopefully this is not an exercise in futility :) (or at the very worst case the sndh archive will have some new tunes :))


btw which debugger are you using


I'm a bugaboo man. For the really awkward cases I fall back to STEem debug.
is 73 Falcon patched atari games enough ? ^^

FedePede04
Atari God
Atari God
Posts: 1014
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: Anyone to convert a Z80 music player?

Postby FedePede04 » Fri Apr 20, 2018 8:11 pm

ggn wrote:
FedePede04 wrote:
ggn wrote:So for anyone that cares: I just finished a 2nd pass at the source code, tidying up things and taking care of loose ends. Which in practice means:

a) It's now ready for debugging (so far I've been writing code at blind, so tons of bugs expected!)
b) It is most certainly not optimal! For now it's simply mirroring the behaviour of the z80 routine in order to have a reference routine up and running
c) After (a) is done then the player can be reworked into something really optimal. At least that's my guess! Running the code under a debugger will also have the benefit of identifying lots of unneeded code and also enable doing things in a more 68000 friendly way

At least one musician apart from dma-sc expressed interest in it so hopefully this is not an exercise in futility :) (or at the very worst case the sndh archive will have some new tunes :))


btw which debugger are you using


I'm a bugaboo man. For the really awkward cases I fall back to STEem debug.


i don't know anything about ST debuggers, only one i tried is the one in devpac,
how does it work do you load your prg files in it, and can it steep thought line?
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

User avatar
ggn
Atari God
Atari God
Posts: 1194
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Fri Apr 20, 2018 8:22 pm

Here you go, a crash course kind of article written by yours truly 11 years ago: http://d-bug.mooo.com/dbugforums/cgi-bi ... 1179828064
is 73 Falcon patched atari games enough ? ^^

FedePede04
Atari God
Atari God
Posts: 1014
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: Anyone to convert a Z80 music player?

Postby FedePede04 » Sat Apr 21, 2018 12:26 am

ggn wrote:Here you go, a crash course kind of article written by yours truly 11 years ago: http://d-bug.mooo.com/dbugforums/cgi-bi ... 1179828064


many thx i will read this :)

on the atari i still debug on the old hardcore mode, for example set color change in my code,
so many time i could use a good debugger :lol:
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

User avatar
ggn
Atari God
Atari God
Posts: 1194
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Sat Apr 21, 2018 7:16 pm

A small update here: now the player can init and play a song, it even outputs things to the ym!

However it's still doing something wrong and loops early (after playing about 2-3 notes?) but hey - progress!

If targhan is still reading this, I have a couple of small requests for the exporter:

a) In certain lines you output something like:
dc.b 8 : dc.w Main_Subsong0_RegisterBlock_784 + 1 ; Optimization: goto common Block at index 1.

No ST assembler I know of recognises this - can we please have two separate lines of dc.w?
(I won't even mention here that a dc.w after dc.b is a huge issue as ST assemblers can auto-even after a dc.b! Plus the code that handles this gets really convoluted - I think I will revisit this in more detail once the player is working!)

b) This is probably a minor thing but it would help this debugging stage a lot: when outputting source code there are statements like:
dc.w Main_Subsong0_Track_0

Because of the org being forbidden usually on ST programs (unless you want to assemble something at a fixed address) the above line will get relocated in ram once a program is loaded. Ideally I would want this to be an offset relative to the beginning of the track. For now I get around this by doing a search/replace of these lines with something like
dc.w Main_Subsong0_Track_0-Main_Subsong0

but I think it'd be an easy change to add to the exporter. I realise that in most conditions people will simply export to binary, but like I said it'd help me with debugging for now.

(you can see the vile vim commands for both these on the git repositories)

Anyway, that's all for now!
is 73 Falcon patched atari games enough ? ^^

User avatar
ggn
Atari God
Atari God
Posts: 1194
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Sun Apr 22, 2018 11:28 am

Okay, I spent some more time on the player - it now actually plays something that resembles music :).

I'll need to do a more careful listen of the original and compare it with what's played, or make a specific tune so I can compare differences easier. Anyway, progress!

(github/bitbucket updated, anyone can clone the repo, hit build.bat and listen to the result for themselves - although it does sound like bits demos for now ;))
is 73 Falcon patched atari games enough ? ^^

Targhan
Atari User
Atari User
Posts: 31
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Sun Apr 22, 2018 6:12 pm

Hey, that's great, fantastic work :).

dc.b 8 : dc.w Main_Subsong0_RegisterBlock_784 + 1 ; Optimization: goto common Block at index 1.
No ST assembler I know of recognises this - can we please have two separate lines of dc.w?


Really? What kind of crappy assemblers are you using :) ? Well, I can add an option in the Source Profile: "Only one instruction per line". This can be added for the next release.

dc.w Main_Subsong0_Track_0-Main_Subsong0
but I think it'd be an easy change to add to the exporter. I realise that in most conditions people will simply export to binary, but like I said it'd help me with debugging for now.


Mmmh, so you want EVERY label reference to be relative? Wouldn't it be simpler for the user to set the ORG at 0? It work the same way.

Targhan
Atari User
Atari User
Posts: 31
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Sun Apr 22, 2018 6:15 pm

As for a thorough test result, I suggest you convert the songs in the package called "Targhan - Midline Process - Carpet.sks", "Targhan - Midline Process - Molusk.sks" and "Targhan - DemoIzArt - End Part.sks", in the "STarKos" folder (yep, these are songs I made). They are quite complex and long songs. If they work, everything will.

User avatar
ggn
Atari God
Atari God
Posts: 1194
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Sun Apr 22, 2018 8:28 pm

Targhan wrote:Hey, that's great, fantastic work :).

dc.b 8 : dc.w Main_Subsong0_RegisterBlock_784 + 1 ; Optimization: goto common Block at index 1.
No ST assembler I know of recognises this - can we please have two separate lines of dc.w?


Really? What kind of crappy assemblers are you using :) ? Well, I can add an option in the Source Profile: "Only one instruction per line". This can be added for the next release.


Pardner, them are fightin' words ;) - this ain't basic here, this is real men one instruction per line only club! (although at least one assembler has a very powerful command called 'init' that can initialise constants of any size in the same line).

Jokes aside, thanks!

dc.w Main_Subsong0_Track_0-Main_Subsong0
but I think it'd be an easy change to add to the exporter. I realise that in most conditions people will simply export to binary, but like I said it'd help me with debugging for now.


Mmmh, so you want EVERY label reference to be relative? Wouldn't it be simpler for the user to set the ORG at 0? It work the same way.[/quote]

A normal ST application is PC relative all the way, so if I include a source file that contains a "org" instruction the assemblers will barf - how can you place absolute and pc-relative code in the same file? I'd have to resort to creating object files and linking them together which is a bother, or create binary files and incbin them, which loses debuggability. Like I said, this is low priority and only applies to source export anyway.

Targhan wrote:As for a thorough test result, I suggest you convert the songs in the package called "Targhan - Midline Process - Carpet.sks", "Targhan - Midline Process - Molusk.sks" and "Targhan - DemoIzArt - End Part.sks", in the "STarKos" folder (yep, these are songs I made). They are quite complex and long songs. If they work, everything will.


Thanks for the tips, I'll be giving them a go.

Also, I just pushed a fix that makes the tune I exported work :.! All sounds ok except the buzztones, something is still wrong there. A bit more debugging required there, but all the same people can grab the repository and compile/run the example :).
is 73 Falcon patched atari games enough ? ^^

User avatar
ggn
Atari God
Atari God
Posts: 1194
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Mon Apr 23, 2018 9:35 pm

RIght, so a couple of clerical errors fixed and now it seems to sound like it should :D.

I'll provide emulator recordings tomorrow so people can listen and compare but it does sound very close now!
is 73 Falcon patched atari games enough ? ^^

Targhan
Atari User
Atari User
Posts: 31
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Tue Apr 24, 2018 7:56 am

Awesome!!

User avatar
Estrayk
Captain Atari
Captain Atari
Posts: 182
Joined: Mon Nov 23, 2015 2:52 pm
Location: Spain

Re: Anyone to convert a Z80 music player?

Postby Estrayk » Fri Apr 27, 2018 1:12 am

Targhan & ggn:
Even if we do not participate in this thread, let you know that many of us are pending this thread.
・Falcon ct60e・Atari MegaSTE ・Atari STe ・MIST ・

User avatar
ggn
Atari God
Atari God
Posts: 1194
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Wed May 02, 2018 4:41 pm

Just a small update here:

The player now has been optimised quite a bit, and there's a way to create .sndh files directly. I am working on streamlining tune export with Targhan a bit, hopefully pretty soon it'll be easier. But as it is right now there are instructions on the repository and it is possible!

Sorry I didn't create any recordings yet - there's only so many hours in the day!

Hopefully a few more ST musicians will start using this tracker, it's a very good solution when low CPU usage is mandatory :).
is 73 Falcon patched atari games enough ? ^^

User avatar
thomas3
Atari maniac
Atari maniac
Posts: 85
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: Anyone to convert a Z80 music player?

Postby thomas3 » Wed May 02, 2018 7:38 pm

Estrayk wrote:Targhan & ggn:
Even if we do not participate in this thread, let you know that many of us are pending this thread.


I second this - this work is awesome and super useful :)

Targhan
Atari User
Atari User
Posts: 31
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Fri May 11, 2018 4:20 pm

Thanks!

A new version (alpha 3) has just been released. It should make ggn's work a bit easier :).

User avatar
ggn
Atari God
Atari God
Posts: 1194
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Sat May 12, 2018 10:23 am

Good stuff Targhan!

And hello from me everyone here at Outline 2018! Since we finished our entries for the party we thought we (me and Grazey) could have a crack at adding SID voices to the replay routine. Guess what - it worked :)

Here's a sneak preview, the source will be cleaned up and uploaded after the party!
You do not have the required permissions to view the files attached to this post.
is 73 Falcon patched atari games enough ? ^^

Targhan
Atari User
Atari User
Posts: 31
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Sat May 12, 2018 10:03 pm

Congrats for your "LovelyYM" demo, I really like it. Although I kinda hate sid, what you've done off the player is really interesting. We'll have to discuss about sid one day, though that's going quite difficult to satisfy everyone, since there are so many way of doing a "sid", and it's sooo difficult to do accurately on 8-bits...

User avatar
ggn
Atari God
Atari God
Posts: 1194
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Sun May 13, 2018 4:40 pm

Thanks for your kind words :).

For the rest, the demo is now live at http://www.pouet.net/prod.php?which=76112

As for vocals: it really was a 20 minute hack at the party, Grazey supplied me the code he used for hipsid and I simply piggybanked it to the player. Personally I won't even dare to ask you to add sid support to the tracker. My current view is that it can be enabled on the player directly (per channel) at the programmer/musician's wishes, probably switchable on and off using timing commands from the tracker.
is 73 Falcon patched atari games enough ? ^^

Targhan
Atari User
Atari User
Posts: 31
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Mon May 14, 2018 10:02 pm

The demo states the player takes 3 scanlines. How much for a raw YM player, and how much for a "normal" player (Maxymiser without SID)? Just to compare with our CPC.

wietze
Captain Atari
Captain Atari
Posts: 211
Joined: Fri Mar 01, 2013 10:52 pm

Re: Anyone to convert a Z80 music player?

Postby wietze » Tue May 15, 2018 6:39 am

Targhan wrote:The demo states the player takes 3 scanlines. How much for a raw YM player, and how much for a "normal" player (Maxymiser without SID)? Just to compare with our CPC.


Its aroundd 1 scanline for raw YM dump.
Lets say around 20 scanlines for mYM player.

Targhan
Atari User
Atari User
Posts: 31
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Tue May 15, 2018 9:28 am

Ok thanks! On CPC, the AKY player takes 13 scanlines, but average players used to take 30 to 50 scanlines! Now modern players takes more 25-35 scanlines. So yeah, music has a price on a CPC.

User avatar
ggn
Atari God
Atari God
Posts: 1194
Joined: Sat Dec 28, 2002 4:49 pm

Re: Anyone to convert a Z80 music player?

Postby ggn » Thu May 17, 2018 12:55 pm

I just managed to do some measurements using gwEm's CPU measurer (is that even a word? anyway).

The optimised player now averages on less than 2 scanlines, peak is at about 2.5 (at least with the test tunes I tried). As for SID voices:

Image

(doesn't mean much as it says in the text, more tests will be required. Also the sid player is not by any means optimal)
is 73 Falcon patched atari games enough ? ^^

Targhan
Atari User
Atari User
Posts: 31
Joined: Thu Mar 23, 2017 2:18 pm

Re: Anyone to convert a Z80 music player?

Postby Targhan » Thu May 17, 2018 4:11 pm

Cool, only twice slower than raw YM and much, much much, more memory-efficient!
Do you consider your player finished? If possible, I'd like a version to be integrated to the Arkos Tracker 2 package. Do you think it is a good idea, or do you prefer only having a repository? I like somehow having the AT2 package fully useable "stand-alone", but having to update it whenever you change a comment is quite bothersome :).

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1684
Joined: Sun Jul 31, 2011 1:11 pm

Re: Anyone to convert a Z80 music player?

Postby Eero Tamminen » Thu May 17, 2018 7:25 pm

ggn wrote:I just managed to do some measurements using gwEm's CPU measurer (is that even a word? anyway).


Hatari profiler can measure an exact amount of cycles for you, for any part of your code.

Probably easiest way to do that is adding symbol for start and end of the part of code you want to measure before starting profiling.


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 3 guests