Welcome to %s forums

BrainModular Users Forum

Login Register

whats the limit of objects drawn in ::onpaint.

Create your own modules in C++
Post Reply
23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 14 Apr 2015, 20:46

I first made my module simple, but it was needing many other items 'outside' like a XY pad on input, some arrays to display output ects.

I ve completely rebuild to mtControl.

so far so good i could get the code working for displaying , selectioning and udating all my controls points, tangants of a multipoints bezier curve directly on the single module canvas.

but when i want to display the output wavform i try to generate from my pitch bezier curve, the array outputs display correctly, (purple down) while if i try to draw on canvas it seems incomplete.

ie my array is 1024, it's like it's displaying the 256-512 or so first values only.(green on canvas)

I guess it might be too much asking hehe ^^, will proceed diferently with external devices, but just to know, is there a fixed limit of 'objects' drawing, if so what is it?
also, what is the "child window?"


Image

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 14 Apr 2015, 21:38

oops nevermind, i removed all the unused in/outs to clean and now that works as espected .. fail to understand lol
anyway sorry again, but just interested to know if there is a defined limit.. back to work^^

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 15 Apr 2015, 13:59

wow 23fx23,

it's a kind of sexy canvas you have here :D

seems like you resolved your problem

i'm not aware of a limit for drawing things, what functions are you using.

anyway, this kind of stuff have to be optimized as it can be really CPU/GPU demanding
as the canvas coord is between 0 and 1, you don't have to put all wave data to be drawn, most of the time (depending of the pixel size of the canvas in fact)
Martin FLEURENT - Usine Developer - SDK maintainer

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 15 Apr 2015, 14:27

ok cool, thanks for infos, ill try to be nice with the draw proc hehe^^
yep ive separated the true wav audio datas, from a 'proxy low rez" wav display. you are right no need to be larger than pixels dimensions, will optimize a bit more^^

i make several paint if bool is on on ::onpaint , i first draw the bezier curve representation by points (64), then then tangants segment (lsdkine), then the ctrl points, when moving XY and mouse dwn, and finally the 'low rez"wav display.
i try to do only when needed, ie the fina kick result is procecessed/updated only on mouse up, not while xy tweaking, but it still have to be repaint with the rest.
Yup everything works as espected in last night version, im quite happy :) cpu seems ok for now i don't see spikes, and it's MUCH MUCH lower than my previous Delphi script version ^^
around 20-30x lol
Thanks again for the crasy sdk works, really in love that new playing game area, will keep me busy for a while! haha y made my year.
ive made this version with jpg as background, have to decide myself maybe less handy to share when will be ok.
most stuff is ok now. bezier manipulation, no more erreors on init/reload as i backup the datas and repopulate in internal memory wich i didn't do previously.
got a nice frequency to note display for tweaked point.

Today im working on the wav stream. i still fail to get results with the sdk createAudiofile but i will investigate.
anyway if i don't manage i should still be able to populate an array of bloc size, scrubbing the wav datas in bigger internal array.
here a little prev of last version:

Image

cheerz mate! usine Rocks & sdk rocks!

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 15 Apr 2015, 14:57

cool,

on the optimization point, note that sdkDrawPathXX are more efficient than sdkDrawPolyLine

now, you just have to integrate the Automation Recording to make easy real-time automation of your bezier param :D
take a look at the granulator module to see how it work ;)
Martin FLEURENT - Usine Developer - SDK maintainer

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 15 Apr 2015, 15:06

thanw lin check! i wad using sinple draw line as i neead to get only between specific points, but will try and compage with the path procedurs
hehe i wil l try to get the audio stream ok, then Automation could be very sexy hehe, will check alll those nice exemples! thx

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest