movie importer Preserve Pitch

zanroversi's picture

Hello !

There's something very bizarre with the Movie Importer Patch : in asynchronous mode, in a simple composition, the sound pitch is preserved if rate changes but it is not preserved when running into a qcView.

did somebody experience the same behaviour ? Any idea to access this parameter ?

With a QTMovie object in a QTMovieView, there is the :

"QTMovieRateChangesPreservePitchAttribute"

...which turn this feature ON or OFF.

thanks by advance for any advice ! greetings

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

dust's picture
Re: movie importer Preserve Pitch

are you saying when you run your movie in async from a qc view pitch isn't locked to the rate ? but when you change the rate in qc the pitch is locked to the rate ? i'm confused as to what you want ? the preserved pitch on or off ? or you just want to be able to turn it on or off. wait i think i got it in a qc view its not working so you want to turn it on via a parameter ?

check this thread out. i explain how i'm preserving the pitch of the audio but changing rate of the video at the same time with a qc view. i'm doing this synchronously not asynchronously. i'm using an apple audio time effect unit. the same unit will let you bend pitch as well by cents or semitones. i want my pitch preserved or locked that way i can transpose by key to harmonically mix.

http://kineme.net/forum/Programming/bestapproachtovideoscratchplugin

zanroversi's picture
Re: movie importer Preserve Pitch

Hello dust,

Thanks for your reply, sorry if I didn't make myself clear, and for the delay of my reply...

Indeed, the solution you propose is very interesting, maybe it will be my way too but I would like first to avoid splitting video and audio management...

But to explain again what I meant :

I noticed that :

In Quartz Composer (alone, no cocoa things), with a movie importer in asynchronous mode, the sound pitch doesn't change while "rate" value changes. Preserved pitch is "ON".

If I put the same qtz (with the same movie importer in asynchronous mode) into a QCView in Cocoa/IB project and if I bind a IB slider to the rate input, the "preserved pitch" is "OFF".

And I don't understand the reason of this different behavior. And I wonder if anyone did experience this or if I did something wrong.

greetings !

gtoledo3's picture
Re: movie importer Preserve Pitch

Maybe try binding to an input splitter that you've set a max and min value for, instead of the input of the video patch itself ? (unsure if this is your fix, but seems likely...). I don't know how you could be getting max and min vals otherwise.

zanroversi's picture
Re: movie importer Preserve Pitch

In fact, I've already limited the range of my slider in Interface Builder to appropriate values for the "rate" input.

thanks anyway !

gtoledo3's picture
Re: movie importer Preserve Pitch

...but you haven't in QC.

Again, not 100% sure if this is necessary, but I suspect it may be.

sooo, do with that info what you will.

zanroversi's picture
Re: movie importer Preserve Pitch

hello

I've just tried with a ranged input splitter in QC, I have the same behavior. but you're right, I should have tried your suggestion before reply...

Indeed, I did experience sometimes strange differences when an input splitter is present or not.

The fact is : as I wanted to say in my first post, I don't know how "movie importer" patch is made but I suppose it is built with QTMovie or QTKit library, isn't it ? And QTMovie.h proposes clearly the :

"QTMovieRateChangesPreservePitchAttribute"

I just can't figure why Movie Importer behave differently in QC and in Cocoa/IB app ! (and if there is other surprises like this I need to expect...)

thanks again.

dust's picture
Re: movie importer Preserve Pitch

i tried to reproduce this issue. see attached sample comp and x code build. this is a movie patch on async with a mouse scrubber. see normally you would want your rate "tempo" slider to be in the range of 0 to 2. that way if your doing BPM calculations based on rate you can reflect the changes easily by multiplying the rate time the bpm. that is supposing you know the bpm.

an interesting thing with the rate on the movie is that a negative number will start playing the movie backwards so you can also use it to scrub. in this case you need to use interpolation and a bit of logic to switch over to the scrub rate when scrubbing and back to the tempo slider setting when you stop scrubbing. you could just as easily set up a slider min and max 0 to movie duration and update the slider position with your current position but in async you have to restart to update position so a negative rate seems like the best way to scrub the movie patch.

with all that i was really unable to hear any difference. with xcode app or inside QC. maybe you should make sure forward all events is checked off in your view ? i published the rate to a qc parameter view and set the movie location via key. i'm not sure maybe the issue is with binding ? im not sure how that would effect the renderer ? try this build see if you get the same results.

like i said i am treating the audio separately and using the apples audio unit AUTimePitch. this way you can set the rate and pitch independently, the draw back is that you have to send your audio's current time to the external time of the movie patch. its not a clean IB bind type of situation and involves a great deal of set up defining data types and components etc..

when i'm ready to share my project your more than welcome to look at the process.

PreviewAttachmentSize
preservePitch.zip112.64 KB

zanroversi's picture
Re: movie importer Preserve Pitch

Hello Dust,

Thanks for your great help. I built your project. It works and the pitch is preserved. No differences between QC and .app. I'm very surprised but it's an hard proof there is no systematic problem.

I made a new Cocoa project "from scratch" and... no pb too !

I can't reproduce the situation I encounter in the "other project". I can't even see what is different. I checked what you suggested (forward all events) with no success.

Just for info, I checked if the difference occurs with Quartz Builder too.

I encountered another problem : no image, just a short blink (I read something about that elsewhere... I'm also interested to solve this !).

Anyway, no image with QB but the sound is playing and pitch is not preserved ! (see attached files and open parameters panel).

I really would like to "dive" into your project but I'm afraid not to be "strong" enough yet... i tried to implement something with AUthings. It is far too hard for me (yet :-). Don't want to make you loose your time too much ! But maybe in a short time, with great pleasure.

Thanks again.

PreviewAttachmentSize
pitchCompare.zip174.67 KB