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 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.
2011-04-08 17:05
TWW

Registered: Jul 2009
Posts: 541
Alright. I guess that's sorted then :)

Thanx to all involved and taking the time to reply!
2011-04-08 20:30
ready.

Registered: Feb 2003
Posts: 441
but back to the original problem of not hearing the SID when $d418 = 0. Is it really a problem? I haven't tested but the zero would be played for just a very short period of time (sampling time), and would hardly be noticable.
2011-04-09 01:49
TWW

Registered: Jul 2009
Posts: 541
If I understood you correctly;

The point of doing 3 bit samples is that you can have the 4th bit (bit #3) set at all times, thus making any sound produced by the SID hearble even though you use the 3 LSBs (bit 0, 1 & 2) to modulate samples. This will effectivly give you 3 sid voices + 1 "3 bit sample voice". i.e. $d418 would never be zero but instead range from 8 to 15 depending on sampledata.

If I didn't understand you correctly: What?
2011-04-09 05:49
chatGPZ

Registered: Dec 2001
Posts: 11136
that idea is somewhat broken, what you really should do is simply use 4 bit samples and be done with it, there is no need to sacrifice that one bit at all.
2011-04-09 14:27
TWW

Registered: Jul 2009
Posts: 541
Alright. I'll do some testing on the whole matter and see what I come up with. I do however see ready.'s point of $d418 being 0 during sample playing but then again how much does it matter?

Let's for the sake of argument say that it is a problem for a sid-tune playing at the same time. with 4 bit samples you could then probably do "lsr + ora #$08" and get away with it (yes this is one thing I'm gonna test soon(tm)).

If this is the case, why not just have the sample in 3 bits to begin with (Maybee even processed a bit better then a straight lsr) and then gain a 25% memory boost in the process?

Or maybee I should just shut up and test it 8-D
2011-04-09 15:08
chatGPZ

Registered: Dec 2001
Posts: 11136
the point is that the average level of an audio sample is pretty much exactly half its amplitude. so playing a 4 bit sample along a sid tune practically equals playing the sid tune at half volume. now if you reduce the sample to 3 bits and offset it by 8 (by setting bit 3) that will equal playing the sid tune at 75% original volume.

so you are really trying to solve a problem that does not exist, you are only making it worse =)
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
LightSide
Guests online: 81
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 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Musicians
1 Vincenzo  (9.8)
2 Rob Hubbard  (9.7)
3 Stinsen  (9.7)
4 Jeroen Tel  (9.6)
5 Linus  (9.6)

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