[{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n        \u003cp class=\"p1\"\u003eDo you want to build CircuitPython MIDI drum sequencer? Maybe one \u003ca href=\"https://learn.adafruit.com/drum-track-sequencer\" target=\"_blank\"\u003elike this\u003c/a\u003e (Lego style), or\u0026nbsp;\u003ca href=\"https://github.com/samblenny/txtseq\" target=\"_blank\"\u003elike this\u003c/a\u003e (plaintext style)? To play sounds, you'll need a MIDI synthesizer or sampler. But, with all the sampler and synth options, which one should you pick? To start with a simple browser-based drum synth, you could try\u0026nbsp;\u003ca href=\"https://samblenny.github.io/web-midi-drumkit/\" target=\"_blank\"\u003eweb-midi-drumkit\u003c/a\u003e.\u003c/p\u003e\n      \n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/926/original/webmidi-drumkit.gif?1718247785","metadata":{"caption":""}},{"element_type":"markdown","content":"\u003ch2\u003eQuick Start\u003c/h2\u003e\n\n\u003cp\u003eTo try it out, connect a USB MIDI controller or sequencer to your computer and open the \u003ca href=\"https://samblenny.github.io/web-midi-drumkit/\"\u003eweb-midi-drumkit\u003c/a\u003e demo page in Chrome (Web MIDI is relatively new, and not all browsers support it). You'll need to click the \"Unmute Sound\" button and probably also answer a security prompt to allow MIDI access.\u003c/p\u003e\n\n\u003cp\u003eSet your MIDI controller or sequencer to send notes on channel 10 using the following note mapping:\u003c/p\u003e\n\n\u003ctable\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003cth\u003eMIDI Note\u003c/th\u003e\n\u003cth\u003eNote Name\u003c/th\u003e\n\u003cth\u003eDrum Sound\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd\u003e51\u003c/td\u003e\n\u003ctd\u003eD#3\u003c/td\u003e\n\u003ctd\u003eRide Cymbal\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e49\u003c/td\u003e\n\u003ctd\u003eC#3\u003c/td\u003e\n\u003ctd\u003eCrash Cymbal\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e48\u003c/td\u003e\n\u003ctd\u003eC3\u003c/td\u003e\n\u003ctd\u003eTom 1 (high)\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e46\u003c/td\u003e\n\u003ctd\u003eA#2\u003c/td\u003e\n\u003ctd\u003eHi-hat (open)\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e45\u003c/td\u003e\n\u003ctd\u003eA2\u003c/td\u003e\n\u003ctd\u003eTom 2 (low)\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e43\u003c/td\u003e\n\u003ctd\u003eG2\u003c/td\u003e\n\u003ctd\u003eTom 3 (floor)\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e42\u003c/td\u003e\n\u003ctd\u003eF#2\u003c/td\u003e\n\u003ctd\u003eHi-hat (closed)\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e38\u003c/td\u003e\n\u003ctd\u003eD2\u003c/td\u003e\n\u003ctd\u003eSnare\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e36\u003c/td\u003e\n\u003ctd\u003eC2\u003c/td\u003e\n\u003ctd\u003eKick\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n","metadata":{"markdown":"## Quick Start\n\nTo try it out, connect a USB MIDI controller or sequencer to your computer and open the [web-midi-drumkit](https://samblenny.github.io/web-midi-drumkit/) demo page in Chrome (Web MIDI is relatively new, and not all browsers support it). You'll need to click the \"Unmute Sound\" button and probably also answer a security prompt to allow MIDI access.\n\nSet your MIDI controller or sequencer to send notes on channel 10 using the following note mapping:\n\n| MIDI Note | Note Name | Drum Sound |\n| --------- | --------- | ---------- |\n| 51 | D\\#3 | Ride Cymbal |\n| 49 | C\\#3 | Crash Cymbal |\n| 48 | C3  | Tom 1 (high) |\n| 46 | A\\#2 | Hi-hat (open) |\n| 45 | A2  | Tom 2 (low) |\n| 43 | G2  | Tom 3 (floor) |\n| 42 | F\\#2 | Hi-hat (closed) |\n| 38 | D2  | Snare |\n| 36 | C2  | Kick |"}},{"element_type":"markdown","content":"\u003ch2\u003eTechnical Details\u003c/h2\u003e\n\n\u003cp\u003eTo see how the drum synth works, you can read my code \u003ca href=\"https://github.com/samblenny/web-midi-drumkit\"\u003eon GitHub\u003c/a\u003e. The important files and directories are:\u003c/p\u003e\n\n\u003col\u003e\n\u003cli\u003e\n\u003ccode class=\"inline\"\u003eindex.html\u003c/code\u003e has HTML that includes SVG paths for the drum pad silhouettes and CSS rules that control color changes for the activity indicators\u003c/li\u003e\n\u003cli\u003e\n\u003ccode class=\"inline\"\u003emain.js\u003c/code\u003e has a JavaScript module that sets up all the event handling and logic to listen for MIDI events, play samples, and update the activity indicators (by changing CSS classes)\u003c/li\u003e\n\u003cli\u003e\n\u003ccode class=\"inline\"\u003esamples/\u003c/code\u003e has FLAC format drum sample files\u003c/li\u003e\n\u003c/ol\u003e\n\n\u003cp\u003eTo learn more about HTML, CSS, SVG, and Javascript web APIs, I highly recommend Mozilla's MDN Web Docs, including:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API\"\u003eWeb MIDI API\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API\"\u003eWeb Audio API\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\n\u003ca href=\"https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Audio_codecs\"\u003eWeb audio codec guide\u003c/a\u003e (includes playback latency estimates for different audio file types)\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript\"\u003eJavaScript\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started\"\u003eGetting started with HTML\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://developer.mozilla.org/en-US/docs/Web/CSS\"\u003eCSS: Cascading Style Sheets\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://developer.mozilla.org/en-US/docs/Web/SVG\"\u003eSVG: Scalable Vector Graphics\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n","metadata":{"markdown":"## Technical Details\n\nTo see how the drum synth works, you can read my code [on GitHub](https://github.com/samblenny/web-midi-drumkit). The important files and directories are:\n1. `index.html` has HTML that includes SVG paths for the drum pad silhouettes and CSS rules that control color changes for the activity indicators\n2. `main.js` has a JavaScript module that sets up all the event handling and logic to listen for MIDI events, play samples, and update the activity indicators (by changing CSS classes)\n3. `samples/` has FLAC format drum sample files\n\nTo learn more about HTML, CSS, SVG, and Javascript web APIs, I highly recommend Mozilla's MDN Web Docs, including:\n- [Web MIDI API](https://developer.mozilla.org/en-US/docs/Web/API/Web_MIDI_API)\n- [Web Audio API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API)\n- [Web audio codec guide](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Audio_codecs) (includes playback latency estimates for different audio file types)\n- [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript)\n- [Getting started with HTML](https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started)\n- [CSS: Cascading Style Sheets](https://developer.mozilla.org/en-US/docs/Web/CSS)\n- [SVG: Scalable Vector Graphics](https://developer.mozilla.org/en-US/docs/Web/SVG)\n"}}]