| |
stunt Account closed
Registered: Jul 2006 Posts: 48 |
ways of implementing vibrato
Cadaver hinted me about a classic 'lean' way of implementing vibrato that i want to ask some more details about.
Basicly at each new note to take also the value of the note that is one semitone higher and take the absolute value of the difference between them, divide that by an 'vibrato dept' value by right-shifting, and then use this value to update pitch each frame.
So this describes the value by which pitch is (in/de)cremented each frame...
So how is this implemented.... does it start with the 'sign' set to "adding" and is the vibratodepth established by like keeping track of how many times (frames) the value is *added* and when adding maximum (vibratodept) reached the direction (adding or subtracting) changes and the sutracting starts till the subtracting minimum (vibratodept) is reached?
Till now i can only guess how this is usually done. Please help me out. Thx.
Stunt |
|
| |
cadaver
Registered: Feb 2002 Posts: 1163 |
You can start up or down, your preference.
The usual thing to determine depth is to init a counter with half of the depthvalue, let it count to zero and add (or subtract) that many times, then reset the counter with the full depthvalue and change direction, repeat over & over. |
| |
Laxity Account closed
Registered: Aug 2005 Posts: 459 |
Here's a mean and lean version of vibrator direction determination. It doesn't give much resolution in terms of different frequencies as one could desire, but it works and is simple to implement.
upOrDown .byte 0
freqCnt .byte 0
frequency .byte 2 ;Set any desired frequency value. 2 is an example
initVib
lda #1
sta upOrDown
lda frequency
sta freqCnt
rts
updateVibDirection
dec freqCnt
bpl .done
lda frequency
sta freqCnt
inc upOrDown
.done
rts
determineVibDirection
lda upOrDown
and #2
bne .up
; Vibrate down
rts
.up
; Vibrate up
rts
Makes any sense?
This vibrato direction determination method only gives the possibility of having 2 up/down, 4 up/down, 6 up/down.. etc.. I usually implement one that has 1 up/down, 3 up/down etc., as well. Doing so is a little more cumbersome, but obviously possible. |
| |
Dane
Registered: May 2002 Posts: 423 |
Vibrato...the death of rtime usage! |
| |
Bamu® Account closed
Registered: May 2005 Posts: 1332 |
Quote: Vibrato...the death of rtime usage!
... as long it sounds good. :D |