Better way to deal with long string of arguments

Doing everything ‘in place’ would be better, as you don’t have to worry about dealing with lots of temp buffers to scoot stuff around.

1 Like

ok here are questions emerging from the first few ‘preset’ use:

the first 2 are the same. All of them share an issue: the syntax is problematic in 2 ways (welcome to the world of discussing interface with @weefuzzy and I :wink:

  1. how do you want to specify the target? all your calls imply it differently and I’m not sure how. then if you specify a target I presume you agree it will be wiped with the new content?
  2. how do you envisage channel count discrepancies? just adding to fit the maximum?

sorry, I don’t understand: so here goes an example: I have a 9 track buffer, and you want to split it in 5 stereo buffers. what do you expect as a message in, and out? I can do this easily but I’m not clear on what. Also, knowing how open/programmatic you want this to be is important: do you want the call to check the n-channels of input, the m-channels of dest buffer (which will be overwritten anyway), etc.

this is a single call from the current syntax, to do the 2 30

// first make your dest buffers of size 1 1 with silence, then
process input 0 -1 0 30 destA destA;
process input 0 -1 30 30 destB destB;

@weefuzzy already submitted this code in another thread. I can retrieve it for you if you want, or post it again with comments?

I didn’t specify in my original post as the source/target doesn’t matter in what I’m suggesting. As does the ‘in place’-ness or not. So it could be be that it just concat bufferB and the end of bufferA (in place), or vice versa. And for >2 lists, it can concat them all in place at the last one.

And for channels, it would always produce a file that contains as many channels as the buffer with the highest buffer count.

So concat bufferA bufferB, where bufferA = stereo and bufferB = mono, would produce a stereo file, with bufferB just existing on the first channel.

With weird ‘edge cases’ like that, it should resolve to the “stupid” solution where it does what it is told, rather than trying to assume (so in that example, not making bufferB stereo on concatenation.

So the suggestion is to be able to bypass the 1 0 -1 1 0 1 1 -1 part of message if what you want to do is copy from beginning to end, without any offsets/fades/etc…

My hesitation with the abstraction method has to due with shareability. In your bach example, @tremblap, sharing a patch that uses some bach abstractions means telling someone “you have to have bach x.x.x installed” since it’s impossible to know how “far down” the abstraction layers go. You can’t just include the bits you think are required since there’s no way to know what “bits” are actually in use. (and I don’t trust Max projects for finding them).

I think I cannot stress that enough. This is good, as long as you all consider that fruitful discussion on the best way forward, more than a client-moaning-tech-defending dynamic :wink:

I think you made a mistake there :wink:

I understand. I’m not saying these will stay abstractions forever, but for now, as we as a group explore interface questions, it is much simple to do it like this and even you might like it later as taching material - one can hope. Worse comes to worse, if they stay as abstraction, you can always copy them/resolve them as bpatcher in the patch…

Not sure on the “mistake” part?

I don’t see how it would be a teaching material since, as @weefuzzy put it, it’s an obtuse domain-specific language (i.e. useless as “knowledge”). Learning the awkward string of arguments, their order, and their meaning adds no information about what’s happening under the hood. All the knowledge is obtained with concat bufferA bufferB, the rest doesn’t mean anything.

I just worry/think, that if you start building an “there’s an abstraction for that” paradigm, around, what seems to me, a fundamental syntax/legibility problem, that problem will never be solved as any changes to the syntax will then break the whole scaffolding of abstractions.

In terms of a gap-stop, sure, but I don’t think there’s any merit in the present syntax. It offers no flexibility, scalability, or power that can’t be achieved in significantly more elegant ways.

1 Like

a dad joke - you keep complaining they are hard to understand, I pretended you meant real values and not jibberish.

I half-agree. I think that the intuition of named arrays of args is quite potent now. Your keyword use cases would still need to be abstracted though. Let’s see how that floats.

1 Like

Something like…

stack <source> <dst> <numbuffers> <numchannels>

and in that particular scenario

stack <source> <dst> <5> <2>

You put in 9 track buffer and will get five stereo buffers of whic the last one will have an empty channel. Unfortunately this is where the idea of abstracting out certain commands starts to falter in favour of exact low level commands (as it is now). Imagine a scenario where we want buffer 5 to just be mono - we’re back to square 1 of s^&$ loads of arguments. I would guess at that stage you’d have another process triggered by the outlet of bufcompose~ that might clean up that last empty channel.

Thanks for answers to the other 2. That makes sense and is quite simple as is, but gets a little messier for the 60 → 1. Perhaps thats where interfacing with polybuffer~ could still remain useful :slight_smile:

Yes, with the caveat that you’d still need to provide defaults in cases where you wanted a specific value for some buffer later in the list, e.g. if there’s three sources and you want to specify an offset for the third, you’d want startframes 0 0 x

The propositions aren’t mutually exclusive. My preference is towards making everything wiggle-able, but in many cases where you’re allocating memory, there’s no sensible way to know how much you’ll need except to make it excplit. Consider a delay line: how big do I make the internal buffer in the abence of any other information?

Yeah obviously, and in that case, you know what you’re getting in to. But if you don’t need offsets, you wouldn’t need to type them at all.

here is the concat message. It takes any number of inputs and stash them in that order, in the first one (it made more sense in the end to me, I hope you will agree)

Test examples provided, code still dirty and no check of validity at all on the buffers so don’t feed it shit - it would give you errors from the underlying bufcompose I reckon but I have not tested.

enjoy! Comments welcome.

q: should we do another thread for this? I will add the other messages like this, it feels good for now.

<pre><code>
----------begin_max5_patcher----------
2446.3oc2bt0iihiEG+4jOEHj52ppD1bKruMeCFocWsOzZTIB3jxyRvHvo6p
mVS+Ye8EfvcrITIU1QZRk1FvG+yG+2GaryO2twbO4cTgow+v3qFa17ysa1HR
hmvlx+8FySguGkDVHtLy8moTRp4SxrHmoIHJ8GYH4yvbeX5QSi+nL6rPZza3
ziulihnxqv0B7h0SF19P9efNUeVeOomOgSYOTQwAJSDGKJbx9+7YaGyKWor7
acoEzejHrFSSdB+81s7OdRwp2ITQQ3QTUQPQuKrayHRZTH0HCGlRLRHeeT.L
YkOv0UTe8r3+AXI9CDNVsG1u1CCpJ4rbTAJkFRwjzlEgsDrdBLaU9Qym+slY
mvwWK21A7axMns9ba2LbaGbWih3lvsuG9MzAR9oeMJTNjPBolOM4WRvEh+NI
.c.hZmiyKtr5nqmnKHXL94N.+blgeWJggvWzar1+CGJPzlsOsgpWenVlx9yG
NfxSCOISV3L8X.bfTeaI.2VMfCbTve8+qPKDBazSsjsdN5vV3LrstHrWS39F
93aOFrErKXwrELKasaTDqEaYCx7ffVvxQqk40AI93uq336E3+BwCh4IiC3jD
iBbJqZYsvHijTYmz2.3p8.7f4BLxyQDQDPB96ZfQC.tqjaxfpAVA5yscJxMK
3mQtAtJtU1YbQby+ibZHonuyJjd.P1e9WFhQRlUwZ14hIgfsr166LMCFXpX.
2gY.7Vv.th+Zg.HTH33CzGAN2QDL07ozEA.GgzqWf9Hv9iDAioEjixRBiPF+
qbzo8Ig+34+4u87+NKm0wf967fX+cTbXx+AGidgMF+B0Hj8HjS1zeARDVl22
Ycy7OlVpXxpuWYeixIcC7zF.yOzhrDrgeVVq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O927sB1Y4T9z2dYLTVaUN6V6Npl4Il0iqV24lssspvMBUb3pbKSxAZ6BC
3VisOz0Q7MnuiKXsMqVmo9gMr8G4+D2TadMiVnZHSyi4gwXdHjUCzKtbPMg8
X+m+SC9MPyiTr31fU2l+tcLN7zfeq+sUcWv.KPfnkztrkj+MVRfN2Ear8xSN
meiSPaVNIijWeDCewNn95OSI0Uz52yPcDVZ3yNUyW6dGp0J1b5YJ3cIrEGla
kET7MFkX0xk5Ywtm+d6+CsUfEbA
-----------end_max5_patcher-----------
</code></pre>
1 Like

Yeah that’s really handy.

Probably doesn’t warrant it’s own thread, since it’s quite on topic for this one, but it should definitely go in the alpha03 helpfiles.

1 Like

Will add the other methods as I have a minute, between other tasks.

1 Like

A Christmas present: Merge and Stack are now implemented. Dirty demo code again, feel free to roadtest

<pre><code>
----------begin_max5_patcher----------
3216.3oc6cksaiiiE84juBAioeyUfHoV625+fFXlAyCEZDHaS6npkkLjjSkp
Zz029PQJoPsuQsjtXATNNjRh26gjGdI4QL+0iOr6Pva3ncJ+pxmUd3g+5wGd
flTRBOj96Or6pyaG8bhnW1tq3nHmK3c6Y4EieKlldTryw+T4lqiefhWvWyx2
+9UWeObL8lgoIdKDGg8ichcC7eNDeLlY.VlVOotWApQ+gZ5GJ+w6Opf6wYOK
PZpQweyCSsfrh7lS7wWb8uv8jsgPtmrMh9KPtmM6AG+saX1MraWdVtmnO8fC
e4SH8cIo82O9XxG6EBhc08zDQMccl6nIZTyx1l6IC.5iE1LlGXi.XJu3d4kQ
gZHVaMUUgiZVPtmLP0drnlo3QsDDifbiBvfL+wzT3.lgF2S1ZzcNsDJdgiOb
+7Yb3X6VB.zJdjsvwK.v3I8jmLE1R4LGAdgFCdc1KfX50BHfbSNz4JNFG9L1
24.yeTSy6bP3UGpeXTKP.GBPfrXPrNH4G5p8.H1qr6fi+k5ADnHa.852CBtp
7u.s11YBsBzX7KosBLFcuF04oWyHYYPpo8ZPhtWS9SlhWVpiDufFyCdQCAXt
Z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ofLDQIA6QIwu+OiujTWJeBzmRBIfBBZrTtDTew.uEpINbgJmkhsC
rT.2RwAsTr2Z8oypPZwYuTMsWppHPe7HftHJo93R.g3S8YvbPU1aVbQkdcoS
JjRudzkdsnq95P27qAc4W+YZ7yrnBKEKVd7tjfSMRhXk5MYulwEQfCWNF3wr
nOqvdOOx+P8I8bjHIXV5U9rqehOlBZp7+k9fda42gywijYxy8zUexJ4xrP1P
fQx2LUssT0RuqGeeJAjZqPxsVNf2cWIVua1J2yW6Vvg4VIj5c4BljFDoCsSr
FjITWi9MnolNPzl0UbTjS1edUp2vFNFe3xYWOubGhe5RYw3u6RnyI2j0TIal
NzKGjWmXP9m49Z+FWQkdavrayzxhfb6q8aUusr6BZqBro08nz59juQRBT5tH
SFI88K278W74c2BCtEDl+h3+DxN+5uGGj6n46sS1j3pu5qXui9UKxu5i8n0E
sNSizrRER+FwmI17XaYQtm+9w+O.vM4Ea
-----------end_max5_patcher-----------
</code></pre>
1 Like

Man, I was more excited to see the jsui in use as I thought it was “fixed” to allow for really short buffers, but alas, it does not.

It’s good to have these extra keyword abstractions now though!

these are short buffers (100 ms). feel free to fix it for shorter. It should be simple, in the division loop of pixel width to buffer size, I reckon.

I’ll have a look, but I’m talking short as in 64samples (i.e. a small fft dict).

I guess it can have a check where if the buffer is < 1024 samples, it doesn’t downsample at all.

I guess this is the line in question:

var samperpix = Math.floor(bufsize/(w-1));

But I’m not sure why this would be returning something unviewable (at 64samps).

Color-wise, I think RGB is fine, but if you want more (or different) you can use the colors from Max’s js parser (blue, red, orange, purple, green):

1 Like

It’s on my todo for straight after break to read your demands on the viewer. in the meantime (and in that thread) feel free to propose slick colour schemes for different selections as at the moment it is R, G or B…

Maybe a candycane option like multislider?

Then give the ability to set an RGB offset so each generated buffer rotates through a gradient. Loads of differentiation for the user and will make it more visually distinctive.

1 Like

Thank you Santa :):santa::santa::santa::santa::santa::santa::santa::santa::santa: