I am using scene changer for a fairly large project and I’m currently trying to add in audio to each scene. I was hoping to do this in the same way that visual content is added, by using opfind to find all of the chops called ‘audio_out’ within a scene.
I am trying to get this to work but I don’t think I am understanding how opfind works. In scenechanger it is just looking in the scene folder but I don’t see anwhere that specifies to look for the out1 tops even though that is what is shown in the opfind dat.
I can see that it uses tags on the scenes. Where does it specify to only see out1 tops?
Here is what the opfind parameters are set to
There is also a dat callback file attached to the opfind but I don’t see it actioning to find the out1. This is all that it says
def onOPFound(dat, curOp, row, results):
return
I’m guessing that the curOp part holds the key, if anyone can help explain this to me, that would be fantastic. Or if anyone can point me in the direction to understanding how to show my audio_out chops in a list using opfind
sceneChanger is really great for augmenting to add multiple channels worth of outputs from your scenes for audio or video but it does take a little understanding and surgery.
The opfind is only looking for the actual scene comps in your larger scenes COMP via tag. The selection of the outputs is happening in the sceneGates that get created for each scene. You will need to augment the sceneGateMaster0 comp to select new outputs from your scenes.
In that master comp you will find the select TOP with this expression:
parent.Gate.par.Scenecomp.eval().op('out1') if parent.Gate.par.Scenecomp.eval() is not None else ''
You can follow that TOP setup in CHOPs, replace “out1” with “audio_out” and add a similar CHOP version for audio with a cross fade driven by the gate null1 chop and an out. The difference here would be that you need to use something like a math instead of a switch since the TOP switch is using the blend functionality of TOP Switch to level the TOP off for cross fading out of a scene.
Then you need to modify the scene select COMP the include the same mechanics for your audio outs for each scene gate ( the gates will get replicated from the master and re-cloned so you only need to modify that master gate).
You’ll need to add the CHOP version of the double select > over > switch > out TOP network you see in sceneSelect, so likely it will be chop selects > math(add) > switch > out
Does that make sense? I’m attaching a rough version of this as a toe. It has a pane open in every place where i made a change to the sceneChanger setup.
The one hangup I’m not completely positive about is regarding audio sample rate and the file playback rate. Typically there is a bit of a “dark art” technique for making sure audio runs smoothly by making any chop controlling audio ( like cross fades, levels, etc) run at the audio’s sample rate so that any frame drops are timesliced properly to avoid pops/clicks in the audio output. In this case I am resampling to 44100 after the filter CHOP that controls the fade in the scene gate, this means that filter is still running at 60 ( it is not properly perfromant at 44100). This may suffice, but I can’t guarantee it wont give clicks/pops. Someone else may be able to weigh in about the absolute best way to achieve this if you do indeed hear aberrations in your audio.
awesome! thanks so much for all this info, I think I had tried to use this code
parent.Gate.par.Scenecomp.eval().op('out1') if parent.Gate.par.Scenecomp.eval() is not None else
but I guess I didn’t have the audio out files in the scenes yet. Thanks loads for the comp, I will check it out today. I am enjoying getting to understand how this works and modifying it so the audio works dynamically as the video.
I’ll let you know how it goes. Also once I’m done I can share the file (I won’t yet as it’s got six massive scenes that I will remove beforehand)
In my system based on SceneChanger, I hacked in chop outputs for audio, and mirrored the gating system for tops to do the same thing for chops in the gate components of SceneChanger. this allows you to effectively have one audiodevice out at the end of your project that only pulls from the currently playing scene
That sounds great. Do you have a file you can share? I’m having a play with the scene @archo-p suggested and it’s working well. One issue I need to work on now is that I want the file to play from the start when it is switched to. I’m using a timer chop and segments, using the length of each audio file for every segment. I’m hoping that I’ll be able to script this to do what I want.