West (Reaktor) programmer

Post your Lemur Projects.
Macciza
Regular
Posts:1325
Joined:07 Dec 2011 04:57
Location:Sydney, Australia.
Re: West (Reaktor) programmer

Post by Macciza » 30 Oct 2014 11:50

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
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]

lABl
Lemur Guru
Posts:269
Joined:09 Dec 2011 15:56
Contact:

Re: West (Reaktor) programmer

Post by lABl » 30 Oct 2014 13:32

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.38KiB)Viewed 6338 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.

lABl
Lemur Guru
Posts:269
Joined:09 Dec 2011 15:56
Contact:

Re: West (Reaktor) programmer

Post by lABl » 30 Oct 2014 22:24

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

Macciza
Regular
Posts:1325
Joined:07 Dec 2011 04:57
Location:Sydney, Australia.

Re: West (Reaktor) programmer

Post by Macciza » 31 Oct 2014 10:31

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
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]

lABl
Lemur Guru
Posts:269
Joined:09 Dec 2011 15:56
Contact:

Re: West (Reaktor) programmer

Post by lABl » 31 Oct 2014 15:49

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

Macciza
Regular
Posts:1325
Joined:07 Dec 2011 04:57
Location:Sydney, Australia.

Re: West (Reaktor) programmer

Post by Macciza » 01 Nov 2014 01:17

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
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]

Phil999
Regular
Posts:932
Joined:11 Jan 2012 01:53

Re: West (Reaktor) programmer

Post by Phil999 » 01 Nov 2014 04:47

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.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro

Joe Soap
Regular
Posts:475
Joined:07 Jul 2012 15:04

Re: West (Reaktor) programmer

Post by Joe Soap » 01 Nov 2014 05:03

Where are the Interface / Project size options Phil?

Macciza
Regular
Posts:1325
Joined:07 Dec 2011 04:57
Location:Sydney, Australia.

Re: West (Reaktor) programmer

Post by Macciza » 01 Nov 2014 05:07

Hi Phil
Sent you some stuff off list to check out
LFO Leds etc . .
Cheers
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]

Phil999
Regular
Posts:932
Joined:11 Jan 2012 01:53

Re: West (Reaktor) programmer

Post by Phil999 » 01 Nov 2014 05:25

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!
Last edited by Phil999 on 01 Nov 2014 14:03, edited 1 time in total.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro

Post Reply