|
|
|
04-30-2012, 10:54 PM
|
#201
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,653
|
Quote:
Originally Posted by Justin
Fixed the builds (only change was for i386 OSX).
|
Yes, it is working again, thanks!
|
|
|
04-30-2012, 11:38 PM
|
#202
|
Human being with feelings
Join Date: Jul 2006
Posts: 626
|
arp!0 starts to break here i think:
Code:
@init
//- arrays and "pointer" vars
mem= 1;
//[...other mem vars...]
gdvarx= mem; mem+= 1; //id for variant dropdown
gpt= mem; mem+= 256; //gfx param: text
gptlen= mem-gpt;
gdt= mem; mem+= 256; //gfx param: text
gdtlen= mem-gdt;
somehow gptlen becomes -256; likewise gdtlen and everything following that uses this pattern are negative when they should be positive. i have also tried just the code fragment above with the same results, so it is reproduceable for me outside of the arp!0 behemoth. :^)
enjoy! /dan
|
|
|
05-01-2012, 01:10 AM
|
#203
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,653
|
Quote:
Originally Posted by bang
somehow gptlen becomes -256; likewise gdtlen and everything following that uses this pattern are negative when they should be positive. i have also tried just the code fragment above with the same results, so it is reproduceable for me outside of the arp!0 behemoth. :^)
|
I can't confirm, your code fragment gives me the following (seemingly correct) values:
Code:
gdt 258
gdtlen 256
gdvarx 1
gpt 2
gptlen 256
mem 514
Perhaps you have tried it with the previous build, which did have some issues with Mac OS X i386?
EDIT: Reading IXix's reply... I am also on Win32, so it might also be a new Mac OS X issue. However, I don't have my MacBook on me right now, so I can't try...
Last edited by Tale; 05-01-2012 at 01:22 AM.
|
|
|
05-01-2012, 01:14 AM
|
#204
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,653
|
Quote:
Originally Posted by Justin
Should be faster-yet on x86/x86-64
|
Yes sir, it is indeed: I have just run the tests from this post again using the latest build:
Code:
Previous jsfx_functions Latest jsfx_functions
Delay 26.4% 19.5%
Tone generator 33.2% 31.9%
Yay, performance improvements all round!
|
|
|
05-01-2012, 01:16 AM
|
#205
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
|
Quote:
Originally Posted by bang
i have also tried just the code fragment above with the same results, so it is reproduceable for me outside of the arp!0 behemoth.
|
That fragment works correctly here.
Win7 32bit.
Edit: And arp!0 works fine too (as near as I can tell anyway!)
|
|
|
05-01-2012, 06:45 AM
|
#206
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Quote:
Originally Posted by bang
arp!0 starts to break here i think:
Code:
@init
//- arrays and "pointer" vars
mem= 1;
//[...other mem vars...]
gdvarx= mem; mem+= 1; //id for variant dropdown
gpt= mem; mem+= 256; //gfx param: text
gptlen= mem-gpt;
gdt= mem; mem+= 256; //gfx param: text
gdtlen= mem-gdt;
somehow gptlen becomes -256; likewise gdtlen and everything following that uses this pattern are negative when they should be positive. i have also tried just the code fragment above with the same results, so it is reproduceable for me outside of the arp!0 behemoth. :^)
enjoy! /dan
|
Thanks, maybe this is just on OSX/i386 too, fsub vs fsubr. That's pretty likely actually, accept my (and gcc's) apologies.
Edit: OSX/i386 build updated with the fix!
Last edited by Justin; 05-01-2012 at 06:55 AM.
|
|
|
05-01-2012, 09:15 AM
|
#207
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,653
|
Quote:
Originally Posted by Justin
Edit: OSX/i386 build updated with the fix!
|
I have just replicated the issue on my Mac, and when I check into the forum to report this there is a fix already. Thanks!
|
|
|
05-01-2012, 09:27 AM
|
#208
|
Human being with feelings
Join Date: Jul 2006
Posts: 626
|
Quote:
Originally Posted by Justin
Thanks, maybe this is just on OSX/i386 too, fsub vs fsubr. That's pretty likely actually, accept my (and gcc's) apologies. Edit: OSX/i386 build updated with the fix!
|
arp!0 is happy again! thanks! and wow: if you can't trust your compiler, who can you trust? :^P enjoy! /dan
|
|
|
05-01-2012, 02:38 PM
|
#209
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
|
I had a stab at making a kind of GUI framework a while back. Now I'm trying to convert it to use the new functions and namespaces, I'm getting an odd error...
There may well be an error (or several) but the code doesn't actually contain those words.
Using the latest build of course
Edit: The line number it gives is the closing brace of a particular function. If I relocate the function, the error still points to the closing brace.
Edit again: Moving the offending function into a separate script produced a more sensible error message which enabled me to fix the error. I guess the odd message text is somehow related to code size. Or something.
Last edited by IXix; 05-01-2012 at 02:55 PM.
|
|
|
05-01-2012, 04:32 PM
|
#210
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Can you send me the script with the funny error?
Quote:
Originally Posted by IXix
I had a stab at making a kind of GUI framework a while back. Now I'm trying to convert it to use the new functions and namespaces, I'm getting an odd error...
There may well be an error (or several) but the code doesn't actually contain those words.
Using the latest build of course
Edit: The line number it gives is the closing brace of a particular function. If I relocate the function, the error still points to the closing brace.
Edit again: Moving the offending function into a separate script produced a more sensible error message which enabled me to fix the error. I guess the odd message text is somehow related to code size. Or something.
|
|
|
|
05-02-2012, 12:55 AM
|
#211
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
|
Quote:
Originally Posted by Justin
Can you send me the script with the funny error?
|
Done
|
|
|
05-02-2012, 12:41 PM
|
#212
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Quote:
Originally Posted by IXix
Done
|
Perfect, the error in the build I just posted should now be more helpful.
- This build has a few more code generation optimization, mostly for when calling pow(), asin(), etc, but also min()/max() and sign().
- PPC: boolean operations (||, &&) and ?: should now be slightly faster, too.
- This version should also fix some bugs, an ancient JS function which I won't name here would crash on certain architectures in previous versions...
- Memory access ([] and gmem[]) are now slightly slower on error (i.e. when accessing out of bounds), but as a result are quite a bit smaller in code.
I think this should be it for a bit.. if nobody finds problems in the next few days (please test!), I'll merge this into 4.23.
|
|
|
05-02-2012, 01:56 PM
|
#213
|
Human being with feelings
Join Date: Jan 2012
Posts: 104
|
4.23pre7 - May 2 2012
# JS: editor now top level window with icon
a note on this.
here on windows7 x64,
not having the opportunity to fix the window with the function on top,
is a little awkward to edit when you must interact with the arrange,
Also if you set the window js-plugin with the option on top. you can not call up the window-editor above the other.
Therefore, the possibility of having the option on top of the window for the editor?
Last edited by Tronic; 05-02-2012 at 06:19 PM.
|
|
|
05-02-2012, 02:53 PM
|
#214
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
|
The new build gives a much better error message.
Before the dust settles, please consider adding an option to keep the editor on top of REAPER like it used to be? Having it in a totally separate window is proving quite inconvenient on my small screen.
|
|
|
05-02-2012, 03:15 PM
|
#215
|
Human being with feelings
Join Date: Jul 2006
Posts: 626
|
Quote:
Originally Posted by Justin
I think this should be it for a bit.. if nobody finds problems in the next few days (please test!), I'll merge this into 4.23.
|
arp!0 still sounding good. in the very trivial category, at some point we lost the thin right margin on Js fx windows on macos. in the not so trivial category, it would be *wonderful* to have an Opt-Dump command in the Js editor that would display memory contents at the value of the variable under the cursor somehow. actually, make that *awesomely wonderful*. :^) enjoy! /dan
|
|
|
05-02-2012, 03:21 PM
|
#216
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
|
Quote:
Originally Posted by bang
it would be *wonderful* to have an Opt-Dump command in the Js editor that would display memory contents at the value of the variable under the cursor somehow. actually, make that *awesomely wonderful*.
|
Nah, that'd make it too easy.
|
|
|
05-02-2012, 03:30 PM
|
#217
|
Human being with feelings
Join Date: Jul 2006
Posts: 626
|
Quote:
Originally Posted by IXix
Nah, that'd make it too easy.
|
lol. surely you mean too *awesomely* *wonderfully* *easy*? :^)
|
|
|
05-02-2012, 09:15 PM
|
#218
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Quote:
Originally Posted by bang
arp!0 still sounding good. in the very trivial category, at some point we lost the thin right margin on Js fx windows on macos. in the not so trivial category, it would be *wonderful* to have an Opt-Dump command in the Js editor that would display memory contents at the value of the variable under the cursor somehow. actually, make that *awesomely wonderful*. :^) enjoy! /dan
|
Funny, the nontrivial thing is more easily dealt with...
|
|
|
05-03-2012, 10:57 AM
|
#219
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
OK, I've updated the build (hopefully I'm really done for a bit now): - Peeking using right click or Ctrl+K will now also show mem contents at the offset specified by the peeked value, if that offset is within the valid RAM range.
- The editor window is again owned by the REAPER window
- There are improvements to the optimizer -- it uses less memory during compilation, and it can now reduce statements more effectively when they have no effect, such as : "sin(x=5);" becomes "x=5;" if the result of the sin() function is not used, etc.
- Code generation is improved for OSX/i386, a lot less code is generated to keep the stack aligned, but this needs a lot of testing (a non-16-byte aligned stack on OSX/i386 can cause crashes when calling C functions). It also needs testing for win32 (and to a lesser extent win64/osx64) since much of that code is shared.
|
|
|
05-03-2012, 11:35 AM
|
#220
|
Human being with feelings
Join Date: Jul 2006
Posts: 626
|
Quote:
Originally Posted by Justin
Peeking using right click or Ctrl+K will now also show mem contents at the offset specified by the peeked value, if that offset is within the valid RAM range.
|
thanks so much! this is very useful. and right click! xsweet!
couple o' bits, fwiw: with the new instance variable namespace features the variables pane of the Js editor might be a bit narrow. and no explicit variable declarations yet. not a big deal if that doesn't make the current cut. the ref count column helps a lot.
you have been spectacularly good to us Js folk with all the recent changes Justin. i am simply overjoyed! the combo of code reusability and significantly faster code opens up a whole new Js universe of possibilities. i am deeply grateful. thank you.
enjoy! /dan
|
|
|
05-03-2012, 11:53 AM
|
#221
|
Human being with feelings
Join Date: Sep 2008
Location: UK
Posts: 394
|
Given that JS is getting a bit of attn at the mo, I'd like to first resurrect some old calls for a customisable external editor path. This would be great!
(See: http://forum.cockos.com/showthread.php?p=956375 )
And, given that, this also makes sense:
Quote:
Originally Posted by beyond
Also, file change detection of loaded JS programs, so when you save it in an external editor and it re-compiles automatically, would be a very significant time saver...
|
Cheers!
|
|
|
05-03-2012, 11:59 AM
|
#222
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Quote:
Originally Posted by bang
thanks so much! this is very useful. and right click! xsweet!
couple o' bits, fwiw: with the new instance variable namespace features the variables pane of the Js editor might be a bit narrow. and no explicit variable declarations yet. not a big deal if that doesn't make the current cut. the ref count column helps a lot.
you have been spectacularly good to us Js folk with all the recent changes Justin. i am simply overjoyed! the combo of code reusability and significantly faster code opens up a whole new Js universe of possibilities. i am deeply grateful. thank you.
enjoy! /dan
|
Requests/thoughts noted.. I'm very happy to work on this, to the extent that I can't do everything asked for, I apologize (there were some things that I wanted to come up with a better solution for before implementing)..
BTW, this latest build should be a LOT faster on OSX 32 bit.. I didn't realize how awful the code being generated on that platform was...
|
|
|
05-03-2012, 02:48 PM
|
#223
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
...and updated once again to fix some bugs that could cause crashing.
|
|
|
05-03-2012, 05:00 PM
|
#224
|
Human being with feelings
Join Date: Jul 2006
Posts: 626
|
Quote:
Originally Posted by Justin
to the extent that I can't do everything asked for, I apologize
|
absolutely unnecessary. everyone has limits. i for one am thrilled and amazed at all you *have* done recently.
Quote:
Originally Posted by Justin
BTW, this latest build should be a LOT faster on OSX 32 bit
|
well, that high cpu audio Js fx is now *twice* as fast as it was in v4.21 on 32bit osx. way cool!
thanks again for the Js love! /dan
|
|
|
05-04-2012, 09:45 AM
|
#225
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Build updated once again -- using the midi super arpeggiator (GUI version), it would take approximately an hour to compile, hah.
|
|
|
05-04-2012, 10:05 AM
|
#226
|
Human being with feelings
Join Date: Jun 2009
Location: Croatia
Posts: 4,689
|
no browsing ? thank you for your hard work!
|
|
|
05-04-2012, 03:08 PM
|
#227
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
|
stack
I thought there would be just one stack but there seems to be one for each @section. Is that how it's supposed to be?
Code:
@init
stack_push(9);
debugInit = stack_peek(0);
@block
debugBlock = stack_peek(0);
@gfx
debugGfx = stack_peek(0);
If I run this, debugInit is 9 but debugBlock and debugGfx are both 0.
|
|
|
05-04-2012, 03:17 PM
|
#228
|
Human being with feelings
Join Date: Jun 2007
Location: Palm Beach FL
Posts: 265
|
Code:
function MIDI_Start() ( 0 );
beat_position <= last_beat_position ? MIDI_Start(); // Fails to compile !
beat_position <= last_beat_position ? 0; // OK
function MIDI_Start() ( any_variable ); //
beat_position <= last_beat_position ? MIDI_Start(); // OK
MIDI_Start() is a later overidable empty function...
|
|
|
05-04-2012, 03:36 PM
|
#229
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Yeah, the stack is supposed to be section local -- for example, the gfx code runs in a different thread from the audio, so it's somewhat necessary...
Quote:
Originally Posted by IXix
I thought there would be just one stack but there seems to be one for each @section. Is that how it's supposed to be?
Code:
@init
stack_push(9);
debugInit = stack_peek(0);
@block
debugBlock = stack_peek(0);
@gfx
debugGfx = stack_peek(0);
If I run this, debugInit is 9 but debugBlock and debugGfx are both 0.
|
|
|
|
05-04-2012, 03:36 PM
|
#230
|
Human being with feelings
Join Date: Jun 2007
Location: Palm Beach FL
Posts: 265
|
Also on the subject of MIDI, the input event time offsets are still out of order. This can be a significant problem for stateful chronological MIDI processing and was brought up in an old thread. Justin had replied then, considering quick-sorting the midi input events for JS.
He also suggested using a radix sort algorithm to do this in JS, since JS does not currently support recursion (inlining functions).
Should we look into doing a radix sort in JS, or is there a fix on the horizon?
Also, what about the idea for a general purpose quick_sort(ArrayAddress, ItemCount) function, that will sort an array of SortKey & Value pairs. The Values can be indexes to other array addresses, hence the ability to sort structures of data.
bang's arp!0 is the most ambitious undertaking I have seen in JS, and also the best arpeggiator I have seen anywhere! I do wonder why he did not do this in C++. Nevertheless, a true test of the limits and potential of JS!
|
|
|
05-04-2012, 04:16 PM
|
#231
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Quote:
Originally Posted by beyond
Code:
function MIDI_Start() ( 0 );
beat_position <= last_beat_position ? MIDI_Start(); // Fails to compile !
beat_position <= last_beat_position ? 0; // OK
function MIDI_Start() ( any_variable ); //
beat_position <= last_beat_position ? MIDI_Start(); // OK
MIDI_Start() is a later overidable empty function...
|
Got it, will be fixed in the next rev.
|
|
|
05-04-2012, 04:17 PM
|
#232
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Quote:
Originally Posted by beyond
Also on the subject of MIDI, the input event time offsets are still out of order. This can be a significant problem for stateful chronological MIDI processing and was brought up in an old thread. Justin had replied then, considering quick-sorting the midi input events for JS.
He also suggested using a radix sort algorithm to do this in JS, since JS does not currently support recursion (inlining functions).
Should we look into doing a radix sort in JS, or is there a fix on the horizon?
Also, what about the idea for a general purpose quick_sort(ArrayAddress, ItemCount) function, that will sort an array of SortKey & Value pairs. The Values can be indexes to other array addresses, hence the ability to sort structures of data.
bang's arp!0 is the most ambitious undertaking I have seen in JS, and also the best arpeggiator I have seen anywhere! I do wonder why he did not do this in C++. Nevertheless, a true test of the limits and potential of JS!
|
Hmm, I will see if I can have them sorted, as they should be anyway.
|
|
|
05-04-2012, 09:38 PM
|
#233
|
Human being with feelings
Join Date: Mar 2007
Location: Surrey, BC
Posts: 745
|
Quote:
Originally Posted by Justin
Build updated once again -- using the midi super arpeggiator (GUI version), it would take approximately an hour to compile, hah.
|
In a weird way, this makes me very proud (I helped bring Justin's compiler TO IT"S KNEEEEEEEES!!! )
....Hey, I'm just thrilled he actually downloaded it
That is all.
|
|
|
05-05-2012, 01:16 AM
|
#234
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
|
Quote:
Originally Posted by Justin
Yeah, the stack is supposed to be section local -- for example, the gfx code runs in a different thread from the audio, so it's somewhat necessary...
|
Oh okay. I was trying to adjust my gfx debug helper to show the stack content but I guess I'll have to abandon that idea.
Edit: I suppose if I need to check a stack I can copy the content to memory and display that.
Edit: Wheee! Functions are great!
Code:
function StackToMem(memOffset, stackOffset, count)
(
loop
(
count,
memOffset[0] = stack_peek(stackOffset);
memOffset += 1;
stackOffset += 1;
);
);
Last edited by IXix; 05-05-2012 at 02:04 AM.
|
|
|
05-05-2012, 02:25 AM
|
#235
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
|
Justin, would it be possible to implement a method to save/load all the variables in a namespace in @serialize? Something like this...
Code:
@init
obj.a = 1;
obj.b = 2;
obj.c = 3;
@serialize
// This does the same as file_var(obj.a); file_var(obj.b); file_var(obj.c);
file_serialize(obj);
I think it would be pretty useful.
|
|
|
05-05-2012, 03:39 AM
|
#236
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,653
|
Crash with automation
I was trying to test section safety of variables, so I made this little script:
Code:
desc:test
slider1:0<0,1>slider1
@slider
foo = 1;
@sample
foo = 2;
foo == 1 ? err += 1;
To stress it I thought I'd automate the slider using LFO modulation. Although the test itself is successful (i.e. err stays 0), when I recompile the script with the LFO automation still running REAPER crashes most of the time. If it doesn't crash straight away I just hit the recompile button a couple of times until it does crash.
|
|
|
05-05-2012, 05:35 AM
|
#237
|
Human being with feelings
Join Date: Mar 2008
Location: Unwired (probably in the proximity of Amsterdam)
Posts: 4,868
|
On the subject of MIDI, it would be awesome if we could access MIDI input like SysEx messages as well.
And could you please also have a look at some of Jesusonic's general usability issues, like making JS plugins respect the preference setting "Commit changes to some edit fields after 1 second of no typing" (that is, do not commit any changes immediately without any option not to do so), and GUI alignment/resizing (currently a plugin with a single slider leaves the left half of its window completely unused when sized down manually a little bit )?
__________________
˙lɐd 'ʎɐʍ ƃuoɹʍ ǝɥʇ ǝɔıʌǝp ʇɐɥʇ ƃuıploɥ ǝɹ,noʎ
|
|
|
05-05-2012, 09:11 AM
|
#238
|
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Quote:
Originally Posted by Tale
I was trying to test section safety of variables, so I made this little script:
Code:
desc:test
slider1:0<0,1>slider1
@slider
foo = 1;
@sample
foo = 2;
foo == 1 ? err += 1;
To stress it I thought I'd automate the slider using LFO modulation. Although the test itself is successful (i.e. err stays 0), when I recompile the script with the LFO automation still running REAPER crashes most of the time. If it doesn't crash straight away I just hit the recompile button a couple of times until it does crash.
|
You're doing the full recompile/reset, right? If you do the normal recompile (Ctrl+S in editor), do you get no crash?
|
|
|
05-05-2012, 01:20 PM
|
#239
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,653
|
Quote:
Originally Posted by Justin
You're doing the full recompile/reset, right? If you do the normal recompile (Ctrl+S in editor), do you get no crash?
|
Yes, I am doing a full recompile. I will try the normal recompile tomorrow.
BTW, the crash is on WinXP Pro SP3. I have just tried it on Mac OS X 10.6.8, but on Mac it (fortunately) won't crash.
|
|
|
05-05-2012, 01:37 PM
|
#240
|
Human being with feelings
Join Date: Jul 2006
Posts: 626
|
fwiw:
Code:
@init
jnk.x= 0;
//function f() local( foo ) ( this.z= 0; ); //wishes != fishes
function f(x) ( !this.x ? this.x= 1+2*x : this.y= 1+3*x; );
jnk.f(); //no error
jnk.f(5);
//jnk.x == 1; jnk.y == 16
//jnk.f(2,3); //error
was hoping f() and f(x) would be distinct. but am unclear why there is an error for f(2,3) w/ 2 args but not with none. and if i uncomment f() and comment out f(x), there is no error for f(5). no biggie though. enjoy! /dan
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 01:21 AM.
|