-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
N dimensional tabulate #151
Comments
Hi Bart,
This sounds great, and extremely useful! Thanks!
How about interpolators.lib ? It already has interpolated 1D tables
(frdtable, frwtable, and of course other interpolated things).
Cheers,
Julius
…On Wed, May 3, 2023 at 2:11 PM Bart Brouns ***@***.***> wrote:
I made an N dimensional tabulate.
The code is in quite rough shape at the moment, but it works.
It can do val,lin and cub, with any number of parameters for the function
to tabulate.
All the values are stored in one big table with the size being the product
of the individual sizes.
Usage example:
process =
tabulateNd(2,0,twoDfunction,sizeX,sizeY,rx0,ry0,rx1,ry1,x,y)
, twoDfunction(x,y);
So it's: dimension ,C , expression, sizes, start values, end values,
parameters.
I'd like to contribute it to the libraries.
Apart from general cleanup, any suggestions?
I doubt I can get it in a state where it will be easily understandable.
Once grame-cncm/faust#890 <grame-cncm/faust#890>
is resolved, I can make the code a bit more elegant.
Here's a permalink to the code in it's current state:
https://github.com/magnetophon/lamb/blob/bbce0d505c7788282f7de827ba678f50de20bca6/lamb.dsp#L16
—
Reply to this email directly, view it on GitHub
<#151>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQZKFNBM2NW2LQHM3QHXCTXELCZ7ANCNFSM6AAAAAAXU6EKXM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Julius O. Smith III ***@***.***>
Professor Emeritus of Music and by courtesy Electrical Engineering
CCRMA, Stanford University
http://ccrma.stanford.edu/~jos/
|
I assumed it was going into basics.lib, since that is where tabulator lives, but I don't really care where it ends up. |
Ok, I didn't know that, so I withdraw my suggestion.
Stéphane, what do you think?
…On Wed, May 3, 2023 at 3:23 PM Bart Brouns ***@***.***> wrote:
I assumed it was going into basics.lib, since that is where tabulator
lives, but I don't really care where it ends up.
—
Reply to this email directly, view it on GitHub
<#151 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQZKFIT5H44D4OYYPC6JYTXELLHDANCNFSM6AAAAAAXU6EKXM>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Julius O. Smith III ***@***.***>
Professor Emeritus of Music and by courtesy Electrical Engineering
CCRMA, Stanford University
http://ccrma.stanford.edu/~jos/
|
@josmithiii you actually helped improve the documentation of |
Currently, the code has (simplified): process = tabulateNd(params);
tabulateNd(params) =
calc.lin
with {
calc =
environment {
// do the work here
};
}; When I change it to: process = tabulateNd(params).lin;
tabulateNd(params) =
environment {
// do the work here
}; I get: What does that error mean? Here is the actual code change: magnetophon/lamb@master...broken |
I cleaned up the code as far as I could: https://github.com/magnetophon/lamb/blob/eb7c4baabcbf6bb7de5b278811a9b7ae79328122/lamb.dsp#L23-L192 |
I found a minimal example to reproduce the error: env = environment {
part=1+_;
};
process =
env(1).part; I would expect this to output 2.
Is that a bug or a feature? ;) This works, but is not applicable to tabulateNd, since the number of parameters should be variable: env(x) = environment {
part=1+x;
};
process =
env(1).part; |
How can the message be more clear ? With the first |
Why can you not use an environment as if it's a function? |
I'm sorry, most of that goes over my head.
What is lexically scoped?
What do you mean by an expression "keeping it's meaning"?
What is bounded? What is a closure? In any case, I don't think the manual explains why you cannot use an environment as if it's a function. |
An environment contains a collections of definitions, some of them can be functions:
|
Thanks. I understand how it works and what the constraints are, more or less. What I would like to know: does it have to be this way? Sorry for repeating the question, but you seem to miss it every time. |
We cannot do that: what is the need ? |
The need is cases like mine: Why do you ask for the need if you cannot change it though? :) |
I still don't understand why it can't be written with the current model... |
How would you do it? |
As always, in hindsight it was easy: just declare I'll get started on the PR now! :) Thanks for your patience @sletz! |
That solution does have the downside that you need to call it with extra brackets around the parameters, so they become one entity. tabulateNd(3,1,threeDfunction, ( sizeX,sizeY,sizeZ,rx0,ry0,rz0,rx1,ry1,rz1,x,y,z ) ).lin Does anyone know a more elegant solution? I barely understand it myself, so I'm not in a good position to explain it to others. My best shot at the simple version would be:
Is that more or less correct? |
I made some docs. They don't explain the whole thing, but at least they give an overview. Please give me feedback.
I particularly hope Julius can have a look, being both a domain expert and a native English speaker. |
Hi Bart,
It reads very well to me! In general, non-native speakers can use
ChatGPT-4 to rewrite their prose as "technical professional English" (or
whatever style you want to specify), but your English is fine for me.
I find ChatGPT-4 (even 3.5) to consistently have perfect spelling and
grammar, but its signal-processing knowledge leaves a lot to be desired. :-)
Thanks again for super useful ND interpolated table support!
Cheers,
- Julius
…On Sun, May 7, 2023 at 7:38 AM Bart Brouns ***@***.***> wrote:
I made some docs. They don't explain the whole thing, but at least they
give an overview.
https://gist.github.com/magnetophon/4b6db0aa32ab6983fa931c6d2454d91f
Please give me feedback.
-
Is everything clear?
-
Is it too much detail, not enough?
I imagine it's both depending who is reading and on which part of the
docs we are talking about.
For example: a computer scientist would have summarized the whole
"Storage method" section in a few jargon terms, but then I wouldn't
understand it myself, at least not the me before I wrote all this! 😄
-
Am I using correct English?
I particularly hope Julius can have a look, being both a domain expert and
a native English speaker.
—
Reply to this email directly, view it on GitHub
<#151 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQZKFNC2XVQ3HLWH2TZPYTXE6XYDANCNFSM6AAAAAAXU6EKXM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Julius O. Smith III ***@***.***>
Professor Emeritus of Music and by courtesy Electrical Engineering
CCRMA, Stanford University
http://ccrma.stanford.edu/~jos/
|
I made an N dimensional tabulate.
The code is in quite rough shape at the moment, but it works.
It can do
val
,lin
andcub
, with any number of parameters for the function to tabulate.All the values are stored in one big table with the size being the product of the individual sizes.
Usage example:
So it's: dimension ,C , expression, sizes, start values, end values, parameters.
I'd like to contribute it to the libraries.
Apart from general cleanup, any suggestions?
I doubt I can get it in a state where it will be easily understandable.
Once grame-cncm/faust#890 is resolved, I can make the code a bit more elegant.
Here's a permalink to the code in it's current state:
https://github.com/magnetophon/lamb/blob/bbce0d505c7788282f7de827ba678f50de20bca6/lamb.dsp#L16
The text was updated successfully, but these errors were encountered: