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 > Music player + Open side border
2012-02-20 16:17
ready.

Registered: Feb 2003
Posts: 441
Music player + Open side border

hello all,
I am writing a demo part open side borders (left and right borders), which of course eats a lot of rastertime and lots of NOPs. Basically all the raster time in the open border area is wasted to open the borders.

I thought it'd be nice to play a tune instead for NOPing, wasting raster time waiting to change $d016 to open the side border.

The player should be so that it always goes throu the same code to play the tune and always requires the same raster time.

Of course the most simple thing would be to record in RAM all the SID registers and write them all at each frame, in a way like:

lda #??
sta $d400
lda #??
sta $d401
.....
....
but that would require too much memory and raster time.
Is there any such player around?

thanks,
Ready.
2012-02-20 17:18
MagerValp

Registered: Dec 2001
Posts: 1078
An unrolled music routine eats a lot of RAM, and only uses a few raster lines. Why not use the available raster time to run another effect at the same time? And if you simply want to avoid a lot of NOPs, use a timer based raster stabilization routine instead that triggers just in time for the border opening (see this thread: Stable Raster via Timer).
2012-02-20 18:32
algorithm

Registered: May 2002
Posts: 705
Like Magervalp said, However, If you are however only planning on showing the demo part for a short time (20 seconds or so) then the approx usage would be around 1k a second of audio (this could be finally compressed to much smaller size using lz based compression. Don't try and predecompress the stream in realtime as it will defeat the whole objective of getting rid of the music player
2012-02-20 18:45
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
never seen such a player. dont think it exist.
but im not quite sure how the stream player that the hungarian guy did is doing.

but no, "use same time always player". never seen it.

playing the tune in the nops, will result that only a part can be, and the rest will have to be after all the nops, it will crash the ADSR in the sid, unless the player is engineered to work this way. so... no...

as far as i know.. ?

2012-02-20 18:50
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
name of streaming sid player coder: ? i forgot his name, im sorry. yes, HERMIT!

can this in any way be used ? i dotn know...
2012-02-20 19:01
Dane

Registered: May 2002
Posts: 423
Yep, it's doable. Check out Cycle for open fullscreen sideborder and multispeed music.
2012-02-20 19:07
chatGPZ

Registered: Dec 2001
Posts: 11386
Quote:
never seen such a player. dont think it exist.

there were such players already many many years ago, its really not a new idea =) here is also some tool around that lets you play the tune and capture the data for replaying later (forgot how the hell it was called though).

dane: but the player in cycle first puts values into a buffer, and then the buffered values are stored to the SID inside the irq code.... right? so its not strictly "streaming".

however, the same should be doable with most modern players, since they usually buffer the sid writes anyway.
2012-02-20 21:28
Zyron

Registered: Jan 2002
Posts: 2381
http://csdb.dk/search/?seinsel=all&search=music+raster+cruncher..
2012-02-20 21:30
Dane

Registered: May 2002
Posts: 423
Yes it buffers all 4 replays to zeropage. It's not rocket science but I think we were the first to combine it with a fullscreen plasma. Anyway, best of luck with your endeavours Ready.
2012-02-20 21:57
ready.

Registered: Feb 2003
Posts: 441
thanks, for all the feedback. Actually it could work even with the NOPs, but the effect execution would slow down. Now gotta see what to put in place of the NOPs: tune or part of the demo effect..... stay tune, hopefully X2012
2012-02-28 12:40
ChristopherJam

Registered: Aug 2004
Posts: 1409
I've considered similar before, but never quite got around to it.

Concept for a fully constant time routine was to use things like lookup tables for decrementing note duration counters etc, then use the same index to select one of two tables that when indexed by note counter do or do not update the note counter to the next one. Same concept could be extended for updating phrase/section. Not very efficient mind..

ldx v3count
lda subtract1,x
sta v3count
lda tableselect,x
sta ll:+2

ldx v3note
ll:
lda nextnote,x
sta v3note


In practice I think I'd be more likely to use a simple mid-note constant time update 1-3 times mid frame to make for some 100-200Hz update style effects (smoother frequency sweeps etc), rather than trying to do phrase and note updates in that time.
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
Scrap/Genesis Project
Dr. Doom/RAD
Guests online: 104
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 Webmasters
1 Slaygon  (9.6)
2 Perff  (9.6)
3 Sabbi  (9.5)
4 Morpheus  (9.4)
5 CreaMD  (9.1)

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