Csound Csound-dev Csound-tekno Search About

pvsmooth / ampdb conversion issue? (wierd)

Date2007-10-25 00:42
FromTim Mortimer
Subjectpvsmooth / ampdb conversion issue? (wierd)
Hello

I'm in a bit of a rush this morning but i was desparate to post this

I've made a pretty much kick arse phase vocoder piano (using separate PVX
files for all 88 keys) with complex partial masking & panning, the whole box
& dice.

Problem is as soon as i added PVSsmooth, the whole thing ceased to function.
(click, ckick, click, thousands of samples out of range...)

It's taken me about 4 hrs last night, & a bit of time this morning, but i've
reduced the whole 700 odd line instrument to the simplest, "non operational
example" below

if pvsmooth is commented out, it works fine (just like the original, more
complex instrument)

HOWEVER

it seems the conversion 

			
			kbindB = dbamp (kbinamp)
			kbinamp = ampdb (kbindB)
			
that takes place during my pvsftr/w loop means that pvsmooth ceases to
function?

if 0dbfs was the problem, well, why would pvsmooth work at all? (without the
conversion?)

so somehow dbamp , ampdb, & pvssmooth don't seem to be operating together

very keen to sort this out. a tiny bit of smoothing on the routed noisy bins
of my piano fsig is going to have it all sounding sweet. & i really want to
keep using dB rather than amp values for bin attenuation (that's my
"spectral  tide" essentially....)

probably the final thing to add is that im still on 5.06

very keen to find the issue, & work towards a solution. (& if it's a bug,
well, alert the fixer!)

(off to work - thanks oeyvind & victor for further python suggestions - will
look at that tonight)

much thanks

Tim




-d ;-o "testout.wav"




  sr	    	=  48000
  ksmps	=  64
  nchnls  =  2
  
  0dbfs = 1
  
  seed 0
	
	gadB01 init 0
	
	gibins init 1024
	
	gipvsrwtablecount init 3000
	

instr 3001
	
	ipartialatten init 0
	inoiseatten init +18
	
	adB01 init p5
	avelatten = ampdb (adB01)
	
	ilen init p3 
	
	;;; overall amp env
	idec init .05
	idur init ilen-idec
	aamp expsega 1,idur,1,idec,0.000000001
	
	igrpmasknum = p4+1000
	igrpnormnum = p4+2000
	
	gipvsrwtablecount = gipvsrwtablecount+1
	
	;;;read fsig to this ftable
	ipvsftw ftgen gipvsrwtablecount,0,1024,-17,0,0
	
	;;; ********************************
	
	ktimpt line 0,p3,3
	
	;;; ********************************
	
	fsig pvsfread  ktimpt, "PVOC\\Piano\\Piano47.pvx"
	
	kflag   pvsftw  fsig,ipvsftw   
	
	if kflag == 1 then
	
		;;; ************************
		kindex = 0

		binloop:
		
			kbinamp table kindex, ipvsftw
			
			;printk2 kbinamp
			
			;;;if this conversion & reconversion is removed
			;;;pvsmooth works
			
			;;;this conversion also works fine 
			;;;if pvsmooth is removed however
			;;;(see below)
			
			kbindB = dbamp (kbinamp)
			kbinamp = ampdb (kbindB)
			
			;printk2 kbinamp
			
			tablew kbinamp2, kindex, ipvsftw
			
			kindex = kindex+1
			
			if (kindex < gibins) kgoto binloop
		
		;;;return amplitude to centre fsig
		pvsftr fsig,ipvsftw
		
	endif
	
	fsig2 pvsmooth fsig, 0.025, 0.025
	
	aoutL    pvsynth    fsig2
	aoutR    pvsynth    fsig2

	aoutL = aoutL*aamp*avelatten
	aoutR = aoutR*aamp*avelatten
	
	outs aoutL,aoutR
	
endin





i 3001 	 0.000 	 4.018 	 67	 -6

i 3001 	 4.023 	 7.975 	 67	 -6

i 3001 	 11.998 	 3.987 	 67	 -6





-- 
View this message in context: http://www.nabble.com/pvsmooth---ampdb-conversion-issue--%28wierd%29-tf4687773.html#a13397540
Sent from the Csound - General mailing list archive at Nabble.com.

Date2007-10-25 10:18
FromTim Mortimer
SubjectRe: pvsmooth / ampdb conversion issue? (wierd)
well, problem solved, but it's STILL wierd

1) firstly, yes there is a minor error in the code i posted earlier

the line

    tablew kbinamp2, kindex, ipvsftw 

should read

    tablew kbinamp, kindex, ipvsftw 

2) 

when i replace

     kbinamp = ampdb (kbindB) 

with

    kbinamp = 10^(kbindB/20)


pvsmooth starts working again (!!!???)

so the wierdness is as reported , but it appears i have a fix

how do 2 otherwise perfectly functional opcodes with apparently little or
nothing to do with each other result in a whole orchestra to fall down?

one for the gurus...

ps. tried a few python things for the batch processing. given up for the mo.
if anyone wants to write a book about csnd.py i'll buy it.




-- 
View this message in context: http://www.nabble.com/pvsmooth---ampdb-conversion-issue--%28wierd%29-tf4687773.html#a13402920
Sent from the Csound - General mailing list archive at Nabble.com.