<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>e dot dot dot 18 10 2026</title>
    <link>http://www.jamesraposa.com/index.cgi</link>
    <description>e dot dot dot - a mostly about the Internet weblog by James Raposa</description>
    <language>en</language>

  <item>
    <title>Software's new consolidator gets big vote of confidence from Berkshire</title>
    <link>http://www.jamesraposa.com/index.cgi/2026/10/18#auto___software_s_new_consolidator_gets_big_vote_of_confidence_from_berkshire</link>
    <description>Furnished content.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Less than four months into life as a public company, Bending Spoons got a big vote of confidence this week from Berkshire Hathaway.&lt;br /&gt;&lt;br /&gt;Read more &lt;a class=&quot;sw_sl&quot; href=&quot;https://www.cnbc.com/2026/10/17/bending-spoons-wants-to-revive-software-castoffs-berkshire-investing.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;</description>
  </item>
  <item>
    <title>The $27 tool that should touch every outlet before your screwdriver does</title>
    <link>http://www.jamesraposa.com/index.cgi/2026/10/18#auto___the__27_tool_that_should_touch_every_outlet_before_your_screwdriver_does</link>
    <description>Furnished content.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                                            Use this electrical safety device first before you touch any wiring in your home DIY project.                                         &lt;br /&gt;&lt;br /&gt;Read more &lt;a class=&quot;sw_sl&quot; href=&quot;https://www.makeuseof.com/tool-that-should-touch-outlets-before-screwdriver/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;</description>
  </item>
  <item>
    <title>I changed what happens when I tap a link on Android and there's no reason to do it the old way anymore</title>
    <link>http://www.jamesraposa.com/index.cgi/2026/10/18#auto___i_changed_what_happens_when_i_tap_a_link_on_android_and_there_s_no_reason_to_do_it_the_old_way_anymore</link>
    <description>Furnished content.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                                            Now I look inside a link before it opens.                                         &lt;br /&gt;&lt;br /&gt;Read more &lt;a class=&quot;sw_sl&quot; href=&quot;https://www.makeuseof.com/changed-what-happens-when-i-tap-link-on-android/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;</description>
  </item>
  <item>
    <title>Only one major phone maker won't let you turn off battery throttling</title>
    <link>http://www.jamesraposa.com/index.cgi/2026/10/18#auto___only_one_major_phone_maker_won_t_let_you_turn_off_battery_throttling</link>
    <description>Furnished content.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                                            Battery health, forced.                                        &lt;br /&gt;&lt;br /&gt;Read more &lt;a class=&quot;sw_sl&quot; href=&quot;https://www.makeuseof.com/battery-throttling-forced-for-google-pixel/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;</description>
  </item>
  <item>
    <title>AI stocks plunge. Inflation heats up. Where we're still finding opportunities</title>
    <link>http://www.jamesraposa.com/index.cgi/2026/10/18#auto___ai_stocks_plunge__inflation_heats_up__where_we_re_still_finding_opportunities</link>
    <description>Furnished content.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The sinking AI trade rattled last week's market. But solid bank earnings and a rotation beyond tech gave us reasons for optimism.&lt;br /&gt;&lt;br /&gt;Read more &lt;a class=&quot;sw_sl&quot; href=&quot;https://www.cnbc.com/investingclub/2026/10/17/ai-stocks-plunge-inflation-heats-up-where-were-still-finding-opportunities.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;</description>
  </item>
  <item>
    <title>Adventures in Real-Time MIDI</title>
    <link>http://www.jamesraposa.com/index.cgi/2026/10/18#auto___adventures_in_real_time_midi</link>
    <description>Furnished content.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2 id=&quot;preamble&quot;&gt;Preamble&lt;a class=&quot;heading-anchor&quot; href=&quot;#preamble&quot; aria-label=&quot;Permalink to Preamble&quot;&gt;&lt;/a&gt;&lt;/h2&gt;Since discovering Perl &lt;a href=&quot;https://metacpan.org/pod/MIDI::RtMidi::FFI::Device&quot;&gt;real-time MIDI&lt;/a&gt; and &lt;a href=&quot;https://www.perl.com/article/making-an-asynchronous-clocking-drum-machine-in-perl/&quot;&gt;writing about creating async drums&lt;/a&gt; with it, I&amp;rsquo;ve dug deeper into what&amp;rsquo;s possible. I have a few &lt;a href=&quot;https://metacpan.org/search?size=20&amp;amp;q=music&quot;&gt;music&lt;/a&gt; and &lt;a href=&quot;https://metacpan.org/search?size=20&amp;amp;q=midi&quot;&gt;MIDI&lt;/a&gt; modules on CPAN and like to put them to use in real time, now that I have been enlightened by zen master &lt;a href=&quot;https://metacpan.org/author/JBARRETT&quot;&gt;John Barrett&lt;/a&gt;. Ha :DThis will be a mostly commented-code illustration of real-time arpeggiation. It is maybe &amp;ldquo;just a hobby.&amp;rdquo; But the principles of asynchronous programming, periodic execution of a set of things, are generically applicable to other types of problems.There is no perplexing music theory here: just some terms to know. A &lt;em&gt;note&lt;/em&gt; is a little vector of a &lt;em&gt;pitch&lt;/em&gt; (high or low) and a &lt;em&gt;duration&lt;/em&gt; (long or short). A &lt;em&gt;scale&lt;/em&gt; is a collection of pitches, starting at the &lt;em&gt;tonic&lt;/em&gt;. An &lt;em&gt;octave&lt;/em&gt; is the musical interval between one note and another, where each has the same letter name but twice (or half) its &lt;em&gt;frequency&lt;/em&gt; (in Hertz). A &lt;em&gt;clock&lt;/em&gt; is a &lt;em&gt;MIDI&lt;/em&gt; message sent to a device to keep timing. MIDI stands for &amp;ldquo;musical instrument digital interface&amp;rdquo; and is the beating heart of a lot of digital music. An &lt;em&gt;arpeggio&lt;/em&gt; is usually a chord of the chosen scale, where the notes are played individually in rising or descending order. A &lt;em&gt;chord&lt;/em&gt; is a collection of three or more notes. An arpeggio is played over a given spread or range of &lt;em&gt;beat&lt;/em&gt; durations. A beat is an atom of the &lt;em&gt;rhythm&lt;/em&gt;. The rhythm is the collection of note durations of a phrase. A &lt;em&gt;measure&lt;/em&gt; of musical time is a group of beats  most commonly four. Finally, the term &lt;em&gt;velocity&lt;/em&gt; is equivalent to the volume or loudness of a note. Whew!Anyway, on with the show. (And &lt;a href=&quot;#audio-examples&quot;&gt;audio examples&lt;/a&gt; are at the bottom.)&lt;h2 id=&quot;broad-strokes&quot;&gt;Broad strokes&lt;a class=&quot;heading-anchor&quot; href=&quot;#broad-strokes&quot; aria-label=&quot;Permalink to Broad strokes&quot;&gt;&lt;/a&gt;&lt;/h2&gt;&lt;strong&gt;What this is:&lt;/strong&gt;A generative arpeggiator that runs forever, choosing random scale notes and random arpeggios. This plays them on a MIDI synth, all driven by a MIDI clock.&lt;strong&gt;The core ideas:&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;A universe of notes defined by a tonic pitch, a scale name, and a set of octaves&lt;/li&gt;&lt;li&gt;An asynchronous clock engine using a periodic timer to drive events and MIDI messaging&lt;/li&gt;&lt;li&gt;Phrase generation with flexible arpeggio parameters and velocity randomization&lt;/li&gt;&lt;li&gt;Graceful shutdown with all-notes-off/panic being the important part&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;Code overview:&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;Dependency imports&lt;/li&gt;&lt;li&gt;Optional parameters that guide the processing&lt;/li&gt;&lt;li&gt;Internal parameters defining program operation&lt;/li&gt;&lt;li&gt;Cleanup on program halt&lt;/li&gt;&lt;li&gt;Loop and periodic timer&lt;/li&gt;&lt;li&gt;Handy subroutines&lt;/li&gt;&lt;/ul&gt;Basically, this code is all machinery to play things in real time. The actual arpeggiation is pretty simple and happens at the beginning of the &lt;code&gt;trigger_notes()&lt;/code&gt; routine, given the &lt;code&gt;&lt;/code&gt; object.Let&amp;rsquo;s look at each of these in closer detail.&lt;h2 id=&quot;dependency-imports&quot;&gt;Dependency imports&lt;a class=&quot;heading-anchor&quot; href=&quot;#dependency-imports&quot; aria-label=&quot;Permalink to Dependency imports&quot;&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre tabindex=&quot;0&quot; style=&quot;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;use&lt;/span&gt; v5&lt;span style=&quot;color:#ae81ff&quot;&gt;.36&lt;/span&gt;;                                          &lt;span style=&quot;color:#75715e&quot;&gt;# use a modern Perl&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;use&lt;/span&gt; IO::Async::Loop ();                             &lt;span style=&quot;color:#75715e&quot;&gt;# async&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;use&lt;/span&gt; IO::Async::Timer::Periodic ();                  &lt;span style=&quot;color:#75715e&quot;&gt;# async&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;use&lt;/span&gt; List::Util &lt;span style=&quot;color:#e6db74&quot;&gt;qw(max sum0)&lt;/span&gt;;                        &lt;span style=&quot;color:#75715e&quot;&gt;# duration scaling&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;use&lt;/span&gt; MIDI::RtMidi::Util &lt;span style=&quot;color:#e6db74&quot;&gt;qw(out_port stop_all_notes)&lt;/span&gt;; &lt;span style=&quot;color:#75715e&quot;&gt;# rt-midi&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;use&lt;/span&gt; Music::MelodicDevice::Arpeggiation ();          &lt;span style=&quot;color:#75715e&quot;&gt;# arpeggios&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;use&lt;/span&gt; Music::Scales &lt;span style=&quot;color:#e6db74&quot;&gt;qw(get_scale_MIDI)&lt;/span&gt;;               &lt;span style=&quot;color:#75715e&quot;&gt;# pitches&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&quot;optional-parameters&quot;&gt;Optional parameters&lt;a class=&quot;heading-anchor&quot; href=&quot;#optional-parameters&quot; aria-label=&quot;Permalink to Optional parameters&quot;&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre tabindex=&quot;0&quot; style=&quot;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; %opt &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; (&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    port     &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;synth&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#75715e&quot;&gt;# required MIDI device (e.g. microKORG or fluidsynth)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    bpm      &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;80&lt;/span&gt;,      &lt;span style=&quot;color:#75715e&quot;&gt;# beats-per-minute&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    arp_type &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;any&amp;#39;&lt;/span&gt;,   &lt;span style=&quot;color:#75715e&quot;&gt;# &amp;#39;any&amp;#39; or any known to the arp module&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    note_num &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;5,7&amp;#39;&lt;/span&gt;,   &lt;span style=&quot;color:#75715e&quot;&gt;# number of notes to arp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    repeats  &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt;,       &lt;span style=&quot;color:#75715e&quot;&gt;# arp repeats before the next one begins&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    spread   &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;4&lt;/span&gt;,       &lt;span style=&quot;color:#75715e&quot;&gt;# beats an arp should stretch across&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    octave   &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;3,4,5&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#75715e&quot;&gt;# octaves (0 .. 9)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    tonic    &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;C&amp;#39;&lt;/span&gt;,     &lt;span style=&quot;color:#75715e&quot;&gt;# scale key base note&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    scale    &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;minor&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#75715e&quot;&gt;# scale name as known to Music::Scales&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    program  &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt;,       &lt;span style=&quot;color:#75715e&quot;&gt;# synth program&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    channel  &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt;,       &lt;span style=&quot;color:#75715e&quot;&gt;# the MIDI channel&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&quot;internal-parameters&quot;&gt;Internal parameters&lt;a class=&quot;heading-anchor&quot; href=&quot;#internal-parameters&quot; aria-label=&quot;Permalink to Internal parameters&quot;&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre tabindex=&quot;0&quot; style=&quot;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#75715e&quot;&gt;# one arpeggiator instance is reused&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; Music::MelodicDevice::Arpeggiation&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;new&lt;/span&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    repeats &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; {repeats},&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    verbose &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#75715e&quot;&gt;# used to rescale durations&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; Music::MelodicDevice::Arpeggiation::TICKS();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#75715e&quot;&gt;# split things&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; @octave    &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; split &lt;span style=&quot;color:#e6db74&quot;&gt;/,/&lt;/span&gt;, {octave};&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; @note_nums &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; split &lt;span style=&quot;color:#e6db74&quot;&gt;/,/&lt;/span&gt;, {note_num};&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; @arp_types &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; {arp_type} &lt;span style=&quot;color:#f92672&quot;&gt;eq&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;any&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    ? keys &lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;arp_type&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;%&lt;span style=&quot;color:#960050;background-color:#1e0010&quot;&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    : split &lt;span style=&quot;color:#e6db74&quot;&gt;/,/&lt;/span&gt;, {arp_type}; &lt;span style=&quot;color:#75715e&quot;&gt;# see the Music::MelodicDevice::Arpeggiation docs&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#75715e&quot;&gt;# get full range of pitches by octave&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; @pitches &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; map { get_scale_MIDI({tonic}, $_, {scale}) } @octave;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;die &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#34;No pitches for tonic={tonic} scale={scale}\n&amp;#34;&lt;/span&gt; &lt;span style=&quot;color:#66d9ef&quot;&gt;unless&lt;/span&gt; @pitches;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;say &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#34;Arp types: {arp_type}&amp;#34;&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;say &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#34;Arp nums: {note_num}&amp;#34;&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;say &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#34;Pitches: @pitches&amp;#34;&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#75715e&quot;&gt;# we are in 4/4 time...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;        &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;4&lt;/span&gt;; &lt;span style=&quot;color:#75715e&quot;&gt;# useful factor :)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;*&lt;/span&gt; ; &lt;span style=&quot;color:#75715e&quot;&gt;# PPQN&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;   &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;60&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;/ {bpm} /&lt;/span&gt; ; &lt;span style=&quot;color:#75715e&quot;&gt;# time / bpm / ppqn&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#75715e&quot;&gt;# when spread is falsy, fall back to one bar&amp;#39;s worth of beats&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; {spread} &lt;span style=&quot;color:#f92672&quot;&gt;||&lt;/span&gt; ;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; @active;  &lt;span style=&quot;color:#75715e&quot;&gt;# { note =&amp;gt; , off_tick =&amp;gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; @pending; &lt;span style=&quot;color:#75715e&quot;&gt;# { note =&amp;gt; , on_tick =&amp;gt;  }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;       &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color:#75715e&quot;&gt;# clock ticks&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt;; &lt;span style=&quot;color:#75715e&quot;&gt;# beats!&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#75715e&quot;&gt;# open the MIDI device for output&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; out_port({port});&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;program_change({channel}, {program});&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;say &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#34;Opened {port}&amp;#34;&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&quot;cleanup&quot;&gt;Cleanup&lt;a class=&quot;heading-anchor&quot; href=&quot;#cleanup&quot; aria-label=&quot;Permalink to Cleanup&quot;&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre tabindex=&quot;0&quot; style=&quot;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#75715e&quot;&gt;# Ctrl-C clean shutdown&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;{INT} &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#66d9ef&quot;&gt;sub&lt;/span&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    say &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#34;\nStop&amp;#34;&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    stop_all_notes(); &lt;span style=&quot;color:#75715e&quot;&gt;# make sure all notes are off&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    exit;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&quot;loop-and-timer&quot;&gt;Loop and timer&lt;a class=&quot;heading-anchor&quot; href=&quot;#loop-and-timer&quot; aria-label=&quot;Permalink to Loop and timer&quot;&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre tabindex=&quot;0&quot; style=&quot;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#75715e&quot;&gt;# loop object to own and drive all timers/events&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; IO::Async::Loop&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;new&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#75715e&quot;&gt;# drive the whole sequencer  clock out, note off, note on, retrigger&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; IO::Async::Timer::Periodic&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;new&lt;/span&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    interval   &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; ,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    reschedule &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;hard&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#75715e&quot;&gt;# anchor to a fixed schedule, don&amp;#39;t let tempo drift&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    on_tick    &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span style=&quot;color:#66d9ef&quot;&gt;sub&lt;/span&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;clock; &lt;span style=&quot;color:#75715e&quot;&gt;# emit a MIDI clock tick&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#f92672&quot;&gt;++&lt;/span&gt;; &lt;span style=&quot;color:#75715e&quot;&gt;# advance the master tick counter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#75715e&quot;&gt;# release any notes whose time is up&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#66d9ef&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; $i (reverse &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;..&lt;/span&gt; $#active) {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;            &lt;span style=&quot;color:#75715e&quot;&gt;# iterate in reverse so splice() below doesn&amp;#39;t invalidate remaining indices&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;            &lt;span style=&quot;color:#66d9ef&quot;&gt;if&lt;/span&gt; ( &lt;span style=&quot;color:#f92672&quot;&gt;&amp;gt;=&lt;/span&gt; [$i]{off_tick}) {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;                &lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;note_off({channel}, [$i]{note}, &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;                splice @active, $i, &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt;; &lt;span style=&quot;color:#75715e&quot;&gt;# remove from the &amp;#34;currently sounding&amp;#34; list&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;            }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#75715e&quot;&gt;# align to fire exactly on beat boundaries&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#66d9ef&quot;&gt;if&lt;/span&gt; (( &lt;span style=&quot;color:#f92672&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt;) % &lt;span style=&quot;color:#960050;background-color:#1e0010&quot;&gt;$&lt;/span&gt;clocks_per_beat &lt;span style=&quot;color:#f92672&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;            &lt;span style=&quot;color:#66d9ef&quot;&gt;if&lt;/span&gt; ( % &lt;span style=&quot;color:#960050;background-color:#1e0010&quot;&gt;$&lt;/span&gt;phrase_beats &lt;span style=&quot;color:#f92672&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt;) { &lt;span style=&quot;color:#75715e&quot;&gt;# retrigger every &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;                trigger_notes(); &lt;span style=&quot;color:#75715e&quot;&gt;# start a new arp phrase!&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;            }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;            &lt;span style=&quot;color:#f92672&quot;&gt;++&lt;/span&gt;; &lt;span style=&quot;color:#75715e&quot;&gt;# only increment on beat boundaries&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#75715e&quot;&gt;# collect every pending note whose start time has arrived&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; @ready &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; grep {  &lt;span style=&quot;color:#f92672&quot;&gt;&amp;gt;=&lt;/span&gt; $_&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;{on_tick} } @pending;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#75715e&quot;&gt;# keep the notes still waiting for a future tick&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        @pending  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; grep {  &lt;span style=&quot;color:#f92672&quot;&gt;&amp;lt;&lt;/span&gt;  $_&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;{on_tick} } @pending;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#66d9ef&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; $p (@ready) {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;            &lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;note_on({channel}, $p&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;{note}, velocity(&lt;span style=&quot;color:#f92672&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color:#ae81ff&quot;&gt;10&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;10&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;110&lt;/span&gt;));&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;            &lt;span style=&quot;color:#75715e&quot;&gt;# remember the note, so the release loop above can turn it off at the right tick&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;            push @active, { note &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; $p&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;{note}, off_tick &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; $p&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;{off_tick} };&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    },&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;start;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;add();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;run;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&quot;handy-subroutines&quot;&gt;Handy subroutines&lt;a class=&quot;heading-anchor&quot; href=&quot;#handy-subroutines&quot; aria-label=&quot;Permalink to Handy subroutines&quot;&gt;&lt;/a&gt;&lt;/h2&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre tabindex=&quot;0&quot; style=&quot;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&quot;&gt;&lt;code class=&quot;language-perl&quot; data-lang=&quot;perl&quot;&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;sub&lt;/span&gt; &lt;span style=&quot;color:#a6e22e&quot;&gt;trigger_notes&lt;/span&gt; {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#75715e&quot;&gt;# pick a random note count, then that many random pitches, sorted low-to-high for the arpeggiator&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; @notes &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; sort { $a &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;lt;=&amp;gt;&lt;/span&gt; $b }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        map { [int rand @pitches] } &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;..&lt;/span&gt; [int rand @note_nums]; &lt;span style=&quot;color:#75715e&quot;&gt;# XXX clunky&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#75715e&quot;&gt;# get an arpeggiated note list given a random arp_type&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;arp(&lt;span style=&quot;color:#f92672&quot;&gt;\&lt;/span&gt;@notes, &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt;, [int rand @arp_types]);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#75715e&quot;&gt;# convert from the arp&amp;#39;s 96-ticks-per-quarter-note scale to our clock ticks&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; @raw_ticks &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; map {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; () &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; $_&lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;[&lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt;] &lt;span style=&quot;color:#f92672&quot;&gt;=~&lt;/span&gt;&lt;span style=&quot;color:#e6db74&quot;&gt; /^d(\d+)$/&lt;/span&gt;; &lt;span style=&quot;color:#75715e&quot;&gt;# duration encoded as a string like &amp;#34;d96&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#75715e&quot;&gt;# rescale from the module&amp;#39;s tick resolution to our own clock&amp;#39;s ticks-per-beat&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        max(&lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt;, int( &lt;span style=&quot;color:#f92672&quot;&gt;*&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;/&lt;/span&gt; ));&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    } @;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt;; &lt;span style=&quot;color:#75715e&quot;&gt;# default multiplier: 1 = no rescaling&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#66d9ef&quot;&gt;if&lt;/span&gt; ({spread}) {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#75715e&quot;&gt;# total unscaled duration of the arp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; sum0(@raw_ticks) &lt;span style=&quot;color:#f92672&quot;&gt;||&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#75715e&quot;&gt;# convert the desired spread (in beats) into tick units&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; {spread} &lt;span style=&quot;color:#f92672&quot;&gt;*&lt;/span&gt; ;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#75715e&quot;&gt;# factor that stretches or squeezes the arp&amp;#39;s total length to exactly fill the available ticks&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;         &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;/&lt;/span&gt; ;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#75715e&quot;&gt;# anchor the first note of this phrase to &amp;#34;right now&amp;#34; of the master clock&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; ;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#66d9ef&quot;&gt;for&lt;/span&gt; &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; $i (&lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;..&lt;/span&gt; $#) {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt; (undef, ) &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; @{ &lt;span style=&quot;color:#f92672&quot;&gt;-&amp;gt;&lt;/span&gt;[$i] }; &lt;span style=&quot;color:#75715e&quot;&gt;# a note is a duration and a pitch&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#75715e&quot;&gt;# note&amp;#39;s scaled length, floored at 1 tick&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt; max(&lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt;, int([$i] &lt;span style=&quot;color:#f92672&quot;&gt;*&lt;/span&gt; ));&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#75715e&quot;&gt;# schedule the note to be turned on/off&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        push @pending, {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;            note     &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; ,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;            on_tick  &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt; ,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;            off_tick &lt;span style=&quot;color:#f92672&quot;&gt;=&amp;gt;&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;+&lt;/span&gt; ,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        };&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;        &lt;span style=&quot;color:#75715e&quot;&gt;# advance the cursor so the next note in the arp starts right where this one ends&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;         &lt;span style=&quot;color:#f92672&quot;&gt;+=&lt;/span&gt; ;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#66d9ef&quot;&gt;sub&lt;/span&gt; &lt;span style=&quot;color:#a6e22e&quot;&gt;velocity&lt;/span&gt; (00, , ) {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#75715e&quot;&gt;# generate a randomized velocity within [min+offset, max+offset]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#66d9ef&quot;&gt;my&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;=&lt;/span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;+&lt;/span&gt; int(rand( &lt;span style=&quot;color:#f92672&quot;&gt;-&lt;/span&gt; 00 &lt;span style=&quot;color:#f92672&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt;)) &lt;span style=&quot;color:#f92672&quot;&gt;+&lt;/span&gt; 00;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;    &lt;span style=&quot;color:#66d9ef&quot;&gt;return&lt;/span&gt; ;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;A superior implementation would use the &lt;a href=&quot;https://metacpan.org/pod/Getopt::Long&quot;&gt;Getopt::Long&lt;/a&gt; module to parse command-line arguments. Hint, hint. ;)&lt;h2 id=&quot;audio-examples&quot;&gt;Audio examples&lt;a class=&quot;heading-anchor&quot; href=&quot;#audio-examples&quot; aria-label=&quot;Permalink to Audio examples&quot;&gt;&lt;/a&gt;&lt;/h2&gt;This is the General MIDI piano played with &lt;a href=&quot;https://www.fluidsynth.org/&quot;&gt;fluidsynth&lt;/a&gt;:&lt;audio controls&gt;  &lt;source src=&quot;https://www.perl.com/media/adventures-in-real-time-midi/example-5.mp3&quot; type=&quot;audio/mpeg&quot;&gt;  Your browser does not support the audio element.&lt;/audio&gt;Not terribly exciting, yet.The following were recorded with my &lt;a href=&quot;https://www.korg.com/us/products/synthesizers/microkorg/&quot;&gt;microKORG&lt;/a&gt; synthesizer. But any MIDI-capable synth will do!This one sounds like an arcade. It repeats the arp twice:&lt;audio controls&gt;  &lt;source src=&quot;https://www.perl.com/media/adventures-in-real-time-midi/example-4.mp3&quot; type=&quot;audio/mpeg&quot;&gt;  Your browser does not support the audio element.&lt;/audio&gt;With an old-school sound and an already arpeggiated synth patch:&lt;audio controls&gt;  &lt;source src=&quot;https://www.perl.com/media/adventures-in-real-time-midi/example-1.mp3&quot; type=&quot;audio/mpeg&quot;&gt;  Your browser does not support the audio element.&lt;/audio&gt;Here is another:&lt;audio controls&gt;  &lt;source src=&quot;https://www.perl.com/media/adventures-in-real-time-midi/example-2.mp3&quot; type=&quot;audio/mpeg&quot;&gt;  Your browser does not support the audio element.&lt;/audio&gt;OK. How about an ethereal pad arping in slow motion?&lt;audio controls&gt;  &lt;source src=&quot;https://www.perl.com/media/adventures-in-real-time-midi/example-3.mp3&quot; type=&quot;audio/mpeg&quot;&gt;  Your browser does not support the audio element.&lt;/audio&gt;~And here is an example of the verbose console output that is produced:&lt;div class=&quot;highlight&quot;&gt;&lt;pre tabindex=&quot;0&quot; style=&quot;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&quot;&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&amp;gt; perl perl.com/arpeggios.pl&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Arp types: any&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Arp nums: 5,7&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Pitches: &lt;span style=&quot;color:#ae81ff&quot;&gt;48&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;50&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;52&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;53&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;55&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;57&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;59&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;60&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;62&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;64&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;65&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;67&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;69&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;71&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;72&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;74&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;76&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;77&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;79&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;81&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;83&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Opened midimate on program &lt;span style=&quot;color:#ae81ff&quot;&gt;21&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Repeat: 1, Type: pedal_down, Pattern: &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;5&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Ticks: 96, Duration: &lt;span style=&quot;color:#ae81ff&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Arp: &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;77&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;77&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;77&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;77&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;77&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;67&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;77&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;65&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;77&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;53&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;77&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;52&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Repeat: 1, Type: pedal_up, Pattern: &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;5&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Ticks: 96, Duration: &lt;span style=&quot;color:#ae81ff&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Arp: &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;50&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;53&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;50&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;53&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;50&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;72&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;50&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;72&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;50&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;76&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;50&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d8&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;76&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Repeat: 1, Type: down, Pattern: &lt;span style=&quot;color:#ae81ff&quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Ticks: 96, Duration: &lt;span style=&quot;color:#ae81ff&quot;&gt;19&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Arp: &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;77&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;76&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;67&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;65&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;50&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Repeat: 1, Type: down, Pattern: &lt;span style=&quot;color:#ae81ff&quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Ticks: 96, Duration: &lt;span style=&quot;color:#ae81ff&quot;&gt;19&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Arp: &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;81&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;65&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;62&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;57&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;55&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Repeat: 1, Type: pedal_updown, Pattern: &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;5&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;5&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;4&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;6&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Ticks: 96, Duration: &lt;span style=&quot;color:#ae81ff&quot;&gt;4&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Arp: &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;48&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;60&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;48&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;64&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;48&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;65&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;48&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;67&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;48&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;71&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;48&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;76&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;71&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;76&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;67&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;76&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;65&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;76&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;64&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;76&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;  &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;60&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;76&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d4&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;48&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;&lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Repeat: 1, Type: random, Pattern: &lt;span style=&quot;color:#ae81ff&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;3&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color:#ae81ff&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Ticks: 96, Duration: &lt;span style=&quot;color:#ae81ff&quot;&gt;19&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Arp: &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;52&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;65&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;65&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;59&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;, &lt;span style=&quot;color:#f92672&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color:#e6db74&quot;&gt;&amp;#39;d19&amp;#39;&lt;/span&gt;, &lt;span style=&quot;color:#ae81ff&quot;&gt;59&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt; &lt;span style=&quot;color:#f92672&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;^C&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;display:flex;&quot;&gt;&lt;span&gt;Stop&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;The port that is opened is my MIDI interface to the microKORG, which is partly named &lt;code&gt;midimate&lt;/code&gt;. It is worth pointing out that the &lt;code&gt;out_port()&lt;/code&gt; function uses case-insensitive substrings/regexes to match MIDI device names.&lt;h2 id=&quot;conclusions&quot;&gt;Conclusions&lt;a class=&quot;heading-anchor&quot; href=&quot;#conclusions&quot; aria-label=&quot;Permalink to Conclusions&quot;&gt;&lt;/a&gt;&lt;/h2&gt;You too can make MIDI music in real-time! And arpeggios are a highly useful technique for &amp;ldquo;filling the silence.&amp;rdquo;Timing events with async code takes quite a bit of logic. And &lt;code&gt;sleep&lt;/code&gt;ing is &lt;strong&gt;not&lt;/strong&gt; an option.These techniques have wider usefulness. Knowledge of event systems is essential for programming graphical and interactive applications, high-concurrency network services, simulations, &lt;code&gt;&lt;/code&gt;, and more! :-)&lt;h2 id=&quot;resources&quot;&gt;Resources&lt;a class=&quot;heading-anchor&quot; href=&quot;#resources&quot; aria-label=&quot;Permalink to Resources&quot;&gt;&lt;/a&gt;&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://metacpan.org/pod/IO::Async::Loop&quot;&gt;IO::Async::Loop&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://metacpan.org/pod/IO::Async::Timer::Periodic&quot;&gt;IO::Async::Timer::Periodic&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://metacpan.org/pod/List::Util&quot;&gt;List::Util&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://metacpan.org/pod/MIDI::RtMidi::FFI::Device&quot;&gt;MIDI::RtMidi::FFI::Device&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://metacpan.org/pod/MIDI::RtMidi::Util&quot;&gt;MIDI::RtMidi::Util&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://metacpan.org/pod/Music::MelodicDevice::Arpeggiation&quot;&gt;Music::MelodicDevice::Arpeggiation&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://metacpan.org/pod/Music::Scales&quot;&gt;Music::Scales&lt;/a&gt;&lt;/li&gt;&lt;li&gt;The code for this article: &lt;a href=&quot;https://github.com/ology/Music/blob/master/perl.com/arpeggios.pl&quot;&gt;arpeggios.pl&lt;/a&gt;&lt;/li&gt;&lt;li&gt;The more complete and musical version: &lt;a href=&quot;https://github.com/ology/Music/blob/master/arping.pl&quot;&gt;arping.pl&lt;/a&gt;&lt;/li&gt;&lt;li&gt;My original music is at &lt;a href=&quot;https://geneboggs.bandcamp.com/&quot;&gt;https://geneboggs.bandcamp.com/&lt;/a&gt; and &lt;a href=&quot;https://www.youtube.com/@GeneBoggs&quot;&gt;https://www.youtube.com/@GeneBoggs&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Read more &lt;a class=&quot;sw_sl&quot; href=&quot;https://www.perl.com/article/adventures-in-real-time-midi/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;</description>
  </item>
  <item>
    <title>Some companies give AI to everyone. This CEO is doing the opposite</title>
    <link>http://www.jamesraposa.com/index.cgi/2026/10/18#auto___some_companies_give_ai_to_everyone__this_ceo_is_doing_the_opposite</link>
    <description>Furnished content.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Paysend CEO Ben Chisell limits AI tools to top performers as other U.K. companies push broader workplace rollouts.&lt;br /&gt;&lt;br /&gt;Read more &lt;a class=&quot;sw_sl&quot; href=&quot;https://www.cnbc.com/2026/10/17/ai-workplace-tokenmaxxing-paysend.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;</description>
  </item>
  </channel>
</rss>