Writing cue points to files

Off On's icon

I am working on a patch that creates multiple files, each containing a loop point at the end of it. Is there a way to write data like that to file on disk? Wav files have native support for cue points (loop points) but I can't find a way to write these in maxmsp... Any ideas would be greatly appreciated.

Off On's icon

No ideas? Anyone? Writing cue points or loop points to wav files seems to be impossible with MAX?

pdelges's icon

I don't think there is a simple (i.e. Max only) way.

Years ago I made an object to read markers in sound files (https://cycling74.com/tools/sfmarkers-v0-4-1 - I should even have an untested Win version somewhere), but never implemented a write function.
It could be done of course, but writing datas in a sound file implies to rewrite the whole file, which can be very time consuming, and doesn't fit well, in my opinion, in a real time environment.

p

Off On's icon

Interesting, thanks for you reply. This sort of makes my project much less exciting... I need to be able to create samples that can be also used in other players such as NI Kontakt and Live Sampler. But some samples require loop points to make them usable.

Do you know if JS api has any additional file writing features that I can use?

pdelges's icon

Maybe js' file i/o are now faster than 10 years ago…
Here is the ugly code I wrote (for AIFF) to convince myself I should continue working in C rather than in JavaScript. Maybe there are existing libraries in Java for this purpose.

addmarker.js
js
Off On's icon

Thanks for sharing this! My background is in webdev, so this logic is new to me. I can understand most of the code but the idea of writing chunks into an aiff file is somewhat unclear. I will investigate this further - but at least know which direction to take.

Appreciate your help!