/usr/share/audacity/nyquist/upic.sal is in audacity-data 2.2.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | ;; upic.sal -- play upic data
;;
define function upic(data)
begin
if data then
;; use reverse to make a copy of data since sort is destructive
return upic-curve(sort(reverse(data), quote(upic-compare)))
else
return s-rest()
end
define function upic-compare(a, b)
return third(a) < third(b)
define function upic-curve(data)
begin
with curve = first(data),
waveform = first(curve),
envelope = second(curve),
points = cddr(curve),
from-time = first(points),
to-time = nth(length(points) - 2, points),
dur = to-time - from-time,
next = rest(data),
next-start, snd
;; shift curve to start at t = 0
loop
with relpoints
while points
set relpoints @= first(points) - from-time
set relpoints @= second(points)
set points = cddr(points)
finally set points = cdr(reverse(relpoints))
end
set snd = hzosc(pwlv-list(points), symbol-value(waveform)) *
(funcall(envelope) ~ dur)
if next then
begin
set next-start = third(first(next))
;; display "curve", from-time, dur
set snd = seq(set-logical-stop(snd, next-start - from-time),
upic-curve(next))
end
return snd
end
define function upic-env()
return env(0.01, 0.01, 0.01, 1, 1, 1)
|