Coffecients and pot values

Software questions and issues with the FV-1

Moderator: frank

Post Reply
the_boris
Posts: 2
Joined: Sun Nov 18, 2012 7:56 am
Location: United States

Coffecients and pot values

Post by the_boris »

I'm a bit confused by what values of POT0-2 are supposed to be. According to docs and forum posts, the values are 0-1. But when I use a coefficient that represents the same range of values, the behaviors are not at all the same. Below is an example of a basic script where POT2 is a volume pot. If instead of POT2 I use the VOLUME coefficient, it doesn't work.

Code: Select all

equ VOLUME .75

rdax adcl, .5
rdax adcr, .5
mulx pot2 ;works
;mulx VOLUME ; doesn't work.
wrax dacl, 1
wrax dacr, 0

Boris
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

MULX requires the parameter to be a register and not a constant so you would need to save 0.75 in to a register called VOLUME then use it like:

Code: Select all

equ VOLUME .15

equ	volreg	reg0

sof	0,VOLUME
wrax	volreg, 0 ; load VOLUME value into  register

rdax adcl, .5 
rdax adcr, .5 
;mulx pot2 ;works 
mulx volreg ; works with register
wrax dacl, 1 
wrax dacr, 0 
If you want to use VOLUME as a coefficient directly then use sof or other instruction that takes a coefficient directly
Frank Thomson
Experimental Noize
the_boris
Posts: 2
Joined: Sun Nov 18, 2012 7:56 am
Location: United States

Post by the_boris »

perfect! thank you!

my background in higher level programming made me assume that a constant and a variable are interchangeable.
Boris
Post Reply