• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Modifying Pitch Shift in QuickTime Player (was: no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modifying Pitch Shift in QuickTime Player (was: no subject)


  • Subject: Re: Modifying Pitch Shift in QuickTime Player (was: no subject)
  • From: kai <email@hidden>
  • Date: Thu, 14 Sep 2006 05:43:27 +0100


On 13 Sep 2006, at 13:10, Peter Baxter wrote:

I regularly use Quicktime to play accompaniments for my music students and use one of Doug's applescripts to speed up the accompaniment and slow it down depending on the ability of the student I am working with. The script is below.

I would like to be able to tune the music as well as some of my recordings are baroque and played a semitone lower than the modern instrument. Changing the pitch can also help a clarinettist play with an un-transposed accompaniment. Anyway, Quicktime has a slider in its AV controls called "Pitch shift" and I would like to be able to alter it in the same way as the script below works on the speed of the music. Is there anyone who can help me script the slider?

Can't see any way to script this directly in QuickTime Player, Peter. However, it's possible via GUI Scripting (which therefore needs to be enabled).


The following modified version of your original offers a pitch shift of one or two semitones in either direction - although this could, if required, be extended to up to 4 semitones each way. (Incidentally, since I couldn't quite figure how a coercion of the variable 'myChoice' from a single-item list to integer could work, I've also suggested a small amendment to that statement.)

--------------

to shift_pitch by v
tell application "QuickTime Player" to set show av controls window to false
tell application "System Events" to tell process "QuickTime Player"
set frontmost to true
keystroke "k" using {command down}
tell window "A/V Controls"
repeat until exists
delay 0.1
end repeat
set value of group 1's slider 4 to v
end tell
end tell
tell application "QuickTime Player" to set show av controls window to false
end shift_pitch


set myspeeds to {0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 0}
set myChoice to (choose from list myspeeds)
if myChoice is false then error number -128

set shift_list to characters of ¬
	(«data utxtD834DD2B266D266E266FD834DD2A» as Unicode text)
set shift_value to choose from list shift_list with prompt ¬
	"Choose a pitch shift:" default items shift_list's middle item
if shift_value is false then error number -128

tell shift_value's beginning to repeat with i from 1 to count shift_list
	if it is shift_list's item i then exit repeat
end repeat
set shift_value to (i - 3) * 100

tell application "iTunes"
	pause
	set my_track to location of current track
	set my_seconds to player position
end tell

tell application "QuickTime Player"

	open my_track
	set my_movie to first movie
	set ts to time scale of my_movie
	set current time of my_movie to my_seconds * ts

my (shift_pitch by shift_value)
set rate of my_movie to beginning of myChoice -- starts playing (*amended*)


end tell

--------------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Modifying Pitch Shift in QuickTime Player (was: no subject)
      • From: Peter Baxter <email@hidden>
References: 
 >(no subject) (From: Peter Baxter <email@hidden>)

  • Prev by Date: Mount AFP volume and if/or cases
  • Next by Date: Re: (no subject)
  • Previous by thread: (no subject)
  • Next by thread: Re: Modifying Pitch Shift in QuickTime Player (was: no subject)
  • Index(es):
    • Date
    • Thread