Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Sepa ! (Registered 2024-05-13) 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: 32
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
2014-09-15 08:29
chatGPZ

Registered: Dec 2001
Posts: 11140
just take a tune that you like.
2014-09-15 08:33
Starfox

Registered: Jul 2014
Posts: 32
Okay, so I guess the scene is still relaxed about using other people's tunes as long as credit is given =)
2014-09-15 09:00
chatGPZ

Registered: Dec 2001
Posts: 11140
most people are, some will give you the shits and spawn drama. just like in 1986 =)
2014-09-15 09:28
Oswald

Registered: Apr 2002
Posts: 5025
you can just record the sid register writes, if you have the memory. then find a good looping point :)

also there is a 1 rasterline player by hermit, and a lots of tunes made for it.

Visage - 1 Rasterline Cover
One Rasterline Tracker V0.9
2014-09-15 09:53
Flavioweb

Registered: Nov 2011
Posts: 447
You can try to optimize main demo code for speed, and if you have some free memory, just unrolling some loops can give you sufficient time to play the music.
30 rasterlines isn't the world fastest player, but isn't very very bad after all... if you are coding on a PAL environment.
2014-09-15 10:35
Starfox

Registered: Jul 2014
Posts: 32
Interesting idea oswald =), and I will look into that player. Btw, wouldn't I need to record more than once per frame. I mean arpeggio etc. isn't that some kind of loop in the music routine that changes notes or whatever over a predefined amount of time in the same frame?

Flavioweb:

Yes it's PAL =)
I have optimized it as much as I think I can within reason.

If I completely unroll it where it is only absolute adresses like: LDA ADDR - STA ADDR, it would take like 30kb with 0 cycles overhead.

I have another version using indexed adressing (LDA ADDR,X - STA ADDR,Y) taking 17kb with 390 cycles overhead for the entire runthrough.

And a more practical version taking a few kb with 676 cycles overhead (using the same indexing).

I was surprised I could even make it work using indexed because of the way the data has to be stored. It isn't just LDA ADDR,Y - STA ADDR,Y for X amount of bytes. The load is from sequential addresses, but the store isn't.

Also, the rastertime used to display the effect is almost dead, which is why I need every last cycle almost lol.

Maybe I can put a link to the routine. I'm sure there's more or better ways to optimize it.
2014-09-15 10:47
Hate Bush

Registered: Jul 2002
Posts: 455
AFAIR, if a tune is singlespeed (called once per frame), you need to record the registers only once per frame.
2014-09-15 11:05
Flavioweb

Registered: Nov 2011
Posts: 447
What you mean exactly with
Quote:
Also, the rastertime used to display the effect is almost dead
?
Do you calculate fx data somewhere and display they somewhere else in mem?
2014-09-15 11:36
Starfox

Registered: Jul 2014
Posts: 32
Randall: Ok, I will have to try to find out then =)

Flavioweb: Yeah, after the raster is done displaying the effect, the draw routine takes data from tables and places them in the display data area. Then next frame the display will show the changes.

There's pretty much 0 cycles left in the area where the effect is displayed because of the way it works, so I can only really optimize the draw routine and have a faster music routine =)

Here's a small snippet of one of the draw routines:
https://dl.dropboxusercontent.com/u/4130839/new%20draw%202.txt
2014-09-15 11:43
Flavioweb

Registered: Nov 2011
Posts: 447
...mmm...
But when "raster display data"... the code is working on something or just "waiting"?
 
... 17 posts hidden. Click here to view all posts....
 
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
Guests online: 93
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 Party Elk 2  (9.7)
2 It's More Fun to Com..  (9.6)
3 Layers  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Original Suppliers
1 Black Beard  (9.7)
2 Derbyshire Ram  (9.5)
3 hedning  (9.2)
4 Baracuda  (9.1)
5 Jazzcat  (8.6)

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