<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Uncodeable864</title>
    <description>The latest articles on DEV Community by Uncodeable864 (@uncodeable864).</description>
    <link>https://dev.to/uncodeable864</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F700603%2Fd459825f-58c7-445c-ab57-a7ccb9267105.png</url>
      <title>DEV Community: Uncodeable864</title>
      <link>https://dev.to/uncodeable864</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/uncodeable864"/>
    <language>en</language>
    <item>
      <title>Create the Musicbot of Musicness with @magenta/music </title>
      <dc:creator>Uncodeable864</dc:creator>
      <pubDate>Sun, 21 Nov 2021 19:08:36 +0000</pubDate>
      <link>https://dev.to/uncodeable864/create-the-musicbot-of-musicness-with-magentamusic-51hj</link>
      <guid>https://dev.to/uncodeable864/create-the-musicbot-of-musicness-with-magentamusic-51hj</guid>
      <description>&lt;p&gt;If you're here, you either Googled a Magenta tutorial, or this was recomened to you. Before we start, I'll quickly explain what Magenta is. According to &lt;a href="https://magenta.tensorflow.org/"&gt;Magenta's website&lt;/a&gt;, Magenta lets you "make music and art using machine learning" Today, we'll make music. &lt;/p&gt;

&lt;p&gt;Sidenote: Magenta is open-source and the GitHub repo is here: &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--566lAguM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/magenta"&gt;
        magenta
      &lt;/a&gt; / &lt;a href="https://github.com/magenta/magenta-js"&gt;
        magenta-js
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Magenta.js: Music and Art Generation with Machine Learning in the browser
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Side-sidenote: This article is about Magenta.js, the JS library, NOT the python library.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building the Basics
&lt;/h2&gt;

&lt;p&gt;First off, I'll be making the website on &lt;a href="https://glitch.com"&gt;Glitch&lt;/a&gt;. Second off, we'll need to bring in the script tags, with this code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;        &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/npm/@magenta/music@1.9.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This loads Magenta.js into the webpage.&lt;/p&gt;
&lt;h2&gt;
  
  
  Uploading the note sequence.
&lt;/h2&gt;

&lt;p&gt;Magenta understands music through &lt;code&gt;NoteSequence&lt;/code&gt;, which is an object of notes with their start/stop times, and is pretty big for a minute-long song. You &lt;em&gt;could&lt;/em&gt; put this in manually, but that's is boring and takes forever. Instead, what we'll to is convert a MIDI file to a &lt;code&gt;NoteSequence&lt;/code&gt;. MIDI is short for Musical Instrument Digital Interface, and is a file type that is similar to a &lt;code&gt;NoteSequence&lt;/code&gt;. So, the folks at Magenta allowed us to convert the two with ease. To convert them we'll first need a &lt;code&gt;Blob&lt;/code&gt; or a URL with the MIDI. I like to use the URL. In your JS file, you'll need to add this code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mm&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This places the window's &lt;code&gt;mm&lt;/code&gt; object in the variable &lt;code&gt;mm&lt;/code&gt;. Up next make sure your script tag is using &lt;code&gt;defer&lt;/code&gt;. This code block will make get the MIDI file and convert it to &lt;code&gt;NoteSequence&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;midi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[MIDI FILE URL HERE]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;ns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;mm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;urlToNoteSequence&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;midi&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})();&lt;/span&gt;

&lt;span class="c1"&gt;//More code will be added below this code block&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Playing the NoteSequence
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Creating the Player
&lt;/h3&gt;

&lt;p&gt;Ok, we have the &lt;code&gt;NoteSequence&lt;/code&gt; now. We can use a &lt;code&gt;Player&lt;/code&gt; to play it!&lt;/p&gt;

&lt;p&gt;This code will initialize a &lt;code&gt;Player&lt;/code&gt; object:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;player&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;mm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Player&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now, the default player wont sound the best, so you use replace &lt;code&gt;new mm.Player()&lt;/code&gt; with a new &lt;code&gt;SoundFontPlayer&lt;/code&gt;. A Soundfont is collection of instrument sounds in a font-like format. The constructor takes in a URL, like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// const player = new mm.Player();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;player&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;mm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SoundFontPlayer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://storage.googleapis.com/magentadata/js/soundfonts/sgm_plus&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Actually playing it!
&lt;/h3&gt;

&lt;p&gt;Quick check in: your JS should look like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;midi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[MIDI FILE HERE]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;ns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;mm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;urlToNoteSequence&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;midi&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})();&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;player&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;mm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SoundFontPlayer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://storage.googleapis.com/magentadata/js/soundfonts/sgm_plus&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now, unfortunately, we need to start the player after the user interacted with the page, this is to prevent people from randomly playing music on a page. So, we can just slap a button on the page:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;button&amp;gt;&lt;/span&gt;play&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now, to start a player we can use this code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;player&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ns&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This tells the &lt;code&gt;SoundFontPlayer&lt;/code&gt; to start playing the &lt;code&gt;NoteSequence&lt;/code&gt; &lt;code&gt;ns&lt;/code&gt;. Because we didn't shove everything in that async function, we can just call it in the button's &lt;code&gt;onclick&lt;/code&gt; event. Like so:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"player.start(ns)"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;play&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If we want to stop the music, we can just use this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;player&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If we put it in a &lt;code&gt;button&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"player.stop()"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;stop&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now, if you click play you should hear a sound! Pushing stop should stop it(if it doesn't reload the page)&lt;/p&gt;
&lt;h2&gt;
  
  
  Bringing in Musicbot
&lt;/h2&gt;

&lt;p&gt;Because of technical limitations, we can't make a Magenta model in the browser, but we can use one.&lt;/p&gt;
&lt;h3&gt;
  
  
  Continuing your music file with MusicRNN
&lt;/h3&gt;

&lt;p&gt;One of the "vanilla" Magenta models is &lt;code&gt;MusicRNN&lt;/code&gt;. It continues a &lt;code&gt;NoteSequence&lt;/code&gt;. So, how do we implement this power? First, we need to reel in the model, like so:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;musicbot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;mm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MusicRNN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://storage.googleapis.com/magentadata/js/checkpoints/music_rnn/basic_rnn&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This pulls in the bot from the dangers of the web. But, the bot is asleep until we tell it to activate, with the &lt;code&gt;initialize&lt;/code&gt; command. Turning on the bot is as simple as so:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;musicbot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Great! We've turned on our bot. He is ready to continue our music.&lt;/p&gt;
&lt;h2&gt;
  
  
  Making the music
&lt;/h2&gt;
&lt;h3&gt;
  
  
  The &lt;code&gt;musicfy&lt;/code&gt; function of creation
&lt;/h3&gt;

&lt;p&gt;To make our music, we'll need to bring the the big guns -- a async function. We'll call it &lt;code&gt;musicfy&lt;/code&gt;. So, the function code is like this as of now:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;musicfy&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="c1"&gt;// Code goes here&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now, to create the music we first need to quantize -- or makes the notes in beats instead of seconds.&lt;/p&gt;
&lt;h3&gt;
  
  
  Quantizing the &lt;code&gt;NoteSequence&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;To quantize the note sequence the note sequence, we need to call the &lt;code&gt;mm.sequences.quantizeNoteSequence&lt;/code&gt; function, like so:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;qns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sequences&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;quantizeNoteSequence&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ns&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Great news! We can now generate the music.&lt;/p&gt;
&lt;h3&gt;
  
  
  Making the MUSIC!!
&lt;/h3&gt;

&lt;p&gt;To make our music, we can use the &lt;code&gt;continueSequence&lt;/code&gt; function, like so:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;musicbot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;continueSequence&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;qns&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;player&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;start&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nns&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Let's talk about those parameters. The first one is, of course, our quantized note sequence. The second is how many new steps, or notes, musicbot should make. The third is the temperature. Or how repetitive it should be. Now, you can hook up this function to a &lt;code&gt;button&lt;/code&gt; or anything else your heart desires.&lt;/p&gt;
&lt;h2&gt;
  
  
  Three more things...
&lt;/h2&gt;
&lt;h3&gt;
  
  
  First
&lt;/h3&gt;

&lt;p&gt;Magenta has more models you can use!&lt;/p&gt;
&lt;h3&gt;
  
  
  Second
&lt;/h3&gt;

&lt;p&gt;The code is avalible here:&lt;br&gt;
&lt;/p&gt;
&lt;div class="glitch-embed-wrap"&gt;
  &lt;iframe src="https://glitch.com/embed/#!/embed/musicbot-of-musicness?sidebarCollapsed=true&amp;amp;attributionHidden=true&amp;amp;path=script.js" alt="musicbot-of-musicness on glitch"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;h3&gt;
  
  
  Third
&lt;/h3&gt;

&lt;p&gt;Magenta has a tutorial &lt;a href="https://hello-magenta.glitch.me/"&gt;here&lt;/a&gt;. It's competly intertive and really cool (the code was also used to help make this article)&lt;/p&gt;

&lt;p&gt;Bye!&lt;br&gt;
PS. You can also convert a &lt;code&gt;NoteSequence&lt;/code&gt; into a &lt;code&gt;Blob&lt;/code&gt;, which you can then use a tool to convert to an MP3, and then listen to what your AI has made!&lt;br&gt;
PPS. You can get Magenta on NPM under &lt;a href="https://www.npmjs.com/package/@magenta/music"&gt;@magenta/music&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>music</category>
      <category>machinelearning</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
