02-20-2007, 09:36 AM
|
#1 |
|
Human being with feelings
Join Date: Feb 2007
Posts: 12
|
Hi- New user of Jesusonic with REAPER here. I LOVE it.
I have a C programming background so I feel quite comfortable with Jesusonic rules, but I'm having a few problems. 1- I can't seem to get sliderchange() to work. The display doesn't seem to get updated until I click on the slider. 2- The reference says that set_slider() takes an effect number as an argument, i.e. 1.3 would be effect 1, slider3. What is the definition of an effect number? Where do I get it? 3- Any way to get debugging info out, other than using slider displays? 4- The docs state that the code x=5; will define a variable called x and set it to 5. It further states that buffer=1024; will set buffer to point to the 1024th location in temporary storage. Is "buffer" a reserved variable name? It isn't on the list of "special variables." 5- Any possibility of user defined functions? Or #includes or #defines, just for readability? That's good for a start. Thanks for any help. David |
|
|
02-20-2007, 03:04 PM
|
#2 | ||||
|
Human being with feelings
Join Date: May 2006
Posts: 2,373
|
Quote:
Quote:
Quote:
Quote:
No. |
||||
|
|
02-20-2007, 06:57 PM
|
#3 |
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 16,809
|
you can also do sliderchange(slider1) and it'll notice that you passed it slider1, and update it accordingly...
or you can use the bitmask (2^(idx-1)) -Justin |
|
|
03-09-2007, 05:30 AM
|
#4 | |
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 4,024
|
I'm confused about the memory buffer thing too!
Quote:
|
|
|
|
03-09-2007, 06:20 AM
|
#5 | |
|
Human being with feelings
Join Date: May 2006
Posts: 2,373
|
Quote:
Code:
buffer = 1024; // set buffer to reference the local memory starting at 1024 x=buffer[0]; // read first item in buffer buffer[1]=x; // write to second item in buffer buffer[n]=x; // write to n'th item in buffer ![]() You could also have foo[n] where 'foo'+'n' is the offset in the local memory (contrary to e.g. C/C++ where only 'n' would define the offset and 'foo' the element/array...) |
|
|
|
03-09-2007, 07:20 AM
|
#6 |
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 4,024
|
I was still confused but in the process of formulating my reply, I think I've understood how it works.
'buffer' itself doesn't point to the memory location, it's just a variable with the value 1024. Writing buffer[n] is the same as writing 1024[n], which will retrieve the 1024th item in the memory, yes? |
|
|
03-09-2007, 08:24 AM
|
#7 | |
|
Human being with feelings
Join Date: May 2006
Posts: 2,373
|
Quote:
EDIT: It will, however, retrieve the '1024+n'th item [/nitpicker]
|
|
|
|
03-09-2007, 08:28 AM
|
#8 |
|
Human being with feelings
Join Date: Feb 2007
Posts: 12
|
I am the original poster of this question and at first the explanations given still didn't make sense to me, but upon further reflection I realized that it is all very simple and I couldn't understand it at first cause I was overcomplicating it.
What I believe to be the case is this: There is no difference between the statements buffer = 1024; and x = 5; in that each one creates a local variable and initializes it. It is the act of putting square brackets after one of these variables that turns the variable into a pointer, i.e. makes it operate by reference. So, buffer[0] references the value stored at the 1024th location in local memory. And buffer[1], buffer[2] reference subsequent values. But there is nothing special about the variable "buffer". So when the docs say: buffer = 1024; // set buffer to reference the local memory starting at 1024 I think this is misleading. "buffer" isn't being set to reference memory starting at 1024 any more than every other statement which creates and initializes a variable, such as "x = 5;" sets that variable to "reference memory starting at location whatever (in this case 5)." The fact is that any variable can be used as a pointer into local memory if [] is put after it. So if "buffer" happens to be set the VALUE 1024, then buffer[0] is essentially the same as 1024[0]. All in all it's very handy and very simple. But I think the docs should make clear that there is no special voodoo going on in the buffering example. It is also important to realize that the space which is allocated for the variables themselves, i.e. "buffer", "x", etc. is allocated elsewhere. So one is free to use any location one wants to use within local memory. So, looking at each of the following lines individually, 1000[1] = 6; 1[1000] = 6; x = 500; x[501] = 6; y = 501; y[500] = 6; buffer = 1001; buffer[0] = 6; buffer = 1000; buffer[1] = 6; buffer = 0; buffer[1001] = 6; All of them do the EXACT same thing with regard to memory location 1001. "x" and "y" and "buffer" are just variables which can be used in any way variables can be used. Sorry if this seems all too obvious, but if I can help clear up confusion for someone I think it is worth it. |
|
|
03-09-2007, 08:44 AM
|
#9 |
|
Human being with feelings
Join Date: Feb 2007
Posts: 12
|
and let me add that looking at the previous posts again, I realize that with my long treatise I just said pretty much the same thing IXix said in two sentences. Oh well, I guess brevity isn't my strong suit this time!
|
|
|
03-09-2007, 09:05 AM
|
#10 | ||
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 4,024
|
Quote:
![]() At least this thread should help any poor C people like us to understand how it works. That line in the manual is very misleading indeed. If it wasn't for that I would have figured it out for myself. Quote:
|
||
|
|
04-21-2007, 12:39 PM
|
#11 |
|
Human being with feelings
Join Date: Sep 2006
Location: Germany's California
Posts: 1,543
|
thank you dsilver. i think now everybody (including me) got it. that documentation is in fact misleading...
__________________
Intel Core 2 Quad Q6600 / 2 GB / WinXP Pro SP2 / EMU 0404 USB "Recording is God's way of telling you that you suck." - Bob Brozman My Jesusonic FX - Xenakios' Extension REAPER FR Tracker - what is that? The "How Stuff works in REAPER": video blog |
|
|
03-06-2008, 07:20 AM
|
#12 |
|
Human being with feelings
Join Date: Jan 2008
Location: America, Land of Illusion
Posts: 26
|
|
|
|
![]() |
| Thread Tools | |
|
|