Hi there,
procedural segmentation. I want to get a sample and to iterate a lot of recombination and save this as different files, I know how to do that using lower-level processes (I mean C++ coding for direct access outside of Max) but I wanted to explore the flucoma way.
Before saving as files (which will be race-conditions stuff problems coming…), just recombing at first
I send 4 messages for reordering a buffer. working very fine.
now I want to do the same by triggering a V8 that creates my 4 messages. exactly the same.
carefully fromsymboling this. ok
no process. no error.
I obviously miss something here
I even put a scheduling way. But I think that’s something else here.
I tried different blocking / non blocking mode & queue etc.
inlets = 1;
outlets = 1;
var buffer_source = "src";
var buffer_dest = "dst";
var process_interval = 100; // Time in milliseconds between messages
function setbuffers(source, dest) {
buffer_source = source;
buffer_dest = dest;
}
function compose() {
var args = arrayfromargs(arguments);
var num_segments = args.length;
if (num_segments === 0) {
error("No segments provided\n");
return;
}
var buffer = new Buffer(buffer_source);
var total_frames = buffer.framecount();
var segment_size = Math.floor(total_frames / num_segments);
var i = 0;
function sendMessage() {
if (i >= num_segments) {
outlet(0, "bang"); // Send final bang after all messages have been sent
return;
}
var src_index = args[i] - 1; // Convert to zero-based index
if (src_index < 0 || src_index >= num_segments) {
error("Index out of range: " + args[i] + "\n");
return;
}
var src_start = src_index * segment_size;
var dst_start = i * segment_size;
var message = "source " + buffer_source + ", startframe " + src_start + ", numframes " + segment_size +
", destination " + buffer_dest + ", deststartframe " + dst_start +
", gain 1., destgain 0., bang";
outlet(0, message);
i++;
if (i < num_segments) {
task = new Task(sendMessage, this);
task.schedule(process_interval);
}
}
sendMessage();
}
Any help would be nice 
I think the problem is that the use of a comma to produce sequential messages is a property of the message
object itself, not a generic max behaviour.
If I stick [fromsymbol]–[print]
on the output of a code box with the above code, then I get the whole string with commas in the console, e.g.
print: source src, startframe 82958, numframes 41479, destination dst, deststartframe 41479, gain 1., destgain 0., bang
However, if I pipe it through a message
box [fromsymbol] – [t b l] = [message] – [print]
then I see each individual message in the console like
print: source src
print: startframe 0
print: numframes 41479
print: destination dst
print: deststartframe 0
print: gain 1.
print: destgain 0.
print: bang
and it seems to work.
Probably the best fix is not to output the comma delimited string in the first place, but a bunch of separate messages through multiple calls to outlet()
1 Like
omg.
obviously (as we said when someone else find your answer)
It works very fine.
Thanks @weefuzzy
In the meantime, I coded something with lower level as I said.
Easier for saving files on the fly and very fast in the process (threads etc)
Adding the saving part to my max patch.
Again more procedural.
Before diving into a “procedural” way for batching processes (something like I want to write 1000 recombination versions of my buffer to the disk), I wanted to ask you any suggestions.
I can do that elsewhere (c++, but don’t want to port that one too externals here), but I like the way flucoma works (and the live tweaking it brought too).
Would you make a V8 → bufcompose → progress → write buffer → go back to V8 thing ?
Or may it exist something I missed with flucoma?
Any ideas would be fantastic.
That is the whole reason of FluCoMa, so I can say I love it too 
The way I’ve done that in the past is to code a dirty workflow I could listen to (in sc) then record the Edit Decision List and dump that with a script as a Reaper file. It is so powerful to have the recombination in symbolic more than audio, so one can use the power of the eraser 
I hope this helps?
1 Like
Hi Pierre Alexandre,
That’s nice.
Actually, I’d love to press the button and have my 100 recombinations files written very fast.
As far as I understand what you answered, separating the writing process would be the way you’d suggest me.
yes, indeed, writing a simple reaper file with it would have the double advantage of speed and editability.
I’ve used that, and also MIDI (when it was real-time tweakable) to great success (at least in the workflow, as for the music, you can judge yourself
)
1 Like
I got it, but in my process, for this project, I intentionally want to write some rules, and to let the system dumping (BUNCH) of wavs, and no more edition later except assembling them (procedurally too).
For the style, I’ll try what you mention. Never scripted for Reaper, actually. And I’d love to
(and assembling / loading audio clips dynamically in Live with Max is just… not allowed by Ableton for sure
. Actually we can. but it is A MESS)
For the project, I’ll go straight to the C++ things I already tried (and talk to my SSD to be ready to be filled by Gb of sound matter)
I do it the garage way like @jamesbradbury - you can literally write a text file with minimal info. You seem fluent in text language, so I recommend looking for the supercollder example on this forum you’ll find my code. Let me know if you cannot find it!
1 Like

with a great community - @tedmoore has corrupted the whole world with his teaching 
2 Likes