--DJ Vicki / Victoria --by Manuel Wanskasmith and Mike Whybark, March, 2005 --In progress, v.b02 --This script is intended to allow you to whack a key on your Mac and have your speech synthesis voice read info on the current tracks and the preceding two tracks. DJ Victoria will lower the playing iTunes volume and tell you a bit about what you've been hearing. --Currently, we have a very simple method for presenting random interstitial text. Eventually, we hope to implement a random number of songs that Vicki reads information for, and we may add a more listy method of storing and adding to the interstitials. --set globals global A1, A2, B1, B2, C1, C2 set A1 to some item of {"You're listening to", "What you hear playing is", "Behind me you hear"} set A2 to some item of {"by", "lovingly performed by", "laid to wax by"} set B1 to some item of {"Before that, we heard", "That was preceded by", "Leading into that we heard"} set B2 to some item of {"from", "played by", "recorded by"} set C1 to some item of {"And starting off the set was", "Three tracks ago, we heard", "led off by"} set C2 to some item of {"shouted into a wire recorder by", "atrociously covered by", "downsampled to mp3 from the original analog sixteen track by"} tell application "iTunes" if player state is playing then set OriginalVolume to sound volume set CurrentVolume to sound volume set FadedVolume to sound volume * 0.5 repeat if (CurrentVolume > FadedVolume) then set CurrentVolume to CurrentVolume - 1 set sound volume to CurrentVolume else exit repeat end if end repeat say A1 say name of current track as string say A2 say artist of current track as string delay 0.5 tell application "iTunes" set current_playlist to current playlist set current_track_index to index of current track set previous_track_index to current_track_index - 1 set previous_track_ref to (first track of current_playlist whose index is previous_track_index) say B1 say name of previous_track_ref as string say B2 say artist of previous_track_ref as string end tell tell application "iTunes" set previous2_track_index to current_track_index - 2 set previous2_track_ref to (first track of current_playlist whose index is previous2_track_index) say C1 say name of previous2_track_ref as string say C2 say artist of previous2_track_ref as string end tell delay 0.5 repeat if (CurrentVolume < OriginalVolume) then set CurrentVolume to CurrentVolume + 1 set sound volume to CurrentVolume else exit repeat end if end repeat else say "Nothing is playing" end if end tell