rumblesan patch-a-day - data structures

Upload: barbara-drnac

Post on 07-Aug-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    1/22

    Patch-a-Day November 2011 – Day 14 – Data Structure Basics (part 1)

     Posted in Patch-A-Day , Pure Data - 16 November 2011 - No comment

    Starting at the beginning with data structures. There’s a lot to take in, but it’s pretty cool once you get down to it. I found the old patches I wrote when I was getting to grips with it all thefirst time round which is pretty helpful but this time I’ll actually write things down heh.

    First up, you can think of Data Structures in PD as lists of items, where each list has a specific

    name, and the items they contain can be floats, symbols, arrays, or a list of other datastructures. To naigate around these lists you use pointers, which literally !ust point to aposition on the list.

    "hen creating a patch that uses data structures, there are three parts that really make thestructure. These are a template, a struct and a datawindow. The template is a subpatch thatcontains a struct. The struct defines what data the structure contains and the datawindow willcontain the data.

    The data is stored as an ordered list of scalars, where a scalar would contain an entry for eachof the alues defined in the struct. The lists are naigated by using pointers, one of the PD datatypes, that literally !ust point to a single scalar in the list.

    #ets hae a look at a patch to try and clear some of this up.

     Basic data structure

    In the top left are the three ob!ects that make up the data structure. The template$ subpatchcontains a single struct ob!ect. The struct defines a structure called struct$ with a single field,the float a. The datawindow$ subpatch has no ob!ects in it. %ne thing to note at this point, thename of the struct has to be uni&ue throughout PD otherwise you’ll get an error being thrown,

    the same goes for the datawindow.'ow that the data ob!ect has been constructed, we need to add some data to it and we can dothis using the append ob!ect. This takes a pointer into its rightmost inlet and then the alues tostore are entered using the other inlet. (ppend is gien the name of the struct that it will bemodifying and also an argument for each alue in the struct we want to modify. If you hae a

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=380.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=380.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=380.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=380.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=380.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=380.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    2/22

    struct with multiple alues then you don’t need to modify all of them.

    The pointer ob!ect gets gien a message to tell it which datawindow it’s pointing to and then abang to get it to output the alue of its current pointer. "hen we first initialise it with atraerse message the pointer will point to the head of the list. This isn’t actually a scalar but isthe position in front of the first scalar element so any alue appended to it will get added afterthis. The pointer goes to the append ob!ect to tell it where it will be appending the alues.

    Sending the pointer a ne)t message will get it to moe to the ne)t scalar in the list, to begin

    with that will result in an error because there aren’t any other alues, but if there were itwould mean we could append after any position in the list.

    The append ob!ect will increment the pointer it has itself, so all that’s needed is to send it thepointer then send whateer alues we want to store in the left inlet.

    To retriee them you can use the get ob!ect. This works in a similar way to append with thearguments tell it what struct and what alues it’s dealing with and the pointer telling it whichscalar to retriee. This time it’s necessary to step through manually and you can do that withne)t.

    *ere’s an e)ample of how easy it is to e)tend this to more float alues if you want.

     Data structure with multiple values

    'ot sure I’ll be able to get another post out tonight unfortunately, relearning this stuff has beena bit of a crash course and took longer than I e)pected. +ither way, I know the direction I’ll beheading with this oer the ne)t few days so I shouldn’t hae any problems working out what Iwant to patch.

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    3/22

    Patch-a-Day November 2011 – Day 15 – Data Structure Basics (part 2)

     Posted in Patch-A-Day , Pure Data - 18 November 2011 - No comment

     (pologies for missing yesterday, I was at the #ondon *ackspace for the weekly music hackersmeetup that’s been gathering steam and I find that now I know a few more people there I&uickly get sucked in and don’t get around to working on the patches like I should be.

    I’e also realised that, unlike last time I did the patch a day month, I hae a lot more pro!ects

    and a fair bit more socialising going on. So I think I’m going to not worry too heaily aboutgetting a new patch done eery eening and instead !ust concentrate on getting them done in atimely manner and making them good. That said, Patch-a-day-ish onth plus some days/doesn’t hae the same ring to it.

     (nyway, onto the patch for tonight. 0etting data from specific positions in a data structure list.

    Getting specific values from a data structure

    The left hand side is the template, struct and data window which should be familiar to you now.The right hand section can be used to automatically fill a data structure list with some data. Itsets the pointer to the head of the list and sends it to the append ob!ect. Then it increments acounter using the until ob!ect and gies each of these alues to the append as data, &uicklyfilling it up.

    The central section is the important part here. It takes an integer and then outputs the aluestored at that position in the data structure. To do this, first the pointer ob!ect is gien atraerse message, setting it so that it points to the head of the list. The until ob!ect then sendsout the specified number of bangs which trigger ne)t messages, incrementing the position ofthe list pointer.

    1ecause we only want the specific alue and not all the alues, the pointer alue that comes outat each ne)t message is stored in a second pointer ob!ect. These work pretty much like floatob!ects where a alue passed into the right inlet is stored but not output. %nce the until hasstopped the alue from the second pointer is output to the get ob!ect which puts out our alue.

    It’s worth mentioning the bang ob!ect hanging off the first pointer. This is so that if we gie a alue greater than the length of the list we won’t get errors being printed out. "hen the 2ne)t’messages cause the pointer to hit the end of the list it will output a bang from the right outlet,this is sent to the until to stop it running so we end up !ust getting the last alue.

    'e)t stop is setting specific alues in lists, then I’m going to start tackling some of the isualstuff you can do.

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=387.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=387.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=387.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=387.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=387.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=387.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    4/22

    Patch-a-Day November 2011 – Day 16 – Data Structure Basics (part )

     Posted in Patch-A-Day , Pure Data - 19 November 2011 - No comment

    I almost think that tonight’s patch and last nights should hae been rolled together into onepost but I’e also been thinking that some of these post can suffer from being too long and I’dprefer to hae a greater number of smaller, more understandable posts.

    This time I’m looking at the set ob!ect, but in truth there’s really not much too it.

    Setting values for specific data structure items

    The set ob!ect is located at the bottom of the patch and is really !ust a slightly modified ersionof the get section. The until ob!ect gets gien a alue, it increments the pointer to that positionin the data structure list and then the alue can easily be updated. This idea of incrementingpointers to get to specific places in a data structure is pretty important to grasp I feel.

    I’m going to do one post on using the graphical capabilities of the data structures ne)t but I’monly planning to spend a single post on it for the moment. %ther possibilities to play with Ithink.

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=389.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=389.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=389.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=389.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=389.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=389.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    5/22

    Patch-a-Day November 2011 – Day 1! – Data Structure Basics (part 4)

     Posted in Patch-A-Day , Pure Data - 19 November 2011 - No comment

    Drawing basic polygon shapes with the data structures is actually pretty easy it turns out. Thisis one of the things that had confused me the first time I looked at it but haing spent themorning reading up, it turns out it’s not that tricky. *ae a look at the patch below first of alland then I’ll run through what it does.

     Drawing polygons with data structures

    The top left section with the border is the contents of the template$ subpatch. There’s a structwhich defines eight float alues, and a filledpolygon ob!ect with a bunch of arguments, most ofwhich match alues in the struct. #ooking at the main patch, the collection of ob!ects here willfill the data window with some number of struct$ ob!ects. These ob!ects will hae randomnumbers for si) of their eight alues, with the other two, ) and y, defaulting to 3ero.

    The filled polygon ob!ect is what does all the work here. It tells PD that in the datawindow wewant to draw a polygon with a certain number of points, a specific centre colour and a borderwith a specific colour and thickness. The argument order is 4

    $. Internal colour in 501 alue.

    67 here means 767 which translates to medium green

    8. 1order colour in 501.

    $ here means ery dark blue

    9. 1order width in pi)els

    :. #ist of points to !oin as ;),y< coordinates

    In this patch, the coordinates are actually alues stored in the struct. This means that anypolygons drawn will hae three edges, with points at ;)a,)b

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    6/22

     Polygons in data window

    Fie green triangles with black borders, each of them representing a scalar in our datastructure. The cool part about this is that if the patch is locked, when you can select one of thepoints on a triangle and moe it around this will affect the data in the struct. ?sing this it’s

    possible to create some &uite interesting user interfaces and ways of more simply manipulatingcomple) data sets. To see the alues of the scalar that defines the shape, right click on it andselect properties.

    %ne last thing to point out. In the struct there are two float alues called ) and y. These areactually special and are used to set the oerall position of the shape. ?nlock the patch, select ashape and then moe it around. This will only affect the ) and y alues, not the position alues.

    *opefully you’e grasped eerything that’s happened so far with the data structures, if not goback and hae a read of the preious posts. I’e actually found learning the polygon drawingstuff to be &uite interesting so I might come back to it at some point. For the ne)t couple ofdays though I want to start building a data storage and preset system. It’s something that

    should end up being pretty useful and I’e been meaning to get to it for a while.

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    7/22

    Patch-a-Day November 2011 – Day 1" – Data Structure Basics (part 5)

     Posted in Patch-A-Day , Pure Data -  21 November 2011 - No comment

    %k, not &uite done with data structures yet. I realised that I should probably go oer how youstore symbols and arrays in a data structure. Tonight it’s a &uick post on symbols, I’ll try tocoer all of arrays tomorrow.

    The first thing to know is that storing symbols in a data structure is almost, but not &uite like,

    storing floats. >ou can’t actually use the append ob!ects to create a new scalar with a symboldirectly. >ou instead hae to create the scalar, then set the symbol element once it’s made. Thisfeels really kludgy to me and I’m going to be doing some inestigating to see if there’ssomething I’e missed. 1ut this appears to be the way it’s done.

    Storing symbols in a data structure

    The struct we’re dealing with defines a float and a symbol. I realised that you need to hae a

    float as an element in the struct because otherwise I can’t see a way to create a new scalar. Theset ob!ect can only update alues, not create new scalars. So the append ob!ect is used tocreate some scalar entries in our data structure. The set ob!ect can then be used to update the alues for our symbol.

    'otice that there’s now a -symbol flag there. This means the set ob!ect will accept symbols 1?Tcan only accept symbols. There would need to be two different set ob!ects now, one to set the alue of a, the other for b.

    The get ob!ect still works e)actly the same, the outlet for a sends out its float, b sends out it’ssymbol.

    I realised that symbol storage is actually pretty important, mostly !ust so in a preset storagesystem you can gie names to the presets. The array storage I’m still working on at the momentthough it’s not too much more comple). Patches will be with you tomorrow.

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=395.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=395.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=395.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=395.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=395.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=395.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    8/22

    Patch-a-Day November 2011 – Day 1# – Data Structure Basics (part 6)

     Posted in Patch-A-Day , Pure Data -  22 November 2011 - No comment

     (rrays in data structures are a little tricky it seems. 'ot too tricky, but they re&uire a couple ofe)tra ob!ects and like symbols, it seems that you can’t hae a scalar with !ust arrays. This isbecause to modify an array field in a data structure scalar, you need to first create that scalar,and you can apparently only create a scalar using a float sent into an append ob!ect. If I’e

    got this wrong then someone feel free to tell me. (nyway, there are three new ob!ects to use with data structure arrays, setsi3e and getsi3eshould be pretty obious, element maybe not so much. *ae a look at the patch and I’ll gothrough what’s going on.

     Array manipulation in data structures

    There are now two templates in the patch, each of which contains a struct. The first struct iscalled struct $, it defines a float field called a, and an array field called array$. "hen definingan array it’s necessary to gie a third argument which is the name of a struct that will hold the

    array information. That second struct is held in the second template, is called testarray and hasa single field, y.

    Two things worth pointing out here. First, you can draw arrays in data windows like we didwith the polygons, and like with the polygons, the field y is special. This is the alue that will beused to draw the height of the polygon. This actually leads into the second point, the structthat’s used to define the array is really !ust a normal struct, and so can store data in the sameway. If you download the repository then there’s a second patch called nested structures,where this second array has another float field and a symbol field. This should e)plainsomewhat why the y field is special, because it’s !ust the same as with regular polygons anddata structures. In short, a data structure array is actually !ust an array of other nested data

    structures.In the top right of the patch there’s an append setup. This is !ust there so that when the patchloads a new scalar ob!ect is created in struct $. This needs to be done because to operate onthe array, we hae to hae an array in the first place.

    1elow this is the interesting stuff. First a pointer ob!ect is told to traerse the datawindow and

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=397.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=397.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=397.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=397.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=397.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=397.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    9/22

    then increment onto the first scalar element, the one created aboe. This goes to a setsi3e andgetsi3e ob!ect which, unsurprisingly, set and get the si3e of the array. (ll arrays hae aminimum of one scalar element.

    The pointer also goes to the element ob!ect, which has arguments pointing it to the datastructure struct$, and the field array$. This ob!ect takes a float in the left inlet and will sendout a pointer to that position in the array. It plays the role of the until @ counter setup we’epreiously used to get to specific scalars in a data structure. 1ear in mind that you can only geta pointer to a scalar in the array that e)ists, so better increase the si3e of the field usingsetsi3e.

    The pointer from element can be passed to set and get ob!ects which work e)actly like they dowith normal data structure scalars.

    *ae a play and inestigate, it’s pretty much the best way to get a grasp of what’s going onhere. %nce you hae it howeer it should be pretty useful, especially with the preset patchesthat I will get to tomorrow.

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    10/22

    Patch-a-Day November 2011 – Day 20 – Preset savi$%

     Posted in Patch-A-Day , Pure Data -  23 November 2011 - No comment

    Preset saing, done the simple way.

    "ell, maybe not that simple, this isn’t some magical system that can be used like a)SP’sautopattr system, but it should gie a fair degree oer the saing, loading and control ofpresets in PD. I’e dug out the synth oices patch from Day 9 again and I’m going to be

    modifying the control abstraction so that that also stores the presets. This should again showthat a nicely arranged and abstracted patch is a good thing which allows you to modify ande)tend without messing things around. *ae a look at the main section of it.

    Control abstraction with presets

     (ll that’s actually added here is a couple of e)tra control, a loadbang to set the preset numberand a small subpatch called preset. It’s the internals of this that are what’s interesting.

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=401.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=401.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=401.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=401.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=401.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=401.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    11/22

     Preset saving patch

    First things first, the section on the right is there to create the ten scalars we’ll be saing ourpreset alues in. (t the moment this clears the window on start up and creates ten new scalars.This isn’t really that useful if we want to hae our presets saed with the patch itself, but this is !ust temporary while we build it so ignore it for now.

    The data template and data window patches are contained here, both with names to make surethey’re uni&ue throughout the patch. The data structure has a float field for each of thesettings we’re saing ;and an e)tra one here called number which isn’t actually needed, I !ustforgot to take it out

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    12/22

    Patch-a-Day November 2011 – Day 21 – Preset &oa'i$%

     Posted in Patch-A-Day , Pure Data -  25 November 2011 - No comment

     (nd now for the patch to load alues out of the saed preset and into our settings. This mightseem a little under whelming because there’s not much to it, but a lot of the work was alreadydone by the infrastructure already in place.

     Preset value loading 

    I made a change to the preious section so that the pointer alues won’t be calculated until youhit the load or sae buttons. %therwise you’re !ust adding in a bit of needless oerhead.

    The loading is een simpler than the saing, the preset patch number is selected, the loadbutton pressed and the until ob!ect is used to calculate the pointer position. This pointer thengets sent to a get ob!ect which retriees the alues we want from our data structure scalar. The alues then get sent straight to the gui elements in the aboe patch.

    Simple, but pretty effectie.

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=405.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=405.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=405.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=405.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=405.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=405.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    13/22

    Patch-a-Day November 2011 – Day 22 – Preset i&e savi$%

     Posted in Patch-A-Day , Pure Data -  2 November 2011 - No comment

    The preset loader is working pretty well, but at the moment it’s limited to only saing presetswithin one PD session/. If we close and then reopen the program then all our presets are lost.To make this really useful, you need to be able to sae the data structure info and hae itloaded up ne)t time you start the program up.

    #uckily Pure Data allows you to sae the data structure information to a file and then read itback in later, and we can use that to make our preset information usable between sessions.*ere’s the updated preset ob!ect.

     Preset data structure files

    The patch now has a third inlet that can be used to gie clear, file load or file sae commands.The clear command is !ust the initial blank patch loadbang setup that has always been in thepatch. This means we can clear all the presets and reload ten blank presets if we want.

    The fileload and filesae commands will gie a symbol to a makefilename ob!ect. This will gieus a filename in the format preset*$ame+,p'c actually saing or loading the data to andfrom the file is as simple as sending a read or write command to the data window patch. *ereI’e had to get the B7 alue worked into the setup but that’s only necessary if your data windowuses it.

    So now we can sae presets between sessions, hae multiple abstractions load and sae to asingle file and can start making some much easier to use performance patches.

    %ne thing to note that I’e found. In the file containing the data structure data it has the nameof the data window it was saed from. "hen you reload the data from the file, if the nameinside the file matches the data window you load into you’ll get a multiply defined/ error. This

    doesn’t seem to cause any issues, but I mention it to stop any confusion.

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=408.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=408.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=408.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=408.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=408.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=408.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    14/22

    Patch-a-Day November 2011 – Day 2 – e$eric Preset abstractio$s

     Posted in Patch-A-Day , Pure Data -  2 December 2011 - No comment

    1ack on the case finally. Too many things on the go and fairly behind on Patch-a-Day. I’mplanning on getting &uite a few patches built this weekend so I should be finished with the 97days by mid way through ne)t week, hopefully.

     (nyway, this eenings patch is an e)tension of the preset saing that we’e been looking at. I

    realised that actually it was ery easy to moe the get and set ob!ects into their ownabstractions for each preset alue you’re interested in saing. It’s using the same sort ofpassthrough design I’e talked about and it results in much less clutter and much more usefulcode I feel.

     Individual preset parameter abstractions

    The bottom section is what’s actually in the preset-param abstraction. This time the loadingand saing are being triggered by a pointer sent into either the left side for saing, or the right

    side for loading. The param ob!ects still get and set their alues using the send and receieob!ects and now it’s ery simple to add more parameters to store in our preset.

    I’m probably going to turn the file loadingCsaing and structure clearing section into anabstraction as well, at which point this should all work as a fairly generic solution. There are afew other things I think could be added but I’m probablly going to be leaing this for the timebeing.

    I’e decided oer the weekend I’m going to build up a se&uencer based on my 'oationlaunchpad and using the data structure and preset stuff I’e been learning. Tomorrow is a newday, full of patchingA

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=411.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=411.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=411.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=411.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=411.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    15/22

    Patch-a-Day November 2011 – Day 24 – Step Se.ue$cer Basics

     Posted in Patch-A-Day , Pure Data - 3 December 2011 - No comment

    I’e !ust noticed I think I missed out a day somewhere. This patch is patch 8= in myrepository, but it’s day 8:. #ooks like I made a patch titled Improed presets and haen’twritten it up but oh well. I might go back and slot it in if I think it’s missed out anything ital.

    %n with the step se&uencer for the moment though. I’m designing this to run on my 'oation

    #aunchpad, the plan being to hae eight tracks with 6:steps each. Track selection will be doneby the left hand row of function buttons and all track steps displayed on the grid. The firstthing to do is work out how the pattern will be stored, and I’e decided that the data structuresare the right way to go about doing it. 1elow is the beginnings of the patch.

     Beginning of the data structure sequencer 

    Structure and datawindow patches in the top left corner, struct has eight float fields named ato h. The central section !ust clears our window and creates the data for the 6: steps. Thesection on the right is !ust to that I can write out the data to a file for debugging and won’t bethere in the final patch.

    The group of daisy chained ob!ects on the left hand side are dealing with saing and loadingthe data about indiidual tracks. The left hand inletsCoutlets deal with setting indiidual stepsfor specific patterns. The middle is so the ob!ect can receie a pointer to a specific step andload the alue from it, the right hand inletsCoutlets are where this data comes from. For themoment only the saing works, though the loading doesn’t need much more done.

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=413.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=413.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=413.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=413.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=413.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    16/22

     Basic trac abstraction

    I’e realised that in patch comments are probably a good idea heh, so I’e started adding them. (s they show, the creation arguments for the abstraction are the name of the data window, thename of the struct and the name of the field to set or get.

    %ne of the things I decided for this was that the functionality for getting the right pointer whensetting a alue should be inside the abstraction, but when getting the alue the pointer shouldcome from outside. y reasoning was that when getting the alue from a step we’re actuallygoing to want to get the alue from all the steps and, because they would all use the samepointer, it would be wasteful to repeat that functionality. "hen we’re setting a alue we’reusually !ust doing it for one track so it’s simpler to contain that inside the abstraction.

    The abstractions all use the passthrough design so when a message comes into the left handinlet it is routed to the correct place by checking for the field name. From here the stepposition triggers a standard traerse-EuntilEne)t style setup and then the alue is set using theset ob!ect. Try sending some messages in and then saing the data to a file so you can hae alook. This works pretty well and should mean the entire se&uencer itself will be pretty compact.

    Tomorrow I’ll get the the retrieing side of it done, then time to start on interfacing it with thelaunchpad.

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    17/22

    Patch-a-Day November 2011 – Day 25 – Step Se.ue$cer /&oc 

     Posted in Patch-A-Day , Pure Data -  ! December 2011 - No comment

    %, carrying on from yesterdays patch, lets get the stepping and clock for the se&uencer.

    Sequencer cloc and output 

    The setup here is really pretty simple, but there’s a couple small things to note. I’m routing forclock and reset messages, !ust to make things obious when youGre controlling the se&uencer.The reset message gies the pointer a traerse message which resets it to the head of our listof scalars. The clock message will trigger a ne)t message to be sent to the pointer which willthen send it’s alue to the series of daisy chained ob!ects. This will cause all of them to output

    their alues and they can be seen printed out to the console.The trigger ob!ect is there because of how the pointer deals with coming to the end of a list.The pointer will output a bang, upon receiing a ne)t message once it has already output thelast list element. we want that final bang to send it back to the beginning, andthen immediately output the first list element. To do that, when the pointer sends out its bang,it first triggers a new traerse message, and then triggers another ne)t message, meaning thefirst step alues get sent out.

    'e)t I’m planning to neaten this up a bit, and then we can start dealing with #aunchpad input.

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=418.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=418.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=418.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=418.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=418.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    18/22

    Patch-a-Day November 2011 – Day 2! – au$chpa' se.ue$cer 

     Posted in Patch-A-Day , Pure Data - 5 December 2011 - No comment

    5ight, time to hook the launchpad up to the se&uencer. I’e modified the #aunchpad I%abstraction to neaten it up and make it actually deal with output and input. The se&uencerpatch has been changed so that incomng grid messages are conerted to a stop number andthe mode buttons select the track number to update and the main clock is now on the outside.

    #et’s run through them and I’ll e)plain a bit about what’s going on.

     !irst launchpad sequencer 

    The se&uencer is now the steps abstraction and the first argument tells it how many steps wewant to hae. The basic metro clock is still there, entirely unchanged. The launchpadHioabstraction now takes the channel as an argument as well. (ll simple and a bit dull.

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=426.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=426.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=426.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=426.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=426.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    19/22

     Improved launchpad I"

    The launchpad I% now !ust deals with outputting the IDI in messages and sending the IDIout messages. (ll I% goes through a single inlet or outlet and all messages are prefi)ed witheither grid, mode or ctl to show where it’s from or going to. There’s also the reset option

    aailable which sends the clear message.

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    20/22

    #pdated step sequencer 

    The step se&uencer now has a bit more functionality. It takes the input direct from the

    launchpad and pulls out the grid and mode button messages. The mode messages controlwhich track we are updating and do that by pre-pending the track name onto the front of thegrid message. The tracks then route for this as they do normally. 'ote the spigot on the modesection, this is there so that only button on messages get through. "e don’t actually care aboutbutton off messages here so we !ust stop them coming through.

    The grid messages are conerted from their > format into a single alue that gies the stepposition. (t this point it may be clear that there is a problem with the current setup. The gridbuttons also hae button up and down messages coming through, so when we press a buttonthe 1 alue gets stored, but as soon as it’s released the 0 is stored oer the top of it.

    For the moment I’ll let you think about how you might sole this, tomorrow I’ll show you how I

    do it.

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    21/22

    Patch-a-Day November 2011 – Day 2# – au$chpa' &i%hts

     Posted in Patch-A-Day , Pure Data -  December 2011 - No comment

    Sending output to the launchpad is pretty easy. Sending the right output, in a way that’s easilyconfigurable and fits in with the standard is a little trickier. I’e had more of a read of the#aunchpad programming guide and hae a better handle on the double buffering and so on andI’ll put some of that into practise here. The updates to the se&uencer here are, I feel I should

    point out, as pretty or high performance as they could be. There’s definitely a lot moretweaking needed.

    %ne of the things I’e found a bit of a problem is sending the large number of update messagesto the launchpad. There’s a slow down in PD whilst it’s going. I don’t know if it’s due to theIDI output, or !ust trying to send a mass list of 6: messages and needing to make the processmore efficient but more inestigation is needed.

    Step sequencer trac with light output 

    This is the updated track abstraction with the output for the light states. The left hand sectionthat updates the data structure will now also send out a message with the new alue of theupdated step. The right hand sections are for dumping out the state of all the steps in the datastructure. This is used when changing tracks as we want to update the launchpad with the new alues and clear the old ones. 1y dumping out the state of all on or off steps we clear the olddata and fill the grid with the new. This could be made more efficient by first clearing the grid,then !ust sending the steps that are on but i decided this is initially simpler to deal with.

    http://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=435.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=435.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=435.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=54.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-cat=25.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=435.htmhttp://h/INSTALL/Sound/Apps/Pd%20-%20PureData/_docs%20-%20Tutorials%20&%20Other/www.rumblesan.com%20(Teleported)/www.rumblesan.com/-p=435.htm

  • 8/21/2019 Rumblesan Patch-A-Day - Data Structures

    22/22

     !ull sequencer with light state output 

    The main se&uencer section has been updated as well to parse the data now being output bythe tracks. The ob!ects right at the bottom will take the step messages, conert the step

    number back into the > coordinate and change the $ or 7 alue into the correct note elocityfor the colour we want. The clr abstraction works differently now !ust to point out. It takes twoarguments, one is the colour alue to send out when it gets a $ input, the second for when itgets a 7 input. I’m following the #aunchpad programming guide by sending out a alue of $8for off. This apparently makes it easier to add in double buffering later which might well benecessary.

    There’s also a small section in the middle at the top that sends out the light onCoff messages forthe mode lights. The tracklight patch !ust keeps track of the current track number and, whenthe track changes, will send out an off message for the old button and an on for the new one.

     (s I said, there’s actually a fair bit of work that needs to happen on this to make it fast enough

    but it’s not bad as a start. I’ll probably concentrate on tacking on the drum sounds for the ne)tpatch-a-day and then call it finished for the moment.

    That will also actually be my last patch-a-day patch for this round. I’m going to be continuing