Clapping music: Difference between revisions

From XPUB & Lens-Based wiki
No edit summary
No edit summary
Line 30: Line 30:
     }
     }
}</source>
}</source>
The trivial bashified version, note the need to escape (backslash) the $s.


<source lang="bash">
<source lang="bash">
cat << END
cat << END
@head {
@head {
     $tempo 120
     \$tempo 120
     $time_sig 4/4
     \$time_sig 4/4
}
}
@body {
@body {
     @channel 1 {
     @channel 1 {
         $patch 1
         \$patch 1
         $length 16
         \$length 16
         $octave 4
         \$octave 4


     c c c r c c r c r c c r
     c c c r c c r c r c c r
Line 49: Line 51:
     }
     }
     @channel 2 {
     @channel 2 {
         $patch 2
         \$patch 2
         $length 16
         \$length 16
         $octave 7
         \$octave 7


     c c c r c c r c r c c r
     c c c r c c r c r c c r

Revision as of 12:22, 12 October 2010

See Bash for help with loops & variables

Template for midge, each channel is one of the parts.

@head {
    $tempo 120
    $time_sig 4/4
}
@body {
    @channel 1 {
        $patch 1
        $length 16
        $octave 4

    c c c r c c r c r c c r
    c c c r c c r c r c c r


    }
    @channel 2 {
        $patch 2
        $length 16
        $octave 7

    c c c r c c r c r c c r
    c c r c c r c r c c r c


    }
}

The trivial bashified version, note the need to escape (backslash) the $s.

cat << END
@head {
    \$tempo 120
    \$time_sig 4/4
}
@body {
    @channel 1 {
        \$patch 1
        \$length 16
        \$octave 4

    c c c r c c r c r c c r
    c c c r c c r c r c c r


    }
    @channel 2 {
        \$patch 2
        \$length 16
        \$octave 7

    c c c r c c r c r c c r
    c c r c c r c r c c r c


    }
}
END
for ((i=0; i<13;i++))
do
done