1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 15:49:36 +02:00

Usage of _ in Nyquist program bodies

This commit is contained in:
Paul Licameli 2018-03-01 14:52:26 -05:00
parent da9471ac7f
commit 0beb16210f
21 changed files with 136 additions and 133 deletions

View File

@ -88,6 +88,7 @@ s-in))
(if (and (> v thres) (> sil-c sil-length))
;Mark the user-set number of seconds BEFORE this point to avoid clipping the start
;of the material.
; Should "S" be translated or become a control value?
(add-label (- (/ n s1-srate) labelbeforedur) "S")
)
;If this sample is NOT silent, then reset the silence counter
@ -110,6 +111,6 @@ s-in))
;If no silence markers were found, return a message
(if (null l)
(setq l "No silences found. Try reducing the silence\nlevel and minimum silence duration.")
(setq l (_"No silences found. Try reducing the silence\nlevel and minimum silence duration."))
)
l

View File

@ -149,7 +149,7 @@ s-in))
;If no sound markers were found, return a message
;Otherwise, if some sounds were found, also optionally place a label at the end of the file.
(if (null l)
(setq l "No sounds found. Try reducing the silence\nlevel and minimum silence duration.")
(if (= finallabel 1) (add-label (/ s1-length s1-srate) (/ s1-length s1-srate) "[End]"))
(setq l (_"No sounds found. Try reducing the silence\nlevel and minimum silence duration."))
(if (= finallabel 1) (add-label (/ s1-length s1-srate) (/ s1-length s1-srate) (_"[End]")))
)
l

View File

@ -33,20 +33,21 @@ $copyright (_"Released under terms of the GNU General Public License version 2")
(env (snd-pwl 0.0 rate breakpoints)))
(cond
((not (or f0 f1)) ; This should never happen for a 'spectral' effect.
(throw 'error-message "Please select frequencies."))
(throw 'error-message
(format nil (_"~aPlease select frequencies.") p-err)))
((and f0 f1 (= f0 f1))
(throw 'error-message
(format nil "~aBandwidth is zero (the upper and lower~%~
(format nil (_"~aBandwidth is zero (the upper and lower~%~
frequencies are both ~a Hz).~%~
Please select a frequency range."
Please select a frequency range.")
p-err f0)))
;; Biqud filter fails if centre frequency is very low and bandwidth very high.
;; 'Magic numbers' 10 Hz and 10 octaves are experimental.
((and f0 (< f0 10) (or (not bw)(> bw 10)))
(throw 'error-message
(format nil "~aNotch filter parameters cannot be applied.~%~
(format nil (_"~aNotch filter parameters cannot be applied.~%~
Try increasing the low frequency bound~%~
or reduce the filter 'Width'."
or reduce the filter 'Width'.")
p-err)))
;; low pass frequency is above Nyquist so do nothing
((and (not f1) (>= f0 (/ *sound-srate* 2.0)))
@ -61,5 +62,5 @@ $copyright (_"Released under terms of the GNU General Public License version 2")
(prod (diff 1.0 env) sig))))))
(catch 'error-message
(setf p-err "Error.\n")
(setf p-err (_"Error.\n"))
(multichan-expand #'result *track*))

View File

@ -33,24 +33,24 @@ $control control-gain (_"Gain (dB)") real "" 0 -24 24
(env (snd-pwl 0.0 rate breakpoints)))
(cond
((not (or f0 f1)) ; This should never happen for a 'spectral' effect.
(throw 'error-message (format nil "~aPlease select frequencies." p-err)))
(throw 'error-message (format nil (_"~aPlease select frequencies.") p-err)))
((not f0)
(throw 'error-message (format nil "~aLow frequency is undefined." p-err)))
(throw 'error-message (format nil (_"~aLow frequency is undefined.") p-err)))
((not f1)
(throw 'error-message (format nil "~aHigh frequency is undefined." p-err)))
(throw 'error-message (format nil (_"~aHigh frequency is undefined.") p-err)))
((and fc (= fc 0))
(throw 'error-message (format nil "~aCenter frequency must be above 0 Hz." p-err)))
(throw 'error-message (format nil (_"~aCenter frequency must be above 0 Hz.") p-err)))
((and f1 (> f1 (/ *sound-srate* 2)))
(throw 'error-message
(format nil "~aFrequency selection is too high for track sample rate.
(format nil (_"~aFrequency selection is too high for track sample rate.~%~
For the current track, the high frequency setting cannot~%~
be greater than ~a Hz"
be greater than ~a Hz")
p-err (/ *sound-srate* 2))))
((and bw (= bw 0))
(throw 'error-message
(format nil "~aBandwidth is zero (the upper and lower~%~
(format nil (_"~aBandwidth is zero (the upper and lower~%~
frequencies are both ~a Hz).~%~
Please select a frequency range."
Please select a frequency range.")
p-err f0)))
;; If centre frequency band is above Nyquist, do nothing.
((and fc (>= fc (/ *sound-srate* 2.0)))
@ -59,7 +59,7 @@ $control control-gain (_"Gain (dB)") real "" 0 -24 24
(prod (diff 1.0 env) sig))))))
(catch 'error-message
(setf p-err "Error.\n")
(setf p-err (_"Error.\n"))
(if (= control-gain 0)
nil ; Do nothing
(multichan-expand #'result *track*)))

View File

@ -49,15 +49,15 @@ $control control-gain (_"Gain (dB)") real "" 0 -24 24
(env (snd-pwl 0.0 rate breakpoints)))
(cond
((not (or f0 f1)) ; This should never happen for a 'spectral' effect.
(throw 'error-message (format nil "~aPlease select frequencies." p-err)))
(throw 'error-message (format nil (_"~aPlease select frequencies.") p-err)))
((and f0 (>= f0 (/ *sound-srate* 2.0)))
; Shelf is above Nyquist frequency so do nothing.
nil)
((and f0 f1 (= f0 f1))
(throw 'error-message
(format nil "~aBandwidth is zero (the upper and lower~%~
(format nil (_"~aBandwidth is zero (the upper and lower~%~
frequencies are both ~a Hz).~%~
Please select a frequency range."
Please select a frequency range.")
p-err f0)))
(T (if f0 (validate f0))
(if f1 (validate f1))
@ -67,7 +67,7 @@ $control control-gain (_"Gain (dB)") real "" 0 -24 24
(prod (diff 1.0 env) sig)))))))
(catch 'error-message
(setf p-err "Error.\n")
(setf p-err (_"Error.\n"))
(if (= control-gain 0)
nil ; Do nothing
(multichan-expand #'result *track*)))

View File

@ -39,7 +39,7 @@ $copyright (_"Released under terms of the GNU General Public License version 2")
(let ((dur (get-duration 1)))
(cond
((< len 3) "Selection too short.\nIt must be more than 2 samples.")
((< len 3) (_"Selection too short.\nIt must be more than 2 samples."))
((< dur 0.2) (mult s (r-cos dur)))
(t (mult (filter s dur)(r-cos dur)))))

View File

@ -53,14 +53,14 @@ selection length, but preview only needs to process preview length."
(if (= units 0) ;percentage values
(cond
((or (< x 0)(< y 0))
(throw 'err (format nil "~aPercentage values cannot be negative." err)))
(throw 'err (format nil (_"~aPercentage values cannot be negative.") err)))
((or (> x 1000)(> y 1000))
(throw 'err (format nil "~aPercentage values cannot be more than 1000 %." err))))
(throw 'err (format nil (_"~aPercentage values cannot be more than 1000 %.") err))))
(cond ;dB values
((or (> x 100)(> y 100))
(throw 'err (format nil "~adB values cannot be more than +100 dB.~%~%~
(throw 'err (format nil (_"~adB values cannot be more than +100 dB.~%~%~
Hint: 6 dB doubles the amplitude~%~
\t-6 dB halves the amplitude." err))))))
\t-6 dB halves the amplitude." err)))))))
;;; select and apply fade
(defun fade (sig type curve g0 g1)
@ -192,7 +192,7 @@ selection length, but preview only needs to process preview length."
(setf curve (/ curve 100.0))
(setf gain0 (gainscale gain0 units))
(setf gain1 (gainscale gain1 units))
(setf err "Error\n\n")
(setf err (_"Error\n\n"))
(catch 'err (fade *track* type curve gain0 gain1))

View File

@ -18,6 +18,7 @@ $control thresval (_"Threshold Percentage") int "" 65 5 100
(setq thres (* (/ thresval 100.0) max))
(setq s2 (signal))
(do ((c 0.0) (l NIL) (p T) (v (snd-fetch s2))) ((not v) l)
; "B" seems too short to put into the i18n catalog. Make it a control?
(if (and p (> v thres)) (setq l (cons (list c "B") l)))
(setq p (< v thres))
(setq c (+ c 0.001))

View File

@ -37,8 +37,8 @@ $copyright (_"Released under terms of the GNU General Public License version 2")
;; 2) The selection may not start or end in white-space.
(setf err1 "Error.\nInvalid selection.\nMore than 2 audio clips selected.")
(setf err2 "Error.\nInvalid selection.\nEmpty space at start/ end of the selection.")
(setf err1 (_"Error.\nInvalid selection.\nMore than 2 audio clips selected."))
(setf err2 (_"Error.\nInvalid selection.\nEmpty space at start/ end of the selection."))
(defun find-ends (T0 T1 clips)
@ -128,4 +128,4 @@ $copyright (_"Released under terms of the GNU General Public License version 2")
(get '*selection* 'start)
(get '*selection* 'end)
(get '*track* 'clips)))
"Error.\nCrossfade Clips may only be applied to one track.")
(_"Error.\nCrossfade Clips may only be applied to one track."))

View File

@ -72,5 +72,5 @@ audio clip, fade in, otherwise fade out."
(if (< in-dist out-dist) 'in 'out)))
(if (< (length (get '*selection* 'tracks)) 2)
"Error.\nSelect 2 (or more) tracks to crossfade."
(_"Error.\nSelect 2 (or more) tracks to crossfade.")
(crossfade type direction curve))

View File

@ -42,19 +42,19 @@ $control constrain (_"Allow duration to change") choice ((_"Yes") (_"No")) 0
T nil))
(when (err-chk number 1 50)(setq err (format nil
"Number of echoes '~a' outside valid range 1 to 50.~%~a"
(_"Number of echoes '~a' outside valid range 1 to 50.~%~a")
number err)))
(when (err-chk shift -12 12)(setq err (format nil
"Pitch change '~a' outside valid range -12 to +12 semitones.~%~a"
(_"Pitch change '~a' outside valid range -12 to +12 semitones.~%~a")
shift err)))
(when (err-chk delay 0 10)(setq err (format nil
"Delay time '~a' outside valid range 0 to 10 seconds.~%~a"
(_"Delay time '~a' outside valid range 0 to 10 seconds.~%~a")
delay err)))
(when (err-chk dgain -30 6)(setq err (format nil
"Delay level '~a' outside valid range -30 to +6 dB.~%~a"
(_"Delay level '~a' outside valid range -30 to +6 dB.~%~a")
dgain err)))
@ -121,7 +121,7 @@ $control constrain (_"Allow duration to change") choice ((_"Yes") (_"No")) 0
;;; return errors or process
(if (> (length err) 0)
(format nil "Error.~%~a" err) ; return error
(format nil (_"Error.~%~a") err) ; return error
(let* ((delay (if (= delay-type 0) delay (/ delay number)))
(output
(multichan-expand #'delays

View File

@ -49,12 +49,12 @@ $control firstnum (_"Begin numbering from") int-text "" 1 0 nil
"Throw error if excessive number of labels ('Interval' mode only)"
(when (> totalnum 1000)
(throw 'err
(format nil "Too many labels.~%~%~
(format nil ("Too many labels.~%~%~
Selection length is ~a seconds and~%~
Label interval is ~a seconds~%~
giving a total of ~a labels.~%~
Maximum number of labels from this effect is 1000.~%~
Please use a shorter selection, or a longer Label interval."
Please use a shorter selection, or a longer Label interval.")
(formatgg (get-duration 1))
(formatgg interval)
(if (= adjust 1)

View File

@ -20,11 +20,11 @@ $control rolloff (_"Rolloff (dB per octave)") choice ((_"6 dB") (_"12 dB") (_"24
(cond
((< frequency 0.1) "Frequency must be at least 0.1 Hz.")
((< frequency 0.1) (_"Frequency must be at least 0.1 Hz."))
((>= frequency (/ *sound-srate* 2.0))
(format nil "Error:~%~%Frequency (~a Hz) is too high for track sample rate.~%~%~
(format nil (_"Error:~%~%Frequency (~a Hz) is too high for track sample rate.~%~%~
Track sample rate is ~a Hz~%~
Frequency must be less than ~a Hz."
Frequency must be less than ~a Hz.")
frequency
*sound-srate*
(/ *sound-srate* 2.0)))

View File

@ -20,11 +20,11 @@ $control rolloff (_"Rolloff (dB per octave)") choice ((_"6 dB") (_"12 dB") (_"24
(cond
((< frequency 0.1) "Frequency must be at least 0.1 Hz.")
((< frequency 0.1) (_"Frequency must be at least 0.1 Hz."))
((>= frequency (/ *sound-srate* 2.0))
(format nil "Error:~%~%Frequency (~a Hz) is too high for track sample rate.~%~%~
(format nil (_"Error:~%~%Frequency (~a Hz) is too high for track sample rate.~%~%~
Track sample rate is ~a Hz~%~
Frequency must be less than ~a Hz."
Frequency must be less than ~a Hz.")
frequency
*sound-srate*
(/ *sound-srate* 2.0)))

View File

@ -18,11 +18,11 @@ $control frequency (_"Frequency (Hz)") float-text "" 60 0 nil
$control q (_"Q (higher value reduces width)") float-text "" 1 0.1 1000
(cond
((< frequency 0.1) "Frequency must be at least 0.1 Hz.")
((< frequency 0.1) (_"Frequency must be at least 0.1 Hz."))
((>= frequency (/ *sound-srate* 2.0))
(format nil "Error:~%~%Frequency (~a Hz) is too high for track sample rate.~%~%~
(format nil (_"Error:~%~%Frequency (~a Hz) is too high for track sample rate.~%~%~
Track sample rate is ~a Hz.~%~
Frequency must be less than ~a Hz."
Frequency must be less than ~a Hz.")
frequency
*sound-srate*
(/ *sound-srate* 2.0)))

View File

@ -48,7 +48,7 @@ $control low (_"MIDI pitch of weak beat") int (_"18 - 116") 80 18 116
(defun help1 ()
(format nil
"Rhythm Track Generator help - screen 1 of 2
(_"Rhythm Track Generator help - screen 1 of 2
Generates a rhythm track at the selected tempo, beats per
measure, and either number of measures or track duration,
@ -75,12 +75,12 @@ If you enter a value into this field, the 'number of measures'
value will be ignored.
To generate rhythm track or view help screen 2,
restart Rhythm Track and select from 'Action choice'.")) ;end of help1
restart Rhythm Track and select from 'Action choice'."))) ;end of help1
(defun help2 ()
(format nil
"Rhythm Track Generator help - screen 2 of 2
(_"Rhythm Track Generator help - screen 2 of 2
'Start time offset': makes the rhythm track start at a later
time than the very beginning (zero seconds), maximum
@ -95,7 +95,7 @@ what pitch to use. C-notes are:
C# (C-sharp) above middle C is 61.
To generate rhythm track or view help screen 1,
restart Rhythm Track and select from 'Action choice'.")) ;end of help 2
restart Rhythm Track and select from 'Action choice'."))) ;end of help 2
;Check function: returns 1 on error
@ -156,44 +156,44 @@ restart Rhythm Track and select from 'Action choice'.")) ;end of help 2
; tempo
(if (= (check tempo 30 300) 1)
(setq error-msg (strcat error-msg (format nil
"Tempo ~a outside valid range 30 to 300 bpm
" tempo))))
(_"Tempo ~a outside valid range 30 to 300 bpm
") tempo))))
;beats per measure
(if (= (check timesig 1 20) 1)
(setq error-msg (strcat error-msg (format nil
"Beats per measure ~a outside valid range 1 to 20
" timesig))))
(_"Beats per measure ~a outside valid range 1 to 20
") timesig))))
;number of measures
(if (= (check measures 1 1000) 1)
(setq error-msg (strcat error-msg (format nil
"Number of measures ~a outside valid range 1 to 1000
" measures))))
(_"Number of measures ~a outside valid range 1 to 1000
") measures))))
;time start offset
(if (= (check offset 0 30) 1)
(setq error-msg (strcat error-msg (format nil
"Time offset ~a outside valid range 0 to 30 seconds
" offset))))
(_"Time offset ~a outside valid range 0 to 30 seconds
") offset))))
; q
(if (= (check q 1 20) 1)
(setq error-msg (strcat error-msg (format nil
"Filter quality q ~a outside valid range 1 to 20
" q))))
(_"Filter quality q ~a outside valid range 1 to 20
") q))))
;high MIDI pitch
(if (= (check high 18 116) 1)
(setq error-msg (strcat error-msg (format nil
"High MIDI pitch ~a outside valid range 18 to 116
" high))))
(_"High MIDI pitch ~a outside valid range 18 to 116
") high))))
;low MIDI pitch
(if (= (check low 18 116) 1)
(setq error-msg (strcat error-msg (format nil
"Low MIDI pitch ~a outside valid range 18 to 116
" low))))
(_"Low MIDI pitch ~a outside valid range 18 to 116
") low))))
;validate string
(if (> (length m-s) 0) ;if at least one item
@ -203,16 +203,16 @@ restart Rhythm Track and select from 'Action choice'.")) ;end of help 2
(not (integerp (first m-s))) ;first is not an integer or
(and (= (length m-s) 2)(not (integerp (second m-s))))) ;second is not an integer
(setq error-msg (strcat error-msg (format nil
"If used, 'Optional rhythm track duration' must be
(_"If used, 'Optional rhythm track duration' must be
entered as either one number (seconds0, or two
numbers (minutes seconds) separated by a space.
Use whole numbers only.~%"))))
Use whole numbers only.~%")))))
;one or two integers
((and
(= (length m-s) 1) ;one integer and
(= (check (first m-s) 0 3660) 1)) ;outside valid range
(setq error-msg (strcat error-msg (format nil
"~a seconds is outside valid range 0 to 3660~%" (first m-s)))))
(_"~a seconds is outside valid range 0 to 3660~%") (first m-s)))))
;one or two integers
((and
(= (length m-s) 2) ;2 integers and
@ -220,7 +220,7 @@ Use whole numbers only.~%"))))
(= (check (first m-s) 0 60) 1) ;1st is outside valid range or
(= (check (second m-s) 0 59) 1))) ;2nd is outside valid range or
(setq error-msg (strcat error-msg (format nil
"~a is outside valid range 0 to (60 59)~%"
(_"~a is outside valid range 0 to (60 59)~%")
m-s))))))) ;end of error checking
(defun metronome-tick (hz peak)
@ -366,4 +366,4 @@ Use whole numbers only.~%"))))
(make-click-track measures (* timesig beatlen)))) ;click track
;Else error message
(setq error-msg (strcat (format nil
"Error.~%You have entered at least one invalid value:~%~%") error-msg)))))
(_"Error.~%You have entered at least one invalid value:~%~%")) error-msg)))))

View File

@ -109,9 +109,9 @@ $control owrite (_"Allow files to be overwritten") choice ((_"No") (_"Yes")) 0
(defun checknumber ()
(setq number (min number len))
(if (< number 1)
(add-error "No samples selected."))
(add-error (_"No samples selected.")))
(if (> number 1000000)
(add-error "Cannot export more than 1 million samples."))
(add-error (_"Cannot export more than 1 million samples.")))
(setq number (truncate number)))
@ -215,15 +215,15 @@ $control owrite (_"Allow files to be overwritten") choice ((_"No") (_"Yes")) 0
(if (and (arrayp s)(= chan 2))
(progn
(unless (= header 0) ; Don't print 'channel' if no header
(format fp "Left Channel.~%~%"))
(format fp (_"Left Channel.~%~%")))
(print-text (aref s 0))
(if (= header 0) ; Don't print 'channel' if no header
(format fp "~%")
(format fp "~%~%Right Channel.~%~%"))
(format fp (_"~%~%Right Channel.~%~%")))
(print-text (aref s 1))
(close fp)
(if (= messages 0)
(format nil "~aData written to:~%~a~a~a"
(format nil (_"~aData written to:~%~a~a~a")
(normhead) path fileseparator filename)
nil))
;; mono or alternate
@ -231,7 +231,7 @@ $control owrite (_"Allow files to be overwritten") choice ((_"No") (_"Yes")) 0
(print-text s)
(close fp)
(if (= messages 0)
(format nil "~aData written to:~%~a~a~a"
(format nil (_"~aData written to:~%~a~a~a")
(normhead) path fileseparator filename)
nil))))
@ -275,7 +275,7 @@ $control owrite (_"Allow files to be overwritten") choice ((_"No") (_"Yes")) 0
(string-equal path realdir)))
;; makefilename or error
(setq filename (makefilename filename FileExt))
(add-error (format nil "Output folder \"~a~a\" cannot be accessed."
(add-error (format nil (_"Output folder \"~a~a\" cannot be accessed.")
path fileseparator))))
;; check if file is writeable
(when (= (length err) 0)
@ -283,7 +283,7 @@ $control owrite (_"Allow files to be overwritten") choice ((_"No") (_"Yes")) 0
(setq fp (open filename :direction :output))
;check file is writeable
(if (not fp)
(add-error (format nil "\"~a~a~a\" cannot be written."
(add-error (format nil (_"\"~a~a~a\" cannot be written.")
path fileseparator filename)))))
@ -299,7 +299,7 @@ $control owrite (_"Allow files to be overwritten") choice ((_"No") (_"Yes")) 0
(defun minhead ()
(format nil
"Sample Rate: ~a Hz. Sample values on ~a scale.~%~a~%~a"
(_"Sample Rate: ~a Hz. Sample values on ~a scale.~%~a~%~a")
(get 'info 'srate) ; sample rate
(get 'info 'units) ; units
(get 'info 'chan-order) ; Channel Order
@ -311,7 +311,7 @@ $control owrite (_"Allow files to be overwritten") choice ((_"No") (_"Yes")) 0
(defun normhead ()
(if (= fileformat 4) ; html
(format nil
"~a ~a~%~aSample Rate: ~a Hz.~%Length processed: ~a samples ~a seconds.~a"
(_"~a ~a~%~aSample Rate: ~a Hz.~%Length processed: ~a samples ~a seconds.~a")
filename ; file name
(get 'info 'channels) ; mono/stereo
(get 'info 'chan-order) ; Channel Order
@ -322,8 +322,8 @@ $control owrite (_"Allow files to be overwritten") choice ((_"No") (_"Yes")) 0
(format nil "~%~a~%~%~%" optext) ; optional text
(format nil "~%~%~%"))) ; no optional text
(format nil
"~a ~a~%~aSample Rate: ~a Hz. Sample values on ~a scale.~%~
Length processed: ~a samples ~a seconds.~a"
(_"~a ~a~%~aSample Rate: ~a Hz. Sample values on ~a scale.~%~
Length processed: ~a samples ~a seconds.~a")
filename ; file name
(get 'info 'channels) ; mono/stereo
(get 'info 'chan-order) ; Channel Order
@ -338,9 +338,9 @@ Length processed: ~a samples ~a seconds.~a"
(defun fullhead ()
(format nil
"~a~%Sample Rate: ~a Hz. Sample values on ~a scale. ~a.~%~aLength processed: ~a ~
(_"~a~%Sample Rate: ~a Hz. Sample values on ~a scale. ~a.~%~aLength processed: ~a ~
samples, ~a seconds.~%Peak amplitude: ~a (lin) ~a dB. Unweighted RMS: ~a dB.~%~
DC offset: ~a~a"
DC offset: ~a~a")
filename ; file name
(get 'info 'srate) ; sample rate
(get 'info 'units) ; units
@ -353,9 +353,9 @@ DC offset: ~a~a"
(srms s) ; rms
(let ((vals (dc-off s))) ; DC offset
(if (= (length vals) 2) ; mono
(format nil "~a linear, ~a dB."
(format nil (_"~a linear, ~a dB.")
(first vals)(second vals))
(format nil "Left: ~a lin, ~a dB | Right: ~a lin, ~a dB."
(format nil (_"Left: ~a lin, ~a dB | Right: ~a lin, ~a dB.")
(first vals)(second vals)(third vals)(fourth vals))))
(if (> (length optext)0)
(format nil "~%~a~%~%~%" optext) ; optional text
@ -481,9 +481,9 @@ ul {
(srms s) ; rms
(let ((vals (dc-off s))) ; DC offset
(if (= (length vals) 2) ; mono
(format nil "~a linear, &nbsp;&nbsp;~a dB."
(format nil (_"~a linear, &nbsp;&nbsp;~a dB.")
(first vals)(second vals))
(format nil "Left: ~a lin, ~a dB | Right: ~a linear, &nbsp;&nbsp;~a dB."
(format nil (_"Left: ~a lin, ~a dB | Right: ~a linear, &nbsp;&nbsp;~a dB.")
(first vals)(second vals)(third vals)(fourth vals))))))
@ -561,7 +561,7 @@ Daulton") " (<a href=
(format fp (html-foot))
(close fp)
(if (= messages 0)
(format nil "~aData written to:~%~a~a~a"
(format nil (_"~aData written to:~%~a~a~a")
(normhead) path fileseparator filename)
nil))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -598,14 +598,14 @@ Daulton") " (<a href=
(setq number (read (make-string-input-stream number)))
(if (numberp number)
(checknumber)
(add-error (format nil "~a is not a number." number)))
(add-error (format nil (_"~a is not a number.") number)))
(filewriter)
(if (> (length err) 0)
;; output error message if enabled
(if (= messages 2)
nil ; return nil
(format nil "Error.~%~a" err)) ; return errors
(format nil (_"Error.~%~a") err)) ; return errors
;; else print to file
(progn
(put-head-info) ; put basic info for headers

View File

@ -107,23 +107,23 @@ $control bad-data (_"Invalid data handling") choice ((_"Throw error") (_"Read as
(defun fileopensp (path fname)
(let ((path (string-trim " " path)))
(if (string-equal fname "")
(throw 'err "Error\nNo file name."))
(throw 'err (_"Error\nNo file name.")))
(if (string-not-equal fname ".txt" :start1 (- (length fname) 4))
(throw 'err "Error\nThe file must be a plain ASCII text file\nwith '.txt' file extension."))
(throw 'err (_"Error\nThe file must be a plain ASCII text file\nwith '.txt' file extension.")))
;; Handle special 'path' formats:
(cond
; "~" without "/" is not recommended (or documented)
; but more user friendly to allow it.
((string= path "~")
(if (windowsp)
"Error\n'~/' is not valid on Windows"
(_"Error\n'~/' is not valid on Windows")
(setq path (home))))
;; replace "~/" on Linux/Mac
((and (>= (length path) 2) (string= path "~/" :end1 2))
(if (windowsp)
"Error\n'~/' is not valid on Windows"
(_"Error\n'~/' is not valid on Windows")
(setq path (strcat (home)(subseq path 1)))))
((string-equal path "Home directory")
((string-equal path (_"Home directory"))
(setf path (home)))
;; If empty, use 'Home'
((string-equal path "")
@ -131,26 +131,26 @@ $control bad-data (_"Invalid data handling") choice ((_"Throw error") (_"Read as
;; Now check that the file can be opened:
(cond
((not (setdir path))
(throw 'err (format nil "Error~%~
Directory '~a' could not be opened." path)))
(throw 'err (format nil (_"Error~%~
Directory '~a' could not be opened.") path)))
((not (setf fstream (open fname)))
(throw 'err (format nil "Error~%~
(throw 'err (format nil (_"Error~%~
'~a~a~a' could not be opened.~%~
Check that file exists."
Check that file exists.")
path *file-separator* fname)))
; File opened OK, so check for normal ASCII, then close it and return 'true'
(t (do ((j 0 (1+ j))(b (read-byte fstream)(read-byte fstream)))
((or (> j 100000)(not b)))
(when (> b 127)
(throw 'err (format nil "Error:~%~
(throw 'err (format nil (_"Error:~%~
The file must contain only plain ASCII text.~%~
(Invalid byte '~a' at byte number: ~a)" b (1+ j) ))))
(Invalid byte '~a' at byte number: ~a)") b (1+ j) ))))
(close fstream)
t))))
;; ':new' creates a new class 'streamreader'
;; 'filestream' and 'chanel' are its instance variables.
;; (every objet of class 'streamreader' has it's own
;; (every object of class 'streamreader' has its own
;; copy of these variables)
(setq streamreader
(send class :new '(filestream chanel)))
@ -183,9 +183,9 @@ $control bad-data (_"Invalid data handling") choice ((_"Throw error") (_"Read as
((not val) nil) ;end of file
((numberp val) (float val)) ;valid.
((= bad-data 0) ;invalid. Throw error and quit
(throw 'err (format nil "Error~%~
(throw 'err (format nil (_"Error~%~
Data must be numbers in plain ASCII text.~%~
'~a' is not a numeric value." val)))
'~a' is not a numeric value.") val)))
(t 0.0)))) ;invalid. Replace with zero.
;; Instantiate a new sound object
@ -195,7 +195,7 @@ $control bad-data (_"Invalid data handling") choice ((_"Throw error") (_"Read as
(defun sound-from-file (filename)
;; Set path. fileopenp should return 'true'
(if (not (fileopensp path filename))
(throw 'err "Error.\nUnable to open file"))
(throw 'err (_"Error.\nUnable to open file")))
; Note: we can't use (arrayp *track*) because
; *track* is nil in generate type plug-ins.
(cond

View File

@ -70,14 +70,14 @@ $control high-transition (_"High Cut for Vocals (Hz)") real "" 9000 1 24000
(t (/ s-xy s-x2))))
(a0 (- bar-y (* a1 bar-x))))
(if show (format t
"Average x: ~a, y: ~a
(_"Average x: ~a, y: ~a
Covariance x y: ~a
Average variance x: ~a, y: ~a
Standard deviation x: ~a, y: ~a
Coefficient of correlation: ~a
Coefficient of determination: ~a
Variation of residuals: ~a
y equals ~a plus ~a times x~%"
y equals ~a plus ~a times x~%")
bar-x bar-y s-xy s-x2 s-y2 (sqrt s-x2) (sqrt s-y2) r r2 (* s-y2 (- 1 r2)) a0 a1))
(list r r2 pos-xy a0 a1)))
;;
@ -86,34 +86,34 @@ bar-x bar-y s-xy s-x2 s-y2 (sqrt s-x2) (sqrt s-y2) r r2 (* s-y2 (- 1 r2)) a0 a1)
;;
;; Summary for "Analyse", fed with coeff. of correlation
(defun summary (analysis &aux (corr (car analysis)) (pan-position (third analysis)))
(format nil "Pan position: ~a~%The left and right channels are correlated by about ~a %. This means:~%~a~%"
(format nil (_"Pan position: ~a~%The left and right channels are correlated by about ~a %. This means:~%~a~%")
pan-position
(round (* corr 100))
(cond
((between corr 0.97 1.1)
" - The two channels are identical, i.e. dual mono.
(_" - The two channels are identical, i.e. dual mono.
The center can't be removed.
Any remaining difference may be caused by lossy encoding.")
Any remaining difference may be caused by lossy encoding."))
((between corr 0.9 0.97)
" - The two Channels are strongly related, i.e. nearly mono or extremely panned.
Most likely, the center extraction will be poor.")
(_" - The two Channels are strongly related, i.e. nearly mono or extremely panned.
Most likely, the center extraction will be poor."))
((between corr 0.5 0.9)
" - A fairly good value, at least stereo in average and not too wide spread.")
(_" - A fairly good value, at least stereo in average and not too wide spread."))
((between corr 0.2 0.5)
" - An ideal value for Stereo.
However, the center extraction depends also on the used reverb.")
(_" - An ideal value for Stereo.
However, the center extraction depends also on the used reverb."))
((between corr -0.2 0.2)
" - The two channels are almost not related.
(_" - The two channels are almost not related.
Either you have only noise or the piece is mastered in a unbalanced manner.
The center extraction can still be good though.")
The center extraction can still be good though."))
((between corr -0.8 -0.2)
" - Although the Track is stereo, the field is obviously extra wide.
(_" - Although the Track is stereo, the field is obviously extra wide.
This can cause strange effects.
Especially when played by only one speaker.")
(t " - The two channels are nearly identical.
Especially when played by only one speaker."))
(t (_" - The two channels are nearly identical.
Obviously, a pseudo stereo effect has been used
to spread the signal over the physical distance between the speakers.
Don't expect good results from a center removal."))))
Don't expect good results from a center removal.")))))
;;;
;;; FFT Functionality
;;
@ -128,7 +128,7 @@ bar-x bar-y s-xy s-x2 s-y2 (sqrt s-x2) (sqrt s-y2) r r2 (* s-y2 (- 1 r2)) a0 a1)
(progn (setf cut (truncate (- fs zeros 1)))
(snd-pwl 0 fs
(list 0 (/ (float hop))(- cut hop) 1.0 cut 0.0 fs 0.0 fs)))))
; Han
; Hann
((= type 1)
(seq (cue (control-srate-abs fs
(mult 0.5 (sum 1 (lfo (/ fs (* 2.0 hop)) (/ (- fs zeros) (get-duration fs)) *table* 270)))))
@ -195,7 +195,7 @@ bar-x bar-y s-xy s-x2 s-y2 (sqrt s-x2) (sqrt s-y2) r r2 (* s-y2 (- 1 r2)) a0 a1)
;;; main procedure
(defun catalog (&aux snd
(original-len (/ (+ len hop) *sr*)) (dur (get-duration 1)))
(if (soundp *track*) (return-from catalog "This plug-in works only with stereo tracks.")
(if (soundp *track*) (return-from catalog (_"This plug-in works only with stereo tracks."))
(setf snd (vector (snd-copy (: *track* 0)) (snd-copy (: *track* 1)))))
(cond
((= action 7)

View File

@ -35,7 +35,7 @@ $control high-range (_"Frequency band to (Hz)") float-text "" 2000 0 nil
(defun help ()
(let ((msg (format nil
"Vocal Remover requires a stereo track. It works best with
(_"Vocal Remover requires a stereo track. It works best with
lossless files like WAV or AIFF, rather than MP3 or
other compressed formats. It only removes vocals or other
audio that is panned to center (sounds equally loud in left
@ -59,7 +59,7 @@ sounds like the most significant frequency range of the
original vocals. If the other choices remove too much
audio in a particular frequency range (such as low drums
or bass), try 'Retain frequency band'. This only removes
frequencies outside the limits, retaining the others.")))
frequencies outside the limits, retaining the others."))))
(format t "~a" msg) ;print to debug (coppying supported on all platforms)
msg)) ;return message
@ -67,10 +67,10 @@ frequencies outside the limits, retaining the others.")))
(defun check-stereo ()
(when (soundp *track*)
(throw 'err (format nil
"~%Vocal Remover requires an unsplit, stereo track.~%~
(_"~%Vocal Remover requires an unsplit, stereo track.~%~
If you have a stereo track split into left and right~%~
channels, use 'Make Stereo Track' on the Track~%~
Drop-Down Menu, then run Vocal Remover again.~%"))))
Drop-Down Menu, then run Vocal Remover again.~%")))))
(defmacro validate (Hz)
;; Filters become unstable when very close to 0 Hz or
@ -100,11 +100,11 @@ Drop-Down Menu, then run Vocal Remover again.~%"))))
(defun bandstop (sig low high)
(if (and low high (< (/ (- high low) low) 0.1))
(format t "Warning:~%~
(format t (_"Warning:~%~
Selected band-stop filter is~%~
~a Hz to ~a Hz.~%~
A very narrow stop-band filter may have~%~
unexpected results.~%~%"
unexpected results.~%~%")
low high))
(let ((low-sig (if low (lowpass8 sig low)(s-rest 1))))
(sum
@ -121,7 +121,7 @@ Drop-Down Menu, then run Vocal Remover again.~%"))))
(bandstop (aref *track* 1) low-range high-range)))
; Nothing to remove - skip effect.
((and (= band-choice 2)(not low-range)(not high-range))
(format t "Current settings returned the original audio.")
(format t (_"Current settings returned the original audio."))
nil)
((= band-choice 2) ; remove frequencies inside range
(sum (aref *track* 0)

View File

@ -136,4 +136,4 @@ $control radar-f (_"Frequency of Radar Needles (Hz)") real "" 30 1 100
(0 s) ; let Audacity coerce back to stereo
(1 (vector original s)))))
(t ; this effect isn't meant for mono
"Error.\nStereo track required."))
(_"Error.\nStereo track required.")))