Monday, April 8, 2013

STRUCTURE SYNTH BASICS - HOW TO USE YOUR BRAIN

I enjoy fiddling with Structure Synth as a mental exercise.  I noticed in some of the examples a certain lack of elegance, and in the course of figuring out how things work I decided to clean up something I thought was executed in a shockingly crude way - building a hollow box. 

Here is the script, showing how to do the same thing in a more elegant way.  This can be applied to almost anything in life.  You can hammer away at it or you can stop and think.

// Two ways to build a hollow box:
// 1: brute force - define and locate
// each member

rule frame {
{ s 0.1 1.1 0.1 x 5 z 5 } box
{ s 0.1 1.1 0.1 x 5 z -5 } box
{ s 0.1 1.1 0.1 x -5 z 5 } box
{ s 0.1 1.1 0.1 x -5 z -5 } box

{ s 1 0.1 0.1 y 5 z 5 } box
{ s 1 0.1 0.1 y 5 z -5 } box
{ s 1 0.1 0.1 y -5 z 5 } box
{ s 1 0.1 0.1 y -5 z -5 } box

{ s 0.1 0.1 1 y 5 x 5 } box
{ s 0.1 0.1 1 y 5 x -5 } box
{ s 0.1 0.1 1 y -5 x 5 } box
{ s 0.1 0.1 1 y -5 x -5 } box
}

{ y 2 } frame


// 2: Use the program:
// create two frame members

rule mem {
{ s 0.1 1.1 0.1 x 5 z 5 } box
{ s 0.1 1.1 0.1 x -5 z 5 } box
}

// make them into a square

rule sq
{
mem
{ rz 90 } mem
}

// make two squares and two sets
//of frame members into a hollow box

rule frame2
{
sq
{ z 1 } sq
{ rx 90 y 1} mem
{ rx -90 y -1} mem
}

// Here they are in a row.

mem
{x 2 } sq
{ x 4 } frame2


No comments: