<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="pretty-atom-feed.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
  <title>ljud.org</title>
  <subtitle>Searching for a basic jazz rhythm</subtitle>
  <link href="https://ljud.org/feed/feed.xml" rel="self" />
  <link href="https://ljud.org/" />
  <updated>2016-03-22T00:00:00Z</updated>
  <id>https://ljud.org/</id>
  <author>
    <name>Johannes Burström</name>
  </author>
  <entry>
    <title>Reverse-engineering human rubato</title>
    <link href="https://ljud.org/post/2016/reverse-engineering-human-rubato/" />
    <updated>2016-03-22T00:00:00Z</updated>
    <id>https://ljud.org/post/2016/reverse-engineering-human-rubato/</id>
    <content type="html">&lt;p&gt;&lt;em&gt;This is a part of a series of posts where I&#39;m trying to explain some of the decisions made in Timmer, a solo project for double-bass and electronics.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Already when recording the source material for &lt;em&gt;Timmer&lt;/em&gt;, I knew that the material would be cut up and re-assembled. A lot of the material came to be quite sound-oriented and rhytmical, but often without a fixed tempo. So for one of the recorded tracks, I wanted to create a randomized stream of rhythmic events, based on the recording.&lt;/p&gt;
&lt;p&gt;The code is SuperCollider, and the full example outlined below is &lt;a href=&quot;https://github.com/jpburstrom/timmer/blob/237dce7a6ae89566bcf556b105089c91f8e3268f/player/test-08-random-stream.scd&quot;&gt;available on GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;audio controls=&quot;&quot; src=&quot;https://ljud.org/post/2016/reverse-engineering-human-rubato/Timmer-08-beginning.mp3&quot;&gt;&lt;/audio&gt;&lt;/p&gt;
&lt;p&gt;The first step would be to get the durations of the notes. I chose these first 18 onsets to represent a kind of rhythmic &lt;em&gt;motif&lt;/em&gt;, from which I would extract some more or less statistically insignificant data.&lt;/p&gt;
&lt;p&gt;As with all the other recordings, I did a combination of onset extraction and manual corrections in &lt;a href=&quot;http://www.sonicvisualiser.org/&quot;&gt;Sonic Visualiser&lt;/a&gt; to make a simple textfile of onset times and durations. The file was imported into SuperCollider, where I started with plotting the durations.&lt;/p&gt;
&lt;p&gt;&lt;picture&gt;&lt;source type=&quot;image/avif&quot; srcset=&quot;https://ljud.org/img/_mpYEdOyaT-764.avif 764w&quot;&gt;&lt;source type=&quot;image/webp&quot; srcset=&quot;https://ljud.org/img/_mpYEdOyaT-764.webp 764w&quot;&gt;&lt;img loading=&quot;lazy&quot; decoding=&quot;async&quot; src=&quot;https://ljud.org/img/_mpYEdOyaT-764.png&quot; alt=&quot;test-08-durations&quot; width=&quot;764&quot; height=&quot;486&quot;&gt;&lt;/picture&gt;&lt;/p&gt;
&lt;p&gt;Very exciting. Here we can see that the durations are roughly between 0.5 and 1.5, with a mean somewhere around 0.8. What can we do with this information? Let&#39;s make a test instrument and a test pattern to try it out.&lt;/p&gt;
&lt;h3 id=&quot;different-randoms&quot;&gt;Different randoms&lt;/h3&gt;
&lt;pre class=&quot;language-supercollider&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-supercollider&quot;&gt;~motif &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; q&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;player&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;data&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;onset&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;17&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;flop&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;//First 18 onsets of recording&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;SynthDef&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token symbol&quot;&gt;&#92;testDrum&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;freq&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; amp &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; sustain&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; snd &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;BPF&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ar&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;Decay&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ar&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;Impulse&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ar&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.01&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;EnvGen&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ar&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;Env&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;perc&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; sustain&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token label property&quot;&gt;doneAction&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;token class-name&quot;&gt;Out&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ar&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;snd &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;6&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; amp &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;softclip&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;dup&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;add&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token class-name&quot;&gt;Pbindef&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token symbol&quot;&gt;&#92;test_08_Pwhite&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token symbol&quot;&gt;&#92;instrument&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token symbol&quot;&gt;&#92;testDrum&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token symbol&quot;&gt;&#92;amp&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token symbol&quot;&gt;&#92;legato&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;token symbol&quot;&gt;&#92;dur&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Pwhite&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;~motif&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;minItem&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; ~motif&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;maxItem&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;play&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;audio controls=&quot;&quot; src=&quot;https://ljud.org/post/2016/reverse-engineering-human-rubato/Timmer-08-test-1-Pwhite.mp3&quot;&gt;&lt;/audio&gt;&lt;/p&gt;
&lt;p&gt;Here, I&#39;m simply trying to generate random durations between the minimum and maximum duration of the motif, which we soon realize is too random to be musical. Another try:&lt;/p&gt;
&lt;pre class=&quot;language-supercollider&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-supercollider&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; maxChange &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; ~motif&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;differentiate&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;maxItem&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token class-name&quot;&gt;Pbindef&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token symbol&quot;&gt;&#92;test_08_Pbrown&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token symbol&quot;&gt;&#92;instrument&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token symbol&quot;&gt;&#92;testDrum&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token symbol&quot;&gt;&#92;amp&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token symbol&quot;&gt;&#92;legato&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token symbol&quot;&gt;&#92;dur&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Pbrown&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;~motif&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;minItem&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; ~motif&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;maxItem&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; maxChange&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;play&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;audio controls=&quot;&quot; src=&quot;https://ljud.org/post/2016/reverse-engineering-human-rubato/Timmer-08-test-2-Pbrown.mp3&quot;&gt;&lt;/audio&gt;&lt;/p&gt;
&lt;p&gt;Switching the completely-random &lt;code&gt;Pwhite&lt;/code&gt; to a &lt;code&gt;Pbrown&lt;/code&gt;, which generates a &lt;a href=&quot;https://en.wikipedia.org/wiki/Brownian_motion&quot;&gt;brownian motion&lt;/a&gt;, makes the rhythm a bit more musical, but it still doesn&#39;t have the same vibe as the original recording. To get closer, we can use the duration data to create a stream of weighted random numbers:&lt;/p&gt;
&lt;pre class=&quot;language-supercollider&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-supercollider&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; q &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.125&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;//quantize&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; weights &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; ~motif&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;round&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;q&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;asBag&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;asWeights&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; rand &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; q &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;//randomness&lt;/span&gt;

&lt;span class=&quot;token class-name&quot;&gt;Pbindef&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token symbol&quot;&gt;&#92;test_08_Pwrand&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token symbol&quot;&gt;&#92;instrument&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token symbol&quot;&gt;&#92;testDrum&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token symbol&quot;&gt;&#92;amp&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token symbol&quot;&gt;&#92;legato&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token symbol&quot;&gt;&#92;dur&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Pwrand&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;weights&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; weights&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;inf&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Pwhite&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt;rand&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;play&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;audio controls=&quot;&quot; src=&quot;https://ljud.org/post/2016/reverse-engineering-human-rubato/Timmer-08-test-3-Pwrand.mp3&quot;&gt;&lt;/audio&gt;&lt;/p&gt;
&lt;p&gt;Here, I&#39;m rounding the original durations to 0.125, which would correspond to 1/8 in 60 bpm. The durations are counted (through converting the array to a &lt;code&gt;Bag&lt;/code&gt;, and converted to an array with durations and weights. This data is passed to a &lt;code&gt;Pwrand&lt;/code&gt;, which picks a duration with a probability according to the weights. To keep the rubato feel, I add some randomness with the last &lt;code&gt;Pwhite&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;repeating-once-or-twice&quot;&gt;Repeating once or twice&lt;/h3&gt;
&lt;p&gt;This starts to resemble the original a bit more, so we continue with some other aspects of the recording. Looking at the plot, we can see that some duration values seem to repeat once or twice. Let&#39;s do that with our random stream as well.&lt;/p&gt;
&lt;pre class=&quot;language-supercollider&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-supercollider&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;Pdef&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token symbol&quot;&gt;&#92;test_08_Pwrand_stutter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Psmartstutter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token class-name&quot;&gt;Prout&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;ev&lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;//Duration threshold. If dur &amp;lt;= 0.05, count it as a repetition&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; repetitionThreshold &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.05&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;//Make a list of booleans. Is this a repetition?&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; repList &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; ~motif&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;differentiate&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;abs&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;collect&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;_&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;=&lt;/span&gt; repetitionThreshold&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;//Number of non-repeated values&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; uniqueCount &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; repList&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;reject&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;value&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;//Repetition choices, starting at a single event, then event + rep, then event + 2x rep...&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; choices &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;..&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;//Assuming max number of repetitions is 10&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; weights &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;!&lt;/span&gt; choices&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;size&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;//Go through every boolean in repList&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; repCount &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
    repList&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;do &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;isRep&lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;
        if &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;isRep&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;//For every repetition, increment repCount&lt;/span&gt;
            repCount &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; repCount &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;//For every non-repetition, add repCount to repProb and reset repCount&lt;/span&gt;
            weights&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;repCount&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; weights&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;repCount&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            repCount &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;token comment&quot;&gt;//Normalized probability of 0-&gt;10 repeats&lt;/span&gt;
    weights &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; weights&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;normalizeSum&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

    loop &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;//According to the plot, only durations between ~0.5 and ~1 is repeated.&lt;/span&gt;
        if &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;ev&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;dur &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.45&lt;/span&gt; &lt;span class=&quot;token label property&quot;&gt;and&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; ev&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;dur &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1.05&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;//Repeat each event x times&lt;/span&gt;

            choices&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;wchoose&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;weights&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;yield&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;yield&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Pdef&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token symbol&quot;&gt;&#92;test_08_Pwrand&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;play&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;First we extract the probability of a duration being played &lt;code&gt;n&lt;/code&gt; times from the recording, where &lt;code&gt;n&lt;/code&gt; is a number from 1 to 10. Then we choose a value if the duration of the current event is between 0.45 and 1.05, meaning that short or long notes never repeat. Sounds fun.&lt;/p&gt;
&lt;p&gt;&lt;audio controls=&quot;&quot; src=&quot;https://ljud.org/post/2016/reverse-engineering-human-rubato/Timmer-08-test-4-stutter.mp3&quot;&gt;&lt;/audio&gt;&lt;/p&gt;
&lt;h3 id=&quot;grace-notes&quot;&gt;Grace notes&lt;/h3&gt;
&lt;p&gt;Another recurrent motif in the motif, are grace notes. Listening to the track, it seems that they come with the longer notes, and after some counting, we can see that 22% of all notes have grace notes. Then, what is the probability for a grace note among only the longer notes? Some math later, we come up with an answer that sounds all right. If note is long, and coin toss is true, we output two notes with a random (0.08-0.15) &lt;code&gt;strum&lt;/code&gt; value, which separates the notes.&lt;/p&gt;
&lt;p&gt;&lt;audio controls=&quot;&quot; src=&quot;https://ljud.org/post/2016/reverse-engineering-human-rubato/Timmer-08-test-5-grace.mp3&quot;&gt;&lt;/audio&gt;&lt;/p&gt;
&lt;pre class=&quot;language-supercollider&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-supercollider&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; middle &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;~motif&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;minItem&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; ~motif&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;maxItem&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;mean&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;//Let prob be probability of a note longer than mean&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; prob &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; ~motif&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;reject&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;_&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; middle&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;size &lt;span class=&quot;token operator&quot;&gt;/&lt;/span&gt; ~motif&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;size&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;//And if note is longer than mean, what should the probability be&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;//to make the total probability of a grace note be 0.22?&lt;/span&gt;
prob &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.22&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;/&lt;/span&gt;prob&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;//~0.66&lt;/span&gt;

&lt;span class=&quot;token class-name&quot;&gt;Pdef&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token symbol&quot;&gt;&#92;test_08_Pwrand_stutter_grace&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Pchain&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;Pbind&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;

        &lt;span class=&quot;token symbol&quot;&gt;&#92;amp&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Pfunc&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;ev&lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;

            &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; out &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.8&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;rrand&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;//some random amp&lt;/span&gt;

            &lt;span class=&quot;token comment&quot;&gt;//If this test passes, output an array, creating two notes&lt;/span&gt;
            &lt;span class=&quot;token comment&quot;&gt;//Assuming Pbrown has an even distribution, which it hasn&#39;t&lt;/span&gt;
            if &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;ev&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;dur &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; middle &lt;span class=&quot;token label property&quot;&gt;and&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; prob&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;coin &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                out &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;rrand&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; out&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;

                if &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;coin&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; out &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; out&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;reverse &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;

            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            out
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token symbol&quot;&gt;&#92;strum&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Pwhite&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.08&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.15&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;Pdef&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token symbol&quot;&gt;&#92;test_08_Pwrand_stutter&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;play&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;if-then-legato&quot;&gt;If Then Legato&lt;/h3&gt;
&lt;p&gt;In the excerpt, some notes are longer than others. They also seem to come in pairs. Two times during the short track we go into a &#39;branch&#39; of &lt;code&gt;long, short&lt;/code&gt; note pairs. Here we translate that into a 2/18 probability of entering such a branch, and a 90% chance of repeating the pair twice (even though it&#39;s 100% in the excerpt).&lt;/p&gt;
&lt;pre class=&quot;language-supercollider&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-supercollider&quot;&gt;&lt;span class=&quot;token class-name&quot;&gt;Pdef&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&#92;&lt;span class=&quot;token symbol&quot;&gt;&#92;test_08_Pwrand_stutter_grace_legato&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Pchain&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;Pbind&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;
        &#92;&lt;span class=&quot;token symbol&quot;&gt;&#92;sustain&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; p &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;ev&lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; prob &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;/&lt;/span&gt;~motif&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;size&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; sustainShort&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token keyword&quot;&gt;var&lt;/span&gt; sustainLong&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            loop &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;//If we have legato, we go into this branch&lt;/span&gt;
                if &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;prob&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;coin&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;token comment&quot;&gt;//90% chance of repeating twice&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;wchoose&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;0.9&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;do &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                        sustainLong&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;yield&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
                        sustainShort&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;yield&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
                    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
                &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;token comment&quot;&gt;//Always yield short after a group of longs&lt;/span&gt;
                sustainShort&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;yield&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;token comment&quot;&gt;//Adjust grace notes&lt;/span&gt;
        &#92;&lt;span class=&quot;token symbol&quot;&gt;&#92;sustain&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Pfunc&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;ev&lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;
            if &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;ev&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;dur&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;isArray&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;
                ev&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;sustain &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;0.1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; ev&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;sustain&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;
            ev&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;sustain
        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;token class-name&quot;&gt;Pdef&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&#92;&lt;span class=&quot;token symbol&quot;&gt;&#92;test_08_Pwrand_stutter_grace&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;trace&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;play&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;why&quot;&gt;Why?&lt;/h3&gt;
&lt;p&gt;&lt;audio controls=&quot;&quot; src=&quot;https://ljud.org/post/2016/reverse-engineering-human-rubato/Timmer-08-test-6-sustain.mp3&quot;&gt;&lt;/audio&gt;&lt;/p&gt;
&lt;p&gt;Now we have something which might be described as the Frankenstein version of the excerpt above. Note that we haven&#39;t really worked on the timbre, dynamics, or other important parameters, and that a lot of fine-tuning could be done to make the rhythm stream closer to the original. But still, this might be usable in some way, which leads us to the question in the headline: &lt;em&gt;Why do this?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;One goal with &lt;em&gt;Timmer&lt;/em&gt; is to find ways of extracting and extrapolating musical information from the solo recordings, to use that information as a base for generative processes. I can imagine taking this data and develop it further, to make a composition based on the seed of rhythmic ideas expressed in this excerpt.&lt;/p&gt;
&lt;p&gt;Going through this analytic process forces you to listen in a different way. When you start thinking about musical events in terms of probabilities it makes you loosen up the linear way of thinking about musical structures, which can be a great way to expand your music-making toolset.&lt;/p&gt;
&lt;p&gt;When writing this, the track is not finished, but I will continue working with this material. The main challenge, for this track and the whole project, is to make something that integrates with and extends the original recording. Let&#39;s see how it goes.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>An update</title>
    <link href="https://ljud.org/post/2015/timmer/" />
    <updated>2015-11-16T00:00:00Z</updated>
    <id>https://ljud.org/post/2015/timmer/</id>
    <content type="html">&lt;p&gt;&lt;em&gt;Timmer&lt;/em&gt; is the working title for a solo project involving double bass and electronics, that has been going on (and off) for the past several years. This autumn I&#39;m fortunate enough to be able to work on it full time for a couple of months. I will try to log the progress here, and very soon also put up some sounds. But first, a long introduction, crammed with all those technical details you love to hear about.&lt;/p&gt;
&lt;p&gt;I&#39;m currently preparing the electronics setup, based on an old idea documented &lt;a href=&quot;https://soundcloud.com/jpburstrom/sets/studies-for-feedback-augmented-double-bass&quot;&gt;here&lt;/a&gt;. I&#39;m using &lt;a href=&quot;http://www.visaton.de/en/chassis_zubehoer/koerperschall/ex60s_4.html&quot;&gt;transducer speakers&lt;/a&gt; mounted on the bass to create a feedback loop, together with the regular contact mic and some filtering in &lt;a href=&quot;http://supercollider.github.io&quot;&gt;SuperCollider&lt;/a&gt;. The filtering and levels should be balanced so the feedback is only happening when a string is open. This makes it possible to manipulate the physical properties of the instrument, making strings resonate infinitely and other nice things.&lt;/p&gt;
&lt;p&gt;The idea works in theory, but the hard part has been to find a simple way to do the filtering, which keeps as much of the signal as possible without breaking anything (ears, speakers or bass). Also, I&#39;ve had problems trying to balance the amplitude of different notes.&lt;/p&gt;
&lt;p&gt;The first draft of the instrument used parallel bandpass filters, tuned in semitones. To balance the amplitude of the notes, the gain could be adjusted, and I also experimented (a lot) with setting individual short delays on each filter, to adjust the phase. This took a lot of time, but wasn&#39;t very effective. I never really understood what was happening and why some notes were so much louder than the others.&lt;/p&gt;
&lt;p&gt;I started to experiment a bit with FFT filtering, trying out &lt;a href=&quot;http://doc.sccode.org/Classes/UGen.html&quot;&gt;UGens&lt;/a&gt; like &lt;a href=&quot;http://doc.sccode.org/Classes/PV_LocalMax.html&quot;&gt;&lt;code&gt;PV_LocalMax&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://doc.sccode.org/Classes/PV_MaxMagN.html&quot;&gt;&lt;code&gt;PV_MaxMagN&lt;/code&gt;&lt;/a&gt;, to only let the most important partials through. I found a few nice effects, but the main problem was still there, with uneven response for different notes.&lt;/p&gt;
&lt;p&gt;So, I put a compressor in the end of the filtering chain, which really made a difference. By accident I also bypassed the FFT filtering, which left me with just a lowpass filter, and a couple of peak filters which was supposed to even out the frequency response of the mic and bass. This was the best version yet, and also the simplest. I later expanded it to use 24 peak filters, tuned in semitones from C1-B2. Or was it 25? Something like that.&lt;/p&gt;
&lt;p&gt;So, now we have a double bass, a volume pedal, and possible infinite sustain. What can you do with this, besides making drones? Probably a good topic for the next post.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>TV4 Avslutning 1992-02-18</title>
    <link href="https://ljud.org/post/2011/tv4-avslutning-1992-02-18/" />
    <updated>2011-09-14T00:00:00Z</updated>
    <id>https://ljud.org/post/2011/tv4-avslutning-1992-02-18/</id>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.youtube.com/v/KD611_1NATs&quot;&gt;http://www.youtube.com/v/KD611_1NATs&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>First start after the winter</title>
    <link href="https://ljud.org/post/2010/first-start-after-the-winter/" />
    <updated>2010-05-06T00:00:00Z</updated>
    <id>https://ljud.org/post/2010/first-start-after-the-winter/</id>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=lcbea2wKHJo&quot;&gt;http://www.youtube.com/watch?v=lcbea2wKHJo&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Dominique Young Unique vs Alfredo Sanchez – War Talk</title>
    <link href="https://ljud.org/post/2010/dominique-young-unique-vs-alfredo-sanchez-war-talk/" />
    <updated>2010-05-03T00:00:00Z</updated>
    <id>https://ljud.org/post/2010/dominique-young-unique-vs-alfredo-sanchez-war-talk/</id>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://soundcloud.com/alfredo-sanchez/war-talk-alfredo-sanchez-remix&quot;&gt;http://soundcloud.com/alfredo-sanchez/war-talk-alfredo-sanchez-remix&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Lose/Lose</title>
    <link href="https://ljud.org/post/2010/loselose/" />
    <updated>2010-04-13T00:00:00Z</updated>
    <id>https://ljud.org/post/2010/loselose/</id>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.stfj.net/index2.php?project=art/2009/loselose&quot;&gt;stfj 3.0&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Lose/Lose is a video-game with real life consequences. Each alien in the game is created based on a random file on the players computer. If the player kills the alien, the file it is based on is deleted. If the players ship is destroyed, the application itself is deleted.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
  </entry>
  <entry>
    <title>Untitled</title>
    <link href="https://ljud.org/post/2010/untitled/" />
    <updated>2010-04-06T00:00:00Z</updated>
    <id>https://ljud.org/post/2010/untitled/</id>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=k77_4lJ4T0s&amp;amp;feature=related&quot;&gt;YouTube - Insane 4000 BMP Double Pedal&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;OF COURSE this double pedal work is sped up. Geez, I&#39;m not Mr.Lech or George Kollias.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
  </entry>
  <entry>
    <title>Crystal</title>
    <link href="https://ljud.org/post/2010/crystal/" />
    <updated>2010-03-23T00:00:00Z</updated>
    <id>https://ljud.org/post/2010/crystal/</id>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://music.geocities.jp/crystalmail2u/&quot;&gt;CRYSTALのホームページへようこそ&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Im Krankenhaus</title>
    <link href="https://ljud.org/post/2010/im-krankenhaus/" />
    <updated>2010-03-16T00:00:00Z</updated>
    <id>https://ljud.org/post/2010/im-krankenhaus/</id>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://chipflip.wordpress.com/2010/03/16/dr-pravdas-ultimate-amiga-rave/&quot;&gt;Dr. Pravda’s Ultimate Amiga Rave&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Dr. Pravda – one of the most blunt Amiga music on record. No fancy tricks or subtleties, this is pure unadulterated tracker rave!&lt;/p&gt;
&lt;/blockquote&gt;
</content>
  </entry>
  <entry>
    <title>PantyChrist Sunday</title>
    <link href="https://ljud.org/post/2010/pantychrist-sunday/" />
    <updated>2010-03-14T00:00:00Z</updated>
    <id>https://ljud.org/post/2010/pantychrist-sunday/</id>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://spisa.org/pantychrist-x2/&quot;&gt;PantyChrist (x2) | Spisa&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Noise meets Noise meets Cabaret&lt;br&gt;
Tokyo meets San Francisco meets NYC meets Venus&lt;br&gt;
Godzilla meets John Cage meets Princess Grace&lt;/p&gt;
&lt;/blockquote&gt;
</content>
  </entry>
</feed>