How to use groove~ for complex time stretching?

Karel Kaas's icon

Currently I'm trying to do more complex stretching using the groove~ element. According to the documentation, I can do this by sending a dictionary to the object to create speedcues and an example is given as follows:

{ "marker01" : { "sourcetime" : "500", "desttimebbu" : "1.0.0", "pitchshiftcent" : -100 } , "marker02" : { "sourcetime" : 1000, "desttime" : 1.2.0, "pitchshift" : 1.1 } , "marker03" : { "sourcetime" : “end”, "desttime" : “*2”, } }

I tried this, but unfortunately I'm unable to get it to work, so does anyone know what I'm doing wrong? (There also seem to be some inconsistencies in the given dictionary, such as trailing commas)

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

terenceformer's icon

That last comma shouldn't be there. Also in "marker01" the 500 shouldn't have quotes around it (this will make it a string, when you want an integer), and for "marker02" it should probably be "desttimebbu" with quotes around the value, otherwise if simply "desttime" then the following number is not a valid float (extra decimal point).
There may be other such errors - make sure you're very careful about the format of your dict entries!

Karel Kaas's icon

Ok, apparently it is working if I create the dictionary like below, which will play the first part at half speed and the resulting part at some other (?) speed (it's faster than normal, so maybe it is trying to make the clip the same length, requiring a speedup in the second part). However, the pitchshift argument doesn't do anything, same goes for pitchshiftcent. What could be the cause of this?

{
    "marker01" :     {
        "sourcetimebbu" : "0.2.0",
        "desttimebbu" : "1.0.0",
        "pitchshift" : 0.5
    }
,
    "marker02" :     {
        "sourcetime" : "end",
        "desttime" : "*1.0",
        "pitchshift" : 0.5
    }

}

terenceformer's icon

Make sure the timestretch attribute is set to 1

Karel Kaas's icon

The timestretch attribute is set to 1, and the strange part is that just sending a message containing a pitchshift value does actually activate the pitchshifting. Anything else that could cause this behaviour?

terenceformer's icon

tbh I didn't actually look at the groove~ reference when I replied before, so I'm apologies for being to helpful $

Now that I've looked at it, I'm very disappointed that Cycling74 was so sloppy about explaining the dictionary function of groove~. I didn't realize that the dict you posted was actually the one they used as an example - jeez! It has obvious errors, as I pointed out, and leaves a few things ambiguous.

About pitchshifting via dict, I tried a bunch of things and nothing worked. It would be great if anyone could confirm if it is actually possible, or if the reference is in error!