Page 2 of 4

Re: West (Reaktor) programmer

Posted: 30 Oct 2014 11:50
by Macciza
Hi phil
The canvas overlay works well for some things and I incasing them in containers helps there,
I have had issues with my rotary touch controller that is easily fixed with a knob

The canvas_save/restore functions slow you to save the then current state of the canvas and later restore it . . .
This allows you to save, then alter the canvas, draw on it and then restore the previous state...
Remember there are two ways of drawing in different places on the canvas- move the pen or move the canvas...
You can draw something at x,y or canvas_ translate to x,y and draw at 0,0 - it's the same thing in the end...

The drawing optimisations come down to the canvas_refresh function and On demand drawing
Rather then always redrawing it only redraws when told to ie when value changes
Other things might be making single background image and using alias's for the rest,..
Or having common code to draw them all so you can change them all easily etc

Checking out html5 canvas tutorials might help once yo realise ways to translate them to lemur
Cheers

Re: West (Reaktor) programmer

Posted: 30 Oct 2014 13:32
by lABl
Well done Phil!, glad to see a reaktor project! ;) Will check the instrument + lemur template for sure.

+1 to each Macciza word about of canvas!

Split stuff in subfunctions and get familiarized with save/restore() will help you a lot, specially if you use transformations (translate,rotate,scale,etc), even you can order / positioning stuff more quickly, I've attached a pict as demo, you will see the order of the buttons depending of how they are called in the script.
Captura de pantalla 2014-10-30 a la(s) 14.29.50.png
Captura de pantalla 2014-10-30 a la(s) 14.29.50.png (59.38 KiB) Viewed 5662 times
That said, I think a good way to get familiarized canvas better is "under-layering", using this like a graphical layer/s, even sometimes if you don't need any special "cursor" behaviour , I would say that is even more "efficient" (by refreshing canvas on demand as Macciza says)

I have tried recreating a factory multiball (multisquare) object from scratch, including physics, cursor mode, attributes, etc, I quickly discovered that duplicating the object memory was 1 %, with only two of those objects, however you need 10 Factory multiball objects to fill the same memory, It was a good lesson for me to learn how well optimized and coded are some objects in lemur.

This also avoid some processes like scalling values and then normalizing them again, to send/receive/process MIDI,osc, etc.

HTML's tutorials are very useful for this, I have a canvas book too , I think there some free articles online from that book, I will seach the link.

Thanks for sharing the project !

btw- sorry the off topic, but is radial gradients working for you guys? here in the editor looks fine, but on iPad it doesn't, seems like if radius is not computed correctly.

Re: West (Reaktor) programmer

Posted: 30 Oct 2014 22:24
by lABl
I've played with the template and ensemble, good work mate! looking forward to your next version, would be interesting to know how this improves. I am interested specially in memory usage, I will keep the track of this project,it already works smooth on ipad retina though!

Here the link for the canvas book I've mentioned, https://www.inkling.com/store/book/html ... a299fe87df , some cool stuff there,but can't locate the link for the free chapters, but is possible to preview some content.

Cheers

Re: West (Reaktor) programmer

Posted: 31 Oct 2014 10:31
by Macciza
Cheers AB

I would be interested to have a look at some of your multiball work, I've been looking into physics stuff lately including multiball style stuff ....

Phil, check out a variety of tutorials and try to get your head around converting their code to Lemur
Also be aware that you will find different approaches and coding styles at many of them.
Some of these styles transfer easily to Lemur but some don't and require more translation

For the ellipse I did a search on html5 canvas ellipse, read a few sites and hacked something up...
Ideally a whole additional library could be developed to make all these things easier, more on that later . . .

MM

Re: West (Reaktor) programmer

Posted: 31 Oct 2014 15:49
by lABl
hey Macciza, I should have the initial prototype on my old laptop, I will send, you can find that stuff in the book that I mentioned too, (maths and physics chapter) it needs some work to translate to lemur domain, but it works, there are several examples and routines, wall bouncing, bouncing between balls by collision, etc. I have the spanish version and I've found this very interesting, also there are many pages are not very useful to use on lemur though.

Cheers

Re: West (Reaktor) programmer

Posted: 01 Nov 2014 01:17
by Macciza
Cheers mate,
I have gone through a few physics tuts already and have a few prototypes using different approaches...

Phil,
The sliding single page is now easily achieved by defining a custom interface size, which then provides native scrolling!
Check out the selector in the editor, you can now define your own sizes ....
Also had a look at the ensemble and we can get the LFO lights happening fairly easily too
Will send you some stuff soon
MM

Re: West (Reaktor) programmer

Posted: 01 Nov 2014 04:47
by Phil999
hey that's good news. The interface size is good news I wasn't caring about, and with the LFO LED's I've been struggling. Tried with the new sequencer objects but somehow it didn't work everytime.

Some help would be great with the LFO's.

Re: West (Reaktor) programmer

Posted: 01 Nov 2014 05:03
by Joe Soap
Where are the Interface / Project size options Phil?

Re: West (Reaktor) programmer

Posted: 01 Nov 2014 05:07
by Macciza
Hi Phil
Sent you some stuff off list to check out
LFO Leds etc . .
Cheers

Re: West (Reaktor) programmer

Posted: 01 Nov 2014 05:25
by Phil999
Joe Soap wrote:Where are the Interface / Project size options Phil?
in the editor, you can choose the project size. iPhone, iPad, Legacy Lemur, etc. And there are custom sizes one can define. Haven't tried this option yet.

Thank you Macciza, but at the moment nothing has arrived yet.

Edit: ah, got it in the mail. Great!