Welcome to our latest new user
eightbitswide
! (Registered 2024-12-24)
You are not logged in -
nap
CSDb User Forums
Forums
>
C64 Coding
>
How to players and trackers usually deal with these modulation issues? --> Bit-scaling? (sid related, but not nescesarily, not a question related to the battlestar galactica music btw;-)
2006-07-19
22:37
stunt
Account closed
Registered: Jul 2006
Posts: 48
How to players and trackers usually deal with these modulation issues? --> Bit-scaling? (sid related, but not nescesarily, not a question related to the battlestar galactica music btw;-)
hi all!
I use the output of osc3(8bit) ($d41b) to modulate the pulsewidth osc1 (12bit) ($d402 & $d403), but now i still do that by just modulating OR the lobyte OR the hibyte register which gives very coarse results and also causes the modulation not to be active on the whole scale of the parameter.
I want to improve this situation so i came up with two strategies, and i'd like to hear your comments on them.
Ok. let's take a look at the situ:
The 8 lsbs reside in d402, the 4 msbs are bits 0,1,3 & 4 of $d403.
Ofcourse I want to spend as less time as possible doing the math.
Now I thought of two strategies:
Strategy 1: To modulate just the 8 most sig. bits of the 12bit word. That would mean to split the modulator byte in two and use the 4 most sig bits to modulate the 4 least sig bits of $d403, and to take the other 4 bits and use them to modulate the 4 most sig bits of $d402.
pros: prolly a time efficient solution
cons: coarse way of modulating: takes 16 steps at a time.
Strategy 2: to "bitscale" or strech up the 8bit modulator value up to a 12 bit value and modulate the 12 bits.
pros: more detailled modulation
cons: prolly lot of math and thus time consuming.
My question: what would be the most time efficient ways to implement both strategies, and which strategy would you guys advice me.
How do players and trackers usually deal with the 12bit wide pulsewidth modulation?
Ofcourse i also want to modulate the 16 bit pitch, the 11 bit filtercutoff and the 4 bit volume parameters.
so i'd like to see a solution for the stretching to all these.
so :
8 bit value modulates 4 bit value
8 bit value modulates 16 bit value
8 bit value modulates 12 bit value
8 bit value modulates 11 bit value
i can imagine dat streching up and down to 4 or 16 is less difficult and strechting up to 11 is the hardest to do. is my intuition right?
very interested to see your solutions to my problem.
And prolly my most important question:
How do players and trackers usually deal with these modulation issues?
Greetz,
Stunt
... 16 posts hidden. Click
here
to view all posts....
2006-07-20
10:21
Kenho
Account closed
Registered: Jan 2003
Posts: 26
Hi, a bit offtopic but have you tried out the Prophet64 package? here->
http://www.prophet64.com/
it might be the only things you need :-)
/K
2006-07-20
11:07
stunt
Account closed
Registered: Jul 2006
Posts: 48
Quote:
With 3 voices to do music, it's a waste to use voice 3 output to modulate pw of one of the other voices. You'd loose 1 voice .
besides:
lda $d41b
and #$fe
tax
lda pwtable,x
sta $d402
lda pwtable+1,x
sta $d403
also looses a lot of detail. Then again, who notices when doing live gigs? :)
@ Hein:
I studied your piece of code and it seems to be just what i'm looking for. Great man thx a lot! c64 coders are the best with time efficient solutions. i knew i could count on you guys.
question1: It's just the and #%11111110 that i dont understand. can you clarify? thx.
question2: why do you say that it loses a lot of detail? I dont understand. please clarify.
PS. (apart from the fact that i'm currently pimping a c64 with more sids, and apart from the fact that indeed i will create my thing for performing) --> i believe i can do great stuff with just 2 properly modulated voices. the great advantage of osc3 is that you can use it like a realtime calculated goniometric movement without wasting cpu. you can read from it as fast as from a table and still the content can easily be modified realtime. I have some great ideas i want to implement, im creating this for performing purposes, but i promise to share the code so they can also be implemented in players and demo's. i mean once i started this stuff, why not also create some cool tunesfor the demoscene:)
2006-07-20
11:17
stunt
Account closed
Registered: Jul 2006
Posts: 48
Quote:
Hi, a bit offtopic but have you tried out the Prophet64 package? here->
http://www.prophet64.com/
it might be the only things you need :-)
/K
@ offtopic:
Prophet64 is actually what comes the closest to what i'm doing. But to me it's sort of useless because it turns your c64 into a 303-like thingy.
I have very specific wishes on terms of interfacing, whereas the prophet is like any standard synth on the market: boring, heard it 10000 times before.
Besides it provides a cubase/logic like mac/pc style sequencer that runs on the c64. I will run my sequencer on pc/mac and talk to c64 with midi so i can I dedicate all available power and memory to the soundengine, and not to horny marketing interface. Besides. the greatest sin is that it uses 1531mouse for navigation. This sucks because it comsumes potx and y of sid. Potx and y are ports that you want to use for controllingpurposes (pedals, knobs, faders for realtime fiddling). So i dont know what gotten into the head of the designer, but we definately have a totally different view on how experimental and original a sid should sound. So my thing is actually an alternative for guys that really want to bleep.
Bleep on
Stunt
2006-07-20
12:29
Hein
Registered: Apr 2004
Posts: 954
you dont need to and #$fe I guess. 2 tables should work out aswell, giving more detail.
ldx $d41b
lda pw_low,x
sta $d402
lda pw_hi,x
sta $d403
frankly, Im not a sidprogramming expert at all, I've been told that its better to collect all parameters, store them, and next frame write them to sid. Doing these inbetween sidwrites might make it jitter, I think.
You're bount to loose detail, because you spread your 8bits over 12bits. Maybe there's a skilled programmer who can do a routine that calculates the in between values, but with a noise waveform modulator, it might be a bit tricky to calculate the correct value. (Or just take a random one. :)
I think this $d41b thing ain't made for pw-modulation, not even filter-modulation, despite of what the manual says. The manual never said anything about open sideborders. It's better to have your own routine doing the modulation. (like Laxity and Cadaver stated)
2006-07-20
13:09
stunt
Account closed
Registered: Jul 2006
Posts: 48
Quote:
you dont need to and #$fe I guess. 2 tables should work out aswell, giving more detail.
ldx $d41b
lda pw_low,x
sta $d402
lda pw_hi,x
sta $d403
frankly, Im not a sidprogramming expert at all, I've been told that its better to collect all parameters, store them, and next frame write them to sid. Doing these inbetween sidwrites might make it jitter, I think.
You're bount to loose detail, because you spread your 8bits over 12bits. Maybe there's a skilled programmer who can do a routine that calculates the in between values, but with a noise waveform modulator, it might be a bit tricky to calculate the correct value. (Or just take a random one. :)
I think this $d41b thing ain't made for pw-modulation, not even filter-modulation, despite of what the manual says. The manual never said anything about open sideborders. It's better to have your own routine doing the modulation. (like Laxity and Cadaver stated)
I figured that in hein's first example he had an interleaved table in mind (table .byte hi,lo,hi,lo, etc)that provided the same amount of detail as two seperatate tables for hi and lo. Is there a difference in detail between two options?
And yes, i will loose detail when i streched 8 bit to 11,12 and 16 bit, but still the modulation will have a 8bitresolution so that's pretty funky if you ask me. Interpolation will indeed provide even smoother modulation but requires realtime math and will prolly cost too much time. Even the streching without interpolation will prolly be quite cpu intensive, altough i'd love to see some expert coder comming up with some lean realtime bitscaling code!
2006-07-22
14:43
stunt
Account closed
Registered: Jul 2006
Posts: 48
So, did none of you coders ever adress the problem of bitscaling?
2006-07-22
17:44
Laxity
Registered: Aug 2005
Posts: 459
lda $d41b
pha
asl
asl
asl
asl
sta $d402
pla
lsr
lsr
lsr
lsr
sta $d403
2006-07-22
17:57
stunt
Account closed
Registered: Jul 2006
Posts: 48
@laxity: ok. that's strategy 1. briliant. thxalot.
2006-07-22
18:08
stunt
Account closed
Registered: Jul 2006
Posts: 48
now for strategy 2, tables would be a solution.
so for every of the $ff steps, to enlist in table two corespondend bytes (hi and lobyte) and precalulate those values for 11,12 and 16 bit values.
But my intuition tells me there must be smarter (calculated) ways, for example to scale an 8 bit byte to a 16 bit word seems easy:
11111111 would become 11111111 11111111
00001111 would become 00000000 11111111
10101010 would become 11001100 11001100
right?
so it means taking bits 8, put it on both
bit 8 and 7 of the hibyte of the word,
take bit 7, put in on bit 6 and 5 of the word.
etc.
what would te most elegant way in asm to do that?
----
now getting from a byte to a nibble seems easy too:
create the nyble out of bits 8 6 4 and 2 of the byte.
any suggestions for how to do that in asm?
----
but getting from byte to 11 and 12 bit words seems the hardest to me...
any elegant (calculated) sollutions?
Thx.
Stunt
2006-07-22
18:22
Laxity
Registered: Aug 2005
Posts: 459
I get your method, but how would you go about scaling from 8 to 12 bit in that way?.. Anyway, I think the result of the "bit streching" (and loss of resolution) will be A LOT more audiable than disregarding the 4 least significant bits of the pulse width as they are indeed the least significant bits ;).
Previous
-
1
| 2 |
3
-
Next
Refresh
Subscribe to this thread:
You need to be logged in to post in the forum.
Search the forum:
Search
All forums
C64 Coding
C64 Composing
C64 Pixeling
C64 Productions
CSDb Bug Reports
CSDb Development
CSDb Discussions
CSDb Entries
CSDb Feedback
CSDb Info
CSDb moderators
CSDb Questions
Messages to moderators
Requests
for
in
Writer & text
Text
Writer
All times are CET.
Search CSDb
All
Releases
Groups
Sceners
Events
BBS
SIDs
-------
Forum
Comments
Advanced
Users Online
iceout/Avatar/HF
krissz
Guests online: 136
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
Copper Booze
(9.6)
5
X-Mas Demo 2024
(9.5)
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
Censor Design
(9.3)
5
Triad
(9.3)
Top Musicians
1
Rob Hubbard
(9.7)
2
Mutetus
(9.7)
3
Jeroen Tel
(9.7)
4
Linus
(9.6)
5
Stinsen
(9.6)
Home
-
Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.06 sec.