Audio clip generator and playback crossfader

Just talk about kJams stuff with each other, describe things you did that worked, talk about your setup, anything that doesn't fit into the other forums!
Post Reply
DeusExMachina
Posts: 1293
Joined: Sun Apr 20, 2008 9:57 am
Location: Pittsburgh, PA
Contact:

Audio clip generator and playback crossfader

Post by DeusExMachina »

I was inspired by a recent forum discussion about the cross fader script. I seldom use iTunes, because I never have free time that I have to fill. I have to go from one singer immediately to the next all night.
But what I DO use is an app to record the audio of a singer, so I can play it back after they are done. I use the hardware mixer to help crossfade, but it is a very rough solution. So I wrote two scripts. The first automates recording the audio clips. It also gives me the option of recording them to disk when they are finished, but that is not necessary, even for the second script to work.
The second script fades the end of the current track in kJams out smoothly, and cross fades the most recent recording into the mix. It can then either play all the way through, or you can hit the stop playback button, which will then fade it back out, return the kJams volume to max, and then bring kJams back to the frontmost application.

Here is a link to the code:
http://karaoke.kjams.com/wiki/Code/AudioClip_Recorder

Hope someone finds it useful.

cstanyer
Posts: 49
Joined: Wed Sep 26, 2007 4:44 am

Re: Audio clip generator and playback crossfader

Post by cstanyer »

That sounds brilliant! I'm still trying to get the whole recording of the singers to work for me though. I tried it last week pre-gig and while audio recorder looked to be recording via the griffin imic (the green bars were certainly moving) I was getting nothing through playback? I need to spend some time looking at this rather then 15 minutes before we start a gig.

dave
Site Admin
Posts: 6715
Joined: Sun Sep 18, 2005 8:02 am
Location: Seattle
Contact:

Re: Audio clip generator and playback crossfader

Post by dave »


cstanyer
Posts: 49
Joined: Wed Sep 26, 2007 4:44 am

Re: Audio clip generator and playback crossfader

Post by cstanyer »

I remember you saying, it just seems a bit "overkill"

DeusExMachina
Posts: 1293
Joined: Sun Apr 20, 2008 9:57 am
Location: Pittsburgh, PA
Contact:

Re: Audio clip generator and playback crossfader

Post by DeusExMachina »

If you are using audio recorder, make sure to check the drop down menu to make sure that you are using that mic as input.
If you are using my script, which triggers quicktime, open a new audio recording and use the disclosure triangle to make sure that the input is set to your mic. From the sound of it, the application is not getting the input.

Brendan
Posts: 424
Joined: Sun Dec 30, 2007 1:05 pm
Location: Vacaville, CA.

Re: Audio clip generator and playback crossfader

Post by Brendan »

Pretty kewl recorder but it times out on me about half way through the song. Any suggestions?

DeusExMachina
Posts: 1293
Joined: Sun Apr 20, 2008 9:57 am
Location: Pittsburgh, PA
Contact:

Re: Audio clip generator and playback crossfader

Post by DeusExMachina »

Oh, I forgot, I had to modify the script to fix that, but I guess I forgot to post the code (or maybe I did, and you got the unupdated version?) Hold on, I'll check… .



Okay, back.
Yup, my fault. The updated code has been posted, but here it is here, too:

Code: Select all

with timeout of 600 seconds
	tell application "QuickTime Player"
		activate
		new audio recording
		start document 1
		set question to display dialog "Recording started" buttons {"Stop recording", "Save Recording"}
		set answer to button returned of question
		stop document 1
		if answer is equal to "Save Recording" then save document 1
	end tell
end timeout
As you can see, all you need to do is wrap the original in a timeout conditional. Normally, Applescript defaults to a very short timeout, as you have seen. Setting it to 600 seconds (10 minutes) lets the script last long enough to record just about any full-length song.

Sorry about the confusion. Hope that helps.

P.S. I would rather use Audio Recorded than QuickTime, but I have not quite figured out how to script it yet.

Brendan
Posts: 424
Joined: Sun Dec 30, 2007 1:05 pm
Location: Vacaville, CA.

Re: Audio clip generator and playback crossfader

Post by Brendan »

What do i do with this? copy and paste it before and after the original recorder script? I looked for the updated recorder script so i could just replace the whole thing but it only shows the 600 timeout script and the playback script. Am i looking in the wrong place? Thanks in advance -Brendan

DeusExMachina
Posts: 1293
Joined: Sun Apr 20, 2008 9:57 am
Location: Pittsburgh, PA
Contact:

Re: Audio clip generator and playback crossfader

Post by DeusExMachina »

Just replace the entire recorder script with that one. If you look closely, you'll see that it is identical, except for the "timeout" wrapper.
Alternately, you could also replace it with this one, which removes the dialogue box, thus requiring you to save using quicktime. That is what I have ended up using, since it occurred to me that the dialogue box was not really simplifying anything. I REALLY want to figure out how to do it with "Audio Recorder" as it has many advantages, but I still can't figure out some scripting issues.

Code: Select all

tell application "QuickTime Player"
		activate
		new audio recording
		start document 1
end tell
Last edited by DeusExMachina on Mon Jul 05, 2010 1:51 pm, edited 1 time in total.

Brendan
Posts: 424
Joined: Sun Dec 30, 2007 1:05 pm
Location: Vacaville, CA.

Re: Audio clip generator and playback crossfader

Post by Brendan »

I get it. Great, everything works fine now, thanks for your help, we will have fun with this one.

dave
Site Admin
Posts: 6715
Joined: Sun Sep 18, 2005 8:02 am
Location: Seattle
Contact:

Re: Audio clip generator and playback crossfader

Post by dave »

8)

Post Reply