Crossfading from kJams Pro to iTunes (and Back)

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!
oss
Posts: 9
Joined: Sat Apr 15, 2006 5:41 am

Crossfading from kJams Pro to iTunes (and Back)

Post by oss »

Well, thanks to Dave and his leet programming skills, I have hacked together an apple script that will let you cross fade between kJams Pro and iTunes..

Please have iTunes and kJams running before launching this script and have a playlist selected in iTunes.

The simple logic of the script assumes that if iTunes is playing and this script is run, you want to cross fade over to kJams..

Alternately, if iTunes is not playing a track, it assumes you want to cross fade over to iTunes. When you are ready to cross fade to kJams, make sure your next song is highlighted/selected. It will NOT automatically go to the next track in your kJams playlist.

Cut and paste this code into a new script in Script Editor (comes standard on OSX) and save to wherever you'd like. Make sure you change the file format to "Application" and uncheck the "Startup Screen" check box in the Save As dialog!

I'd recommend you just make an icon for this script on your dock and click on it.. It won't bring up any dialog.

Although I have tested this code, I make no guarantees with this code, use at your own risk!!

Dave, my upgrade license to kJams Pro will be coming through this week, thanks :).

And this is my first attempt at Applescript, so don't laugh! Any fixes/cleanups are welcomed.. I'm a Python guy :).

Code: Select all


-- Please have iTunes and kJams running before launching this script and
-- have a playlist selected in iTunes
-- The simple logic of the script assumes that if iTunes is playing and this script is run,
--  you want to cross fade over to kJams.. Alternately, if iTunes is not playing a track,
--  it assumes you want to cross fade over to iTunes.
-- when you are ready to cross fade to kJams, make sure your next song is
-- highlighted/selected.  It will NOT automatically go to the next track in
-- your kJams playlist.
-- Although I have tested this code, I make no guarantees with this code,
-- any disasters that occur are not my fault.  Use at your own risk!!


tell application "kJams Pro" to set kSpeakers to 0

--sets how much in percentage the volume is decreased per step
set fadeStep to 5
--sets how long in seconds between each step in the fade
set fadeDelay to 0.1
set kScriptCommand_PLAY_PAUSE to 1
set kScriptCommand_STOP to 2
--this is the max volume settings.. iTunes and kJams must share this for proper mixing.. Change to whatever you like.
set MaxVolume to 80
--this is the minimum volume setting
set MinVolume to 0

tell application "iTunes"
	if (player state is playing) then
		set kJamsVolume to MinVolume
		set iTunesVolume to MaxVolume
		set the sound volume to MaxVolume
		tell application "kJams Pro" to set volume kSpeakers level MinVolume
		tell application "kJams Pro" to docommand kScriptCommand_PLAY_PAUSE
		
		repeat until iTunesVolume ≤ 0
			set iTunesVolume to (iTunesVolume - fadeStep)
			set kJamsVolume to (kJamsVolume + fadeStep)
			tell application "iTunes" to set the sound volume to iTunesVolume
			tell application "kJams Pro" to set volume kSpeakers level kJamsVolume
			delay fadeDelay
		end repeat
		
		tell application "iTunes" to pause
		
	else
		set iTunesVolume to MinVolume
		set kJamsVolume to MaxVolume
		tell application "kJams Pro" to set volume kSpeakers level MaxVolume
		tell application "iTunes" to set the sound volume to MinVolume
		tell application "iTunes" to play
		repeat until kJamsVolume ≤ 0
			set iTunesVolume to (iTunesVolume + fadeStep)
			set kJamsVolume to (kJamsVolume - fadeStep)
			tell application "iTunes" to set the sound volume to iTunesVolume
			tell application "kJams Pro" to set volume kSpeakers level kJamsVolume
			delay fadeDelay
		end repeat
		tell application "kJams Pro" to docommand kScriptCommand_STOP
	end if
end tell

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

:)

Post by dave »

8)

dude that rocks!

Here's a direct download link.

cosmik
Posts: 6
Joined: Fri Jul 25, 2008 12:05 pm
Contact:

Post by cosmik »

C-c-c-c-cool!

Test=OK!

But I don't know yet how to use it...Will mix with mixer for now...
An autofade after each Kjams song to Itunes would be cool.
And a autofade from Itunes to Kjams, if you start the next karaoke song.
That way you just make a playlist in Itunes, never have to switch, and everything happens in Kjams.
No inbetween dock-icon pressing..like crossfading.app is doing now..
So I can drink my beer and let the Imac do it all :-))) HAhahahaha

cheers, Mike

I don't no scripts, but maybe I figure something out...

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

:)

Post by dave »

the plan is to have kJams let you set up a "filler list" and will auto-crossfade to it if you want

-dave

aantix
Posts: 41
Joined: Sat Jun 14, 2008 7:49 pm

Re: :)

Post by aantix »

dave wrote:the plan is to have kJams let you set up a "filler list" and will auto-crossfade to it if you want

-dave
I seriously cannot wait for this feature...

aantix
Posts: 41
Joined: Sat Jun 14, 2008 7:49 pm

Re: :)

Post by aantix »

dave wrote:the plan is to have kJams let you set up a "filler list" and will auto-crossfade to it if you want

-dave
It also just occurred to me that for the in-between filler music you could do a display similar to FrontRow. You'd have access to the corresponding album artwork, album and artist name, so there's no reason you couldn't display that on the video screen when filler music is being played.

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

:)

Post by dave »

yes i know. i have big plans for all that.

leo-magic
Posts: 83
Joined: Sat Sep 06, 2008 7:41 am

Re: :)

Post by leo-magic »

aantix wrote:
dave wrote:the plan is to have kJams let you set up a "filler list" and will auto-crossfade to it if you want

-dave
I seriously cannot wait for this feature...
I can't wait for this feature! It will be a great thing!
kjams is almost perfect now!!

Thanks!! Léo

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

:)

Post by dave »

this is my top feature request so it won't be very long i hope.

along with this feature comes also the "iTunes" integration, you'll see all your iTunes songs inside kJams.

aantix
Posts: 41
Joined: Sat Jun 14, 2008 7:49 pm

Re: :)

Post by aantix »

dave wrote:this is my top feature request so it won't be very long i hope.

along with this feature comes also the "iTunes" integration, you'll see all your iTunes songs inside kJams.

Very excited for this feature. Constant music at the parties!

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

:)

Post by dave »

8)

Paul
Posts: 71
Joined: Sat May 03, 2008 6:52 am
Location: London, UK

Post by Paul »

I hope that smile means we are getting closer :)

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

:)

Post by dave »

it's going to take a while. the smiley means "i've read this".

User avatar
f_n_cool
Posts: 1
Joined: Fri Sep 19, 2008 8:05 am
Location: Azores, Portugal
Contact:

Post by f_n_cool »

This is my first post I have ever done in the forums, :shock: but I thought this topic most fitting for it. I would love to have the ability to integrate iTunes into kJams and still have video support for it. I would want support for iTunes purchases for music and video. This way I can play all my entire library inbetween singers. Any possibiltiy this can happen or does the fact that it's a iTunes purchase complicate the issue? :?
How cool is that!?

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

:)

Post by dave »

You'll have to take that up with Lord Steve. Apple's FairPlay DRM is not available for me to license and include within kJams. ergo: only your NON-DRM purchases from iTunes will work within kJams.

note that currently you can simply "add to library" and point to your iTunes folder. this will import all your iTunes. (use Tags when importing) But any DRM tracks or videos simply won't play.

Post Reply