I have a question about reading audio files in SuperCollider.
Formats such as AIFF and WAV have a Marker or Cue chunk, which can be used to store cue points in the file.
How can I access and use these markers in SC?
For example to create a synth with PlayBuf and use a marker as starting position for playback.
I don’t find anything in the documentation, and Google wasn’t helpful at all.
For context I’m trying to make a generative music video where SC controls video playback via OSC, and I figured that the easiest way to sync between sound and video files would be to use markers in the sound and video files.
The source material is enormous, tens of hours of video and sound, and I want to be able to use large parts of it in an efficient way. If someone has a better idea than using markers, I’m open to suggestions!
If the cue point idea really is the only way to go, one solution would be to run shell commands, as you’ll find documented in the String methods. This way you could write a Python script that extracts each sound file’s cue point data, associates it with that file’s name, and then stores all of this data and returns it to SC. You could then time the playback of each sound and fire functions according to when playback time hits the associated cue point data.
We currently don’t way to access cue info. However, the library we rely on for processing sound files (libsndfile) makes it easy to get and set cue information. It wouldn’t be a difficult task to add a few primitives to do so. If anyone is interested in helping out with that I can point you to the right files and documentation.
@scztt Thanks, I will try that, seems like exactly what I was hoping for! I don’t think it’s critical with range markers, as long as I can get the name of the marker it should be fine.
@VIRTUALDOG I’m not there yet in my programming skills that I would be able to contribute I don’t think, but for sure one of my goals is to become a contributor to the SC project sooner rather than later.