Re: Binary sequencer with data structures Re: Input binary values by mouse
Simon Iten <[email protected]> Fri, 20 Feb 2026 02:25:51 +0100
| Newsgroups | gmane.comp.multimedia.puredata.general |
|---|---|
| Message-ID | <[email protected]> |
I was able to resolve all my issues for now. Thanks. The main problem was, that I made the polygons scalable from left and right and when I positioned a new event and shortened the beginning of the polygon instead of the end, the pointer coordinates did not correspond to what I saw in the score. I changed it so I can only shorten an event at the „tail“ and move it around… Thanks again for your insights! > Am 19.02.2026 um 22:50 schrieb Simon Iten <[email protected]>: > > Thanks for your insights! > >> Am 19.02.2026 um 19:30 schrieb João Pais <[email protected]>: >> >>> I had a go with data-structures and hacked something up with the great examples in the PD help (particularly 04.append.pd and 09.sequencer.pd from 4. data.structures). Find attached my WIP >>> >>> I am struggling to get the duration of the sequences right. If somebody with knowledge of data-structures, and the examples could have a look I would be very thankful. Currently I just have two „lanes“ of data, each lane triggering an oscillator on and off, this is just for debugging. >>> >>> What works: >>> >>> The UI for the most part, but I am not sure if my „trick“ with forcing the y position of segments is advisable. >>> The onset of segments is correct and the tempo can be adjusted correctly >> - if you change the y creation parameter in [pd stuff] to match the height of both lanes, you don't need to click there to "move" the scalars. >> > I am aware of that and would consider this implementation a feature, since a newly created event can immediately be seen, but that is just me :) >> - or use any of the externals to detect mouse clicks on the canvas to add the scalars in the correct x+y positions (iem or else should have something) >> > Will look into that >>> What does not work: >>> >>> -the duration (length of drawn segments in my UI) is not exactly linked to the sequenced time. Hence an overlapping segment in the UI can still cut-off before the next segment begins or vice versa. It depends on the tempo that is set. I am not sure how I can link the length of the bars (the z variable in my struct) to the time set by the tempo numbox. The delay simply delays the next pointer lookup, which is the next start of an event. I somehow need to link the length of the polygon drawn at that pointer to the delay. In my first attempt I simply multiplied the length by the delay-time (as in the rest of the sequencer patch) but that does not work correctly. >> I would myself use a different concept from the ground up: >> >> - y defines the frequency (you can adjust the canvas y value to adjust the overall graphic) >> >> - instead of having 2 general osc~, make a poly or clone with enough "voices", so that each has a parallel sound generator, which is activated by the list of parameters (specially y). z defines the delay/duration to switch off the generator. together with the previous suggestion, this will open you to many more options. >> > The sequencer will be used to control 8 relays on a RPI4, the osc~ were just a quick debugging solution to post on the forum... >> - if you're not changing anything during the playback, probably you don't even need the sequencer patch, it's enough to read all scalar data and feed it to a [text sequence] object. Playback goes through the [text]. >> > Thanks for that suggestion, I will investigate this seems indeed easier. >>> -I would like to implement a timeline i.e. a hslider that increments position along the x axis, but again I have no idea how I would link the time set by the numberbox to the position so it actually corresponds to the drawn polygons… >> in my patches (mainly on my click tracker patch) I use data structures to add a timeline (struct with a symbol, and drawsymbol+draypolygon), and also a playback line (vertical line with x, that gets fed from a [line]). You can see all that if you download the click tracker, but you might not be able to decypher the patch. >> >> I'm not sure what's better, to make the timeline stable and redraw/rescale everything else, or to make the scalars stable and redraw/rescale the timeline. I myself prefer the first (specially when connected to the playback line), but I don't use that on a patch where I change tempo often. >> >>> It could also well be that this is not possible this way, then a short message would also be great :) >> it's possible :) >> >> joao >> >>> Thanks >>> >>> Simon >>> >>> >>> >>>> Am 18.02.2026 um 23:20 schrieb Simon Iten <[email protected]> <mailto:[email protected]>: >>>> >>>> Hi list, >>>> >>>> I am looking for a way to input binary values via mouse input. >>>> >>>> Basically I want a sequencer like structure to turn on and off a bunch of relays on a RPI. >>>> >>>> It would be nice to use something like an array for each output, so the user can draw in the state of the output over time. >>>> >>>> For that it would be great to only allow inputs that are: >>>> >>>> 1) in range (so mouse-movement outside the object does not draw outside the visible array, but constrains to the max or min) >>>> 2) round the values to only integer input, in my case 0 and 1. >>>> >>>> An array would be nice since it would allow very fast (no clicking needed) entry of many points and the state of each output would immediately be visible… >>>> >>>> Maybe there is some external that allows something like that? >>>> >>>> Thanks for any hints >>>> >>>> >>> >>> >>> --- >>> [email protected] <mailto:[email protected]> - the Pure Data mailinglist >>> https://lists.iem.at/hyperkitty/list/[email protected]/message/3GSEBM3ODAGK3ZMDNDJ75NPBPZ7X4SBK/ >>> >>> To unsubscribe send an email to [email protected] <mailto:[email protected]> mailing list >>> UNSUBSCRIBE and account-management -> https://lists.iem.at/ >> -- >> Audre-Lorde-Str. 26 >> 10997 Berlin (Deutschland) >> Tel +49 30 74921288 | Mob +49 176 98476769 >> [email protected] <mailto:[email protected]> | https://www.facebook.com/jmmmpais >> --- >> [email protected] <mailto:[email protected]> - the Pure Data mailinglist >> https://lists.iem.at/hyperkitty/list/[email protected]/message/DF4UY5VTXME3CLUNMMU7BF47SQ64ZBZF/ >> >> To unsubscribe send an email to [email protected] <mailto:[email protected]> mailing list >> UNSUBSCRIBE and account-management -> https://lists.iem.at/ --- [email protected] - the Pure Data mailinglist https://lists.iem.at/hyperkitty/list/[email protected]/message/73HNAF4DMM3TMSXSZ75NHN2SEAGIB2JU/ To unsubscribe send an email to [email protected] mailing list UNSUBSCRIBE and account-management -> https://lists.iem.at/