Crossfade playback between songs

Is kJams missing a feature you need? Post it here! Note: if iTunes has it but kJams doesn't, it's a good bet kJams will have it, but that I just haven't gotten around to it yet. But go ahead and request it anyway!

Would you use Crossfade Playback?

Sure
18
95%
No way
1
5%
 
Total votes: 19

User avatar
Sedge
Posts: 214
Joined: Wed Aug 13, 2008 11:49 pm
Location: Ridgefield, WA
Contact:

Re: Crossfade playback between songs

Post by Sedge »

Deus,

Will your script - or an easily edited version of it - allow me to crossfade between kJams and dJay (which I prefer for playing music)?

Normally I have everything set up separate to my board (with lots of channels) and cross my own fades. I use dJay for longer music segments (like when setting up/warming up before a show, during any breaks, etc) and my iPod patched in for bumper music between singers. Both use iTunes playlists I have created for these purposes.

As far as audio, the iPod goes direct to the board (channel 11/12), the laptop headphone goes to the board on channel 13/14, (with dJay configured to use it as ouput) and kJams goes through a USB audio out (Behringer) to the board (channels 5/6).

I wouldn't mind getting kJams and dJay to share the Behringer USB audio out, with a way to crossfade between them. Then I would use the cue functionality of dJay (and hopefully one day kJams) through the headphone jack.

If not, no big deal, I can cue from the board too between different sources, just not between the dual decks of dJay.

If you need it for testing, or just to play, dJay is available at http://www.djay-software.com and IMO is worth the $50, especially if your shows involve a bit more than karaoke.

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

Re: Crossfade playback between songs

Post by DeusExMachina »

I don't need to buy dJay, I should just be able to use the trial version to see if I can open its AppleScript dictionary. From that I should be able to craft a script. I will look at it after I download it…
OK, back. I opened the dJay dictionary, and lo and behold, yes, it is scriptable. Here is the dJay dictionary:

crossfade v : Triggers an animation of the crossfader in the given direction
crossfade text : The direction to which the crossfader moves ("Left" ,"Right" ,"Middle" ).
load on left turntable v : Plays a given file on the left turntable.
load on left turntable text : The POSIX path of the file to play.
load on right turntable v : Plays a given file on the right turntable.
load on right turntable text : The POSIX path of the file to play.
pause v : Stops both turntables.
pause
pause left turntable v : Stops the left turntable.
pause left turntable
pause right turntable v : Stops the right turntable.
pause right turntable
play v : Plays both turntables.
play
play left turntable v : Plays the left turntable.
play left turntable
play right turntable v : Plays the right turntable.
play right turntable
reset all audio effects v : Resets all audio effects like temp, pitch, etc.
reset all audio effects
set crossfader to position v : Positions the crossfader.
set crossfader to position integer : The position where to move the crossfader to (value between -1.0 ("Left") and 1.0 ("RIght")).
set pitch of left turntable to v : Sets the pitch of the left turntable.
set pitch of left turntable to integer : The new pitch. MinPitch=-12 ; MaxPitch=12.
set pitch of right turntable to v : Sets the pitch of the right turntable.
set pitch of right turntable to integer : The new pitch. MinPitch=-12 ; MaxPitch=12.
set tempo of left turntable to v : Sets the tempo of the left turntable.
set tempo of left turntable to integer : The new tempo relative to the normal tempo (0.0). MinTempo=-75.0 ; MaxTempo=75.0
set tempo of right turntable to v : Sets the tempo of the right turntable.
set tempo of right turntable to integer : The new tempo relative to the normal tempo. MinTempo=-99 ; MaxTempo=100.
start recording to file v : Starts recording to the file located at the given path.
start recording to file text : A filename. Allowed extensions:(".aif" and ".caf").
stop recording v : Stops recording.
stop recording


As you can see, there is no direct volume control, but what I might be able to do is first determine which deck to use, and then use the cross fader controls to fade into or out of that deck, with nothing on the other deck.
So I would fade kJams in as I crossfaded from deck 1 to deck 2 (i.e. fade out deck 1) or would fade out as I crossfaded from deck 2 to deck 1 (faded in deck 1). This all presupposes nothing is loaded on Deck 2 (I think) or at the very least that Deck 2 is not playing. I will look in to it.

User avatar
Sedge
Posts: 214
Joined: Wed Aug 13, 2008 11:49 pm
Location: Ridgefield, WA
Contact:

Re: Crossfade playback between songs

Post by Sedge »

It's really unfortunate that there is no scripted volume control. My normal workflow is to use the Automix feature of dJay, which keeps both turntables loaded. It also appears there is no way to UN load a turntable, and I don't know of one in the application, although it may be there - so almost by default, both turntables remain loaded, and your script concept would start playing the second turntable, along with kJams. There may be a way to incorporate the pause script command to stop the second turntable from playing, though.

Thanks for looking into it.

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

Re: Crossfade playback between songs

Post by DeusExMachina »

It is not all that bad. Since you can independently play and pause both turntables, you can write a script that automatically plays from either of them and crossfades with kJams by pausing the other and just crossfading back and forth. Since nothing is playing on the other turntable, fading TO it should be the same as fading out djay, and fading FROM it should be the same as fading TO it. At least assuming I am not mistaken about how it works. I can try some experiments if you would like.
Last edited by DeusExMachina on Mon May 16, 2011 11:39 am, edited 1 time in total.

User avatar
Sedge
Posts: 214
Joined: Wed Aug 13, 2008 11:49 pm
Location: Ridgefield, WA
Contact:

Re: Crossfade playback between songs

Post by Sedge »

I could be wrong about this, but my understanding of the crossfade feature is that it starts the turntable it is fading to as part of the crossfade action - or, depending on the crossfade mode, starts it after the fade has reached 100% to a deck - not quite sure which. Still, from using the crossfader, it does automagically start one of the decks. The transition buttons do it too.

OK, I'm sort of correct. In regular mode, the crossfade slider doesn't automatically start a turntable. However, I rarely use it in regular mode, and in automix mode, the crossfade slider does start the deck after it gets to 100%.

So, the crossfade script would need to (assuming you are playing from deck 1)
1. crossfade to 99% deck 2
2. Play kJams, fading up volume
3. After kJams is fully up, pause deck 1
4. reset crossfade to 99% deck 1
(this would need to happen before automix kicked in on its own, by my settings, more than 5s before the end of the track.)

to go back to dJay, the script would just
1. fade kJams to 0 volume
2. crossfade to 100% deck 2 (which should also auto-load a new track onto deck 1, and start deck 2 playing.)

This is all if the scripted commands are aware of the automix mode. Otherwise, you're probably closer to correct with just fading all the way, then pausing.
Last edited by Sedge on Wed Jul 07, 2010 9:22 pm, edited 1 time in total.

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

Re: Crossfade playback between songs

Post by DeusExMachina »

There are two ways I see around this:
1) To immediately pause the other deck, or
2) record a silent track, say a 2 minutes of silence, and just load that on the the other turntable in the script, and then cross fade.
Should do exactly what you want.

User avatar
Sedge
Posts: 214
Joined: Wed Aug 13, 2008 11:49 pm
Location: Ridgefield, WA
Contact:

Re: Crossfade playback between songs

Post by Sedge »

Sorry, posted before editing with testing results. I think the blank track would kind of kill the ease of the automix mode. See my edit for the pause timing that should work.

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

Re: Crossfade playback between songs

Post by DeusExMachina »

Since you are able to load tracks via scripts couldn't you just load the silence track, use it to cross fade, and then load another track on to the same turntable, thus setting it back up for use with automix?

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

Re: Crossfade playback between songs

Post by DeusExMachina »

NOt sure what your question is.
DJay works on a standard DJ dual turntable model. Since it does not provide volume scripting, I was suggesting putting a music track on one turntable, a 2 minute silent track on the other, and then simultaneously fading out kJams and crossfading FROM the silent track TO the music track to emulate a kJams -> dJay crossfade. Alternately, fading IN kJams and crossfading FROM the music TO the silent track would imitate a crossfade from dJay -> kJams.

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

Re: Crossfade playback between songs

Post by dave »

:mrgreen:

Post Reply