name of wav in buffer~ to writewave

pb21's icon

I would like to get the filename of the wav file thats in the buffer and then set the writewave to use a part of that filename.

Incoming file name: UNArpC1C6P35

BufB~ writewave ="UNArpC1C2P35
BufC~ writewave ="UNArpC3C4P35
BufD~ writewave ="UNArpC5C6P35

1. how do I get the name of the file in BufA?
2. how do I set the writewave accordingly.

I dont want to see any dialog boxes it can save to a specified folder on C:\specifiedfolder

Max Patch
Copy patch and select New From Clipboard in Max.

I must be an idiot because I am looking at the buffer~ reference but writewave [symbol] isnt helping.

pb21's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Ive made little progress I have managed now to add a watchpoint and I can see the filename in the console, not much joy yet in being able to perform operations in VB I would use left, right or mid to get what I want.

pb21's icon

Ive got the name now by using the right hand message inlet.

Max Patch
Copy patch and select New From Clipboard in Max.

How do I get any characters left of C1 and another separate message right of C6 till the end?

pdelges's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Which 'C6'?
Here is a simple regexp:

pb21's icon

My wav file in the buffer is a range of notes c1toC6... in I am just splitting the wav out, so in the example:

UNArpC1C6C60.wav

C60 is the patch name in the ultranova

so when i split this wav: UNArpC1C6C60.wav

the 3 new wavs need to be called:

UNArpC1C2C60.wav
UNArpC3C4C60.wav
UNArpC5C6C60.wav

so in effect I need to replace the middle parts C1C6 and keep the outer parts.

Max Patch
Copy patch and select New From Clipboard in Max.

my main patch is here as you can see the writewaves are not ready as I didnt know how.

pb21's icon

I am guessing a regexpreplace exists too

pb21's icon
Max Patch
Copy patch and select New From Clipboard in Max.

How do I not have the spaces, I think its almost there except for the sapces and it prints two values one joined correctly the other not,

pb21's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Solved it with combine

pb21's icon

Final part is how do I get the patch to save the buffer with the new name I just created, to a set path. c:\users\peter\desktop\samplewavs\

Max Patch
Copy patch and select New From Clipboard in Max.

I cannot see how to make the link to writewave so that writewave does not bring up a dialog box.