Do I need to learn assembly to make a music disk?

GFA, ASM, STOS, ...

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

Post Reply
User avatar
YQN
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 124
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Do I need to learn assembly to make a music disk?

Post by YQN »

Hello :)

I have searched the forum and read some arguments about assembly vs c, that was quite interesting but I couldn't find the answers I was looking for. Back in the days I used GFA (didn't make anything too impressive though), now I would be more comfortable with C but I might need to learn assembly for my project... Not sure if it sounds like fun or pain in the arse.

I have a few chiptunes made in MaxYMiser and Sidsound Designer I want to release as a music disk, which I would like to attempt coding myself. I don't mean to create fancy effects but I would like to have a menu (with a custom font) and some kind of visualization (obviously no FFT). A bit like this Paradox/DHS disk. Is that possible in C or will I need to learn assembly?

Thanks in advance for your input :)
User avatar
Greenious
Hardware Guru
Hardware Guru
Posts: 1462
Joined: Sat Apr 24, 2004 5:39 pm
Location: Sweden

Re: Do I need to learn assembly to make a music disk?

Post by Greenious »

Sure it is! I am pretty sure you will be able to do something in GFA, STOS etc aswell.

Apart from being darn fun to code, 68k assembler is really only a must if you want to make the absolute most out of the hardware and/or timing is critical (some screen effects requires exact cycle-timing for example, which is more or less impossible unless you use assembler).

Using clever techniques is the key though, (in any language) to make something decent, since brute force just isn't there on Atari. (Which is part of the fun coding it)
Updated my guides as of june 28th, 2016. Check'em out and feedback!
http://www.atari-forum.com/viewtopic.php?t=5040
AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2978
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by AtariZoll »

My opinion is that go with ASM. Or C with some parts in ASM. There may be some speed crucial parts.which need assembler.
Actually, this reminds me that I did only 1 SW in GFA Basic, and there were some ASM parts. So, I think that GFA+asm is option too.
Do you have routines for playback of those chiptunes done in MaxYMiser and Sidsound Designer ?
Famous Schrodinger's cat hypothetical experiment says that cat is dead or alive until we open box and see condition of poor animal, which deserved better logic. Cat is always in some certain state - regardless from is observer able or not to see what the state is.
simonsunnyboy
Moderator
Moderator
Posts: 5235
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by simonsunnyboy »

Lots of music disks have been made with GFA and some small inline assembler.
I did one years ago: https://demozoo.org/productions/73565/


It is entirely possible with C aswell.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
User avatar
YQN
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 124
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by YQN »

AtariZoll wrote:My opinion is that go with ASM. Or C with some parts in ASM. There may be some speed crucial parts.which need assembler.
Actually, this reminds me that I did only 1 SW in GFA Basic, and there were some ASM parts. So, I think that GFA+asm is option too.
Do you have routines for playback of those chiptunes done in MaxYMiser and Sidsound Designer ?
Well I have the GFA routine for SNDH replay but I never tried to use it. It took me a while to remember how to load the inline files, will have to try with a tune of my own. Are there C routines around as well?

Thanks guys for your help, consider me a total beginner so any link to useful resources is more than welcome! Currently I'm reading MarkeyJester’s Motorola 68000 Beginner’s Tutorial which I found searching this forum, very interesting read!
User avatar
Greenious
Hardware Guru
Hardware Guru
Posts: 1462
Joined: Sat Apr 24, 2004 5:39 pm
Location: Sweden

Re: Do I need to learn assembly to make a music disk?

Post by Greenious »

You can find more or less everything you need at http://dev-docs.atariforge.org/ under the category out of print books.

If you want to go the asm route, I also recommend motorola m68000 family programmer's reference manual, that can be found here: http://www.nxp.com/docs/en/reference-ma ... 000PRM.pdf
Updated my guides as of june 28th, 2016. Check'em out and feedback!
http://www.atari-forum.com/viewtopic.php?t=5040
User avatar
YQN
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 124
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by YQN »

simonsunnyboy wrote:Lots of music disks have been made with GFA and some small inline assembler.
I did one years ago: https://demozoo.org/productions/73565/


It is entirely possible with C aswell.
Cool! Have you got the source by any chance? Are the flashes triggered by the sndh?
simonsunnyboy
Moderator
Moderator
Posts: 5235
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by simonsunnyboy »

The flashes are controlled by reading YM channel volume registers.
No, source code is not available.

Yes, i ported the SNDH routines to C aswell, mainly for AHCC. I am unsure on gcc, maybe that one is still on my todo list but not too complicated. Mainly pasing arguments through registers have to be changed to passing via stack.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
User avatar
YQN
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 124
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by YQN »

I'm already stuck with gwEm's GFA routine :/ all my SNDH files are too large for an INLINE, I assume there is a workaround?

Edit: badly searched, now reading the GFA forum...
User avatar
YQN
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 124
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by YQN »

Readings haven't been helpful, I'm afraid I'm gonna need some help to sort that out :/ Can anyybody help?
simonsunnyboy
Moderator
Moderator
Posts: 5235
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by simonsunnyboy »

There are plenty tutorials for GFABASIC.

On the C side, I started a library of various former GFABASIC inlines to be used from gcc.
It is unfinished but you can check it out on GitHub. There is also SNDH and Modfile support.

See https://github.com/simonsunnyboy/stlibs4gcc
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
User avatar
Mug UK
Administrator
Administrator
Posts: 11516
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by Mug UK »

YQN wrote:I'm already stuck with gwEm's GFA routine :/ all my SNDH files are too large for an INLINE, I assume there is a workaround?

Edit: badly searched, now reading the GFA forum...
Are you packing the SNDH files?
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk
User avatar
YQN
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 124
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by YQN »

Mug UK wrote:
YQN wrote:I'm already stuck with gwEm's GFA routine :/ all my SNDH files are too large for an INLINE, I assume there is a workaround?

Edit: badly searched, now reading the GFA forum...
Are you packing the SNDH files?
Well I read this routine plays unpacked files only so no I don't pack them, but you make me think I could pack them and use a depack routine... just found this thread you contributed to: http://www.atari-forum.com/viewtopic.ph ... ice+unpack
Am I on the right track?
User avatar
Mug UK
Administrator
Administrator
Posts: 11516
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by Mug UK »

Yep. There's a filesize limit to GFA's Include command, so you can't go above 65535 bytes. So use a MALLOC to create the full size memory buffer for the unpacked tune and then store the ICE (or whatever packer you use) within the Include area. Depack from the Include into the MALLOC area and then point the SNDH replay at the MALLOC area.
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk
simonsunnyboy
Moderator
Moderator
Posts: 5235
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by simonsunnyboy »

I think the limit is even 32767 bytes....an ugly way to having to deal with Malloc and RESERVE is to use a array:

DIM tunedata%(25000) ! 25000 longs = 100 000 bytes
tuneptr%=V:tunedata%(0)

IIRC .. it has been 6 or 7 years since I coded GFA...
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
User avatar
Grazey / PHF
Atari Super Hero
Atari Super Hero
Posts: 512
Joined: Fri Jun 21, 2002 12:50 pm
Location: Montreal, Quebec
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by Grazey / PHF »

Assembler all the way.

Gfa is far too restrictive
I'll help

Grazey
http://phf.atari.org - demo coders since 1983
http://sndh.atari.org - Maintainer of the Atari ST chip music archive
http://www.scenemusic.net - Nectarine Administrator
User avatar
YQN
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 124
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by YQN »

Grazey / PHF wrote:Assembler all the way.

Gfa is far too restrictive
I'll help

Grazey
Cool! In what ways are you willing to help? BTW another forum user has offered me some help with assembly, maybe we can make this a team work... The thing is I started looking up how to make a music disk but I don't have enough material yet so maybe it's best that I focus on the music first :P
Stethane
Atari freak
Atari freak
Posts: 67
Joined: Sun Mar 13, 2005 4:51 pm

Re: Do I need to learn assembly to make a music disk?

Post by Stethane »

You could have a look at: https://github.com/ggnkua/Atari_ST_Sources
There's a ton of assembly code in there for various menus/demos/music routines. There's probably something in there that might help. You would have to download the whole giithub archive (~500MB) and then extract the files and search for the file extensions for the chiptunes you have. I don't know if there'll be exactly what you want in there, but I know there are tens of thousands of files.
User avatar
YQN
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 124
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by YQN »

Stethane wrote:You could have a look at: https://github.com/ggnkua/Atari_ST_Sources
There's a ton of assembly code in there for various menus/demos/music routines. There's probably something in there that might help. You would have to download the whole giithub archive (~500MB) and then extract the files and search for the file extensions for the chiptunes you have. I don't know if there'll be exactly what you want in there, but I know there are tens of thousands of files.
Found useful sources, thanks a lot!

Edit: more particularly https://github.com/ggnkua/Atari_ST_Sour ... Demosystem
wietze
Captain Atari
Captain Atari
Posts: 321
Joined: Fri Mar 01, 2013 10:52 pm

Re: Do I need to learn assembly to make a music disk?

Post by wietze »

In case you want someone to bounce off questions to or need help; feel free to contact me. I briefly considered helping you with the musicdisk by making it, but I thought I wouldnt have the time to do so; but I'd love to help when I can.
User avatar
YQN
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 124
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by YQN »

wietze wrote:In case you want someone to bounce off questions to or need help; feel free to contact me. I briefly considered helping you with the musicdisk by making it, but I thought I wouldnt have the time to do so; but I'd love to help when I can.
Cool, I'll post my questions either here or in a new topic, help is appreciated, I have so much to learn!
User avatar
YQN
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 124
Joined: Sat Jul 22, 2017 6:01 pm
Location: Meaux
Contact:

Re: Do I need to learn assembly to make a music disk?

Post by YQN »

I started a thread in the 680x0 forums where anyone willing to help can contribute:
http://atari-forum.com/viewtopic.php?f=68&t=37314
Post Reply

Return to “Coding”