sample-accurate scrubbing in maxmsp
I was wondering if anyone knows if it is possible to scrub through the playback of a buffer in samples rather than milliseconds like with groove~ and waveform~. I want to be able to emulate vinyl scratching with a midi controller, and all my attempts so far have been really glitchy sounding due to the resolution of the controller. Is there a way to interpolate the controller value so it will scrub through the buffer smoothly.
Depending on how you’re implementing it, you could try taking a look at the rampsmooth~ and slide~ objects(take the output from your controller, scale it to whatever the file-length is(or perhaps the length of a segment/selection within the file), then the scaled output can be fed into rampsmooth~ or slide~ with appropriate settings of those objects for the amount of smoothing you want). You could also use index~ for sample-based playback but you’ll still want smoothing going from controller values to samples. Hope that helps.
I’ve not used any of the object before, but just tried them out, it seems to work better that my previous attempts. I’m sure there is a better way of doing it though.
Would you mind having a look at the patch I tried with index and rampsmooth~? I’m not sure if I’m using them (particularly rampshooth~) to their full potential. Also I wasn’t sure how to smooth the values out of the slider. I tried scaling 0 127 to the length of the sample, but this way worked better. Should I try line?
Also, it kind of sounds like its working on very short samples, but using longer ones results in lots of high frequency glitching sounds, could this be due to the smoothing of rampsmooth~ not being fast enough?
Thanks for the help, heres the first attempt patch:
----------begin_max5_patcher---------- 739.3ocyWssjhBCD8Y7qHUp8QWKRHp3919cr0TagPzISAIVjPstyTie6atHp iqfgAkwW3RGfb5S28oadaT.boXKUBA+.7KPPvaiBBrlLFB1ee.rHYaZdhz9X vBpTlrlBG6VSQ2pr1krWofugpsKpT4Tk5uantONDBdZ+RqDbEOovt.7mkrj7 5WZShJ8YFe8uKooJ26QlNIbL.iBMmlZOhhmDd3iwxreFwxW9N4vla1ACdLKg v52wYlWUv3ZTYcD7QiNrZshLFeezHygwdxHb5eza++QHJvRvpFoikI70vw.3 pbQhpWbSzBKqPhmLUSTgWlahh6B2ftH2fucbSgTIjIEaj6Zjfjr0bi22OJJx kwLyxTwQ1boFnHbzCEEUZnmBgP87U4n9j8Pb0Twj1nFTmxdhtYUVxbVFszCI klENHg0NlNMfzj+ME1VL1l.p28MUplC80VOxNDRzhIgeB2Vue5ucitsqdX7d MjdUWDYIITXqEFHxWSgwxJkRvaWAssL.jKpO6jLfFcQLzee4F1ifwWI1ADb5 0C14Lo5nZnmWzqrCWeEDJpsFKnv9mbD+IHzlFCojtIOI8dLIx9RFaEyr4sMH R7WybHzWyRR2cUE+o38B+0Gu3rTP+wZ3sqdHUTwU229cNg.x71jChdnFjbY0 pUzRqLA.O.cEbDULt0gkdnlUhwynaaWG8Vj5Daom4s2I41l5X2Bs1O+7eRyh Ri8OxVRQUYZsOWO3O.c.oYTohwSTLci0SdH8ybzadlkkQsKWC5BV1FAiq1iA vSWLz4KjLCZeUHY9YttfIyLL51TnENMNxga5IXOCGWFrl4GGPBzFSCenhomw .M.o3gES9PSngMx4ChFXVh3AlvCb1jGPh7AQj6Nhzi4BlcsHGoiZV5lHFYJ2 HI5eVr9l9BVrOoYgcErV7EibSQYGQ3zqmezGLW22dDdzhnydPH1ft4SOhz48 uAgu4pCW0iOxd3dfH8MuO5e.VvoFJ. -----------end_max5_patcher-----------
if there are millishit on the other end
and pumples on the one end
but you would like to submit pumples to the other end
all you have to do is
to convert pumples to millishit
before you submit them.
……..in regards to the patch I posted, doesn’t actually sound like its working. Still very un-smooth.
here’s a patch that seems to be working for me. try toying with rampsmooth’s values to tailor it to your taste.
----------begin_max5_patcher---------- 682.3ocyX1siiBBEG+Z6SAgrW1sAvu261miMS1PUZKaTnoRy1YlL8YeQv5T2 psp0XlafBhv+yuygCXeegCbs7Dq.B9A3W.Gm2W33X5prCmp1Nvb5ojLZgYXv MYRwwb3R6ijGUYLk508L6bT9XpBtD.WSEagfWpF2FoPUveyLJLZEppa8LwE5 IvL03qFqflaFK7mG3zrKq1dpJYGWr82GXIJ6B54qmL.IzT4WNy.bzJT8BqWA qFMKAopWdpYxkq+y2wXXYeerXQYwxdRAA6u5W9htTrSF4.KRnYL.BfIg.zJs d7iW8.TMHDE7DHxyBGD9ALBeKiBmPDknx3hNYBWXBdtpZ1BgvlJufGfG2awS vTFAw2dtS5nenPaJyERbCrjId3QL9SHRNPy2WjKkpcm06nPHSwjxH2wyHOhc aEgLbH4NFHMA4eISXjRru0tqRt3ZBXPCJAr2Xvv5iJkr67HMs9VMyVLFbXkY 3ewLtqwzhKESlv.etXi7LPJXO1amwKL00czmeLCgGUwEt1nDr6J+6RznVHJZ LDMmUTP2xtMWBaeFMgA9FtSlNLpPFOUBrkgCOwQzXPB6sTZR8YKsZDcmkKxV UW1gVQ2pUuIbCw5ia1vNX1R.HeYRAZ8lwlxHxvS.NkoLzQ2ud+TF287QxjeG BO60NCbGQtzq4h40zo4D++WqXV4x9aBqB4wCIWrY6kzVB9bwSYEJtfp35yP9 bLgMFyNdZJSbcXcNOcuTeozJI.doUGWeUjeOTj6rpH2dnH7rpH8kC5maya9j DtGRxeVoTXe7ayriqGRx6Kohvylhh5ghHyJiHMr+NBjPCSRXeR4s9v1qSGEW 23Y8mj9D0OTwFVoOyeCPr8i5ZzvkbkYT13YMiREF7HyvanlAxnO6GviQd0sZ nVciOV7OVyUllB -----------end_max5_patcher-----------
ya, see ComfortableInClouds patch.
you had the right idea, but the reference page for rampsmooth~ says the default value is 0 for the ramp(if you put no arguments to the object). it’s almost the same thing as having no rampsmooth~ in place.
you could even try the
to put what roman was saying in a bit clearer terms: it doesn’t matter if an object uses milliseconds or samples, since it’s an MSP object its calculations are all sample based. so you don’t need to use index~ to scrub, using play~ and adjusting millisecond values will give the same kind of precision. what does matter, however, is whether or not an object interpolates during sample playback. the details of that, i can’t really tell you. there was a post on that a bit ago im sure you could dig up with some searching.
for sure you want interpolating for scrubbing, index~ wouldn’t cut it, as it is not interpolating. play~ or wave~ would sound better…
unfortunately, though, if you’re using MIDI control values like 0-127, you’ll want rampsmooth~ or similar in the mix to perform additional interpolation no matter what. still, play~ or wave~ is a good starting point.
I made a similar patch a while ago.
My solution was an adaptive smoothing using rampsmooth~.
Basically you need to calculate the instantaneous speed of your controller. And use this value to control rampsmooth~ ramp times.
If your controller is moving slowly the ramp time must be long. If it’s going fast, it will be very short.
I don’t have my patch here with me, I’ll post it here as soon as I find it.
(late answer I know, hope it still helps)