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 Composing > Converting samples to 3 bit
2011-04-08 04:23
TWW

Registered: Jul 2009
Posts: 545
Converting samples to 3 bit

What I want to do:

Play a 3 voice SID tune - while using the 3 LSB's of $d418 to play samples simultaniously (3rd bit of $d418 always set so one always hear the tune).


Problem:

#1: Making samples <- Suggestion for FW/PD tool to make samples with (win7x64).
#2: Converting the sample to 3 bits from however bit-width it was greated from tool in #1 <- The correct mathematical way or a converter to do it.
#3: Any good tip on how to make the samples as "clean" as possible in addition to higher sample frequency? (i.e. any pitfalls I should try to avoid like sampling with too high bit-width or such(which might lead to a bad conversion etc.))? <- Yeah I totally don't know what I'm talking about here in #3 so bear with me 8-D

/TWW
 
... 20 posts hidden. Click here to view all posts....
 
2011-04-09 20:24
GT
Account closed

Registered: Sep 2008
Posts: 308
ORA #8
Done.
2011-04-10 08:11
linde

Registered: Jul 2006
Posts: 47
So you want to store them in three bits per sample? That's a minimal memory gain in most cases I think, (you could try some 1-bit linear encoding instead) but if you really want to try, I could make a tool to convert 8 bit raw to 3 bit raw.
2011-04-10 11:08
TWW

Registered: Jul 2009
Posts: 545
Ok I see that 4 bits is sufficient in most cases.


But for the share fun of it, It would be fun to try the 3 bit approach yielding 75% volume (on average) vs. the 50% vulume (avg.) achieved through 4 bit.

I "picture" the samples to be stored in layers over the same bytes (Yeah I know that sounds weird) like this:

11122233 34445556 66777888 11122233 34445556 66777888 etc.

So if I want to play sample #1:
lda byte 1
and #%11100000
sec
rol
rol
rol
rol

sta $02
lda $d418

and #$f0
ora $02
sta $d418

or if the hi-nybble of $d418 is known at playtime:

lda byte 1
and #%11100000
sec
rol
rol
rol
rol
ora #$X0 // Hi-nybble
sta $d418

Then increase the byte-fetcher with 3 and do again. An index-table would be faster to use if cycles are an isse vs. memory (as usual^^)

@ Groepaz: I like making problems (hehe). But seriously imho it's a quality vs. memory+slightly higer volume issue(maybee^^)

@ Geir: yes agreed for 4 bit playback.

@ Linde: A cross platform tool for prepping the samples would be cool if it uses a "better" aproacht (dithering or noise shaping?) then just dividing each byte with 32 (5 X LSRs). If this wasn't what you had in mind, it would be easy to da a straight converter tool on the c64 to convert from 4 bit or even 8 bits Unsigned RAW (if memory is enough).
2011-04-11 20:13
algorithm

Registered: May 2002
Posts: 705
I would not bother with the 3 bit conversion. Even though the samples will use less space, it is more awkward for the bits to be extracted from packed bytes as well as the noise involved.
As the samples are updated thousands of times per second, there is less likelihood of muting the other audio if using the traditional 4 bit method

Severe issues ofcourse is that the digi's will be near or enough quiet on a new sid chip (unless using one or more channels to boost the digi)

I would recommend 8 bit all the way with compression (vq and/or delta modulation) but of course this method uses sid channels
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
Mr. Mouse/XeNTaX/G*P
Smasher/F4CG
t0m3000/hf^boom!^ibx
Guests online: 150
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 X-Mas Demo 2024  (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 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Performers  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

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