外部フレームワーク(mpSoundEngine)を利用してステレオで(左右のチャンネルで別々の)音階の音を鳴らすAppleScriptです。
AppleScript名:mpSoundEngineで音階発生(Stereo) |
— Created 2017-12-14 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "mpSoundKit" –https://github.com/matthiasplappert/MPSoundEngine property engine : missing value set engine to current application’s MPStereoSoundEngine’s alloc()’s init() –https://pages.mtu.edu/~suits/notefreqs.html set soundList to {261.63, 293.66, 329.63, 349.23, 392.0, 440.0, 493.88, 523.25} set aLen to length of soundList repeat with i from 1 to aLen makeStereoSound(item i of soundList, item (aLen – i + 1) of soundList) of me end repeat engine’s |stop|() on makeStereoSound(aHz, bHz) engine’s leftChannel()’s setFrequency:aHz engine’s rightChannel()’s setFrequency:bHz engine’s start() delay 0.5 end makeStereoSound |
More from my site
(Visited 39 times, 1 visits today)