EFFECT/AMPLIFY - odd behavior?

Help for Audacity on GNU/Linux.
Forum rules
ImageThis forum is for Audacity on GNU/Linux.
Please state:
  • which version of Linux you are using,
  • the exact three-section version number of Audacity from Help menu > About Audacity,
  • whether you installed your distribution's release, PPA version, or compiled Audacity from source code.

Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade (see https://www.audacityteam.org/download/).
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Robert J. H.
Posts: 3633
Joined: Thu May 31, 2012 8:33 am
Operating System: Windows 10

Re: EFFECT/AMPLIFY - odd behavior?

Post by Robert J. H. » Sat Mar 29, 2014 10:10 pm

NTL2009 wrote:Yes- good point, I'll be mindful of the dither functions as I dig into this. I'm looking for the best audio that the various bit-depths can provide (rather than a strict mathematical reduction to X bit-depth), so I'll probably want dither enabled, but will check both ways.

Also, the above Nyquist Prompt code error-ed on me (probably something in the loop calculation), but there was enough there for me to figure what I needed.
I don't think that there's a bug, unless you've tried it on a stereo sample.
Look what the debug screen says.

NTL2009
Posts: 24
Joined: Fri Mar 28, 2014 2:30 pm
Operating System: Please select

Re: EFFECT/AMPLIFY - odd behavior?

Post by NTL2009 » Sat Mar 29, 2014 10:35 pm

Robert J. H. wrote:
NTL2009 wrote: ...

Also, the above Nyquist Prompt code error-ed on me (probably something in the loop calculation), but there was enough there for me to figure what I needed.
I don't think that there's a bug, unless you've tried it on a stereo sample.
Look what the debug screen says.
I had used a stereo track, so I converted to mono, reset things to 32 bit float, and still got errors. I'm not looking to get this debugged (the "(quantize s X)" command is all I needed, but in case you were curious about the errors, here they are, pretty much all Greek to me:

Code: Select all

error: bad argument type - NIL
Function: #<Subr-SND-QUANTIZE: #a147208>
Arguments:
  NIL
  32768
Function: #<Subr-APPLY: #a146298>
Arguments:
  #<Subr-SND-QUANTIZE: #a147208>
  (NIL 32768)
Function: #<FSubr-COND: #a14758c>
Arguments:
  (LEN (SETF RESULT (MAKE-ARRAY LEN)) (DOTIMES (I LEN) (SETF (AREF RESULT I) (APPLY FN (MAPCAR (FUNCTION (LAMBDA (A) (COND ((ARRAYP A) (AREF A I)) (T A)))) ARGS)))) RESULT)
  (T (APPLY FN ARGS))
Function: #<FSubr-LET: #a145218>
Arguments:
  (LEN NEWLEN RESULT)
  (DOLIST (A ARGS) (COND ((ARRAYP A) (SETF NEWLEN (LENGTH A)) (COND ((AND LEN (/= LEN NEWLEN)) (ERROR (FORMAT NIL "In ~A, two arguments are vectors of differing length." FN)))) (SETF LEN NEWLEN))))
  (COND (LEN (SETF RESULT (MAKE-ARRAY LEN)) (DOTIMES (I LEN) (SETF (AREF RESULT I) (APPLY FN (MAPCAR (FUNCTION (LAMBDA (A) (COND ((ARRAYP A) (AREF A I)) (T A)))) ARGS)))) RESULT) (T (APPLY FN ARGS)))
Function: #<Closure-MULTICHAN-EXPAND: #9df0a04>
Arguments:
  #<Subr-SND-QUANTIZE: #a147208>
  NIL
  32768
Function: #<Closure-QUANTIZE: #9db3cb4>
Arguments:
  NIL
  32768
Function: #<FSubr-PROGV: #a148edc>
Arguments:
  (QUOTE (*WARP*))
  (IF (WARP-FUNCTION *WARP*) (LIST (LIST (SREF-INVERSE (WARP-FUNCTION *WARP*) T0) (WARP-STRETCH *WARP*) (WARP-FUNCTION *WARP*))) (LIST (LIST T0 (WARP-STRETCH *WARP*) NIL)))
  (QUANTIZE S (TRUNCATE (EXPT 2 (- 16 BIT-DEPTH))))
Function: #<FSubr-PROGV: #a148edc>
Arguments:
  (QUOTE (*WARP* *SUSTAIN* *START* *LOUD* *TRANSPOSE* *STOP* *CONTROL-SRATE* *SOUND-SRATE*))
  NYQ%ENVIRONMENT
  (AT-ABS T0 (QUANTIZE S (TRUNCATE (EXPT 2 (- 16 BIT-DEPTH)))))
Function: #<FSubr-SETF: #a1450b0>
Arguments:
  FIRST%SOUND
  (WITH%ENVIRONMENT NYQ%ENVIRONMENT (AT-ABS T0 (QUANTIZE S (TRUNCATE (EXPT 2 (- 16 BIT-DEPTH))))))
Function: #<FSubr-COND: #a14758c>
Arguments:
  ((< BIT-DEPTH LOOP%COUNT) (SETF FIRST%SOUND (WITH%ENVIRONMENT NYQ%ENVIRONMENT (AT-ABS T0 (QUANTIZE S (TRUNCATE (EXPT 2 (- 16 BIT-DEPTH))))))) (IF S%RATE (SETF FIRST%SOUND (FORCE-SRATES S%RATE FIRST%SOUND)) (SETF S%RATE (GET-SRATES FIRST%SOUND))) (SETF BIT-DEPTH (1+ BIT-DEPTH)) (COND ((= BIT-DEPTH LOOP%COUNT) FIRST%SOUND) ((ARRAYP S%RATE) (SND-MULTISEQ (PROG1 FIRST%SOUND (SETF FIRST%SOUND NIL)) SEQREP%CLOSURE)) (T (SND-SEQ (PROG1 FIRST%SOUND (SETF FIRST%SOUND NIL)) SEQREP%CLOSURE))))
  (T (SND-ZERO (WARP-TIME *WARP*) *SOUND-SRATE*))
Function: #<Closure: #a144660>
Arguments:
  184.733
1> 

Robert J. H.
Posts: 3633
Joined: Thu May 31, 2012 8:33 am
Operating System: Windows 10

Re: EFFECT/AMPLIFY - odd behavior?

Post by Robert J. H. » Sun Mar 30, 2014 6:24 am

Thanks for the report.
It is obvious that the loop runs out of "sound".
That's queer 'cos I do not get this error.
It might be sufficient to replace "s" with "(cue s)".
Anyways, It is fine that you can work with the quantize part alone.
Another idea would be to use weighted quantization, i.e. quieter sounds are more quantized than louder ones while keeping the bit-depth. That's a trick used in compressed audio formats.

Post Reply