Using encoders to make a DJ platter (Proof of concept & ?'s)

Discuss Lemur and share techniques.
Post Reply
Traxus
Regular
Posts: 211
Joined: 30 Nov 2012 06:19
Location: Detroit
Contact:

Using encoders to make a DJ platter (Proof of concept & ?'s)

Post by Traxus »

Sorry about the flood of threads, I have two questions related to this project and I felt it better they had their own microcosms...

Anyway, now that we have a Z value on knobs, its possible to mimic a DJ platter for Serato/Traktor using encoders. The Z value was critical because we need the ability to stop and hold the track when we are touching the encoder, but not changing its value, so big ups for adding this feature. With a platter, we bascially have four states, hold, scroll forward, scroll backwards, and 'none of the above' which basically means play the track as normal. I was able to code a template to achieve this. I've only been developing it on my iPhone as I'm a bit nervous to install v4 on my iPad 2/6.01 at the moment (waiting for the second update after the new year).

Here is what it looks like:
platterDev.jpg
platterDev.jpg (45.37 KiB) Viewed 3450 times
Download it here:
plattersmall4.jzml
(12.13 KiB) Downloaded 105 times
So, this works (for me at least) but needs some refining. Most notably, you'll notice the set of 3 encoders used to make one big encoder. Obviously this took a bit of coding to accomplish.I was hoping that the new skin feature would allow me to widen an encoder (see thread) and avoid this hack all together?

I'm assuming not so I've been looking for clever ways to keep all of the encoders synced up whilst avoiding the potential of having 2 of them active at the same time, as to force them to act as one.

At any rate, I think this opens up a ton of potential for lemur to start competing with the hardware DJ controllers and make a presence on that scene, I'm really excited to get started with this.
Macciza
Regular
Posts: 1315
Joined: 07 Dec 2011 04:57
Location: Sydney, Australia.

Re: Using encoders to make a DJ platter (Proof of concept &

Post by Macciza »

Hi
There are a few projects in the library that have dealt with this before in different ways
Some are for Serato and some for Traktor I think - would certainly be worth checking out

Also the logic and some of the code for MIDI output could help - but basically its just an encoder . . ..

Cheers
MM
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
lABl
Lemur Guru
Posts: 269
Joined: 09 Dec 2011 15:56
Contact:

Re: Using encoders to make a DJ platter (Proof of concept &

Post by lABl »

Hi guys,

I was digging on it a bit , note I am not a DJ guy (not sure if everything is implemented properly, you can fine tunning it otherwise), just tried to recreate Traxus's concept into a single script, if you want to add more "platters" just add them to "control" and "pass" variables.

I have attached it

Cheers,

edit: a small doubt I had, platterX value should be different for each knob?or all them should use the same value?
Attachments
3Knobs5.jzml
(10.5 KiB) Downloaded 86 times
Traxus
Regular
Posts: 211
Joined: 30 Nov 2012 06:19
Location: Detroit
Contact:

Re: Using encoders to make a DJ platter (Proof of concept &

Post by Traxus »

Macciza wrote:Hi
There are a few projects in the library that have dealt with this before in different ways
Some are for Serato and some for Traktor I think - would certainly be worth checking out

Also the logic and some of the code for MIDI output could help - but basically its just an encoder . . ..
Right, I was going to cannibalize this guys xml file for Serato Scratch Live's midi mapping patterns, largely because I already own SSL. SSL does have its weaknesses though, most notably, no MIDI out, so there will be no way to sync the encoder to the spinning of the platter unless the user is controlling the platter in lemur...

They've got a new product, Serato DJ, I'm not sure whether this has been addressed or not but they also want $125 for it so I'm a bit hesitant as SSL has caused me to severely question the quality (or more over the flexibility) of their coding practices.

I've got some spare cash and might spring for Traktor with an audio 10. I'm not sure what they offer as far as midi control of the decks...


lABl wrote:Hi guys,

I was digging on it a bit , note I am not a DJ guy (not sure if everything is implemented properly, you can fine tunning it otherwise), just tried to recreate Traxus's concept into a single script, if you want to add more "platters" just add them to "control" and "pass" variables.

I have attached it

Cheers,

edit: a small doubt I had, platterX value should be different for each knob?or all them should use the same value?
Interesting, I'll dig into it this weekend.

platterX is synonymous for all the encoders. I was over complicating the stacking of encoders (I hadn't realized that transparency had been added to the black space in the knobs, and more over that this transparent space was not 'dead space') and wanted to ensure that only one value got sent out. Softcore set me straight, platterX could possibly be deprecated and replaced by the x value of the outer most encoder. However, I am still considering ways to make the encoder stack infinitely expandable so the module can be reused (resized), so separation might make some sense.
Macciza
Regular
Posts: 1315
Joined: 07 Dec 2011 04:57
Location: Sydney, Australia.

Re: Using encoders to make a DJ platter (Proof of concept &

Post by Macciza »

Hi All
Encapsulating everything in a container and then using a Platter.x var is the objecty way to do it imho, allows you to address it as a new single object . . .
That way you don't need to know much about what is going on inside because you view it as any object and just get Platter.x or whatever
You'll also find relevant code in those projects for the MIDI data formatting etc . . .

Also we are now touching on design possibilities and the ability to do things that simply arent easy to do , or aren't done with hardware . .
ie The 'one value out' idea - you could also send separate data for each section to allow polyphonic scratching, or mono-scratch 4 different samples depending on 'z'
I guess you could even decouple them all and have 4 independently scratchable tracks . .

Just a few thoughts
MM
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
Traxus
Regular
Posts: 211
Joined: 30 Nov 2012 06:19
Location: Detroit
Contact:

Re: Using encoders to make a DJ platter (Proof of concept &

Post by Traxus »

Macciza wrote:Hi All
Encapsulating everything in a container and then using a Platter.x var is the objecty way to do it imho, allows you to address it as a new single object . . .
That was what I was thinking...

About to take another stab at this, bit the bullet and upgraded to 4 on the ipad, looking stable so far...
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Using encoders to make a DJ platter (Proof of concept &

Post by Softcore »

Yeah no problems here with v4 either - I just stay with classic skin to be on the safe side for now!!!!
Traxus
Regular
Posts: 211
Joined: 30 Nov 2012 06:19
Location: Detroit
Contact:

Re: Using encoders to make a DJ platter (Proof of concept &

Post by Traxus »

Alright, had a pretty productive day with this thanks to everyone's help. I mapped it into serato scratch live and was more than pleased with the results. The latency is nigh non existent and the accuracy is great. The previous attempt at mapping to an SSL deck created by Nathaniel Marrin attempted to use the multiball object for lack of a better solution which unfortunately yielded a ton of slop when trying to control the platter; never the less his scripts and XML mapping file made my life much easier as far as being able to focus on objectifying everything in lemur...

I'm on my iPad ATM so but here is what it is looking like:
image.jpg
image.jpg (118.63 KiB) Viewed 3314 times
Macciza
Regular
Posts: 1315
Joined: 07 Dec 2011 04:57
Location: Sydney, Australia.

Re: Using encoders to make a DJ platter (Proof of concept &

Post by Macciza »

Looking good,
Another thought is maybe add an 'r' variable for 'rotation' - 1 when spinning / 0 when stopped

Something like a 'last_x' and an 'r' - last_x is blank and r =x!=last_x?1:0
then in an OnExpression -x script make sure there is a 'last_x=x' assignment
or setup a set_last_x script to do just that

This will give you an easily accessed var 'r' for whether the platter is rotating or not
Could be handy if you wish to let the platter spin on and slow down
Just a thought
MM

PS: As an afterthought maybe r=x<last_x?-1:x>last_x?1:0 would be better -1 for backwards,0 for stopped, 1 for forwards . . .
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
Traxus
Regular
Posts: 211
Joined: 30 Nov 2012 06:19
Location: Detroit
Contact:

Re: Using encoders to make a DJ platter (Proof of concept &

Post by Traxus »

Macciza wrote:Looking good,
Another thought is maybe add an 'r' variable for 'rotation' - 1 when spinning / 0 when stopped

...

PS: As an afterthought maybe r=x<last_x?-1:x>last_x?1:0 would be better -1 for backwards,0 for stopped, 1 for forwards . . .
Good thought, just added that. I doubt it will be very relevant for SSL due to its lack of midi out but this could come in handy for wiring it into more capable software.

Made some more tweaks, I think I'm about settled on the layout, at least for SSL implementation. I haven't quite finished wiring all of the objects up with one another but I'm almost there. Still a ways off from the coding most of the midi output.

The button in the bottom left with the circle symbol is a modifier button. I've set some of the functionality to only be accessible while this button is held, as to prevent colossal F-ups while playing out... Right now this button applies to all of the options under 'Pitch Settings' as well as the RESET PITCH button. I'm half tempted to apply it to the Fine and Coarse faders as well but that could also be annoying... I'll have to get the midi output of that whole module setup and play with it a bit before I can decide.
PlatterAlpha4.png
PlatterAlpha4.png (64.52 KiB) Viewed 3291 times

Thinking its probably about time to let this thread die off and start a new one in the Templates section...
Post Reply