Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Coding a small demo. Rules about music?
2014-09-15 08:23
Starfox

Registered: Jul 2014
Posts: 42
Coding a small demo. Rules about music?

Hello,

I'm coding a small demo, after having coded the last one 27 years ago (lol), and while coding it I have used an older GREAT placeholder tune. Now, I could keep using that tune in the release as I got in contact with the composer, and he said I could use it, no problem.

But the music routine is taking a bit too much rastertime (peaks at around 30 lines), and that's just too much - since my effect takes up almost all available rastertime, and because of that I have to cut back the size of the effect, which is a bummer.

I know there are more optimized routines out there today that take much less rastertime, but I am concerned that since it is of newer date, that it would not be acceptable to just use one of those tunes?

I also got the idea that maybe I could transplant the music data from the placeholder tune into a newer more optimized player, but it seems like a bit of a challenge lol.

Anyone have any ideas as to what I could do?

Peter
 
... 20 posts hidden. Click here to view all posts....
 
2014-09-16 14:03
Oswald

Registered: Apr 2002
Posts: 5094
cool idea, looks like you're still at it, despite 27 years :) I'd dump though the data from emulator and use a higher level language for re-tracking it.

a simple but fast lzw (packer in c64 terms) would do aswell I guess, but better to handle channel data individually :)
2014-09-16 16:15
Starfox

Registered: Jul 2014
Posts: 42
Yes, it's fun to code a bit of c64 again =)

yeah, good idea. I hope I'll be able to do something like that. There's bound to be a lot of data.
2014-09-16 17:21
DRAX

Registered: Oct 2004
Posts: 225
Cool to see you active here - Peter :D ...
2014-09-16 21:08
Starfox

Registered: Jul 2014
Posts: 42
Hey Drax, long time since back then =) I think it was at some party in Odense I last met you. I was there with some guys from Mechanix. They had to go home early, but I decided to stay and wait for Liteace (Kenneth Bedsted) who was to arrive one day after they had left. I wanted to get some sleep in the meantime, but it was impossible with the noise levels there, so I spent a lot of time looking like a zombie trying to get some sleep under the table. Then I think you recognized me through a window into the next room or something (I was most likely looking like a zombie) =)
I hope you are doing great, and I can see that you are also still in the c64 scene =)

Another friend got me interested in fiddling with the c64 again after he showed me some cross development tools. First I just wanted to see if I could remember how to do a simple scrolltext, then I got an idea for the routine I'm working on. It took a lot of time refreshing how to do things lol.

Edit: It seems the music routine is repeating or letting pass - 6 frames between new data to the sid. Dunno if this is normal, but it means less data if it holds true throughout the entire tune =)

From looking at the c64 memory map at sta.c64.org it seems that $d41b and $d41c are not used in the actual playing of music, so I should be able to skip dumping and writing to those two addresses right? <-- edit: duuh! why don't I just try it and see what happens. It's getting too late to code =)
2014-09-17 07:28
Flavioweb

Registered: Nov 2011
Posts: 463
My 2 cents:
Use this doc as reference:
http://unusedino.de/ec64/technical/aay/c64/
may be useful...
=)
2014-09-17 08:25
algorithm

Registered: May 2002
Posts: 705
Even though the update of notes may be once per 6 frames (usually the default speed for most SID tunes) the updating of waveform data, filter, pulse duty and pitch slides can occur every frame.

To dump rhe registers back to sid, you would essentially need to update around 24 registers (And write them in a specific order) This would require around 1200 bytes per second!

Some type of delta based preprocessing and compression for fast decode can be used (although this will eat up some of your precious cpu time) I would probably estimate that you can shrink the 1200 to less than 300 bytes or so on average.
2014-09-17 18:52
Starfox

Registered: Jul 2014
Posts: 42
Thanks for the link Flavioweb =)

Algorithm: Yeah there will more than likely be some space issues, but I'll try and see what happens. At least, it's fun =)

I played the tune for 10 minutes to make sure I got all all the patterns. The voices have 852 different patterns in total (v1:179 v2:118 v3:555), so thats 852 * 7 bytes just for those. I haven't done the filter+volume yet.

The real spacehog will probably be the 4 tracks that determine which patterns to play each frame x_X

Edit: Let's say we have 100 different sid patterns for voice 1. Would it be wrong to assume that once we notice that 100 different patterns have been played for voice 1 - that voice 1 will now loop?

It will keep playing the tune, harvesting new patterns from voice 1. And since I already know how many different patterns occur in each voice, it will stop playing once it has harvested the last pattern. The music routine in the meantime has played a mix of all the patterns to produce the voice 1 sound output, so all the patterns are included in that timeframe. I don't know - somehow it seems logical to me that that must also be the time where the track for voice 1 loops, but I'm not sure.
Previous - 1 | 2 | 3 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Brush/Elysium
zscs
ΛΛdZ
Guests online: 95
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.042 sec.