sardine
sardine copied to clipboard
amphibian variables in Player don't interpret patterns consistently
- Using amphibian variables in Patterns works fine with parameters set to single values.
- When amphibian variables are reset with patterns, the patterns are not always interpreted. Sometimes the first item of pattern plays but doesn't move on. Other times it causes all sound to stop without any failure or error.
- This can be fixed by using the Pattern Object - BUT, the Player must be reloaded for the new value of the Amphibian variable to be set. That's OK, but then why use Amph Variable? Better to just set the pattern in the Player.
Reproduce
from random import *
def setSampleVals(sampleDurIn):
endRand = random()
beginRand = random() * endRand
periodDur = (endRand - beginRand) * sampleDurIn # sets period length
ampVal = round(random(),1)
speedVal = round(random()+0.5, 2)
return(beginRand, endRand, periodDur, ampVal, speedVal)
V.b, V.e, V.p, V.a, V.s = setSampleVals(2.0)
Px * d('birds:1', begin='(v b)', end='(v e)', p='(v p)', amp='(v a)', speed='(v s)')
# now reset the "amp" or "speed" variables to patterns
V.a = '0.1 0.2 0.4'
V.s = '1 0.8 1.2'
# change amp and speed to use Pattern Object - this works but requires evaluating the Player again:
Px * d('birds:1', begin='(v b)', end='(v e)', p='(v p)', amp=P('(v a)'), speed=P('(v s)'))