![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: Markov chains... |
JackRosete Member |
![]() ![]() ![]() I am building a new Sound within which I would like to implement some more sophisticated probability functions. I would like to use Markov chains in some form and am wondering how I can achieve this in Kyma? Simplified, the kind of thing I am thinking of here is if a particular value has just been selected by some probability code, then the likelihood of it reoccurring is decreased etc. I was thinking about a chain with several regressive steps (five or so?). Is this going to be computationally possible? More importantly, is this going to be possible to script without being a genius?! Any advice would be much appreciated! Thanks in advance, Jack IP: Logged |
SSC Administrator |
![]() ![]() ![]() In Smalltalk, you could create a collection in which the multiplicity of each element was based on the probability of that element. For example, if you wanted 'g' to have a likelihood of 0.3 and 'b' to have a likelihood of 0.7, you collection would look like this: That way, if you select an index into the collection using a uniform random distribution, you are more likely to hit a 'b' than you are to hit a 'g'. Whenever you select an index, you could *remove* the item at that index from the collection. This would reduce the likelihood of hitting that element next time. When the collection is empty, you are either finished with the piece (or you could have a check to avoid remvoing the last element). You could use a Smalltalk Script to generate your random numbers using this algorithm, saving a long sequence of these numbers that you could then use as a CapyTalk array. In CapyTalk, you would simply step through this random sequence, e.g. (!Gate countTriggersMod: lengthOfSeq) of: #(7 9 5 2 6 8 ...etc) IP: Logged |
SSC Administrator |
![]() ![]() ![]() BTW, I was just trying to come up with an algorithm for decreasing the likelihoods each time, not using Markov chains. IP: Logged |
JackRosete Member |
![]() ![]() ![]() Thanks for the reply, that would certainly be a step in the right direction, and I would feel confident in implementing it (albeit with some trial and error!), but I was hoping for something a little more like this: That out of say 16 possible options, certain are more likely to occur than others (set by !Faders in realtime), and that once an option has been selected, the likelihood of it being selected again drops down by say 75%, and then if selected again immediately, by another 25%, and then by 25% again (if it were selected again immediately etc.), inversely, after say 5 steps of it not having been selected, its likelihood of selection returns to it's original value. That way the improvisation could go on indefinitely with the same (or different) probabilities towards the end than at the beginning... I would like each of the 16 options to have a different initial relative likelihood of selection, and during each selection step, to drop in likelihood of selection by a different percentage amount (in other words, some options would drop by 50% the first time they are selected, others by 10%, others by 80% etc.). In fact, it would be great if some options with a very low relative likelihood of selection, once finally selected, actually became much more likely to be selected again for a couple of steps, after which their selection likelihood drops to it's default low value etc. I realize that I'm describing something that requires some serious programming skill. The question is whether it's about modular skill (building the algorithm piece by piece over time) or whether it requires something a lot more complex in a global sense. Also, whether Capytalk is fit for this, or whether Smalltalk would be the way to go (or perhaps many prototypes connected in a large network), or whether it would indeed be possible to do in Kyma at all? If not, then perhaps I should start learning C, so that I could build something like this as an external for Kyma or Max/MSP etc. Although I would rather avoid that if possible! Thanks! [This message has been edited by JackRosete (edited 19 December 2006).] IP: Logged |
Phi Curtis Member |
![]() ![]() ![]() Hi Jack, If you wanted to use max, you can find a bunch of objects with a search at www.maxobjects.com. I see there's a markov object in the RTC (Real-Time Composition) library by Karlheinz Essl - I'm using his brownian object in my current project. I'm sure AC Toolbox would have something as well, if you wanted to get into Lisp... I would indeed love to be able to do this kind of thing directly in smalltalk. SSC, would it be possible to generate new randomized collections as you are describing on the fly, or would you have to generate them with a script at compile time? Phil [This message has been edited by Phi Curtis (edited 19 December 2006).] IP: Logged |
JackRosete Member |
![]() ![]() ![]() Thanks for the tips Phil, I don't know much about programs specializing in algorithmic composition, I have kinda steered away from them assuming that they deal more with note events etc, where I am looking really for triggers/structural processes that can be applied to any data, and that will fit into a more sound designy context than any melodic or score driven process. Indeed, the reason I am looking into this probability code is for interactive (live) performance with my Lemur, to control different Kyma Sounds and other software/hardware. The Lemur is a great tool, but you can only really directly control a few parameters at a time before you loose control. Therefore, I would like to hand down some of these control tasks to Kyma, so that I can trigger processes and influence them in a global sense, and let Kyma dictate their more specific functionality, allowing me to be the conductor as it were, and Kyma the orchestra - almost, because I would like to occasionally be the lead violinist or harpist as well! But I will definitely check out the Max stuff as that does interest me. I have been using Max less and less lately, but this may be a good time to get back into it... [This message has been edited by JackRosete (edited 19 December 2006).] [This message has been edited by JackRosete (edited 19 December 2006).] IP: Logged |
SSC Administrator |
![]() ![]() ![]() To combine the collection manipulation with live interaction, I would recommend creating a Kyma Tool. Smalltalk has a very rich set of objects for manipulating collections and the Tool lets you fire off different blocks of Smalltalk code in response to changes in a Sound's hot values. See page 309 "Writing your own tools" in Kyma X Revealed. IP: Logged |
Phi Curtis Member |
![]() ![]() ![]() Writing Kyma tools is something I think I should get into. Especially since the overhead for running the tool would all be put on the host machine and not on the capy (I assume). Incidentally, there are some markov functions described on pages 276-277 of Kyma X Revealed, although I have not used them yet. I am getting more and more into using max interacting with Kyma. While I would never want to do a whole project all in max, I do find it useful to process incoming controllers and sending it via flame~ to the capy. My current project has max doing amplitude and pitch tracking (fiddle~ object), processing a P5 virtual reality glove and a Contour Shuttle (hi~ object), a wacom tablet,with 2 pens (wacom~), input from the computer keyboard, as well as generating random number streams (brownian object and others). The only kind of annoying thing is you have to have max in front for some of these functions to work. Phil IP: Logged |
JackRosete Member |
![]() ![]() ![]() I will look into the Tools then! I wonder what the potential of this will be? Can't wait ![]() Phil, I have actually started building GUIs for Kyma Sounds in Max with the pictctrl object and some of Max's graphical objects. That has been a lot of fun and allows me to construct more complex stuff in Kyma and yet retain a small, neat graphical front end in Max that I can control from the Lemur. I guess it would only be one step further to build some control functions into the Max GUIs The VCS has some great built-in features like the preset storage, dice, great look etc. But there are also some limitations. I would like to see a better text widget with variable font/font size, copy/paste, easier dragging and an arrow keys nudge feature. Also, if that font/font size selection could be applied to the number boxes, they could be made a lot smaller, and therefore a lot more faders could be displayed more neatly etc. Also the VCS can get pretty slow at times! p.s. Reaktor 5's graphical features are pretty amazing, I love the concept of layers within the front panel 'control surface'. For example, you might have a row of 16 switches that control the steps of an analog sequencer, above those switches, you could have four buttons for kick, snare, hats, and ride, and when you press each of those buttons, the switches below change to display the steps for each part respectively, making great use of screen space. [This message has been edited by JackRosete (edited 19 December 2006).] IP: Logged |
Phi Curtis Member |
![]() ![]() ![]() quote: I'd like to see some screenshots of those! It might give me some ideas, especially since I have to have Max in the foreground anyway. Phil IP: Logged |
JackRosete Member |
![]() ![]() ![]() I can do one better than that, I am working on a new Kyma Sound with a Max GUI, as soon as it is finished (soon) I will post it to the Tweaky with the Max patch as well. IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() ![]() |
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.