Emulate Scratching In Max

jwl283@nyu.edu's icon

Hi.
I'm building a hardware controller. It's gonna have a turntable platter to emulate DJ scratching. Basically, an audio scrubber.

Here's what it needs to do: Spin platter fast=audio plays fast and vice versa. Spin clockwise=audio plays forward, spin counterclockwise=audio plays backwards. It needs to be just as responsive as scratching with a record (ie. instantaneous).

I'm using a rotary encoder, which sends serial data to MAX via USB. Right now, when spun clockwise, the encoder spits out ones, counter-clockwise, it sends zeros. This gives me direction. The encoder has 64 positions, so ever 1/64 turn it will spit out a 1 or a 0. When spun faster, it will spit out more 1's, slower, less numbers. This will give me velocity.

Any suggestions of what I should do with the numbers in MAX to achieve this. So far I've had limited success. How does Ms. Pinky work? Thanks a lot. Jason

Trum's icon

I have done something moderatly similar using a pitch wheel to emulate scratching. To do that I loaded everything into a circular buffer I.e started recording - then playing back a half second or so later.You can then move around the buffer in realtime backwards etc. So maybe you could scale some of the numbers to control a groove or something similar.
Hope this helps
Tristram

Leafcutter John's icon

it sounds like you need to count how many 1's or 0's are received to determine the speed and direction (sel 0 1 > counter?). There are some things to be aware of with this approach: as the encoder has a fairly low resolution it will only detect movement if the platter moves more than 5.625 degrees (360/64). And you will have to work on how often you try to measure direction. Update to fast and you loose accuracy and update too slow and you induce too much latency.

Just my thoughts.

john.

Stefan Tiedje's icon

Jason wrote:
> I'm using a rotary encoder, which sends serial data to MAX via USB.
> Right now, when spun clockwise, the encoder spits out ones,
> counter-clockwise, it sends zeros. This gives me direction.
> Any suggestions of what I should do with the numbers in MAX to
> achieve this.

You have to accumulate the 1s, the zeros you have to translate into -1
and accumulate that as well.
This will give you a value how much you are off the point. You have to
map that to a speed control for groove~ for example. If its 1, its
normal speed, 0 stops, -1 is normal speed backwards.

If you want it to react like a real vinyl scratcher, you should only
consider changes as relevant, as soon you move forward you gain speed,
stop moving would go back to normal speed with a ramp...

Good luck, you basically need to tweak your mapping to make it react as
you want it.

Stefan

--

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

-------------------------x----
--_____-----------|-----------
--(_|_ ----|-----|-----()----
-- _|_)----|-----()-----------
----------()------------x-----

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

dlurk's icon

> fairly low resolution it will only detect movement if the platter
> moves more than 5.625 degrees (360/64). And you will have to work on

This part of the problem can be fixed with gears (and good sturdy
well-mounted components). If I'm not mistaken, that would also increase
the data rate...

dbssll@aol.com's icon

Hi Jason - this might help. Its quick and dirty but does what you want. It is controlled by the mod wheel (or any midi controller) on a keyboard at present but could be easily adapted to work with your controller.
Hope this helps. Dave Bessell

Max Patch
Copy patch and select New From Clipboard in Max.

drewmcm's icon

is there a copy of this for max msp 5 available?

thanks

Jeff Kaiser's icon

Hi Drew, just copy and paste the code, works here.

jamesson's icon

There is an expr there - you can actually count rotational momentum.