Hello,
I'm drawing a keyboard with data structures. The problem is when I use loadbang to draw the keyboard, black keys are losed. If I bang the routine manually it works like a charm..
What I'm losing?
Patch attached..
Thanks Esteban Viveros
Esteban Viveros wrote:
Hello,
hi, nice patch ! beautifully structured as well !
I'm drawing a keyboard with data structures. The problem is when I use loadbang to draw the keyboard, black keys are losed. If I bang the routine manually it works like a charm..
What I'm losing?
seems like data structures need a little time to "load" (if that's the right term in that context). putting a [del 100] after loadbang did the trick for me.
([del 10] was to small ...)
best
oliver
Hi,
for me a [del 1] was enough to make sure the black keys appear. But it doesn't solve the problem that when the window is minimized and then maximized, white keys are again on top (at least on Pd-Ext), for that it works to draw first the black, then the white keys, then vis 0,vis 1. It's not logical, but it seems to work.
Btw, if you declare the dimensions of the filledpolygon as variables, you can make this using only one struct template. Don't know if you plan on use the keyboard to click on it, but it won't work to click on black keys, as it will also trigger a white key - except you do some hacking of the message, or you don't overlap keys by using a more complex shape for the white keys that goes around the black key. This would also solve the problem that when redrawing, the white keys overlap the black ones.
Best,
Joao
2017-05-18 8:19 GMT+02:00 oliver oliver@klingt.org:
Esteban Viveros wrote:
Hello,
hi, nice patch ! beautifully structured as well !
I'm drawing a keyboard with data structures. The problem is when I use loadbang to draw the keyboard, black keys are losed. If I bang the routine manually it works like a charm..
What I'm losing?
seems like data structures need a little time to "load" (if that's the right term in that context). putting a [del 100] after loadbang did the trick for me.
([del 10] was to small ...)
best
oliver
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/li stinfo/pd-list
for that it works to draw first the black, then the white keys, then vis 0,vis 1. It's not logical, but it seems to work.
also works for me. and it helps for filtering the right key events (see my solution).
Gesendet: Donnerstag, 18. Mai 2017 um 08:48 Uhr Von: "João Pais" jmmmpais@gmail.com An: oliver oliver@klingt.org Cc: pd-list@mail.iem.at Betreff: Re: [PD] patch with Loadbang loses data structure
Hi, for me a [del 1] was enough to make sure the black keys appear. But it doesn't solve the problem that when the window is minimized and then maximized, white keys are again on top (at least on Pd-Ext), for that it works to draw first the black, then the white keys, then vis 0,vis 1. It's not logical, but it seems to work. Btw, if you declare the dimensions of the filledpolygon as variables, you can make this using only one struct template. Don't know if you plan on use the keyboard to click on it, but it won't work to click on black keys, as it will also trigger a white key - except you do some hacking of the message, or you don't overlap keys by using a more complex shape for the white keys that goes around the black key. This would also solve the problem that when redrawing, the white keys overlap the black ones. Best, Joao
2017-05-18 8:19 GMT+02:00 oliver <oliver@klingt.org[mailto:oliver@klingt.org]>:Esteban Viveros wrote:Hello, hi, nice patch ! beautifully structured as well !
I'm drawing a keyboard with data structures. The problem is when I use loadbang to draw the keyboard, black keys are losed. If I bang the routine manually it works like a charm..
What I'm losing? seems like data structures need a little time to "load" (if that's the right term in that context). putting a [del 100] after loadbang did the trick for me.
([del 10] was to small ...)
best
oliver
Pd-list@lists.iem.at[mailto:Pd-list@lists.iem.at] mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list%5Bhttps://lists.puredata.info/l... Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list%5Bhttps://lists.puredata.info/l...]
for that it works to draw first the black, then the white keys, then vis
0,vis 1.
It's not logical, but it seems to work.
also works for me. and it helps for filtering the right key events (see my solution).
Seems like a magic for me... Anyway I adopt Christof mixed with João solutions at this patch.
But arises some questions...
Once I need:
keyboard will respond. Like a finger pressing and moving around a real keyboard. 3. the key are velocity sensitive around y axis at first click.
I'm thinking to map the gop are, create a system of coordinates to draw keyboard and using [cyclone/mousestate] and/or only [iemguts/receivecanvas].
In this way maybe is better implement the João suggestion of parameterize the template and implement the keys with more points and implement the control with a gop coordinate system.
Em qui, 18 de mai de 2017 às 09:13, Christof Ressi christof.ressi@gmx.at escreveu:
for that it works to draw first the black, then the white keys, then vis
0,vis 1.
It's not logical, but it seems to work.
also works for me. and it helps for filtering the right key events (see my solution).
Gesendet: Donnerstag, 18. Mai 2017 um 08:48 Uhr Von: "João Pais" jmmmpais@gmail.com An: oliver oliver@klingt.org Cc: pd-list@mail.iem.at Betreff: Re: [PD] patch with Loadbang loses data structure
Hi, for me a [del 1] was enough to make sure the black keys appear. But it doesn't solve the problem that when the window is minimized and then maximized, white keys are again on top (at least on Pd-Ext), for that it works to draw first the black, then the white keys, then vis 0,vis 1. It's not logical, but it seems to work. Btw, if you declare the dimensions of the filledpolygon as variables, you can make this using only one struct template. Don't know if you plan on use the keyboard to click on it, but it won't work to click on black keys, as it will also trigger a white key - except you do some hacking of the message, or you don't overlap keys by using a more complex shape for the white keys that goes around the black key. This would also solve the problem that when redrawing, the white keys overlap the black ones. Best, Joao
2017-05-18 8:19 GMT+02:00 oliver <oliver@klingt.org[mailto: oliver@klingt.org]>:Esteban Viveros wrote:Hello, hi, nice patch ! beautifully structured as well !
I'm drawing a keyboard with data structures. The problem is when I use loadbang to draw the keyboard, black keys are losed. If I bang the routine manually it works like a charm..
What I'm losing? seems like data structures need a little time to "load" (if that's the right term in that context). putting a [del 100] after loadbang did the trick for me.
([del 10] was to small ...)
best
oliver
Pd-list@lists.iem.at[mailto:Pd-list@lists.iem.at] mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list%5Bhttps://lists.puredata.info/l... Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list%5Bhttps://lists.puredata.info/l...]
for that it works to draw first the black, then the white keys, then
vis 0,vis 1. It's not logical, but it seems to work.also works for me. and it helps for filtering the right key events (see
my solution).Seems like a magic for me... Anyway I adopt Christof mixed with João
solutions at this patch.But arises some questions...
Once I need:
- change color of key while mouse click is on at these key
that's easy on its own, get the pointer from the output of [struct] when
you click on it. use it to change the color with [set ...... color].
- once mouse click is on, and mouse cursor move around the gop area,
the keyboard will respond. Like a finger pressing and moving around a
real keyboard.
- the key are velocity sensitive around y axis at first click.
I'm thinking to map the gop are, create a system of coordinates to draw
keyboard and using [cyclone/mousestate] and/or only
[iemguts/>receivecanvas].In this way maybe is better implement the João suggestion of
parameterize the template and implement the keys with more points and
implement >the control with a gop coordinate system.
you can't click and drag on data-s, so your other idea is better (and get
the pointers to make the display look accordingly).
Once I did a sampler what I had an horizontal line of marks indicating
places in a sample; also using [mousestate] to get the mouse actions
(position in window + clicks) I could extrapolate where I was in the
window, and what should sound.
Joao
I have done a precise draw of the key but I have more than one key selected in some cases.
What's wrong?
I have error messages when I run multiples abstractions of this patch, but it still working well.
Thanks for any advance.. :)
Em sáb, 20 de mai de 2017 às 06:31, João Pais jmmmpais@gmail.com escreveu:
for that it works to draw first the black, then the white keys, then vis
0,vis 1.
It's not logical, but it seems to work.
also works for me. and it helps for filtering the right key events (see my solution).
Seems like a magic for me... Anyway I adopt Christof mixed with João solutions at this patch.
But arises some questions...
Once I need:
- change color of key while mouse click is on at these key
that's easy on its own, get the pointer from the output of [struct] when you click on it. use it to change the color with [set ...... color].
- once mouse click is on, and mouse cursor move around the gop area,
the keyboard will respond. Like a finger pressing and moving around a real keyboard. 3. the key are velocity sensitive around y axis at first click.
I'm thinking to map the gop are, create a system of coordinates to draw keyboard and using [cyclone/mousestate] and/or only [iemguts/receivecanvas].
In this way maybe is better implement the João suggestion of parameterize the template and implement the keys with more points and implement the control with a gop coordinate system.
you can't click and drag on data-s, so your other idea is better (and get the pointers to make the display look accordingly). Once I did a sampler what I had an horizontal line of marks indicating places in a sample; also using [mousestate] to get the mouse actions (position in window + clicks) I could extrapolate where I was in the window, and what should sound.
Joao