外部フレームワーク(mpSoundEngine)を利用して、8オクターブ分の音を鳴らすAppleScriptです。
AppleScript名:mpSoundEngineで8 octave分の音階発生 |
— 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 –https://pages.mtu.edu/~suits/notefreqs.html set soundList to {16.35, 17.32, 18.35, 19.45, 20.6, 21.83, 23.12, 24.5, 25.96, 27.5, 29.14, 30.87, 32.7, 34.65, 36.71, 38.89, 41.2, 43.65, 46.25, 49.0, 51.91, 55.0, 58.27, 61.74, 65.41, 69.3, 73.42, 77.78, 82.41, 87.31, 92.5, 98.0, 103.83, 110.0, 116.54, 123.47, 130.81, 138.59, 146.83, 155.56, 164.81, 174.61, 185.0, 196.0, 207.65, 220.0, 233.08, 246.94, 261.63, 277.18, 293.66, 311.13, 329.63, 349.23, 369.99, 392.0, 415.3, 440.0, 466.16, 493.88, 523.25, 554.37, 587.33, 622.25, 659.25, 698.46, 739.99, 783.99, 830.61, 880.0, 932.33, 987.77, 1046.5, 1108.73, 1174.66, 1244.51, 1318.51, 1396.91, 1479.98, 1567.98, 1661.22, 1760.0, 1864.66, 1975.53, 2093.0, 2217.46, 2349.32, 2489.02, 2637.02, 2793.83, 2959.96, 3135.96, 3322.44, 3520.0, 3729.31, 3951.07, 4186.01, 4434.92, 4698.63, 4978.03, 5274.04, 5587.65, 5919.91, 6271.93, 6644.88, 7040.0, 7458.62, 7902.13} set revList to reverse of soundList set engine to current application’s MPMonoSoundEngine’s alloc()’s init() engine’s start() repeat with i in soundList (engine’s channel()’s setFrequency:i) delay 0.01 end repeat repeat with i in revList (engine’s channel()’s setFrequency:i) delay 0.01 end repeat engine’s |stop|() |
More from my site
(Visited 41 times, 1 visits today)