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: 541
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
 
... 14 posts hidden. Click here to view all posts....
 
2011-04-08 11:10
TWW

Registered: Jul 2009
Posts: 541
@ The Human Code Machine: A LSR would yieald 4 bits so still I'm 1 bit short. But I get your drift. Find the shrinkage factor and do it.

But I came to the same conclusion as you, more then just raw shrinkage (^^) needs to be applied to get a good result.

Has anyone had the chance to try out "Soundslogical Resampler"? It states it can handle various bit-width but ofcourse the demo is screwed. I don't mind dishing out some 20-30 $ (good echange rate anywasy) for it but would like to know if it works first...


@ Ready:

Alright, I got it now 8-D. Sample in "X"kHz but no sounds higher then "X/2"Khz for cleanest sound playback (hence the LP filter). It seems this can be post processed though in the proggie i mentioned above. If not I'll ask again^^ Thanx!
2011-04-08 11:16
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
why all this complicated stuff ?

soundforge, wavelab, audition - save as 4 bit unsigned raw.
(or save as 8 bit unsigned raw 8000 hz (THE old way)

convert to 3 bit in realtime on c64 with some code.



those programs resample as it shall be done, and so you dont have to do anything of that.
2011-04-08 12:09
ready.

Registered: Feb 2003
Posts: 441
@rambones: I am 99% sure most of those programs have automatic functions for "clean" re-sampling (i.e.: built in LP-filter and everything), but I just wanted to point out the theory, just in case TWW or others wanted to do the re-sampling in their own way.

I am working on a sound sampler for user-port and noticed the importance of the LP-filter for getting rid of aliasing noise.
2011-04-08 12:26
The Human Code Machine

Registered: Sep 2005
Posts: 110
@TWW For each bit less you'll need one LSR. If you want convert 8 bit samples to 3 bit samples you'll have to LSR 5 times.
2011-04-08 12:45
chatGPZ

Registered: Dec 2001
Posts: 11114
and remember to save them as unsigned before, or that shifting stuff will give you something like nu metal =)
2011-04-08 14:03
TWW

Registered: Jul 2009
Posts: 541
THCM:

5 LSRs?

8 bit sample gives an unsigned number between 0 to 255
3 bit sample gives an unsigned number between 0 to 7

so if the value = 161 in 8 bit the value in 3 bit should be equevivalent to:

161/255*7 = 4

If you take 161 and do 5 LSRs you get: 5

So I don't think it's entirely accurate to do it this way. I could how ever be terribly wrong here :) (it has happened before^^)

@ rambones: Can you also save in 3 bit? (25% less space right of the bat^^)
2011-04-08 14:28
ready.

Registered: Feb 2003
Posts: 441
@TWW: the correct math is:

161/256*8=5

which yelds to 5 times LSR

2011-04-08 15:01
TWW

Registered: Jul 2009
Posts: 541
Quote: @TWW: the correct math is:

161/256*8=5

which yelds to 5 times LSR



Actually the correct math is:

INT(161/256*8) = 5

If you rely on the rounding it does not work correctly (for some of the values in the byte range).

Anyways, the LSR x 5 is waterproof (yes I was wrong but to my defense I did mention that as a slight posibility^^).



Then the remaining question is:

Is this good enough or would a converter taking into account THCM's suggestion above regarding noise shaping and/or dithering be a (mouch?) better result?
2011-04-08 15:38
ready.

Registered: Feb 2003
Posts: 441
I guess the answer can be given by testing several conversion algorithms only.
2011-04-08 15:53
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
The leading sample programs can only save as 2/4/8/16+ etc.
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
Walt/Bonzai
commodore_freak
Matt
dillof
fieserWolF/Abyss-Con..
cobbpg
Airwolf/F4CG
Ko-Ko
Guests online: 103
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (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.5)
2 Derbyshire Ram  (9.5)
3 hedning  (9.2)
4 Baracuda  (9.1)
5 Irata  (8.5)

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