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
 
... 17 posts hidden. Click here to view all posts....
 
2014-09-15 11:05
Flavioweb

Registered: Nov 2011
Posts: 463
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: 42
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: 463
...mmm...
But when "raster display data"... the code is working on something or just "waiting"?
2014-09-15 11:47
Starfox

Registered: Jul 2014
Posts: 42
It's doing something that can't really be changed and takes 52 cycles per line (STA/STX/STY) + 9 for "loop" + 2 wasted cycles on a nop to make it 63 cycles. I bet someone can already guess the overall theme of the effect by now.

I guess without the "loop" I would have 11 cycles free per line. Maybe that would be enough to play some notes??
2014-09-15 15:57
Flavioweb

Registered: Nov 2011
Posts: 463
I suppose you need the cycles, both for "normal" play or "dumped" play, almost in a "consistent block", otherwise is useless to -gain- 10/11 cycles per line because you can't execute a "play" here to "dump" and play sounds, or execute code outside irqs...
And if you need to be in cycle-exact timing with raster beam, it's just impossible to "move" cycles from where they "are".
The only thing is to reduce cycles in the "work" part outside visualization area...
Maybe using some precalculated values or so... in the part of code that isn't just lda/sta'ing bytes around...
But you need 1890 cycles...
2014-09-15 18:17
Oswald

Registered: Apr 2002
Posts: 5094
1 raster tracker will do if 30 lines tracker almost cuts it.
2014-09-16 00:06
Starfox

Registered: Jul 2014
Posts: 42
Flavioweb, Yeah, I did consider using the last cycles of 200+ rasterlines to do an LDA ADDR - STA ADDR to help the draw routine, but other problems pop up then, where the effect become kind of distorted because to make it look decent - I have to find the best compromise between the number of real rasterlines, and how many times they are duplicated to make the effect fill as much of the screen as possible. And yeah, I will have to figure out if I can use even more precalculated tables.

But the routine is nothing special, I just wanted to see if I could code a small demo again after all these years =)

Oswald, I checked that player out, and I also tried experimenting with reading the sid registers when the IO area is in ram mode, and then writing them back after switching back to normal mode. The music sounded a little weird and distorted, but it wasn't hard to recognize. I'm not sure it's worth the hassle though as it would take up too much ram, but it is an interesting idea =)
2014-09-16 06:40
Oswald

Registered: Apr 2002
Posts: 5094
yup, the timing & order of the sid writes is a sensitive thing.
2014-09-16 08:48
Dr.j

Registered: Feb 2003
Posts: 277
@Starfox: sorry to interfere but i think the easy and
comfort way is to..simply find another sid from dozens
of HVSD sids that they aren't that big rasters consumers , i believe most of the tunes with Jch player and the latest most used players are okey to use or better to use hermit
1 raster player like Oswald already suggest
2014-09-16 09:36
Starfox

Registered: Jul 2014
Posts: 42
Ahh, yeah probably screwed up the timing and order of writing the values back =/ I even made some music routines back in the day, but can't remember anything about it lol.

And I guess you are right Dr.J, but I will give just a little more time to see if I can make it work with this tune. And as you suggest, it should be possible to find something. I gotta admit, I only heard a few tunes in that hermit player. They sounded a bit like it was made for a 4k demo =)
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
DJ Gruby/TRiAD
Sulevi/Virtual Dreams
chancer
Guests online: 147
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 Diskmag Editors
1 Magic  (9.8)
2 hedning  (9.6)
3 Jazzcat  (9.5)
4 Elwix  (9.1)
5 Remix  (9.1)

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