How to sweep the phase with AppleScript

AudioTest generates audio test signals and can save audio test signals as audio files.
Post Reply
katsura
Posts: 25
Joined: Sat May 23, 2020 6:16 pm

How to sweep the phase with AppleScript

Post by katsura »

this AppleScript script will repeat -180 to 180 degree phase sweep three times.

Code: Select all

set lp to -180 -- the lowest phase in degree
set hp to 180 -- the highest phase in degree
set rv to 0 -- set to 1 for reverse (hp to lp)
set rp to 3 -- repeat 3 times
if hp is less than lp then
	set tmp to lp
	set lp to hp
	set hp to tmp
end if
if rv is 0 then
	set s to 1
else
	set s to -1
	set tmp to lp
	set lp to hp
	set hp to tmp
end if
tell application "AudioTest"
	play
	repeat with i from 1 to rp
		repeat with ph from lp to hp by s
			set phase to ph
		end repeat
	end repeat
	set phase to 0
	stop
end tell
Post Reply