Tag Archives: fractal

Fractals in HLSL

Here's an interesting little shader I wrote today, initially as an attempt to render the Mandelbrot Set in real-time. Unfortunately, my attempt failed somewhere along the line, because the output set only vaguely resembled the famous Mandelbrot image. Instead of quitting, I played around with the equation and came up with some interesting, real-time morphing fractals. Couple that with a little bloom filter and color transformation, and you've got a pretty nice little image.

Pixel shaders amaze me.

Fractal Grammar

For some time now I have been thinking about using random cutting as a "base" method for a hybrid engine, using the cutting space to control the behavior of another process. These thoughts came to a head a few nights ago when, despite an enormous amount of brainstorming and coding, contour grammar failed to deliver the immediate results for which I was looking. I wasn't joking when I suggested a "fractal grammar" in the last post. Indeed, having now toyed around with implementations of the idea, I believe that this hybrid technique will capitalize on both the contextual coherence of random cutting as well as the internal consistency of grammatical systems. I will refer to the method as fractal grammar from now on.

Fractal grammar is, to put it simply, a grammar system driven by a random cutting engine (which, as discussed previously, falls under the category of fractal methods - specifically, Brownian motion). The engine first performs the same preliminary steps used in Fraccut, placing cutting blocks on the roots (or another specified interval) of each chord, then performing random cutting to subdivide the blocks. Instead of mapping the subdivided blocks directly to pitch space, however, the fractal grammar engine maps block offsets to indexes of words.

Here's an overview of the basic fractal grammar process:

  1. Create a space for random cutting
  2. Map chord progression to blocks in the cutting space
  3. Perform random cutting on the space
  4. Create a phrase (in the style of Contour Grammar)
  5. Map the cutting space to the phrase
    1. Iterate through blocks, for each:
      1. Map the vertical position (traditionally pitch offset) to the index of a word and add the corresponding word to the active phrase
      2. Map the width (traditionally duration) to the duration of the specific element of the active phrase
  6. Convert the phrase into a polystream
  7. Apply final mappings (offset->pitch, time scaling, etc.)
  8. Convert the polystream to a pattern

Note that the first three steps are precisely the steps taken by Fraccut, while the last three steps are precisely those taken by Contour Grammar.  The middle steps, then, are the most important - it is the mapping between the fractal engine and the grammar system that is most crucial to the final product.

Thankfully, fractal grammar has already produced some nice results.  Though not quite up to par with Fraccut yet, I have no doubt that the fractal grammar method, when it reaches maturity, will far surpass the abilities of random cutting and contour grammar.

Sample 15, the first in three months, will come online shortly!

Fraccut: Second Generation

After a very successful life, Fraccut has finally received a full upgrade to version 2. The key difference in the second generation Fraccut plugin lies in the implementation of the random cutting engine. While the first version used a custom random cutting engine (the first I ever wrote), the second version exploits the simplicity and power of the XIAS generalized random cutting engine.

The XIAS engine has already helped eliminate some of the strange artifacts present in Fraccut melodies generated with the old engine. The old cutting method had a few flaws that I identified as contributing to a non-uniform distribution of rhythmic and tonal patterns (that is, certain patterns occurred far more frequently than others). There was, in fact, a single rhythmic pattern that kept appearing in almost every Fraccut melody. Perhaps an observant listener will be able to discern this repeated pattern from the samples. This repetition was starting to wear on my nerves, considering the fact that I had not intended for Fraccut to maintain any stylistic coherence across multiple executions. Regardless, the new cutting modes available in the XIAS engine eliminated this strange repetition.

The increased compositional ability of Fraccut v2 has already been observed in several pieces. I am uploading Sample 12 at this very moment to showcase the new incarnation of a great plugin.