# MIKO.ART - Full Content Archive > Miko Meow is a creative developer, designer, and musician making browser-native apps, drawing tools, and sound experiments — creator of Sketchpad, Color Piano, and ColRD. Generated: 2026-08-16T06:49:53.569Z Author: Miko Meow Website: https://miko.art Curated index: https://miko.art/llms.txt Journal index: https://miko.art/journal/ This file contains every journal entry in reverse chronological order. --- ## Color Piano, Reintroduced URL: https://miko.art/journal/2026/04/color-piano-reintroduced/ Date: 2026-04-16 Categories: Apps Tags: Color, Music, Piano, Web Audio Color Piano has been one of the longest-running ideas in my work: a way of learning music through color, spatial memory, and visual association rather than theory-first intimidation. The original concept goes back years, but the newer site makes the idea feel clearer and easier to walk into, especially for people who think of themselves as visual learners, pattern seekers, or late starters who have been told the front door is somewhere else. In practice At its best, Color Piano sits between instrument, learning aid, and synesthetic experiment. Notes become easier to track. Intervals feel more tangible. Memory gets multiple anchors at once: sound, color, position, repetition. If color can help someone remember a scale, recognize harmony, or simply feel less intimidated by the keyboard, then the software has done something useful. Some projects are exciting because they are new. Color Piano hasn't gotten older so much as more itself. It hasn't changed direction. It's just gotten more honest about the one it was already going. Color Piano hasn't gotten older so much as more itself. The more I return to it, the more it feels like a durable part of the larger body of work around creative tools, visual systems, and musical interfaces. So this is less a launch announcement than a reintroduction. Color Piano is still here, still evolving, and still trying to make music feel a little more visible. --- ## Be Here Meow v1.0 URL: https://miko.art/journal/2024/07/be-here-meow/ Date: 2024-07-29 Categories: Apps Tags: Ai Tools, Journaling, Mindfulness A quiet place to put your thoughts and occasionally be surprised by what comes back. Be Here Meow is officially here. After months of building, testing, and listening to the kind people who walked through beta with us, we're stepping into v1.0. If you're new, welcome. If you've been with us since the beginning, thank you for staying. What's inside When you write about a dream, the app notices and offers an interpretation. Most of us forget our dreams by the time we've poured coffee, and the ones we remember we never do anything with. We wanted to give those fragments somewhere to land. Every entry generates an image based on what you wrote. Not a stock photo, not a generic mood. An actual visual response to your actual words. Over time, your journal becomes a kind of gallery of the days you've lived. You can export everything you've ever written, whenever you want, in full. Your words belong to you. If you want to take them somewhere else someday, you can. There's a haiku feature too. The people in beta loved it, so we kept it. The calendar view, light and dark mode, search, tags, all of that works the way you'd hope. Quietly, in the background, while you write. What it's for What we set out to build was a quiet place to put your thoughts and occasionally be surprised by what comes back. We think we got close. Write. Reflect. Rest. --- ## Sketchpad 5.0 URL: https://miko.art/journal/2018/01/sketchpad-5-0/ Date: 2018-01-09 Categories: Apps Tags: Drawing App, Sketchpad Hot off the press, released January 2018! Introducing Sketchpad v5.0 (codename Fancy Fox), a year after 4.1. The biggest change: brushes now draw *into* layers instead of just on top of them, which opens up a pile of creative techniques that weren't possible before. Sketchpad's exciting new features: - Thousands of new [Clipart](https://sketch.io/sketchpad-v5.1/guide/#clipart) provided by OpenClipart! - Hundreds of new [Fonts](https://sketch.io/sketchpad-v5.1/guide/#text) provided by Google Fonts! - Entirely new [Sketchpad User Guide](https://sketch.io/sketchpad-v5.1/guide/#welcome) developed by Ryan Reece! - **Paint into layers:** You can now use any brush to draw into any Shape or Image layer! - **Mirror Brush:** A crowd favorite! The mirror brush, as its name suggests, allows you to easily draw symmetrical imagery, similar to a mandala. For example the image above was created with this brush! We find this tool to be especially effective art therapy. - **Tile Brush:** Perhaps the most versatile brush, the Tile Brush, allows you to stretch an image across any path that you draw. This can be a lot of fun! If you want, you can even drag an image from your Desktop onto the Stroke, and stretch that image along the path you draw. Experiment for joys abound. - **Align layers:** When using the Select tool you can now align layers in respect to other layers. The new methods supported are: _top, left, right, bottom, horizontal, vertical_ - **Distribute layers:** When using the Select tool you can now distribute layers in respect to other layers. The new methods supported are: _horizontal, vertical_ We hope you enjoy Sketchpad v5.0! As always feel free to drop us a [message](https://sketch.io/contact.html) and let us know what you think :) --- ## Sketchpad 4.1 URL: https://miko.art/journal/2017/01/sketchpad-4-1/ Date: 2017-01-04 Categories: Apps Tags: Drawing App, Sketchpad Extra extra! Released January 2017. There’s a new SketchPad in town, focused on making it feel at home in more places around the world. Themes let you pick a look (I’m on "Deep Purple" right now), and 12 professional translations just shipped, including full RTL support. Here’s a rundown of the latest features: - Choose a theme, or create your own! My current favorite is [Deep Purple](https://sketch.io/sketchpad/?theme=DeepPurple)! - 12 languages professionally translated, complete with LTR/RTL support: - [English](https://sketch.io/sketchpad/?lang=en) - [中文 (Chinese)](https://sketch.io/sketchpad/?lang=zh) - [Español (Spanish)](https://sketch.io/sketchpad/?lang=es) - [日本語 (Japanese)](https://sketch.io/sketchpad/?lang=ja) - [Português (Portuguese)](https://sketch.io/sketchpad/?lang=pt) - [Deutsch (German)](https://sketch.io/sketchpad/?lang=de) - [العربية (Arabic)](https://sketch.io/sketchpad/?lang=ar) - [Français (French)](https://sketch.io/sketchpad/?lang=fr) - [Русский Язык (Russian)](https://sketch.io/sketchpad/?lang=ru) - [한국어 (Korean)](https://sketch.io/sketchpad/?lang=ko) - [Polski (Polish)](https://sketch.io/sketchpad/?lang=pl) - [Svenska (Swedish)](https://sketch.io/sketchpad/?lang=sv) - Realtime preview of tools while editing settings! - High-Res export is now more reliable with all tools. - SVG export has been added. - Heart shape added. - A few spunky new clipart have been added, not much, but super cute, more soon! - The interface has been smoothed out, to be more a structured, uniform, and visual user experience. - Vector Fill has greatly improved support for Clipart. - Bitmap Fill (previously Floodfill) is back! The latest version creates a vectorized cache of the floodfill region making future renders much speedier. - Much speedier scrolling of Layers/History panes thanks to [Clusterize.js](https://clusterize.js.org/) Hope you enjoy! Btw, If you work with a school or non-profit education center [contact me](https://sketch.io/contact.html?type=nonprofit) about getting a free license to use SketchPad with your students. --- ## Sketchpad 4.0 URL: https://miko.art/journal/2016/06/sketchpad-4-0/ Date: 2016-06-17 Categories: Apps Tags: Drawing App, Sketchpad I’m excited to announce [Sketchpad 4.0](https://sketch.io/sketchpad/)! The focus of this release was making the app more colorful, faster, and easier to use. That meant rewriting a lot of the interior: real gradient editors, smoother text editing via OpenType.js, and VectorFill replacing the old bitmap FloodFill for crisper edges and much faster rendering. Here’s an overview of what’s new: - Stroke/Fill is available on all brushes. - VectorFill replaces Floodfill for crisper edges and much faster rendering! This can lead to some fun by importing an SVG into Sketchpad, re-coloring it, and download it back as an SVG (right click to download!). - Linear gradient editor - Radial gradient editor - Text updates with special thanks to [OpenType.js](http://nodebox.github.io/opentype.js/) & some inspiration from [FitText](https://github.com/astrojs/fitsjs/)! Editing text now feels very smooth. Additionally these new features are available: 1. Font Size is automatically set based on textarea dimensions 2. Bold, Italic, Underline & Stroke styles 3. Align Left, Center, Right & Justify 4. Line Height & Letter Spacing - Crop has been merged with the Resize tool making life simpler. What’s better the crop tool now automatically zooms your viewport to fit so you can see your entire document while cropping. - Your library view has been updated with a more robust & spacious interface, along with more obvious buttons for renaming, duplicating, and removing documents. - High-res export now works on all tool and style combinations! - New auto-save UI allows you to disable the ‘auto-saving’ feature. This is helpful especially on large documents with thousands of layers that may take awhile to autosave. Although, to that end, auto-saving is much faster in the new version. - And finally you’ll find an export button right on the toolbar for all those who requested it! - Special thanks to [jsondiffpatch](https://github.com/benjamine/jsondiffpatch) which is now used in Sketchpad’s history. There are a couple things that could not be 100% converted to the new version Sketchpad. You may want to consider whether these matter to you before upgrading your files (you will be prompted). My apologies for any inconvenience these may cause you: - FloodFill was deprecated. It just did not make sense to keep in. It cost too much to maintain, it was notorious for crashing users' browsers. Sketchpad is a vector app, so a bitmap FloodFill never made sense. The new VectorFill replaces the FloodFill, and the results are much nicer! - LinearGradient format needed to be upgraded in order to support the new Gradient Editor, and in doing so, LinearGradients may shift slightly. If for any reason you’d like to use the _older version of Sketchpad_ you can find it at its new permanent URL: [Sketchpad 3.7.6](https://sketch.io/sketchpad-3.7.6/) Or better yet, check out the latest! [Sketchpad](https://sketch.io/sketchpad/) --- ## C.A.R.D.S. Project URL: https://miko.art/journal/2015/10/c-a-r-d-s-project/ Date: 2015-10-19 Categories: Code Art Tags: Canvas, Generative Art I was recently asked to create artwork for the [C.A.R.D.S. Project](http://thecardsproject.com). Chris & John gave me no restrictions, and only one task: Create something interesting that fits on a 3.5 x 2.0 business card. For me, this was a dream project and an exciting excuse to play around with some generative algorithms! My goal was to create an 'ocean scene'. To do this I used Perlin noise vector fields, bezier curves, and color cycling. The 'creatures' or 'waves' are grown based on randomized parameters such as 'width', 'length' and 'color'. The parameters change over time; some linearly, while others are mapped to cosine/sine waves and easing functions (this resulted in a more organic feeling). I ended up submitting 250 unique cards to the project. Each card is composed of 10-frames and took 1-2 minutes to generate. Many were thrown out in the process! From there the cards were sent to [GifPop](http://gifpop.io/) for lenticular printing. Here's a few of my favorites (the squid in the first image is by Justin Windle): [](images/screen-shot-2015-08-11-at-055212-2_20314615179_o.png) [](images/screen-shot-2015-08-11-at-053939_20313118610_o.png) [](images/perlin-noise_20799892485_o.png) [](images/perlin-noise_20790376802_o.png) [](images/perlin-noise_20613175359_o.png) [](images/perlin-noise_20613161489_o.png) [](images/perlin-noise_20613042299_o.png) [](images/perlin-noise_20611897280_o.png) [](images/perlin-noise_20611818660_o.png) [](images/perlin-noise_20178989383_o.png) [](images/perlin-noise_19985452132_o.png) [](images/perlin-noise_19985443852_o.png) [](images/perlin-noise_19966948056_o.png) [](images/perlin-noise_19966917556_o.png) [](images/perlin-noise_19854886179_o.png) [](images/gradient2622scale00006865198035661689seed09447263730689883-1_20830072315_o.png) [](images/gradient114scale00010705421606872893seed09447263730689883-2_20641740428_o.png) [](images/gradient86scale00011066297416606127seed09447263730689883-1_20641485088_o.png) [](images/gradient59scale00007795513832380769seed09447263730689883-2_20206943934_o.png) [](images/gradient47scale00005197800407278259seed09447263730689883-2_20207076014_o.png) [](images/gradient10scale00008660784598281973seed09447263730689883-4_20641470340_o.png) [](images/gradient5scale00015952325924743118seed09447263730689883-6_20819934432_o.png) --- ## Sketchpad 3.7 URL: https://miko.art/journal/2015/02/sketchpad-3-7/ Date: 2015-02-03 Categories: Apps Tags: Drawing App, Sketchpad [Sketchpad v3.7](https://sketch.io/sketchpad/) has arrived, February 2015! This is the release I’d been hearing the most requests about: 300DPI export for print, automatic library saving so you never lose work, and path smoothing on the pencil tool so your lines stop looking shaky. Full list of new features: - High-Res export for print! 300DPI - Autosaving to library! - Document resizing. - Path smoothing on Pencil tool, no more shaky lines! - Path tool: curved path editor. - Polyline tool: straight line editor. - Arrow brush with curved path (or straight path) - More background styles! Colors, gradients and patterns, oh my. - Outline style on Shapes, Text, and various supported Brushes. - Angle control on Linear Gradient style. - Color Noise on Linear & Radial Gradients - Designed for Mobile/Desktop hybrid experience. - Improved speed of undoing multiple actions. - Text-box resizing without scaling by holding ShiftKey. Play around with the latest version to see for yourself 😊✨ --- ## Made with Code URL: https://miko.art/journal/2014/06/made-with-code/ Date: 2014-06-23 Categories: Apps Tags: Creative Coding, Generative Art, Webgl I recently had the pleasure of working on Google’s [Made with Code](https://www.madewithcode.com/) initiative with the [Red & Co.](http://redandco.com/) creative studio and Mash, a group of developers located in Portland Oregon. My primary focuses were creating the renderer for the Bracelet Challenge along with the binary exporter that takes people's rendered bracelets and sends them to Shapeways for 3D printing. I have to say this job was probably the most satisfying work that’s come my way! For three reasons: (1) The initiative of inspiring a more diverse range of people interested in programming at an early age is awesome (2) Red & Co and Mash were friendly, fun and altogether great team to work with (3) The work was challenging and allowed me time to work with more cutting edge technologies. The Bracelet renderer was developed with ThreeJS. My modest contribution back to the ThreeJS project can be found here: [STLBinaryExporter](https://github.com/mrdoob/three.js/blob/master/examples/js/exporters/STLBinaryExporter.js) The letters were generated by Red & Co. and exported into STLs. Since STLs are _huge_ uncompressed representations of 3D objects (made up of tons of triangles) the files from there were converted into CTMs using [OpenCTM](http://openctm.sourceforge.net/)'s ctmconv, this shaved 10’s of megabytes of the combined file-size of the entire alphabet. The letters were then mapped to a spiral like lego bricks as conceived by Ryan Reece of Mash. Here’s a screenshot of what that looked like: [](images/Screen-Shot-2014-06-05-at-11.33.53-AM.png) The app also needed to run in Java (on Google’s AppEngine) so the server could render the bracelets the users created. Although the app could very well send the [STL](http://en.wikipedia.org/wiki/STL_%28file_format%29) files directly to Shapeways, we needed to control what was being sent so there was no unfortunate surprises! By rendering on the backend we could be sure what was being sent to Shapeways. Instead of re-writing the code from scratch I decided to keep as much as possible in Javascript. I first got the scripts running in [Rhino](http://en.wikipedia.org/wiki/Rhino_%28JavaScript_engine%29) but it was too slow. I ran across the project [Jav8](https://code.google.com/p/jav8/) and was quite happy with the results performing around 10x faster than Rhino. I ended up writing some of the matrix math in Java and exposing the function to Javascript to speed things up further. From there, the bracelets are sent to Shapeways where they are printed with high-quality nylon plastic on 3D printers from EOS, a German printer manufacturer who provided P760 SLS 3D printers to support the initiative. The Bracelet challenge has a limited print run, so get them while you can! After that there will still be a lot of other fun challenges on the Made with Code website. --- ## Sketchpad for Custom Print URL: https://miko.art/journal/2013/10/custom-print/ Date: 2013-10-28 Categories: Apps Tags: Creative Tools, Drawing App, Sketchpad Sketchpad has been used in applications from scientific machine learning, to kids drawing, but we haven’t had much chance to focus on any commercial aspects. This is why we’re excited to be changing that. We’re gearing up to provide the technology that makes your users' product customization experience quick and easy by tapping into our experience + codebase in building Sketchpad. One of the many features we’re creating to push the envelope is instant previews of customized products, there is no more need to upload the artwork, process the preview on the server, and then download once again, this can all be done in milliseconds in the browser. We’re looking for partners who own print companies, with websites that are in the need of automation and HTML5 goodness. Connect with us at [Sketch contact](https://sketch.io/contact.html). --- ## Sketchpad 3.0 URL: https://miko.art/journal/2013/07/sketchpad-3-0/ Date: 2013-07-19 Categories: Apps Tags: Drawing App, Sketchpad Sketchpad 3 is available in the Chrome Webstore (for free), combining WebGL effects with vector editing, and lots of HTML5 goodness! You can now drop a photo through webcam filters and paint onto the result in the same session, and save your whole document (vectors + attached assets) as a single .SKETCH package via drag-and-drop. Some of the major improvements include: - [Webcam FX](https://chrome.google.com/webstore/detail/webcam-fx/inlmgknpbjingijmnphnnjakekmncnai?hl=en-US) core integration, take photos with your camera, add filters, and place into your drawing! - Save your entire drawing, from vector commands, to attached assets into a single .SKETCH package container which can be reloaded into the app via Drag & Drop. Special thanks to [Zip.JS](http://gildas-lormeau.github.io/zip.js/) - Gradient text support (with live preview). - Improved SVG parsing/rendering. - Improved UX. [Sketchpad](https://sketch.io/sketchpad/) --- ## WebcamFX - GLSL Shaders URL: https://miko.art/journal/2013/07/filterstack-webcam-effects/ Date: 2013-07-08 Categories: Apps Tags: Image Filters, Shaders, Webcam Effects, Webgl Take photos with your webcam: mix and match combinations of filters to come up with your own unique effects. FilterStack includes a large collection of filter combinations to help get you started. Once you're happy with your image, you can save to your computer, or upload to Sketch.IO to share with your friends. Similarly, you can share your custom filters as well, this way your friends can use the same filter you made for their own pictures. To enable editing, hover over the right side of the app, this will display the sidebar. Here you can: add filters, modify the values of each filter in the stack, reorganize which filter is processed first, enable/disable filters, or remove filters. Each of these controls can create vastly different effects. Play around, share the results, and let us know what you think! Available as a [Chrome Extension](https://chrome.google.com/webstore/detail/filterstack/inlmgknpbjingijmnphnnjakekmncnai?hl=en&gl=US) or [Web app](https://sketch.io/webcam-fx/). [](images/3a611e84-6702-4fae-b255-c748188d7939.jpg) [](images/3e4984d9-52c3-4bfe-a41c-68d6c32e6d9e.jpg) [](images/4c29056b-014a-46d2-a811-93d9b8e3b430.png) [](images/5b1fa9f0-4dc1-4fa3-a9a4-767797db5d5c.jpg) [](images/6fa21528-ff94-4461-afb6-d6371f4fbc3b.jpg) [](images/007.png) [](images/7d48a7f3-2667-49de-9d28-f54d0b896884.png) [](images/8a098df6-0203-45e9-bf84-7f735e027d7c.png) [](images/8ce0a62e-d8f4-4465-bbc8-dc3db7eb6928.png) [](images/8f974d64-2239-41d1-9ac9-7961ef155345.png) [](images/9bd8f69a-62fa-4c76-bcba-f38782393760.png) [](images/22b8a597-6755-4107-80bf-f66eac50b8a9-1.png) [](images/30f4602a-e332-4720-a5aa-a391b7727658.png) [](images/050.png) [](images/056.png) [](images/058.png) [](images/062.png) [](images/067.png) [](images/87b4442e-4645-4c5d-8ca5-51dde79fd87d.jpg) [](images/93b8cb10-707e-41f0-a981-707a2bfa76cc.png) [](images/399d71ab-3b05-4466-851d-2bf88ee7c87a.png) [](images/421a56b3-60c2-4cd5-b607-6249d54c7ece.jpg) [](images/687c619d-fe21-4b4e-a098-887df084d083.png) [](images/970c3962-32e0-452e-8279-8330ba00fce7.png) [](images/5261b49c-8df9-4703-b453-79db8d16bc6e.png) [](images/5997b176-9b28-4d4c-a29d-543b772400a0.png) [](images/06408c29-b75f-4c57-ad5f-71a98f00b036.png) [](images/9144c5d9-4d4f-4baf-92e2-8bb5bed62c3d.jpg) [](images/9794f42a-ab83-4b0b-a754-30339c643b40.png) [](images/343711d8-c1cc-42bf-b1f4-2e6896b3b545.png) [](images/756398da-06b2-41cf-97fc-7319b3a52ac6.png) [](images/2909228b-a971-49e8-b822-08d5131b9617.jpg) [](images/9007740921_c6783059f6_o.jpg) [](images/9009117952_57e84e5760_o.jpg) [](images/a53b19f8-eeca-42bc-9d80-a9a81d569d8e.jpg) [](images/aeacd09d-8d87-4c13-8af7-10c8c1db5748.png) [](images/aec61ace-e152-4412-97cb-f5d5ebe2c5f3.jpg) [](images/b33d7fef-cb5c-4ef1-8472-2b4151726ce8.jpg) [](images/bc562e1b-067a-42d7-865e-764dc241b78f.png) [](images/c2a10764-d19a-4c2a-a58c-01f46196d2a7.png) [](images/d356d721-78cb-4904-b289-d5be9ecdc217.png) [](images/d948411d-b8ad-4601-8d94-a724e48d23ec.jpg) [](images/Drawing-14.png) [](images/Drawing-16.png) [](images/png-2-copy.png) [](images/png-3.png) [](images/png-4.png) [](images/png-5.png) [](images/png-6.png) [](images/png-9.png) [](images/Screen-Shot-2013-05-30-at-4.26.26-AM.png) [](images/Screen-Shot-2013-06-07-at-3.35.52-PM.png) [](images/Screen-Shot-2013-06-09-at-5.34.44-PM.png) [](images/Screen-Shot-2013-06-09-at-5.56.34-PM.jpg) [](images/Screen-Shot-2013-06-09-at-5.57.10-PM.jpg) [](images/sketch-3-copy-3.png) [](images/sketch-111.png) [](images/sketch-16.png) [](images/sketch-copy.png) [](images/sketch.png) [](images/sketch1.png) --- ## Sketchpad 2.1 URL: https://miko.art/journal/2012/11/sketchpad-2-1/ Date: 2012-11-03 Categories: Apps Tags: Drawing App, Sketchpad **UPDATE: [Read about Sketchpad 3.0](/journal/2013/07/sketchpad-3-0/)** Where Sketchpad 2.0 introduced non-destructive vector + bitmap editing on the web. Sketchpad 2.1 (SP2.1) takes that bland package of vector tools and borrows features from [Sketch Mobile on the Wayback Machine](https://web.archive.org/web/*/http://sketchpad.io/mobile/), an app that exhibited my furthest exploration in creating colorful environments. SP2.1 is great at creating background wallpapers quickly now that most of the tools work with gradients, and are all editable in place, this can be especially fun on tools like Mr. Doob’s generative brushes, and the improved stamp tool. New features include: - Multiuser drawing (NodeJS + Socket.io) - Editable generative brushes: Chrome, Fur, Shader, Sketchy, Web (via [Mr Doob](http://mrdoob.com)‘s [Harmony](http://mrdoob.com/projects/harmony/)) - Spacebar+drag while you're in a brush (recommended by [Chris Smith](https://twitter.com/startsequence)) - Change the tool type in the options drop-down menu after you’ve created a layer (Chris Smith) - Preview (ghost) the stamp tool before you apply it (Chris Smith) - Crayon tool reintroduced from Sketch Mobile. - Shapes: Rectangle, Ellipse, Polygon, Gear, Star, Burst, Radial Burst, Spiral (Sketch Mobile) - Gradients in the style window, useable with most tools. - Stamp tool now has “Translate” feature, combined with a low “Flow”, and a nice looking gradient, can create beautiful tapestries in a few clicks. You can access SP2.1beta in two ways: - Create your own multi-user drawing room (replace “myRoom” with your room): - [Archived multi-user room example](https://web.archive.org/web/*/http://sketchpad.io/sketch2.1/?server=myRoom) - Create your own personal drawing room: - [Archived Sketchpad 2.1 app](https://web.archive.org/web/*/http://sketchpad.io/sketch2.1/) Have feature requests, or thoughts of how the interface is horrible? I would love to hear! --- ## Sketchpad 2.0 URL: https://miko.art/journal/2012/10/sketchpad-io/ Date: 2012-10-10 Categories: Apps Tags: Drawing App, Sketchpad **UPDATE: [Read about Sketchpad 3.0](/journal/2013/07/sketchpad-3-0/)** Introducing a new way to create graphics online. [Sketchpad 2.0](http://sketchpad.io/sketch/?src=mudcube/1) is a non-destructive vector & image editor, built in HTML5, that you can start using right now, for free! I/O is for input and output, that means, any drawing you make can be shared, forked, and edited. You can drag and drop images and SVGs into your browser to place them in your drawing. Then drag, resize and rotate. The time-machine feature provides unlimited undo/redo functionality. There’s a huge collection of fonts, graciously provided by those involved with the Google Fonts Directory, the text tool allows you to preview _exactly_ what your text looks like, instead of editing and clicking “apply” over and over. The select tool allows you to edit any layer, and even do bulk operations, such as changing the color of multiple layers. Want your own Sketchpad installation? Sketchpad can be used for recoloring patterns for print or textile industries, drawing/photo competitions, customizing products, kids communities, collaging, or whatever else you can dream up, feel free to [contact me](http://sketchpad.io/contact.html) with your project details. --- ## Presets on Google Developer Live URL: https://miko.art/journal/2012/10/making-web-magic/ Date: 2012-10-09 Categories: Talk Tags: Creative Coding, Sketchpad I recently had the honor to be part of a new series called Presets on Google Developer Live hosted by [Paul Irish](https://plus.google.com/113127438179392830442), and lovingly put together by [Louis Grey](https://plus.google.com/100535338638690515335), [Phoebe Peronto](https://plus.google.com/111795175737033304392) amongst other Googlers. We discussed my most popular [Chrome Experiments](http://www.chromeexperiments.com) including [Color Sphere](/sphere/), [Color Piano](/piano/), as well as my latest project [Sketchpad 2.0](http://dev.sketchpad.io). Here’s the description of the show; > Starting today, we’re introducing a new series on +[GDL](https://plus.google.com/104600989437225677892), called Presents, highlighting Google developers and their incredible products. Kicking off is our first series, Making Web Magic, highlighting the minds behind the most popular+[Google Chrome](https://plus.google.com/100585555255542998765) experiments. These +[Google Developers](https://plus.google.com/111395306401981598462) showcase their latest web experiments and discuss how they are making the web faster, more fun, and more open in this 3-episode hangout. > > Join our host +[Paul Irish](https://plus.google.com/113127438179392830442) and see updates from some amazing guests in this three part series: +[Michael Deal](https://plus.google.com/107688529762867989230), +[Mark Danks](https://plus.google.com/114750061080899808673) and +[Hakim El Hattab](https://plus.google.com/110819624687392857345). The episodes air today at 1, 2 and 3 PM Pacific Time. Join us on +[GDL](https://plus.google.com/104600989437225677892): [Google Developer Live](https://developer.chrome.com/live/) --- ## "Time Traveler" piano song URL: https://miko.art/journal/2012/09/the-traveler/ Date: 2012-09-20 Categories: Music Tags: Piano It’s time to start going out of my comfort zone and pursuing music a bit more! This is a song that I wrote earlier this year for the harpsichord and dulcimer, performed on the electric keyboard, and mastered in Logic. It’s dedicated to my sister, who is living in Tanzania the next few years teaching elementary school. It’s already tomorrow where she lives. [Listen on SoundCloud](https://soundcloud.com/michael-deal/harpcimer) --- ## Sketch Mobile URL: https://miko.art/journal/2012/07/sketch-mobile/ Date: 2012-07-18 Categories: Apps Tags: Drawing App, Sketchpad [Sketch Mobile](https://web.archive.org/web/*/http://sketchpad.io/mobile) is a drawing app build for mobile browsers; taking advantage of technologies such as multi-touch, the accelerometer, and the gyroscope; providing a fun & novel environment to express yourself in colorful ways. Sketch Mobile was commissioned by Google as part of the [Mobile Chrome Experiments](http://m.chromeexperiments.com/) released at Google I/O show in San Francisco. It was an exciting project to be part of, I hope you enjoy! This is a short rundown of some of the technologies used to create the Sketch Mobile app; - Accelerometer: shake the device to clear the drawing like an Etch-a-Sketch. - Canvas: used to create the drawing area and outputs of all the tools pixel/vector based tools. This has long been one of my favorite HTML5 elements. - CSS3: used to create responsive design, looking the same on mobile devices as on desktop computers. - Gyroscope: controls where the drips go using spray paint tool. - Icon Fonts: used for all the graphical elements within the application. - localStorage: used to keep configuration when user comes back. **Icon Fonts** One of the biggest challenges in this project was creating a design that would work as well on a 30” monitor, as it would on an iPhone display, without programming separate designs for each of them. In order to achieve this resolution independence we had to throw raster images out the window; instead we opted to use Icon Fonts along with some fancy CSS3 designed/coded by Daniel Christopher. Icon Fonts allow you to create a package consisting of your own custom SVG illustrations, which are embedded with the @fontface CSS3 attribute; the best part is, this feature is supported by all modern browsers ([Can I use: Font Face](https://caniuse.com/fontface)). My favorite resource for creating your custom fonts is [IcoMoon](https://icomoon.io/), they make generating Icon Fonts a snap! Check it out 😊 The only Javascript required for this scalability is the “font-size” on the html/body, everything else uses em’s or %’s to scale from what that “font-size” was set to, looking like this; ```js var width = window.innerWidth / 1280; var height = window.innerHeight / 800; var ratio = Math.min(width, height) * 100 >> 0; document.body.style.fontSize = ratio + "%"; ``` **Event.js** Another hurdle in creating Sketch Mobile was getting the Events working the same across devices, and prototyping missing event features such as gesture support. I ended up putting together one of the most complete events libraries available, this library is especially relevant if you’re building a HTML5 Canvas application, as it takes into account CSS zooming. [Event.js](https://github.com/mudcube/Event.js) is available on GitHub under the MIT license. The primary features of the library includes; - 1 finger click, dblclick, and dbltap, Ghost onclick event shaves off 300ms on response. - 1+ finger tap, taphold, drag, and swipe, Customizable, from 1 to 12 fingers. - 2+ finger pinch, and rotate, Customizable, from 2 to 12 fingers. - Shake detection. - Keeps track of scaling, event bubbling, bounding boxes, and other things manually, in order to make sure things work the same across browsers. In developing Sketch Mobile, a few other projects were indispensable in helping to shave a time in the development process, and make life easier; **Tongseng for TUIO** Tongseng allows developers to use the MacBook pro touch pad as if it were an iPad, transmitting touch events to the browser. It can be a bit tricky to install, but totally worth it… if you’re having problems installing it, you’ll need to compile it on your own, and in XCode you’ll want to click on “fix errors” and switch the code over to the latest SDK. To learn more, head over the excellent HTML5Rocks article on [Developing for Mobile Touch](http://www.html5rocks.com/en/mobile/touch/) by [Boris Smus](http://smus.com/), and head to the bottom of the page near “Developer Tools” to read more. **Adobe Shadow** Developer tool from Adobe that allows you to use your desktop computer as a debug console for mobile devices. You can connect to your device wirelessly, and use your browsers normal error console to get helpful messages that will help debug your applications. Shadow works with Mobile Safari, Chrome Mobile, and the Android Browser; [archived overview on the Wayback Machine](https://web.archive.org/web/*/http://labs.adobe.com/technologies/shadow/) **Chrome Mobile Debug** Even better than Adobe Shadow is the built in debugger for Chrome Mobile. It provides pretty much the same type of functionality as Shadow, but is more “integrated”, and less buggy. Read more about how to get this up and running in Chrome’s modern [remote debugging docs](https://developer.chrome.com/docs/devtools/remote-debugging/). … Read more about Sketch Mobile in the archived “Information” section on the [Wayback Machine](https://web.archive.org/web/*/http://sketchpad.io/mobile/), where you can still find information such as _How to use_ the app and _Humans.txt_ for a full list of contributors. I apologize for the psychedelically colorful presets on the tools. Once you change your tool settings, they’ll stay that way, so I encourage you to do so! Here’s a few drawings created with Sketch Mobile:                         --- ## Color Picker URL: https://miko.art/journal/2012/04/color-picker/ Date: 2012-04-28 Categories: Open Source Tags: Color, Color Picker, Color Tools The latest rendition of the Color Picker “Classic”, themed after Photoshop, GIMP, and other image editors, there are no frills here, it’s a basic Hue, Saturation, Luminance, and Alpha (HSVA) color selector. It works in browsers that support the `` element; Firefox 2+, Safari 3+, Opera 9+, Google Chrome, IE9+. **Configuration:** - size: how large the saturation/luminance area is. - hueWidth: how large the alpha/hue area is. - autoclose: makes picker self closing when clicking outside the box. - color: input rgba() or #hex. - callback: sends your color to your custom function. - toggle(): true or false, to display and hide. - update(): to change the color externally. - eyeDropLayer: layer to grab colors from. - eyeDropMouseLayer: layer to get events from when grabbing colors. **Basic implementation:** ``` picker = new Color.Picker({ color: "#643263", // accepts rgba(), or #hex callback: function(rgba, state, type) { document.body.style.background = Color.Space(rgba, "RGBA>W3"); } }); picker.element.style.top = 220 + "px"; picker.element.style.left = 270 + "px"; ``` You can find this project on [Github](https://github.com/mudcube/Color.Picker.js). Licensed under the MIT. --- ## MIDI.js URL: https://miko.art/journal/2012/02/midi-js/ Date: 2012-02-16 Categories: Open Source Tags: Audio, Javascript, Midi, Web Audio > **[MIDI.js](https://github.com/mudcube/MIDI.js)** (on github) ties together, and builds upon frameworks that bring MIDI generation to the browser. Combine MIDI.js with [jasmid](https://github.com/gasman/jasmid) to create a web-radio MIDI stream similar to this demo… or with [Three.js](https://github.com/mrdoob/three.js/), [Sparks.js](https://github.com/zz85/sparks.js/), or [GLSL](http://glsl.heroku.com/) to create Audio/visual experiments. Piano/guitar simulations, Drum machines, MIDI recording, and all kinds of certified funkitude are within your grasps (with a little elbow grease)! > > [Google Chrome](https://www.google.com/chrome) is recommended for best listening experience, it has timing perfection. Firefox and Safari can both perform a bit more like the piano has been drinking, arrr. > > Carpe beerum, and [commandeer](https://github.com/mudcube/MIDI.js) yer own copy! The Jack the Tunafish artwork was designed by my mom, Boni Deal; [http://bonideal.com/](http://bonideal.com/) View a live demo of the github project; [/midi-js/](/midi-js/) Please report issues and bugs on Github or here, many thanks! --- ## Color Piano 2.0 URL: https://miko.art/journal/2011/12/color-piano/ Date: 2011-12-28 Categories: Apps Tags: Color, Midi, Music, Piano, Web Audio Learn how to play piano songs by watching notes fall towards the keyboard as color-blocks; similar to how Guitar Hero works, but with a real instrument. Color piano Theory (CPT) ties together chords, scales, inversions, octaves, key signatures, and play-by-play examples of classical compositions, getting you started with _playing piano the easy way_ =) Color Piano is free to use, please share! - To download a copy visit the [Chrome Webstore](https://chrome.google.com/webstore/detail/ihmigmmflfcbhdpdgbkkeojchjhhphnh) - View on the web @ [/piano/](/piano/) _Getting your feet wet with Color Piano (features);_ 1. **_Drag & Drop MIDI files_ into your browser**to view/play them in CPT. Helpful links; - [MIDI-Classics](http://www.midi-classics.com/whatmidi.htm) [explains what MIDI is.](http://www.ehow.com/how_5091403_convert-audio-midi.html) - [eHow](http://www.ehow.com/how_5091403_convert-audio-midi.html) explains how-to convert Audio to MIDI. - [VGMusic](http://www.vgmusic.com/) provides MIDIs to an amazing assortment of video games! - [Freebyte](http://www.freebyte.com/music/#midifiles) has links to other collections of MIDI files. - [Piano MIDI collection](http://www.piano-midi.de/midi_files.htm) 2. **Seek to a specific location in the song**, or replay parts your having troubles with; - To do this, use your MouseWheel, or Scroll with two fingers using a Trackpad, or Use the Scrollbar on the right of the Piano. 3. **Play the keyboard with your computers keyboard =)** - \`1234567890-= and asdfghjkl;’ are all black keys. - qweryuiop\[\] and zxcvbnm,./ are all white keys. 4. **Configure the Piano to play slower**when learning a new song, then slowly increase the speed as you get better! - _Step 1._ Click on the Configure cog on the right of the Piano. - _Step 2._ Use the range slider to configure the Speed. 5. **Configure the Synesthesia**, aka color-to-note mapping, that you relate with. My personal favorite is D.D. Jameson, but there are a lot of other interesting options created by people throughout history, starting with Issac Newton. To configure; - _Step 1._ Click on the Configure cog on the right of the Piano. - _Step 2._ Use the select-menu to configure the Synesthesia. 6. **Configure** whether you want to see the **notes _before_** they happen, or **_after_**they happen. Before is default for learning to play piano, after is a mode to be used strictly as a visualizer (much harder to learn from); - _Step 1._ Click on the Configure cog on the right of the Piano. - _Step 2._ Use the select-menu to configure the Visualization. **UPDATES** - 2.1 - 1/6/13 - Download links on MIDIs. - Circle of Fifths Synesthesia modes. - Cache MIDIs in FileSystem for quicker loading. - 2.0.0 - 9/22/12 - 2,000 MIDI songs from Disklavier. - MIDI-browser w/ search engine. - 1.5.1 - 4/23/12 - Previous + next song buttons. - Faster rendering. Fix bugs in Chrome 18. - Play + Theory modes. - 1.4.2 - 12/23/11 - Load MIDI from remote URls in configure pane. - Improved MIDI reproduction. - 1.3.8 - 12/18/11 - Speed controls, and ability to scroll through midi. - Steinway grand piano synth. - 1.3.0 - 12/11/11 - Tie into [Web Audio API](http://www.html5rocks.com/en/tutorials/webaudio/intro/) for more accurate playback in Chrome. - Tie into localStorage to save settings. - Preview notes before they happen. - 1.2.0 - 12/6/11 - Using [base64 soundfonts](/journal/2011/11/base64-soundfonts/). - Now displays all 88-keys of a standard piano. - Watch notes falling towards the keys before the note plays! - 1.1.0 - 11/27/11 - HTML5 `` is used for sound-output. - Color Piano Theory is available on the [Chrome Webstore](https://chrome.google.com/webstore/detail/ihmigmmflfcbhdpdgbkkeojchjhhphnh). - 1.0beta - MIDI-reading support via [Matt West](http://matt.west.co.tt/)‘s very kindly provided [jasmid](https://github.com/gasman/jasmid) project. - Royalty free classical piano pieces from [Disklavier World on the Wayback Machine](https://web.archive.org/web/*/http://www.kuhmann.com/Yamaha.htm). - [/journal/2011/01/color-piano-theory/](/journal/2011/01/color-piano-theory/) - [/journal/2007/03/piano-theory-widget/](/journal/2007/03/piano-theory-widget/) --- ## HTML5: SoundFonts URL: https://miko.art/journal/2011/11/base64-soundfonts/ Date: 2011-11-28 Categories: Open Source Tags: Audio, Midi, Piano, Web Audio [Color Piano Theory](https://chrome.google.com/webstore/detail/ihmigmmflfcbhdpdgbkkeojchjhhphnh) is now available on the Chrome Webstore. There haven’t been any major UI overhauls since [last reported](/journal/2011/01/color-piano-theory/), but there has been a lot of work going on the back-end! Most importantly moving from the Java interface to the native HTML5 `` tag (as Java isn’t supported in the Chrome Webstore). Although this sounds like a simple task, there’s a lot of steps involved; hopefully this will save someone else a bit of trouble! **Generating your own soundfont files;** - [JSMIDI](https://github.com/sergi/jsmidi) will allow you to generate MIDI files with the MidiWriter package; ```js var key = 0x45; // the note A4 var noteEvents = []; Array.prototype.push.apply(noteEvents, MidiEvent.createNote(key)); var track = new MidiTrack({ events: noteEvents}); var song = MidiWriter({ tracks: [track] }); console.log(song.b64); ``` - **Saving the MIDI files to disk;** [File Writer API](http://www.w3.org/TR/file-writer-api/) allows you to save those generated MIDI files to your hard-disk, or, alternatively (and a bit more simple in terms of programming), you could POST the base64 from an embedded `` to .PHP, and write to the file-system; ```js var iframe = document.createElement("iframe"); iframe.src = "index.php?midi=" + (song.b64) + "&key=" + key; document.body.appendChild(iframe); ``` ```js if ($_REQUEST['midi']) { $myFile = "./midi/".$_REQUEST['key'].".mid"; $fh = fopen($myFile, "w") or die("can't open file"); fwrite($fh, base64_decode(str_replace(' ','+',$_REQUEST['midi']))); fclose($fh); return; } ``` - **Getting out of MIDI format;** At this point, we have a bunch of MIDI files. We need to eventually get these MIDI’s -> OGG format, by mapping it to a high-quality SoundFont; - _Older versions_ of iTunes allows you to batch convert from _MIDI’s_ -> _MP4’s_. That was very nice feature that seems to have disappeared… - Online app, such as [SolMire](http://solmire.com/), allow you to convert from _MIDI’s_ -> _MP3’s_ and other formats, one at a time. I especially like that SolMire allows you to choose the desired SoundFont to use on the .MIDI. - [MIDI2MP3](http://www.audiosoftstore.com/downloads.html) is a command line application available for Window and Mac OSX that enables you to use specific SoundFonts in your encodings, and allows you to use the command line… and therefore the ability for batch _MIDI_ -> _WAV_ conversion! [FluidSynth Soundfont GM](http://packages.debian.org/squeeze/fluid-soundfont-gm) is a good .SF2 file to get you started. - **Getting into the OGG format;** - [Switch](http://www.nch.com.au/switch/index.html) (for Mac) allows you to convert from _WAV’s, MP4’s, and MP3’s_ -> _OGG’s_. - [oggenc](http://www.rarewares.org/ogg-oggenc.php) from Vorbis, allows you do batch conversion of _WAV’s_ -> _OGG’s_ using a bash script. The calls are like this: - ./oggenc -m 64 -M 128 audio.wav - **Converting the _OGG’s_ -> _base64_, and storing them in _.js_ or _.jgz_ file(s):** - Read this amazing Tutorial by the [Grinning Gecko](http://grinninggecko.com/html5-offline-audio/)! The following code will allow you to take those MIDI files we created with the JSMIDI package (step #1) and convert them from WAV to OGG to JS to JGZ in seconds! Presenting a solution for the batch conversions of multiple MIDI’s into base64 soundfonts; ```bash #!/bin/bash # gzip - http://www.gzip.org/ # base64 - http://www.fourmilab.ch/webtools/base64/ # oggenc - http://www.rarewares.org/ogg-oggenc.php # midi2mp3 - http://www.audiosoftstore.com/downloads.html # from MIDI to WAV to OGG to JS to JGZ, and beyond! find ./directory -name '*.mid' -print0 | while read -d $'\0' file do # from MIDI to WAV ./inc/midi2mp3 $file -sf ./sf2/FluidSynth_1.43.sf2 -e wave # from WAV to OGG ./inc/oggenc -m 64 -M 128 $file.wav # from OGG to base64 embedded in Javascript echo "if (typeof(Soundfont) === 'undefined') Soundfont = {};" > $file.js echo "Soundfont['`basename $file`'] = 'data:audio/mpeg;base64,`base64 -i $file.ogg -o -`';" >> $file.js # gzipped version gzip $file.js -c > $file.jgz done ``` Now you’re ready to create your own custom Soundfont =) --- ## Batch Thumbnail Generator URL: https://miko.art/journal/2011/11/batch-thumbnail-generator/ Date: 2011-11-24 Categories: Apps Tags: Image Tools Many times, when researching a larger project, I make smaller demos to break up my workflow and keep things fresh. The [Batch Thumbnail Generator](/software/Thumbnailer/) (BTG) is one of these offshoots, a sandbox for creating zip packages with the [BlobBuilder API](http://dev.w3.org/2009/dap/file-system/file-writer.html), and Flash-based download solutions. I also used BTG to create the thumbnails for the [Software](/software/) page, which didn’t quite justify the time invested. BTG allows you to quickly produce .zip thumbnail packages; - Drag & Drop images into the browser. - Tug on the images to resize them, or enter a specific width & height. - Crop images “to fit”, or “to edges”, or not at all. - Center the image horizontally & vertically, or not at all. - Add a background color to your outputted images, or transparency. - Generate batches of thumbnails in “JPEG” or “PNG” format. - Special thanks to; [JSZip](http://jszip.stuartk.co.uk/), [FileSaver](http://eligrey.com/demos/FileSaver.js), [BlobBuilder](https://github.com/eligrey/BlobBuilder.js), [Downloadify](https://github.com/dcneiner/Downloadify) and [SWFObject](http://code.google.com/p/swfobject/)! --- ## ColRD: Image DNA URL: https://miko.art/journal/2011/11/colrd-image-dna/ Date: 2011-11-22 Categories: Apps, COLRD Tags: Canvas, Color Tools, Image Analysis Exciting news on [ColRD.com](http://colrd.com)! Today we’re announcing the [public beta of Image DNA](https://chrome.google.com/webstore/detail/nifmhaejjafapjonfiidojfddmpndkmc), available exclusively on the Chrome Webstore. Image DNA is an application that aides you with intelligent extraction of colors from images. The colors extracted are spread evenly across the humanly visible spectrum; so you’ll notice, for example, although there is not much blue in this picture (above), the popular colors extracted will be evenly spread throughout the blue/brown spectrum, this gives you a wider range of colors to select from, with less choices. **Features:** - Drag and Drop images into the browser for automatic extraction (FileReader), or enter a URL. - Use the EyeDropper or Color Picker for manually selecting colors. - Zoom and pan around image to find the perfect color. - Breakdown of top 78 unique and simultaneously most reoccurring colors. - Download your color palette for Illustrator, Photoshop, or GIMP. - Share your palette on [ColRD.com](http://ColRD.com) =) Download for free at the Chrome Webstore; [Image DNA](https://chrome.google.com/webstore/detail/nifmhaejjafapjonfiidojfddmpndkmc). --- ## Portland Ketchup URL: https://miko.art/journal/2011/11/portland-ketchup/ Date: 2011-11-16 Categories: Portlandia Foods Tags: Portlandia I’m thrilled to see [Portland Ketchup](http://portlandiafoods.com) in the [Oregon Museum of Science & Industry](http://www.omsi.edu/) (OMSI). This place has always held a sweet place in my heart; it was, and continues to be, an adventure to visit, from the newest exhibits to its oldest classics. Who could forget being part of a zero-gravity simulation, having their friends shock them with a hand-crank generator, or experiencing various types of earthquakes? There’s lizards, dry ice experiments, knowledge on the solar system, a planetarium, the [OMNIMAX](http://www.omsi.edu/omnimax), dinosaurs, games, and even a [nuclear submarine](http://www.omsi.edu/submarine). Keep up to date on the [events calendar](http://www.omsi.edu/events); there’s always something interesting going on at OMSI. One of our main missions at Portlandia Foods is to provide a healthier alternative in public spaces. Because when people don’t have a choice, shouldn’t the only choice be a good one? I feel that Portlandia Foods has simply reset the clock in regards to ketchup, that is to say, Portland Ketchup is probably what ketchup tasted like in the 1920s; there was no High Fructose Corn Syrup (HFCS), or Genetically Modified (GMO) tomatoes. At Portlandia Foods, we use only the highest quality organic ingredients, and work hard to get those ingredients as locally as possible. I have to admit, our ketchup is pretty tasty… those tomatoes deserve all the credit though!! My mom designed this beautiful poster for the OMSI cafeteria! See more of her work at [BoniDeal.com](http://bonideal.com) --- ## Color Sphere URL: https://miko.art/journal/2011/11/color-theory-visualizer/ Date: 2011-11-15 Categories: Apps Tags: Color, Color Theory, Color Tools Color Sphere was one of my 1st HTML5 projects, way back in 2007. Well, the years passed, browsers sped up, my hair grew longer, and nothing changed on Color Sphere… but the time has come! The latest rendition is bigger (easier to see), more accurate (pixel perfect), and looks really cool when you switch it to Websafe mode and move the Saturation slider around. The colors in Color Sphere are mapped to HSL. The luminance is the radius from the center, the hue is the angle, and the saturation controls the z-index; that is to say, the zoom into the HSL color space. Technically, it’s more of a color cylinder. Head over to the [Google Chrome Webstore](https://chrome.google.com/webstore/detail/knomilfbnhpkmibhmleppnkmcempglag) and pick up the free browser app! Or _access it online_ at [Color Sphere](/sphere/). Let me know what you think about the changes! The [old version](/software/Color-Sphere-dev/) can still be accessed for IE8 and below. --- ## Print-ready graphics in Canvas URL: https://miko.art/journal/2011/11/print-ready-graphics-in-canvas/ Date: 2011-11-09 Categories: Diy Tags: Canvas, Image Tools Last month, I posted about the possibility of creating high-resolution and print-ready graphics in ``. Since then, it’s been in the back of my mind, but happened to be at Kinko’s today, and decided to take this experiment to the next level… The following flash-cards were designed in Illustrator \[by [Altered Focus](http://alteredfoc.us/)\], exported into SVG, then parsed into ``… and finally, that one template card (in the picture below it’s the “C” major card on the left) was used to create a large variety of combinations, based on a set of music-theory instructions. Such as; ```js Chord = { // definition for an A chord e1: false, a: { 0: true }, d: { 2: 1 }, g: { 2: 2 }, b: { 2: 3 }, e2: { 0: true } } ``` **The best thing is;** the designer can change the **design in Illustrator** and the design is **automatically updated on the front-end**, the programmer doesn’t even notice. I’m telling you, _Illustrator is one bad-ass HTML5 editor. There are a few bugs in my music-theory code (please excuse the improper fingering positions!), but, as you can see from the following [1,264 x 65,320 pixel image](http://www.flickr.com/photos/mudx/6223941349/sizes/o/in/photostream/), you can create hundreds of variations of a single design. The nice thing is, I can find the bug in my code, fix it, and then updating hundreds of them takes about 30-seconds of CPU time! Next step; find a good printer, and then get these cards into the local-guitar shops around Portland. Oh, and, was thinking… Jacob Seidelin’s [Canvas2Image](http://www.nihilogic.dk/labs/canvas2image/) could be modified to specify the resolution the toDataURL export from ``, exporting into 300DPI, instead of a scaled up 72DPI. **Alternative route to convert from Illustrator to ``** Although it’s not as versatile as a full-blown SVG-parser (as it’s a bit harder to modify the contents) you can get from Illustrator to `` in a much quicker/easier way; [AI-Canvas](http://visitmix.com/work/ai2canvas/) allows you to export from Adobe Illustrator directly into `` paths, and even animations. --- ## Bitwise Gems and other optimizations URL: https://miko.art/journal/2011/11/bitwise-gems-and-other-optimizations/ Date: 2011-11-07 Categories: Open Source Tags: Canvas, Javascript One of my favorite posts in the last few years was [Bitwise Gems in AS3](http://lab.polygonal.de/2007/05/10/bitwise-gems-fast-integer-math/) by _Polygonal Labs_, an article inspired by [Bitwise Operations in C](http://www.gamedev.net/reference/articles/article1563.asp) on _Gamedev_. This article is a summary of what I’ve learned, applied to Javascript, plus a few other tricks. **What’s the wisdom in using bit_wise_?** Bitwise operations can be moderately faster than conventional methods. When processing a lot of data, even a 5% increase in speed can become noticeable. A good example of where you would want to use bitwise operations is in the pixel-manipulation of a _`` element_, especially when dealing with larger dimensions. When you add up all speed improvements here, and then multiply that by each user that uses your application around the world, we could be talking about _years of time saved!_ (in the collective sense). Standard operation on the (left) === (right) is bitwise or an alternative method such as replacing Math.max(a, b) with (a > b ? a : b). All speed results are measured in Javascript using _Google Chrome 15_. Without further ado; **Minimize calls to new Object() and new Array();** _+/- 50% **faster** using flat-variables, not bitwise, but still wise._ ``` var rgb = { R: 255, G: 0, B: 0 }; // slow. var rgb = [ 255, 0, 0 ]; // faster by 40% var R = 255, G = 0, B = 0; // faster by 50% ``` \[2-23-2012\] Updated as per [Closure Compiler](https://groups.google.com/group/closure-compiler-discuss/browse_thread/thread/f7a4bc71f35461e3) group discussion. **Rounding, flooring, and ceiling with bit-shifting;** _+/- 20% **faster** using bitwise operations._ ``` var n = Math.PI; Math.round(n) === n + (n < 0 ? -0.5 : 0.5)>>0 Math.ceil(n) === n + (n < 0 ? 0 : 1) >> 0; Math.floor(n) === n + (n < 0 ? -1 : 0) >> 0; ``` Or, if you’re certain the number will be positive (for example dealing with pixel values): ``` var n = Math.PI; Math.round(n) === (n + 0.5) >> 0; Math.ceil(n) === (n + 1) >> 0; Math.floor(n) === n >> 0; ``` **Storing mathematic constants in local variables;** _+/- 15% **faster** than not doing it, just a reminder. ``` var E = Math.E; var PI = Math.PI; var SQRT2 = Math.SQRT2; var SQRT1_2 = Math.SQRT1_2; var LN2 = Math.LN2; var LN10 = Math.LN10; var LOG2E = Math.LOG2E; var LOG10E = Math.LOG10E; ``` **Fast modulo operation using bitwise AND (&);** _+/- 15% **_faster_** using bitwise operations. _ ``` var numerator = 99999; var divisor = 4; // divisor must be power of 2 (numerator % divisor) === (numerator & (divisor - 1)); ``` **Math.max & Math.min;** _+/- 15% **faster** using alternate operations._ ``` Math.max(a, b) === (a > b) ? a : b; Math.min(a, b) === (a < b) ? a : b; ``` **Math.abs;** _+/- 10% **faster** using bitwise, or alternate operations. The best solution here is not the bitwise operation, nor Math.abs()._ ``` var n = 99999; var n = Math.abs(n); var n = n > 0 ? n : -n; // +/- 10% var n = (n ^ (n >> 31)) - (n >> 31); // +/- 3% ``` **Test for even/uneven integers using bitwise AND;** _+/- 10% **faster** using bitwise operations._ ``` var n = 99999; ((n % 2) == 0) === ((n & 1) == 0); ``` **Multiply by any power of two using left bit-shifting;** _+/- 5% **faster** using bitwise operations._ ``` var n = 99999; (n * 2) === (n << 1); (n * 64) === (n << 6); ``` **Divide by any power of two using right bit-shifting;** _+/- 5% **_faster_** using bitwise operations._ ``` var n = 99999; (n / 2) === (n >> 1); (n / 64) === (n >> 6); ``` **Swap integers without a temporary variable using XOR (^);** _+/- 5% **faster** using bitwise operations._ ``` var a = 1, b = 2; // standard var tmp = a; a = b; b = tmp; // bitwise a ^= b; b ^= a; a ^= b; ``` **Sign flipping using NOT (~) or XOR (^);** _+/- 2% **_faster_** using bitwise operations._ ``` var n = 99999; (-n) === (~n + 1); ``` **HEX -> RGB conversion;** ``` // 24-bit var hex = 0x336699; var r = hex >> 16; var g = hex >> 8 & 0xFF; var b = hex & 0xFF; // 32-bit var hex = 0xff336699; var r = hex >> 24; var g = hex >> 16 & 0xFF; var b = hex >> 8 & 0xFF; var a = hex & 0xFF; ``` **RGB -> HEX conversion;** ``` // 24-bit var r = 0x33; var g = 0x66; var b = 0x99; var hex = r << 16 | g << 8 | b; // 32-bit var r = 0x33; var g = 0x66; var b = 0x99; var a = 0xff; var hex = a << 24 | r << 16 | g << 8 | b; ``` **Fast color conversion from R5G5B5 to R8G8B8 pixel format;** ``` var R8 = (R5 << 3) | (R5 >> 2); var G8 = (R5 << 3) | (R5 >> 2); var B8 = (R5 << 3) | (R5 >> 2); ``` The speed-tests were done with the following code. ``` // lets pretend were running it on a image 1000x1000 pixels var size = 1000 * 1000; // example code var bit1 = "Math.round(Math.PI)"; // standard var bit2 = "(Math.PI + 0.5) >> 0"; // bitwise // create the speedtest function createFunction(f) { return '(function() { var t = (new Date()).getTime(); for (var n = 0; n < size; n ++) { '+f+' } return t - (new Date()).getTime(); });'; }; var timeFunctions = { a: eval(createFunction(bit1)), b: eval(createFunction(bit2)) }; var timeData = { }; // function getAverage(type) { var loops = 10; var loopid = 0; var average = 0; function go() { if (loopid ++ == loops) { timeData[type] = average/loops; if (type == "a") { // get next setTimeout(function() { getAverage("b"); }, 1); } else { // complete var speedGain = ((timeData.a / timeData.b - 1) * 100 + 0.5); console.log(speedGain + "%"); } return; } average += timeFunctions[type](); // setTimeout so browser can rest one loop setTimeout(function() { go(type); }, 1); }; go(); }; setTimeout(function() { getAverage("a"); }, 1); ``` There are 10 loops \* (1000×1000 pixels) = 10 million iterations are used to get the average execution speed of each function. setTimeout is clear the CPU, and prevent the previous loop from interfering with the next loop. **Further optimizations;** - Replace **_Math.random_** with _Park Miller (1988) [“minimal standard” linear congruential pseudo-random number generator](http://www.firstpr.com.au/dsp/rand31/)._ This is also handy because the results are replicable by the seed you originally send it. - Pre-calculate as much math as possible; - var RAD2DEG = 180 / PI; - var DEG2RAD = 1 / RAD2DEG; - …and so on… - When using [Color Matrices](http://en.wikipedia.org/wiki/Color_balance#Mathematics_of_color_balance) store the values of the matrix to local-variables (m0, m1, m2, m3… etc) before looping the pixels. - Use function calls sparingly; when speed is critical, instead of calling a function, use the contents of the function hard coded into your for() or while() loops. Choose where your line between readability, redundancy, and speed lies. **What optimizations do you use in your _graphics_ or _audio_ applications?** --- ## ColRD: Gradient Creator URL: https://miko.art/journal/2011/10/colrd-gradient-creator/ Date: 2011-10-22 Categories: Apps, COLRD Tags: Color, Color Tools, Gradient Tonight, on [ColRD](http://colrd.com/), we released the latest rendition of [Palette Creator](http://colrd.com/create/palette/), along with our newest addition; the [Gradient Creator](http://colrd.com/create/gradient/)! This new webapp makes it fun and easy to create CSS3 linear gradients . **UPDATE:** You can also download the Gradient Creator as a [Chrome webapp](https://chrome.google.com/webstore/detail/hcplneddoadgichngfbobgpllfphdfla). **Features:** - Drag & Drop GIMP Gradient (.GGR) files into the browser to view them! - Delta Swatch: Shows the colors most similar to the one you’re choosing of the 4096 websmart colors (in CIE-Lab color space). - Keyboard goodness with Color Picker: HSL, RGB, and HEX chooser. - Preview: See your gradient in full-screen mode before you save it. - Flip: Flip your gradient, so: first is last, and last is first. - Intriguing new interface to create gradients! … **Do we need a new gradient editor GUI?** Gradient editors haven’t changed much historically, the same dynamic is used throughout GIMP, Illustrator, Inkscape and Photoshop. For me, these interfaces are clunky, leading to repetitive stress of the wrists and fingers, which prompted me to think, “There must be a better way!”. One of the most click-saving changes was combining the Color Picker and Gradient Creator as one unit, there are no popup windows or “Ok” buttons. Traditionally gradient editors allow users to place a point in space that radiates it’s color in both directions evenly. This is the way that computers think about gradients; color points in space, blended (in the case of ``) linearly. **Description of the Gradient Creator;** - ColRD gradient creator presents itself as color blocks, just like a palette. - Inside each color block you will find the midpoint controller, these controllers allow you to stretch the color towards the left or the right of the block. - To the left and right of the color block are col-resize controllers, these allow you to scale the width of the color block and the adjacent one. - Color blocks can be reorganized by dragging and dropping, without rescaling the color block or the ones around it. - If you drag and drop a color block onto the Color Picker, the color will be removed from your gradient (re-absorbed into color space!). **Future developments;** - GGR, SVG, and CSS3 exporting (soon, as in this week). - Desktop wallpaper generator; textures, gradients, and user defined sizing (see [previous article](/journal/2011/10/background-generator/)), along with the Gradient Noise generator. - Time-machine (undo and redo). - The user could split the midpoint, creating a shadow of itself in the opposite direction, this way the user could control the color blur on one edge (as it is now), or both edges simultaneously. The shadow could be fixed to the inverse of the controller (SHIFT-KEY) to create even blurs, or controlled on it’s own independently. If you have any ideas for the future, let us know! **Random thought;** For those interested in exotic gradient editors, SpectraG is a project that uses mathematic equations to generate gradients; [SpectraG on SourceForge](https://sourceforge.net/projects/spectrag/) --- ## Color Accessibility in the Browser URL: https://miko.art/journal/2011/10/color-accessibility-on-digital-displays/ Date: 2011-10-20 Categories: Apps Tags: Color Announcing the release of color-blindness daltonization + simulation bookmarklets; [daltonize.appspot.com](http://daltonize.appspot.com/) The [Chrome Daltonize](https://chrome.google.com/webstore/detail/efeladnkafmoofnbagdbfaieabmejfcf) extension is faster in many cases, and uses less bandwidth than the bookmarklet, highly recommended when Google Chrome is an option! **What is daltonization?** _“Daltonization is a process performed by the computer that allows people with color vision deficiencies to distinguish a range of detail they are otherwise excluded from perceiving. For instance, in the daltonization of an Ishihara test plate (a popular test of color vision) numbers emerge from a pattern that were once invisible to the color blind person.”_ Read more about the [daltonization algorithm](http://www.daltonize.org/2010/05/lms-daltonization-algorithm.html) used on [daltonize.org](http://daltonize.org/). **Technical hurdles with Cross Domain policies;** The following highlight some of the options to get around Cross Domain issues with images; 1. CORS (Cross-Origin Resource Sharing) - Must be recorded in the header of the image hosting website, and the browser must support CORS. This is the best option, it handles the image as if it were any other image. When creating the image use; image.crossOrigin = true; 3. Flash (crossdomain.xml) - The website must have a crossdomain.xml in their root directory, and the browser must have Flash installed. When that is all in place, you can use the ExternalInterface to copy the base64 from Flash into a Image tags src, and subsequently onto ``. 5. UniversalXPConnect (Firefox) - Certain versions of Firefox support this… I haven’t been able to get it working lately, anyone? When it works, it requires the user to click “Accept” to a security box. 7. Base64 proxy from external server. - Max Novakovic’s function [$.getImageData](http://www.maxnov.com/getimagedata/) using [Google App Engine](http://code.google.com/appengine/). This is used as a last-case scenario due to bandwidth concerns. The $.getImageData proxy is used as a last resort, as it produces bandwidth overhead. [CORS](http://www.w3.org/TR/cors/) is the preferable method to access images from external domains. The problem is knowing whether a server supports it or not, the following snippet is a hack to figure out whether an browser/server combination supports CORS, or not; ``` function hasCORS(src, callback) { // Cross-Origin Resource Sharing (CORS) var method = "get"; var req = new XMLHttpRequest(); if ("withCredentials" in req) { req.open(method, src, true); } else if (typeof XDomainRequest != "undefined") { req = new XDomainRequest(); req.open(method, src); } else { // browser doesn't support cors callback(false); } if (req) { // browser supports cors req.onload = function(response) { // server supports cors callback(true); }; req.onerror = function(response) { // server doesn't support cors callback(false); }; req.send(); } }; ``` Hope this helps someone with the same problems! --- ## Background Generator URL: https://miko.art/journal/2011/10/background-generator/ Date: 2011-10-08 Categories: Apps Tags: Canvas, Color, Creative Tools, Gradient I worked on a future release of [BG](/bg/) a few months back, and am excited to share some screenshots! It’s exciting to be able to produce wallpapers **for my Desktop _in my Browser_**. Since creating these images, I’ve found that by using [JSZip](http://jszip.stuartk.co.uk/) and [Downloadify](https://github.com/dcneiner/Downloadify) the browser can generate HUGE, high-resolution and print-ready graphics. The largest file that I’ve successfully exported from Javascript is 17.5MB and 1,264 x 65,320 pixels… that’s enough resolution to print a 30×30 inch poster in 300DPI… more on this later! In the meantime, here are a few of the wallpapers that came out pretty nice: [](http://www.flickr.com/photos/mudx/5760613655/sizes/o/in/photostream/ "View wallpaper on Flickr") [](http://www.flickr.com/photos/mudx/5760785556/sizes/o/in/photostream/ "View wallpaper on Flickr") --- ## Portlandia Foods: Uploader URL: https://miko.art/journal/2011/10/portlandia-foods-uploader/ Date: 2011-10-02 Categories: Portlandia Foods Tags: Canvas, Image Tools, Portlandia At [Portlandia Foods](http://www.portlandiafoods.com/) we’re excited to offer our customers the chance to have their photograph on [Portland Ketchup bottles](http://www.portlandiafoods.com/uploader/)! Previewing what an image would look like is as simple as dragging and dropping a photograph from your desktop into the browser, or clicking “Choose file…” to browse images on your system. HTML5’s [Canvas element](http://www.google.com/url?sa=t&source=web&cd=1&ved=0CB0QFjAA&url=http%3A%2F%2Fwww.w3.org%2FTR%2Fhtml5%2Fthe-canvas-element.html&ei=usiITsmIJs_PiAKDvYypDw&usg=AFQjCNFaKKXgqFnsp7caN2_ZMDRVfOgpmw&sig2=dnZdWbzqntvtwCiTt1R8Sw) along with the [File API](http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBoQFjAA&url=http%3A%2F%2Fwww.w3.org%2FTR%2FFileAPI%2F&ei=cciITsvHGcfmiALgk-20DA&usg=AFQjCNHZAwjf2uyfrebeUohsoiWf5-TdNw&sig2=KnW4-dN8Yj4sOT-_q28cLQ) and [Drag and Drop](http://www.w3.org/TR/html5/dnd.html) are the technologies used to create the demo. --- ## ColRD: Website URL: https://miko.art/journal/2011/08/colrd-life-more-colorful/ Date: 2011-08-17 Categories: COLRD Tags: Color, Color Tools [ColRD](http://colrd.com/) is a new website to help you find [Colors](http://colrd.com/discover/color/), [Palettes](http://colrd.com/discover/palette/), [Gradients](http://colrd.com/discover/gradient/) and [Patterns](http://colrd.com/discover/pattern/). It was developed by Daniel Christopher, of [LucentPDX](http://lucentpdx.com), and myself. The best place to get started is the [Discover page](http://colrd.com/discover/). There you can narrow down results using filter by colors, or types, as seen in the above (Red/Black/Brown Patterns). After many years of selecting colors, I haven’t come across the perfect color picker… With that in mind, the most natural for me so far has been combining the powers of RGB w/ HSL. This is what we did for the ColRD create pages, the [Color Creator](http://colrd.com/create/color/) and the [Palette Creator](http://colrd.com/create/palette/); Once you create some content, or find some things you like, you can start building your own Swatch, where you can quickly find the content that you like. Check out my page, cool stuff: [my ColRD profile on the Wayback Machine](https://web.archive.org/web/*/http://colrd.com/@/mud/) Let us know what you think, and how we can improve your experience! --- ## Music Box URL: https://miko.art/journal/2011/08/webgl-music-box/ Date: 2011-08-08 Categories: Apps Tags: Creative Coding, Midi, Piano, Webgl Last weekend I got a chance to mess around with [Mr. Doob](http://mrdoob.com/)’s rendering framework [Three.js](https://github.com/mrdoob/three.js/) and [Daniel van der Meer](http://www.abumarkub.net/abublog/)’s amazing [MIDIBridge](https://github.com/abudaan/javascriptmidi). I’ve been a big fan of both Ricardo and Daniel for some time now, so it was fun to work with their codebases. Three.js is a lightweight 3D engine that can render in ``, `` and WebGL. Ricardo (Mr. Doob) claims this framework is written “for dummies”, which is perfect for me, because that is exactly where I’m at with 3D programming. Creating this wall of interactive color blocks was simple with Three.js. MIDIBridge allows Javascript to connect to Java’s internal MIDI synthesizer. The author, Daniel, is working on a Javascript to Flash bridge that uses SoundFont2 to map amazing libraries of sound. There are thousands of SoundFont2 patches available, which opens up the doors to all sorts of new creativity. The framework is easy to tie into by sending direct midi messages to specific channels. For instance, the message code 128 turns the note off whereas 144 turns it on. [Matt West](http://matt.west.co.tt)’s MIDI file reader [jasmid](https://github.com/gasman/jasmid) was extremely useful to parse the MIDI files from the server on the client-side using Javascript. I’ve tweaked the script slightly to allow for pausing, and resuming of songs. The collection of royalty free classical piano pieces comes from [Disklavier World](http://www.kuhmann.com/Yamaha.htm). Thank you to all, amazing contributions! Here’s the [WebGL Music Box](/labs/) that reads a selection of classical music such as Tchaikovsky’s Waltz of the Flowers from the Nutcracker. And then there is the [interactive](/labs/) version that you can control the notes with your mouse. This demo has been tested on Mac in Google Chrome, Safari, and Firefox. --- ## ColRD: Color Extractor URL: https://miko.art/journal/2011/08/colrd-color-extractor/ Date: 2011-08-01 Categories: Apps, COLRD Tags: Color, Color Tools, Image Analysis UPDATE: Renamed to Image DNA and released as a Chrome Extension, [read more](/journal/2011/11/colrd-image-dna/). I spent last weekend working on a color palette extractor in HTML5. These examples illustrate automatically picked 7-color and the 90-color palette to represent the image. Although the results are organized by the color popularity within the palette, colors that don’t show up much are given the same diversity in the 90-color palette. For instance, in the following image, the diversity of red in the 90-color palette is given equal weight to green; Speed is looking good, these images are taking around 200ms to process. More to come on this, and future developments in the land of color. --- ## Orange Honey; Epilogue URL: https://miko.art/journal/2011/07/orange-honey-epilogue/ Date: 2011-07-16 Categories: Code Art Tags: Canvas, Creative Tools, Typography The past four years (2007-2011) much of my energy and capital has been focused into building the Mugtug graphics suite; [Sketchpad](https://sketch.io/sketchpad/), [Darkroom on the Wayback Machine](https://web.archive.org/web/*/http://mugtug.com/darkroom/), and Lightbox. The suite has come a long way since I developed Sketchpad during a seven month work binge of Red-Bulls! Through the collaboration of many developers we’ve moved forwards to create an entire framework that blurs the line between “web-app” and “desktop-app”… Due to my own budgetary constraints, and differing visions within the corporation, the time has come for me to move on from [Orange Honey on the Wayback Machine](https://web.archive.org/web/*/http://orangehoney.com/). The projects will continue under the direction of my good friend Charles Pritchard. He is without a doubt _the most_ knowledgable developer I’ve worked with. The following highlight a few of my final contributions to Mugtug; made possible with HTML5; - **Layer Styles**; this module creates effects such as _InnerShadow_, _OuterShadow_, _InnerGlow_, and _OuterGlow_. These are similar to what Photoshop achieves, the difference is, my version has the ability to do what I’ve coined “style stacking”. Style stacking allows the designer to add multiple fills (solid, gradient, pattern) to, for instance, InnerShadow; [](/journal/2011/07/orange-honey-epilogue/images/5807041058_21caef727a_o.png "Open full-size layer styles reference") [](/journal/2011/07/orange-honey-epilogue/images/Screen-shot-2011-03-26-at-9.37.34-PM.png "Open full-size layer styles screenshot") - **SVG Parser**; this module converts .svg files into `` commands, accepting complex examples, supporting features from `<gaussianblur>` to the `<use>` element; [](/journal/2011/07/orange-honey-epilogue/images/Screen-shot-2011-07-16-at-11.09.30-AM.png "Open full-size SVG parser screenshot") This is an image from [OpenClipart](http://www.openclipart.org/detail/21763/sport-car-by-yves_guillou-21763) rendered in the SVG->Canvas parser; [](/journal/2011/07/orange-honey-epilogue/images/Screen-shot-2011-07-16-at-11.08.19-AM.png "Open full-size OpenClipart render") There is no Gaussian blur in HTML5’s ``, and to do a “true” Gaussian blur takes a lot of processing, and computational time. I ended up using Mario Klingemann’s [StackBlur demo on the Wayback Machine](https://web.archive.org/web/*/http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html) to polyfill the support in the SVG parser, the results are pretty good; I think some of the blurring wasn’t turned up enough do to my own Matrix scaling issues. Canvas left, SVG right; [](/journal/2011/07/orange-honey-epilogue/images/Screen-shot-2011-03-14-at-12.41.25-AM.png "Open full-size blur comparison") - **Radial Gradient**; this demo shows how fun radials and gradients can be. [](/journal/2011/07/orange-honey-epilogue/images/Screen-shot-2011-07-16-at-3.07.38-PM1.png "Open full-size radial gradient demo") - **Composite Erase**; this module creates a new composite mode, allowing you to erase colors based on the color of a brush; [](/journal/2011/07/orange-honey-epilogue/images/Screen-shot-2011-07-16-at-3.13.14-PM.png "Open full-size composite erase demo") - **Brushes**; this module adds some fun new brushes to play with, like galaxy (left); [](/journal/2011/07/orange-honey-epilogue/images/Screen-shot-2011-03-15-at-9.51.50-PM.png "Open full-size brushes demo") - **Marquee**; this module creates a “magick wand” with marching ants, for selecting portions of an image, and modifying them with fills, filters, and other effects; [](/journal/2011/07/orange-honey-epilogue/images/Screen-shot-2011-07-16-at-3.12.37-PM.png "Open full-size marquee demo") --- ## Portlandia Foods: Locations URL: https://miko.art/journal/2011/05/portlandia-foods/ Date: 2011-05-07 Categories: Portlandia Foods Tags: Portlandia It’s been an exciting year at [Portlandia Foods](http://portlandiafoods.com/). In the past six-months we’ve gone from an idea, to a product that can be found in local stores, coops, restaurants, and public works. Alberta Coop even featured us in a [great article](http://www.albertagrocery.coop/2011/04/homemade-bbq-sauce-with-ketchup/) covering a short history of Ketchup, and how to make killer BBQ-sauce! A big “Thank you!” to everyone who has helped make this possible; [Jeff Bergadine](http://www.portlandiafoods.com/), [Boni Deal](http://bonideal.com/), [Daniel Christopher](http://alteredfoc.us/), [Kamila Loupal](http://www.equilibriawellness.com/staff.htm), the fine people at [Alexis Foods](http://www.alexisfoods.com/) and [GloryBee Natural Foods](http://www.glorybee.com/), and the support from so many others; we couldn’t of gotten this far without ya! To keep up with what’s going on at Portlandia Foods, and find the nearest place that carries Portland Ketchup we’re introducing a new “locations” page that will make the process a snap! The modern [Google Maps Platform](https://developers.google.com/maps) remains a pleasure to work with, and the original integration provided directions for Bicycling and Walking to locations; many thanks to Google for providing these resources freely to all. Without further ado: [Portlandia Foods locations page on the Wayback Machine](https://web.archive.org/web/*/http://www.portlandiafoods.com/locations/) --- ## global Composite Operation URL: https://miko.art/journal/2011/04/globalcompositeoperation/ Date: 2011-04-15 Categories: Open Source Tags: Canvas, Color The [standard chart](https://developer.mozilla.org/samples/canvas-tutorial/6_1_canvas_composite.html) (a great resource provided by Mozilla) describing the effects of the globalCompositeOperation is incomplete, as it leaves us to extrapolate how 99% of the color-spectrum, and multiple levels of opacity, will affect the composite operation. The [following chart](/labs/html5rocks/globalCompositeOperation.html) allows you to see what the globalCompositeOperation’s is doing on a pixel-to-pixel basis. The source-image contains strictly 0% and 100% opaque pixels. This image depicts the traditional [RGB additive color model](https://en.wikipedia.org/wiki/Additive_color), and was created with three overlapping ellipses using the “lighter” globalCompositeOperation; The destination-image contains a gradient of 0% through 100% opaque pixels. This is the same graphic that is used in [Color Sphere](https://colorsphere.app/), and has been useful for a multitude of other things. This was created with lots of triangles and linear-gradients;  **NOTES:** - Although original W3C specs included 12 GCO modes, the current specs have dropped “Darker”; some venders have kept this feature for legacy reasons. The problem was no one could agree on a standard formula. Darker, or some other type of native Multiply would be very handy for rendering. - The original GCO modes were based on Tomas Porter and Tom Duff’s article entitled _[Compositing Digital Images](http://keithp.com/~keithp/porterduff/p253-porter.pdf)_. - There is missing support for GCO modes between browsers that needs to be sorted out. Currently, six-modes work without fail across browsers (IE9, Chrome, Safari, Firefox, and Opera): **source-over**, **source-atop**,**\-over**, **destination-out**, **lighter**, and **xor**. For a more detailed report on which browsers support what check out [Mike Rekim’s report](http://www.rekim.com/2011/02/11/html5-canvas-globalcompositeoperation-browser-handling/). --- ## HTML5: Typographic Effects URL: https://miko.art/journal/2011/03/html5-typographic-effects/ Date: 2011-03-01 Categories: Open Source Tags: Canvas, Creative Coding, Typography [HTML5 Rocks](http://www.html5rocks.com/) is a website that helps inspire developers and teach how to implement those shiny new HTML5 features in real world examples. They recently asked me to write an article for their website. Working on a project for Google was inspiring (even if there was no pay involved)! … [Neon Rainbow Jitter](http://www.html5rocks.com/tutorials/canvas/texteffects/Text-Effects.html#neon+rainbow+jitter); … [Sleek Zebra](http://www.html5rocks.com/tutorials/canvas/texteffects/Text-Effects.html#pattern+gradient+reflect) (inspired by [WebDesignerWall](http://www.webdesignerwall.com/demo/css-gradient-text)); [](http://www.html5rocks.com/tutorials/canvas/texteffects/Text-Effects.html#pattern+gradient+reflect "Open Sleek Zebra example") … [Spaceage](http://www.html5rocks.com/tutorials/canvas/texteffects/Text-Effects.html#spaceage); [](http://www.html5rocks.com/tutorials/canvas/texteffects/Text-Effects.html#spaceage "Open Spaceage example") … and many other [fun](http://www.html5rocks.com/tutorials/canvas/texteffects/Text-Effects.html#shadow) [effects](http://www.html5rocks.com/tutorials/canvas/texteffects/Text-Effects.html#innershadow+pattern+gradient). The following ones are using a CSS->Canvas converter; the CSS used in the converter was sourced from [Line25](http://line25.com/articles/using-css-text-shadow-to-create-cool-text-effects), and [Stereoscopic](http://lab.simurai.com/css/css3d/), and [Shadow 3D](http://pgwebdesign.net/blog/3d-css-shadow-text-tutorial); [](/journal/2011/03/html5-typographic-effects/images/Screen-shot-2011-05-15-at-11.06.57-PM.png "Open full-size Shadow 3D image") --- ## HTML5: Typographic Metrics URL: https://miko.art/journal/2011/01/html5-typographic-metrics/ Date: 2011-01-28 Categories: Open Source Tags: Canvas, Typography Typography support between browsers has a history of being spotty. One of the major hurdles in creating the ( yet-to-be-released) next-incarnation of Sketchpad was typographic support; between browsers and even within the `` specs. One pitfall of the `` tag is the lack of text-metrics support (past calculating the width via ctx.measureText). This prevents us from emulating how text works in DOM for other elements such as `` or even ``, fortunately, these metrics can be measured through simple css-hacks.The solutions to the following are provided: - ctx.textBaseline=”alphabetic”; // alphabetic, top, bottom, middle - ctx. textAlign=”left”; // left, right, middle, start, end - measureText(‘hello’).width // px width of typeface The solution for finding these metrics is compatible with browsers as far back as 2004 (such as Firefox 1.0), before `` was introduced. Out of 64 browsers tested on BrowserShots and the 30 tested on CrossBrowserShots, four browsers failed to generate proper metrics for Arial with these CSS solutions. There was an error margin of +/- 2px, which may accounted for in the differences between anti-aliasing in `` vs. rendering in ``/``/ ``. ## TOC:2 ## Bounding boxes **Calculating the bounding-box of unicode** I’ve used a simple brute-force formula to calculate the bounding-box of unicode characters for the following text experiments called “getTextMetrics”. Once you know the text metrics, you can do most anything. It’s been very useful to me for many purposes:Unicode Profiling Project, Font-Family Profiling Project, calculating the “Ascent, Descent, and x-height”, and finding the bounding-box of unicode glyphs to create stamps, amongst other things. _See [getBitmapBounds demo](/labs/typography/getBitmapBounds.html) in action._ ```js (function () { var fontFamily = "Arial, san-serif"; var fontSize = 14; getFontMetrics = function (props) { var ctx = props.ctx; var text = props.text; var bboxHeight = props.bboxHeight; var canvasHeight = props.canvasHeight; var baseline = props.baseline || "alphabetic"; var flip = props.flip || false; var drawBaseline = props.drawBaseline || false; if (props.fontFamily) fontFamily = props.fontFamily; if (props.fontSize) fontSize = props.fontSize; // setting up the canvas ctx.save(); // create canvas to use as buffer ctx.font = fontSize + "px " + fontFamily; var textWidth = ctx.measureText(text).width; // This keeps font in-screen, measureText().width doesn't // quite do it in some cases. For instance "j", or the letter "f" // in the font "Zapfino". var offsetx = fontSize * 2; var offsety = fontSize * 2; var cwidth = ctx.canvas.width = Math.round(textWidth + offsetx * 2); var cheight = ctx.canvas.height = canvasHeight ? canvasHeight : Math.round(offsety * 2); if (typeof (baseline) == "string") { offsety = 0; // using baseline ctx.textBaseline = baseline; } // ctx.font has to be called twice because resetting the size resets the state if (flip) ctx.scale(1, -1); ctx.font = fontSize + "px " + fontFamily ctx.fillText(text, offsetx, (typeof (bboxHeight) == "number" ? bboxHeight : offsety)); // drawing baseline if (drawBaseline) { ctx.fillRect(0, canvasHeight / 2, ctx.canvas.width, 1); } // grabbing image data var imageData = ctx.getImageData(0, 0, cwidth, cheight); var data = imageData.data; // calculating top var top = 0; var pos = 0; while (pos < data.length) { if (data[pos + 3]) { pos -= pos % (cwidth * 4); // back to beginning of the line top = (pos / 4) / cwidth; // calculate pixel position top -= offsety - fontSize; pos = data.length; // exit loop } pos += 4; } // calculating bottom var bottom = 0; var pos = data.length; while (pos > 0) { if (data[pos + 3]) { pos -= pos % (cwidth * 4); // back to beginning of the line bottom = (pos / 4) / cwidth; bottom -= offsety - fontSize; pos = 0; // exit loop } pos -= 4; } // calculating left var left = 0; var col = 0, row = 0; // left bounds while (row < cheight && col < cwidth) { var px = data[(row * cwidth * 4) + (col * 4) + 3]; if (px) { left = col - offsetx; row = cheight; col = cwidth; } row++; if (row % cheight == 0) { row = 0; col++; } } // calculating right var right = 0; var col = cwidth, row = 0; // right bounds while (row < cheight && col > 0) { if (data[(row * cwidth * 4) + (col * 4) + 3]) { right = col - offsetx; row = cheight; col = cwidth; } row++; if (row % cheight == 0) { row = 0; col--; } } // calculating real-bottom var realBottom = 0; var pos = data.length; while (pos > 0) { if (data[pos + 3]) { pos -= pos % (cwidth * 4); // back to beginning of the line realBottom = (pos / 4) / cwidth; pos = 0; // exit loop } pos -= 4; } // restoring state ctx.restore(); // returning raw-metrics return { "left": (-left), "top": (fontSize - top), "width": (right - left), "height": (bottom - top), "bottom": realBottom } } ; } ) (); ``` ## ctx.textBaseline **Mimicking the way text is supported in other DOM elements** By default `` text is aligned to the “alphabetic” baseline. When drawing to a canvas, using the default baseline, and a y-position of 0, only the descenders can be seen: ```js ctx.fillText("Hello world!", 0, 0); ; ``` To mimic how text is viewed in``/``/`` other html elements we can use the “top” baseline. This works wonderfully, however, not all browsers support the “top” baseline. If baseline=”top” works in your browser “Hello world!” should become visible in the following example: ```js ctx.textBaseline = "top"; ctx.fillText("Hello world!", 0, 0); ``` Opera, Safari and Chrome work identically with “top”, “bottom”, “middle”, and “alphabetic”… however, Firefox seems to remove the “buffer-spacing” (the invisible spacing that goes above the ascenders, and below the descenders on each line of text) which prevents it from mimicking how Firefox draws other DOM elements. Older browsers won't support baseline=”top” or other baseline variants at all. This illustrates our problem… let's find a solution! **`` -> “Ascent”, “Descent” and “x-height”** According the Apache FOP, the “top” baseline is equal to the “ascent”, the “bottom” basline is equal to the “descent”, and the “middle” baseline is half of the “x-height”. Given this information, it’s possible to measure these values in `` when ctx.getImageData() and ctx.textBaseline are supported. To measure these baselines, the following code was used: _See [`` baseline demo](/labs/typography/googleFontsAPI.html) in action._ ```js // finding portion that protrudes past bottom of alphabetic baseline var Descent = getFontMetrics({ ctx: ctx, text: "YourText", bboxHeight: 0, canvasHeight: bboxHeight * 3, baseline: "alphabetic", fontFamily: fontFamily + ", " + defaultFont, fontSize: fontSize }).bottom; // calculating top-baseline var TopBaseline = getFontMetrics({ ctx: ctx, text: "YourText", bboxHeight: 0, canvasHeight: bboxHeight * 3, baseline: "top" }).bottom - Descent; // calculating bottom-baseline var BottomBaseline = getFontMetrics({ ctx: ctx, text: "YourText", bboxHeight: bboxHeight, canvasHeight: bboxHeight * 3, baseline: "bottom" }).bottom - bboxHeight - Descent; // calculating middle-baseline var MiddleBaseline = getFontMetrics({ ctx: ctx, text: "YourText", bboxHeight: bboxHeight, canvasHeight: bboxHeight * 3, baseline: "middle" }).bottom - bboxHeight - Descent; ``` Unfortunately, the only reliable baseline identically supported between all browsers in `` is “alphabetic”, and there is no way to measure the “ascent” and “descent” when the only working baseline is “alphabetic”. The reason is the invisible “buffer-spacing” above and below the descenders changes the expected output, and there is no way to measure “invisible” space. _To recap:_ at this point, we still don’t have the ability to measure the “ascent”, “descent” and “x-height” when textBaseline isn’t supporting “top” or “bottom”… but, we do now know what values we’re searching for. Next, let’s look into getting the values from CSS. **CSS -> “Ascent”, “Descent” and “x-height”** After searching for a solution for hours in `` under the crazy pursuit of measuring something invisible, I came home and found a simple solution in CSS. By using an `` (or any inline-block element) and the vertical-align property inside of a container element (such as a ``), the values `` provides for ctx.textBaseline can be matched with an error margin of +/- 2px, many fonts are matched exactly. Likely, these discrepancies are due to anti-aliasing in `` vs. DOM. 1. The “top” baseline is equal to the image.offsetTop since an `` element is automatically aligned to the baseline of a font. 2. The “bottom” baseline can be found by subtracting the height of the text (see the measureText section) from the “top” baseline. 3. The “middle” baseline can be found using “line-height: 0” on the container element and measuring the image.offsetTop, this works, because “line-height: 0” aligns the image to the center of the text, as the text now has a height of 0. In order to get the proper values the whole experiment must be offset vertically (so the text isn’t hidden off-screen). _See [CSS text-metrics demo](/labs/typography/CSSTextMetrics.html) in action._ _See [text baseline demo](/labs/typography/metrics.html#textBaseline) in action._ ```js // setting up html used for measuring text-metrics var container = document.getElementById("container"); var parent = document.createElement("div"); var image = document.createElement("img"); image.width = 42; image.height = 1; image.src = "./media/1x1.png"; parent.appendChild(document.createTextNode("TheQuickBrownFox!")); parent.appendChild(image); container.appendChild(parent); // getting css equivalent of ctx.measureText() image.style.display = "none"; parent.style.display = "inline"; var measureHeight = parent.offsetHeight; var measureWidth = parent.offsetWidth; // making sure super-wide text stays in-bounds image.style.display = "inline"; var forceWidth = measureWidth + image.offsetWidth; // capturing the "top" and "bottom" baseline parent.style.cssText = "margin: 50px 0; display: block; width: " + forceWidth + "px"; var TopCSS = image.offsetTop - 49; var HeightCSS = parent.offsetHeight; var BottomCSS = TopCSS - HeightCSS; // capturing the "middle" baseline parent.style.cssText = "line-height: 0; display: block; width: " + forceWidth + "px"; var MiddleCSS = image.offsetTop + 1; ``` **Compensating for “overhanging” and “clipping”** Some font-faces protrude past the outside of their em-box, clipping their x or y axis. This protrusion, in typography, is called an overhang (or overshoot). Fortunately, this is something that can be compensated for. To fix the clipping on the top portion of the text: 1. Measure the entire height of the font in `` using a lot of padding to make sure the entire text-string is visible. 2. Resize the `` to the height of the em-box, and align the baseline of your text to “top”. Measure the entire height again. 3. Subject the first value from the second, this difference is the amount the text protrudes past the top of the em-box. 4. Using this value, the top portion of the font-face that was clipped can become visible. This can be applied to `` ’s using padding-top, or to ``’s by adjusting the y-offset of a text drawing command such as ctx.fillText() and adding the same value to the height of the `` (assuming we want a perfect bounding-box). Here’s an example of finding the clipping on left and top: ```js // compensating for text-clipping using padding-left var leftClipping = getFontMetrics({ ctx: ctx, text: "YourText" }).left; if (leftClipping < 0) { // is padding, not clipping leftClipping = 0; } // compensating for text-clipping using padding-top var topClipping = getFontMetrics({ ctx: ctx, text: "YourText", bboxHeight: 25, canvasHeight: bboxHeight, baseline: "top" }).top + 25; if (topClipping < 0) { // is padding, not clipping topClipping = 0; } ``` **Native support between browsers** On a side-note, it looks like at this time no browser supports the HTML5 standards “ideographic” or “hanging”. Opera/Safari/Chrome default to “top” and “bottom” respectively, whereas Firefox defaults to “alphabetic” in when these options are chosen. It looks impossible to fix “ideographic” and “hanging” without these values being provided via an external means (i.e. Python), please prove me wrong. ## ctx.textAlign **Fixing older browsers** The only align that works in all browsers, old and new, is ctx.textAlign=”left”. We can fix “right” and “center” in older browsers by calculating the text-width. This can be done simply by creating a `` with the same font-properties, and measuring the span.offsetWidth (DOM level 0). Align to “start” and “end” require the additional knowledge of the directionality of the font to distinguish RTL from LTR languages. This poses a problem if the website doesn’t specify this information in the _See [textAlign demo](/labs/typography/metrics.html#textAlign)_ _in action._ ```js Hello world! ``` ```js function getAlign(text, type, offsetx) { var direction = window.getComputedStyle(document.body)["direction"]; control.textContent = text; switch (type) { case "left": break; case "start": offsetx -= (direction == 'ltr') ? 0 : control.offsetWidth; break; case "end": offsetx -= (direction == 'ltr') ? control.offsetWidth : 0; break; case "right": offsetx -= control.offsetWidth; break; case "center": offsetx -= control.offsetWidth / 2; break; } return offsetx; }; ``` **Native support between browsers** Opera, Safari, Chrome and Firefox work identically with “left”, “start”, “end”, “right” and “center” in their latest branches. Older browsers such as Firefox 2.x, and Opera 9.x require a fallback in order for ctx.textAlign to work properly, such as this CSS solution. ## ctx.measureText **Fixing older browsers** We can fix old browsers with broken ctx.measureText support in CSS by calculating the span.offsetWidth using the same methods we used to fix ctx.textAlign: _See [measureText demo](/labs/typography/googleFontsAPI.html#measureText) in action._ ```js Hello world! ``` ```js function measureText(text) { control.style.display = "inline"; control.textContent = text; return { height: control.offsetHeight, width: control.offsetWidth }; }; ``` Measurements provided this CSS solution produces identical results as ctx.measureText in Safari, Chrome and Opera. Firefox results are identical most of the time, with the occasional erroneous result within +/- 1px. Zapfino is an example of a font-face that produces this deviance. **Native support between browsers** Opera, Safari, Chrome and Firefox work nearly identically across systems within a difference of +/- 1px. Older browsers such as Firefox 2.x, and Opera 9.x require a fallback in order for ctx.measureText() to work at all. ## Line-breaks in `` **Finding the “em-height”** The em-height of a font can be found in Opera, Safari, Chrome and Firefox through measuring CSS-positioning in a similar method to the ctx.textAlign and ctx.measureText() demos. Create a `` element with the text you want to measure, with the font-properties set how you want them, and run span.offsetHeight, this measures the em-height. The em-height is the value we’re going to use to offset our line-breaks. **Calculating line & letter breaks** Calculating word-wrapping entails looping through the text.split(“ “) into singular words, and measuring each word individually until the edge of the bounding-box is hit, at which point a break is inserted, and the process continues. This works great for words that don’t extend past the bounding-box on their own. When the word is so large it extends past the bounding box, we need to add in “letter-wrapping”. This is similar to hyphenation, but without the hyphen. Calculating letter-wrapping entails looping through the text.length of the long word in question, until the edge of the bounding-box is hit, at which point a line-break is added. _See [lineBreaks demo](/labs/typography/metrics.html#lineBreak) in action._ ```js function getLines(text, maxWidth) { var returns = text.split("n"); var lines = []; var lastPhrase = ""; function splitWord() { var width = measureText(lastPhrase).width; var posA = 0; var posZ = 0; if (width > maxWidth) { for (var n = 0, length = lastPhrase.length; n < length; n++) { var width = measureText(lastPhrase.substr(posA, posZ++)).width; if (width > maxWidth) { lines.push(lastPhrase.substr(posA, posZ - 2)); posA = n - 1; posZ = 2; } } return lastPhrase.substr(posA, posZ + 2); } }; for (var n = 0; n < returns.length; n++) { if (lastPhrase) lines.push(lastPhrase); var phrase = returns[n]; var spaces = phrase.split(" "); var lastPhrase = ""; for (var i = 0; i < spaces.length; i++) { var measure = measureText(lastPhrase + " " + spaces[i]).width; if (measure < maxWidth) { lastPhrase += ((lastPhrase ? " " : "") + spaces[i]); } else { if (measure > maxWidth) { var split = splitWord(); if (split) { lastPhrase = split + " " + spaces[i]; } else { lines.push(lastPhrase); lastPhrase = spaces[i]; } } } if (i == spaces.length - 1) { lines.push(lastPhrase); lastPhrase = ""; break; } } } return lines; }; ``` ## Conclusion Using the above methods, we can get text working when ctx.measureText, ctx.textAlign or ctx.textBaseline is malfunctioning. In a future installment we’ll look into _embedded fonts_, including adding support of ctx.fillText and ctx.strokeText by parsing SVG fonts and drawing them using the vector primitives ctx.moveTo, ctx.lineTo, ctx.quadradicCurveTo and ctx.bezierCurveTo. _View [CSS text-metrics in ``](/labs/typography/metrics.html)._ _View [CSS text-measurements](/labs/typography/CSSTextMetrics.html)._ --- ## Color Piano v1 URL: https://miko.art/journal/2011/01/color-piano-theory/ Date: 2011-01-19 Categories: Apps Tags: Canvas, Color, Color Theory, Midi, Piano, Web Audio **UPDATE:** There is a more recent post on [Color Piano](/journal/2011/12/color-piano/). [Color Piano Theory](/piano/) (CPT) was inspired by an interest in building an _educational application_ that utilizes colors in _teaching piano theory_. CPT ties together chords, scales, inversions, octaves, and key signatures. CPT is a visual interface for learning the keyboard. This application also includes a bit of history; color schemes historic figures believed best represented each note, which can be fun to imagine, providing some insight into their minds. **Visual/audial memory recognition** To improve memory recognition, colors are mapped to the sounds on the keyboard, creating a [synesthetic](http://en.wikipedia.org/wiki/Synesthesia) experience. By picking a color-mapping that works best for you, these colors will give you a _visual cue to the note_ you’re playing. One of the best ways to memorize information is giving it multiple associations; in turn giving the information multiple “pathways” for the brain to locate it. With color added to the mix, we are building a memory recognition triangulation: **sound** (measured in hz), **color** (in RGB), and **space** (the XY coordinate of key on the keyboard). CPT also provides the [solfège](http://en.wikipedia.org/wiki/Solf%C3%A8ge) (_do, re, mi, fa, sol, la, ti, etc)_ to help people learn to sing by using the piano and a familiar sound to tune their voice. **Historic mapping of color to sound** [](https://web.archive.org/web/*/http://rhythmiclight.com/archives/ideas/colorscales.html "Open archived historic color scale research") The earliest known reference to the idea of mapping colors to sound came in _1704 by Issac Newton_ according to [Fred Collopy](https://web.archive.org/web/*/http://rhythmiclight.com/index.html), author of [Three Centuries of Color Scales](https://web.archive.org/web/*/http://rhythmiclight.com/archives/ideas/colorscales.html). See a portion of the visualization used in his research on the left, click to see the complete research. This leads me to a question brought to me recently, “_Why do so many of these people associate ‘red’ with ‘C’, ‘orange’ with ‘D’, ‘yellow’ with ‘E’, ‘green’ with ‘F’ and so on_?” My best guess is many of these calculations were based on mappings to the rainbow, aka the [visible spectrum](http://en.wikipedia.org/wiki/Visible_spectrum); where ‘C’ in western music has been historically thought of as a grounding, base note, the color ‘red’ is the shortest wavelength in the rainbow. My best guess is _Lous Castel_ was mapping notes to the [visible spectrum](http://en.wikipedia.org/wiki/Visible_spectrum), organized from shortest wavelength to longest, ending with the ultra-violet range, although, why is “A#” and “B” flipped? Perhaps a sign of dyslexia? _Alexander Schriabin_ declared that “D#” sounds “steely with the glint of metal”, and “E” sounds “pearly blue the shimmer of moonshine”, and who can argue with that? What does sound look like to you? **Color Piano Project** The [_Color Piano Project_](https://colorpiano.com/), developed by Dan Vlahos as part of his 1999 undergraduate graphic design thesis project at Massachusetts College of Art and Design, describes how such a piano would function. He also provides an example of a [player](https://en.wikipedia.org/wiki/Player_piano)-like [color piano on the Wayback Machine](https://web.archive.org/web/*/http://colorpiano.com/dv_c001_blk.html) to beautiful effect. **Creating** **“MIDIPlugin”** Being a big HTML5 fan, I decided to program the application in Javascript, the first hurdle was getting MIDI working in the browser to synthesize sound. [](/journal/2011/01/color-piano-theory/images/112517__nickrave__don_tfeedDOG.png "Open full-size inspiration artwork") I began researching solutions: **Dynamic WAV generation** (using sine waves) nearly killed my browser. Creating **MIDI from scratch in base64** and playing through Quicktime note by note didn’t work since the piano is dynamic and requires each key to have one `<audio>` tag. Unfortunately there seems to be a limit to how many tags can be played in a browser at one time, and how quickly their base64 codes can be switched in-between. Firefox recently added [amazing sound support](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Visualizations_with_Web_Audio_API), but **no access to the MIDI Soundbanks**_._ Perhaps someday Google will provide a **Native Client MIDI solution**. …until then… **Javascript `<->` Java communication** [](/journal/2011/01/color-piano-theory/images/Screen-shot-2011-01-26-at-1.51.10-PM.png "Open full-size MIDIPlugin screenshot") After banging my head trying to get MIDI playing with native Javascript commands, I found one solution that would allow me to access MIDI across browsers: Javascript to Java communication. The next step was creating the project [MIDIPlugin on the Wayback Machine](https://web.archive.org/web/*/https://github.com/mudx/MIDIPlugin), a **CC0 framework exposing the Java MIDI interface**. Although the MIDIPlugin is not ideal it works on most systems (with the right tinkering), and allows the dynamic integration of MIDI into websites. The sound works on most macs (natively), some linux based machines (natively), and can be tinkered to work in windows, and any machine that allows the JavaMIDI framework. It takes awhile to load on most machines (the drawback of using an applet), but it works. Read more on [how to tie the MIDIPLugin into your application](/journal/2010/08/dynamic-midi-generation-in-the-browser/). **Presenting a synesthetic educational experiment** The end result was the Color Piano Theory [web-app](http://www.chromeexperiments.com/detail/color-piano/), made public in Google’s [Chrome Experiments](http://www.chromeexperiments.com/detail/color-piano/) collection. Play around with the application, I hope it helps you create something beautiful. **Synesthesia on the web:** - [Ani Williams color wheel reference](https://web.archive.org/web/*/http://www.aniwilliams.com/images/music_chart-color_wheel-lg.jpg) - [Grotrian color piano reference](https://web.archive.org/web/*/http://www.grotrian.de/spiel/e/spiel_win.html) - [Visual Composer](https://web.archive.org/web/*/http://www.typorganism.com/visualcomposer/index.html) - [Virtual Agency reference](https://web.archive.org/web/*/http://www.ampledesign.co.uk/va/index.htm) - [Randy Rhoads synesthesia discussion](https://web.archive.org/web/*/http://www.ultimaterhoads.com/viewtopic.php?f=6&t=4572) --- ## ZenBG: Background Generator URL: https://miko.art/journal/2011/01/html5-background-generator/ Date: 2011-01-06 Categories: Apps Tags: Canvas, Creative Tools, Gradient **[Background Generator](/bg/)** (BG) provides the ability to edit the background of any website in real-time! To give you an idea, the backgrounds of the Journal, Photos, Projects, and Labs sections of Mudcu.be were created using BG. BG allows you to create **fancy Web 3.0 backgrounds** without getting dirty with Photoshop, GIMP, etc. The project includes a collection of **textures** (wood, rust, paper, concrete and so-on) which are combined with custom **linear-gradients** and **colors** to create a **wide assortment of themes**. BG outputs valid **CSS3** code, and also supports older browsers **back to CSS1**. Supporting CSS1 is accomplished through the fallback of using of an embedded JPEG. Designers targeting newer browsers will also be happy; BG supports **\-moz-linear-gradient** (for Firefox), **\-o-linear-gradient** (for Opera) and **\-webkit-gradient** (for Safari/Chrome) with multiple color-stops. Additionally, BG outputs **DXImageTransform** (Internet Explorer) code, as long as there are no more than two color-stops; IE can support multiple color-stops by using the fallback method (JPEG). Supporting browsers across the spectrum: **IE, Firefox, Safari, Chrome, and Opera**. Please enjoy, and if you find it useful, post the website you designed here! --- ## HTML5: Unicode Profiling Project URL: https://miko.art/journal/2010/11/unicode-profiling-project/ Date: 2010-11-10 Categories: Apps Tags: Canvas, Typography, Unicode The **[Unicode Profiling Project](/labs/ucpp/)** was designed to gather statistics on unicode support across systems. The software checks each symbol in your systems Unicode catalog (65,535 glyphs) to see which are visible on your computer using `` and Javascript. The data generated from your computer will help profile the state of unicode support on the web. Your computers unicode support, remote address, user agent and processing time will be submitted to the server upon completion of the test, a statistic analysis of the data will be published, no specific information about your computer will be published. **Running the test:** Once the [test](/labs/ucpp/) is initiated you’ll be able to watch the glyphs as they’re scanned with their related unicode block name. It typically takes over a minute to scan an entire collection of unicode characters. This is what the acid test looks like while being processed: **Reading your profile:** Once the processing has completed you will be presented with a string of binary representing what characters are visible, and which ones are unavailable or invisible (65,535 numbers). Here are the results from my Chromium browser running on OSX 10.6.4: [](/journal/2010/11/unicode-profiling-project/images/Screen-shot-2010-11-10-at-7.43.37-PM.png "Open full-size results screenshot") **Unicode characters:** Now the fun part, click on “Show Available”, this may take a few seconds as you’re referencing tens of thousands of unicode characters at once: [](/journal/2010/11/unicode-profiling-project/images/Screen-shot-2010-11-10-at-7.34.10-PM.png "Open full-size glyph screenshot") [Unicode #65018](http://www.fileformat.info/info/unicode/char/fdfa/index.htm) [](/journal/2010/11/unicode-profiling-project/images/Screen-shot-2010-11-10-at-11.55.10-PM.png "Open full-size character sample") [Brail Patterns \[0x2800-28FF\]](http://www.fileformat.info/info/unicode/block/braille_patterns/utf8test.htm)  **Supported Browsers:** The project fully supports Chrome, Firefox, Safari, and Opera. Some false positives are produced in Internet Explorer as there is a unique “missing symbol” for every unicode block. **Results on my Mac:** - **Safari** 49,493 visible glyphs - **Firefox 3.6** 49,428 visible glyphs _NOTE: Each undefined symbol has a unique hash unless text size is `<=11`_ - **Google Chrome 7.0** 49,493 visible glyphs - **Chromium 8.0** 49,492 visible glyphs - **Opera 10.6** 47,672 visible glyphs _NOTE: Supports different fonts in `` than regular DOM_ **Results on my Windows:** - **IE 9.0** 50,826 visible glyphs _NOTE: Some false positives… each range has it’s own undefined symbol._ - **Firefox 3.6** 51,208 visible glyphs _NOTE: Each undefined symbol has a unique hash unless text size is `<=10`_ - **Google Chrome 7.0** 47,267 visible glyphs _NOTE: Textarea can have different unicode support than Div in some cases. For instance, on my computer_ _ﰿ works in Textarea, but not in Div._ - **Opera 10.6** 56,024 visible glyphs _NOTE: Supports different unicode in Canvas than Div and Textarea. Also, Opera supports more unicode characters than other browsers by far, possibly included in the package?_ **Further Research:** - [Unicode Consortium](https://unicode.org/) - [Unicode on Wikipedia](https://en.wikipedia.org/wiki/Unicode) - [FileFormat.info Unicode reference](https://www.fileformat.info/info/unicode/) --- ## Dynamic MIDI generation in the browser URL: https://miko.art/journal/2010/08/dynamic-midi-generation-in-the-browser/ Date: 2010-08-19 Categories: Open Source Tags: Javascript, Midi, Piano **UPDATE:** This project has been cancelled. The MIDIBridge took this idea much further; see the archived project page on the [Wayback Machine](https://web.archive.org/web/*/http://www.abumarkub.net/abublog/?p=505). Have you ever wanted to use MIDI in your Javascript or Flash project? It’s been a long time dream of mine. After a long search I came up with one solution that would provide the best support for the most computers (at present time), utilizing Java’s [javax.sound.midi](http://java.sun.com/products/java-media/sound/doc-midi.html) interface through an . Introducing the MIDIPlugin providing the fundamental functions to create dynamic music & sound effects in your browser. The MIDIPlugin requires that [Java](http://www.java.com/en/download/manual.jsp) and a [MIDI Soundbank](http://java.sun.com/products/java-media/sound/soundbanks.html) be installed on your computer. Some computers have these installed by default, others do not. More on computability later. [Piano Theory](/piano/) was built utilizing the MIDIPlugin. Although the MIDIPlugin works in Internet Explorer my piano webapp does not (at this time), apologies to IE users. **My pitch for MIDI support becoming a W3C standard** Just as color and native primitives are the building blocks of graphics MIDI is an essential building block of music, we have for graphics, we’re lacking decent support for dynamic music generation. The benefits of dynamic music generation is substantial, saving bandwidth, opening up a whole new realm of sense (the sense of audio) to dynamic content, allowing developers to create more interactive & immersive projects. MIDI is a well defined framework that could be implemented into the W3C standards, as long as there is the support behind it. With the motion that the web has been moving forwards recently, the possibility is ripe. **The plugin is easy to use** 1. Include the MIDIPlugin in your projects to create a dynamic audio experience: ```js ``` 2. Test to see whether the browser supports the MIDIPlugin (has Soundbank installed and supports Java) with the following function in window.onload: ```js MIDIPlugin = document.MIDIPlugin; setTimeout(function () { // run on next event loop (once MIDIPlugin is loaded) try { // activate MIDIPlugin MIDIPlugin.openPlugin(); } catch (e) { // plugin not supported MIDIPlugin = false; } }, 0); ``` 3. When MIDIPlugin is false the user is either missing the [MIDI Soundbank](http://java.sun.com/products/java-media/sound/soundbanks.html) or [Java](http://www.java.com/en/download/manual.jsp), prompt the user to install the appropriate software. If the MIDIPlugin isn’t set to false… well then, the fun starts ;)Functions available to you within the MIDIPlugin object: ```js MIDIPlugin { setChannel(int) setMono(boolean) setMute(boolean) setOmni(boolean) setSolo(boolean) getInstruments(null) setInstrument(int) setBend(double) // 0.5 = default setPan(double) // 0.5 = center setPressure(double) setReverb(double) setSustain(double) setVelocity(double) setVolume(double) playNote(int) // 0 is low C - 1 is C# and so on stopNote(int) // playChord(string) // for instance [0,5,7].join(",") stopChord(string) // stopAllNotes() openPlugin() closePlugin() } ``` 4. Remember to unload the plugin onbeforeunload, or your will have a loose connection hanging, which over time (multiple reloads) will result in the MIDI sound not working until you restart your browser: ```js window.onbeforeunload = function() { MIDIPlugin.closePlugin(); }; ``` **Licensed to use in your projects** Released as [CC0](http://creativecommons.org/publicdomain/zero/1.0/), this means you can use the MIDIPlugin in your project, and modify it to your hearts content without giving recognition, be that commercial or non-commercial. **Git me** The original MIDIPlugin repository is available on the [Wayback Machine](https://web.archive.org/web/*/https://github.com/mudx/MIDIPlugin), or you can download the precompiled [.jar applet](/labs/Piano/MIDIPlugin-0.2.jar). **Supported OS/Browsers** MIDIDPlugin works on Macs out of the box. Linux works out of the box depending on distribution, other times it requires Java SE to be installed. Windows requires Java SE as well as the MIDI Soundbanks to be installed (the Windows version of Java SE doesn’t ship with MIDI Soundbanks included). On the browser front the plugin works across the board: Chrome, Opera, Firefox, Safari and IE. **Other fun things in the name of music** - [Three Centuries of Color Scales](https://web.archive.org/web/*/http://rhythmiclight.com/archives/ideas/colorscales.html) - [Flash MIDI](https://web.archive.org/web/*/http://www.alexisisaac.net/products/flashMidi/) - [FlMML demo](https://web.archive.org/web/*/http://homepage3.nifty.com/sketch/flash/flmml050.swf) - [ABCjs](https://www.abcjs.net/) - [VexFlow](https://vexflow.com/) - [General MIDI](https://en.wikipedia.org/wiki/General_MIDI) --- ## What can 1kb of Javascript do? URL: https://miko.art/journal/2010/08/what-can-1kb-of-javascript-do/ Date: 2010-08-07 Categories: Code Art Tags: Canvas, Color, Creative Coding, Generative Art, Js1k [JS1k](http://js1k.com/) is challenge presented by _Peter van der Zee_ to design the most creative use out of 1kb of Javascript. Many beautiful demos have been added in the first few days: [mr. doob](http://js1k.com/demo/45), [hyperandroid](http://js1k.com/demo/70), and [antimatter](http://js1k.com/demo/62). The challenge is addicting, “How much functionality can you fit in 1024 characters?”. Here are my results: ## [Breathing Galaxies](/labs/js1k/BreathingGalaxies.html) Hypotrochoid with dynamically changing color and diameter. Use the keyboard to change shapes mid-stream, or move the mouse to create a new shape. “When I breath out my mind is at peace… When I breath in my body is at peace…” Create a ripple in the folds of time and space. The code for the Breathing Galaxies, 1019 bytes: ``` window.onload=function(){C=Math.cos;S=Math.sin;U=0;w=window;j=document;d=j.getElementById("c");c=d.getContext("2d");W=d.width=w.innerWidth;H=d.height=w.innerHeight;c.fillRect(0,0,W,H);c.globalCompositeOperation="lighter";c.lineWidth=0.2;c.lineCap="miter";var e=0,h=0;d.onmousemove=function(k){if(window.T){if(D==9){D=Math.random()*15;f(1)}clearTimeout(T)}X=k.pageX;Y=k.pageY;a=0;b=0;A=X,B=Y;R=(k.pageX/W*999>>0)/999;r=(k.pageY/H*999>>0)/999;U=k.pageX/H*360>>0;D=9;g=360*Math.PI/180;T=setInterval(f=function(l){c.save();c.globalCompositeOperation="source-over";if(!l){c.fillStyle="rgba(0,0,0,0.01)";c.fillRect(0,0,W,H)}c.restore();i=25;while(i--){c.beginPath();if(D>450||e){if(!e){e=1}if(D<0.1){e=0}h-=g;D-=0.1}if(!e){h+=g;D+=0.1}q=(R/r-1)*h;x=(R-r)*C(h)+D*C(q)+(A+(X-A)*(i/25))+(r-R);y=(R-r)*S(h)-D*S(q)+(B+(Y-B)*(i/25));if(a){c.moveTo(a,b);c.lineTo(x,y)}c.strokeStyle="hsla("+(U%360)+",100%,50%,0.75)";c.stroke();a=x;b=y}U-=0.5;A=X;B=Y},9)};j.onkeydown=function(k){a=b=0;R+=0.05};d.onmousemove({pageX:300,pageY:290})}; ``` ## [Micro Sketchpad](/labs/js1k/MicroSketchpad.html) Psychodelic text effect with a hypotrochoid drawing tool. [](/labs/js1k/MicroSketchpad.html "Open Micro Sketchpad demo") The code for JS1k Draw, 1024 bytes: ``` window.onload=function(){Q=Math.random;C=Math.cos;S=Math.sin;H=0;w=window;d=document.getElementById("c");c=d.getContext("2d");c.fillRect(0,0,d.width=w.innerWidth*2,d.height=w.innerHeight*2);c.globalCompositeOperation="lighter";c.lineWidth=0.5;setTimeout(function(){c.font="210px Arial";n=360;while(n--){c.globalAlpha=n/1800;c.strokeStyle="hsl("+(n+110%360)+",99%,50%)";x=-n*C(n/360);y=250-S(n/360*2)*n/2.5;c.strokeText("JS1k",x+230,y+60);c.strokeText("Draw!",x+380,y+245)}c.globalAlpha=0.4},0);d.onmousedown=function(b){function a(l,j){X=l.pageX;Y=l.pageY;if(j=="down"){var s,p,h=X,g=Y,k=Q()*99,f=Q()*99,o=Q()*99,u=0;time=setInterval(function(){i=10;while(i--){c.beginPath();q=(k/f-1)*u;x=(k-f)*C(u)+o*C(q)+(h+(X-h)*(i/10))+(f-k);y=(k-f)*S(u)-o*S(q)+(g+(Y-g)*(i/10));if(s){c.moveTo(s,p);c.lineTo(x,y)}c.strokeStyle="hsl("+(H%360)+",99%,50%)";c.stroke();u+=360*Math.PI/180*2;s=x;p=y}H++;h=X;g=Y},5)}else{if(j=="up"){clearTimeout(time)}}}a(b,"down");d.onmousemove=function(f){a(f,"move")};d.onmouseup=function(f){a(f,"up")}}}; ``` ## [Spectrum DJ](/labs/js1k/SpectrumDJ.html) Dynamically generated sphere controlled by mouse movements. I would love to see this made into a Audio Visualizer, there are a lot of cool effects that can be done very quickly with ColorMatrix’s. Here’s the same sphere in [Darkroom](http://mugtug.com/darkroom/), allowing you to edit other attributes of the spectrum \[Tint, Temperature, Exposure, Contrast, etc\]. For instance, Exposure could be mapped to the bass beats. It might be cool. [](images/SpectrumDJ.jpeg "Open full-size Spectrum DJ preview") The code for the Spectrum DJ, 928 bytes: ``` window.onload=function(){w=window;d=document.getElementById("c");c=d.getContext("2d");W=w.innerWidth;H=w.innerHeight;d.style.width=W+"px";d.style.height=H+"px";document.onmousemove=function(g){c.drawImage(image,0,0);var a=(g.pageX/W)*255-127,k=(g.pageY/H)*255-127,h=c.getImageData(0,0,d.width,d.height),f=h.data;for(var b=0,j=f.length;b<j;b+=4){h.data[b]=f[b]-a;h.data[b+1]=f[b+1]+a;h.data[b+2]=f[b+2]+k}c.putImageData(h,0,0)};image=(function(){var k=document.createElement("canvas").getContext("2d"),a=300,h=a/2,f=(1/360)*Math.PI*2,j=W/H,e=-h/4,l=-h/2;d.width=k.canvas.width=h*j;d.height=k.canvas.height=h;k.fillRect(0,0,W,H);for(var b=0;b<=359;b++){var i=k.createLinearGradient(e+h,l,e+h,l+h);i.addColorStop(0,"#000");i.addColorStop(0.5,"hsl("+((b+70)%360)+",100%,50%)");i.addColorStop(1,"#FFF");k.beginPath();k.moveTo(e+h,l);k.lineTo(e+h,l+h);k.lineTo(e+h+2,l+h);k.lineTo(e+h+5,l);k.fillStyle=i;k.fill();k.translate(e+h,l+h);k.rotate(f);k.translate(-(e+h),-(l+h))}return k.canvas})();c.drawImage(image,0,0)}; ``` Each entry is required to work in the latest versions of Firefox, Safari, Chrome and Opera… my apologies to IE users, Microsoft does not yet support the [canvas element](http://www.whatwg.org/specs/web-apps/current-work/complete/the-canvas-element.html#dom-canvas-getcontext) in the HTML5 specs, it’s said to be scheduled for their next release. **_Click, drag, and enjoy =)_** --- ## Sketchpad 1.0 URL: https://miko.art/journal/2009/10/sketchpad-beta/ Date: 2009-10-27 Categories: Apps Tags: Drawing App, Sketchpad UPDATE: [Read about Sketchpad 3.0](/journal/2013/07/sketchpad-3-0/) [Sketchpad](https://sketch.io/sketchpad/) is a free application utilizing [``](https://en.wikipedia.org/wiki/Canvas_element) to allow anyone with a web-connection and a recent copy of Safari, Firefox, Opera, or Chrome the ability to create beautiful drawings. Sketchpad includes a number of Drawing Tools, including: _Text, Shape, Spirograph, Brush, Calligraphy, Pencil, Paint-Bucket, and Stamp_. These tools can be used together with the provided database of _Colors, Gradients, and Patterns_, or you can create you own custom styles by clicking on the “COLOR”, “GRADIENT”, or “PATTERN” tabs on the top-bar. Sketchpad also includes a few generic Drawing Utilities, including: _Marquee, Crop, Eraser, and a HSL/RGBA Color-Picker_. Be sure to click on “LIGHT” mode on the top-bar for extra fun. Feel free to add your Sketchpad drawings to our [Flickr group](http://www.flickr.com/groups/sketchpad/), we’d love to see them! Here are a few drawing made with [Sketchpad](https://sketch.io/sketchpad/):              --- ## Sketchpad (alpha) URL: https://miko.art/journal/2008/03/sketchpad-alpha/ Date: 2008-03-02 Categories: Apps Tags: Drawing App, Sketchpad Welcome to the preview of [Sketchpad](https://sketch.io/sketchpad/). Though not all browsers support [``](https://en.wikipedia.org/wiki/Canvas_element) we’re working hard to extend support before our official release. Until then, you lucky FireFox users ([download Firefox](https://www.mozilla.org/firefox/new/)) will be able to kick the tires and hold the wheel of what we believe will become the new standard in Web-authoring. [Sketchpad](https://sketch.io/sketchpad/) uses the little-known `` tag to provide users and publishers with full control over the presentational qualities of their work. Directly accessing vector graphics, the `` tag gives publishers real-access to their users’ display. The `` tag will be available in HTML 5.0. In the meantime, we’re working to extend support to [Internet Explorer](https://en.wikipedia.org/wiki/Internet_Explorer), and working on compatibilty with [Safari](https://www.apple.com/safari/)/[WebKit](https://webkit.org/)’s javascript layers. In the late 90’s, [Macromedia](https://en.wikipedia.org/wiki/Macromedia) released flash 7.0, using [ActionScript](https://en.wikipedia.org/wiki/ActionScript). This allowed web developers to incorporate advanced graphics and programming into their website. Unfortunately, flash files are difficult to edit and require browser-side plugins. This proprietary format has never-the-less, received wide acclaim and usage over the years. Canvas is something new. With canvas, programming is handled in plain Javascript. Developers and users are given a simple way to manage their interactive programs. Further, canvas is a simple vector programming interface. Whether you’re using a mobile phone or a wide screen display, your Canvas webpages are guarenteed to be crisp, clear and responsive. --- ## Piano Theory widget URL: https://miko.art/journal/2007/03/piano-theory-widget/ Date: 2007-03-21 Categories: Apps Tags: Music, Piano \[update\] Read about [Color Piano Theory](/journal/2011/01/color-piano-theory/).I’ve been working on this widget a long time, on and off, basically whenever I’ve got a vacation. There are a lot of features in the works, so check back for more updates. I would love to hear what you think about this widget, and any ideas you have for improvements: --- ## Sphere Plugin URL: https://miko.art/journal/2007/03/sphere-plugin/ Date: 2007-03-15 Categories: Open Source Tags: Color, Color Theory, Color Picker I’ve prepared a new DHTML plugin, licencened under Creative Commons. It works perfectly on all Macintosh browsers, however, I haven’t had the opportunity to test on Windows… If there are bugs there, it would be great if someone could submit the fix’s… otherwise, you’ll have to wait for me to get around to finding a spare PC to test on. The new plugin is based on our popular Sphere color chooser. The coolest part is that it’s resizable, you can make this thing as big as you want. Check it out [here](http://www.colorjack.com/software/dhtml+color+sphere.html). --- ## ColorJack: Sphere URL: https://miko.art/journal/2007/02/colorjack-sphere/ Date: 2007-02-24 Categories: Apps Tags: Color, Color Theory, Color Picker Ever wonder what a computer programmer does while on vacation? The same thing we do every night. Check out the newest release from ColorJack Labs (developed in Mexico). [Sphere](http://www.colorjack.com/sphere/) allows you to visualize the theory behind color schemes. Try messing around with “Custom” function on the color blindness menu for more advanced options. --- ## Sphere Widget URL: https://miko.art/journal/2007/02/sphere-widget/ Date: 2007-02-03 Categories: Apps Tags: Color, Color Theory, Color Picker Do you like ColorJack [Sphere](http://www.colorjack.com/sphere/)? Want it on your desktop? [Download](http://www.apple.com/downloads/dashboard/reference/colortheory.html) the [widget](http://www.colorjack.com/widget/) for Apple’s Dashboard! --- ## DHTML Color Picker URL: https://miko.art/journal/2006/11/dhtml-color-picker/ Date: 2006-11-20 Categories: Open Source Tags: Color, Color Picker, Javascript I finally got all the ColorJack code into a little widget for your websites! It’s surprisingly small… the entire package weighs in at only 24.5k :) To give you an idea for comparison, it’s nearest competitor is 72.3k. Feel free to use the widget on any of your projects. You can find the [source code](http://www.colorjack.com/software/dhtml+color+picker.html) `<-` over there ;) --- ## Russian Bomber w/ Headphones URL: https://miko.art/journal/2006/03/mad-bomber-w-audio/ Date: 2006-03-18 Categories: Diy Tags: Music Who doesn’t love the classic appeal of the Russian Rabbit Fur Hat? It’s efficiant design is timeless, however, still contains the same technology it never had. It’s missing something fundemental to the 22nd century: music. We love our music, we want to take it everywhere, and we want it to be seemlessly integrated into our lives. So why not make more high-tech clothing? It’s finally within our grasp. This is a simple hybrid of three technologies: a hat, some headphones, and a microphone.What supplies are require? [Mad Bomber Hat](http://www.amazon.com/gp/search?ie=UTF8&keywords=rabbit%20fur%20hat&tag=mudcube-20&index=apparel-index&linkCode=ur2&camp=1789&creative=9325) ($15-$75), pair of [Giro Tune Ups](http://www.amazon.com/gp/search?ie=UTF8&keywords=Giro%20Tune%20Ups&tag=mudcube-20&index=electronics&linkCode=ur2&camp=1789&creative=9325) ($24 to $59), [leather needle](http://www.amazon.com/gp/search?ie=UTF8&keywords=leather%20needle&tag=mudcube-20&index=garden&linkCode=ur2&camp=1789&creative=9325) ($1.29), [thread](http://www.amazon.com/gp/search?ie=UTF8&keywords=thread&tag=mudcube-20&index=garden&linkCode=ur2&camp=1789&creative=9325) ($0.25), [wax](http://www.amazon.com/gp/search?ie=UTF8&keywords=sewing%20wax&tag=mudcube-20&index=garden&linkCode=ur2&camp=1789&creative=9325) ($0.95), [seam ripper](http://www.amazon.com/gp/search?ie=UTF8&keywords=seam%20ripper&tag=mudcube-20&index=garden&linkCode=ur2&camp=1789&creative=9325) ($2.29), a bottle of wine ($27), fruit snacks ($1), and a pair of [scissors](http://www.amazon.com/gp/search?ie=UTF8&keywords=scissors&tag=mudcube-20&index=garden&linkCode=ur2&camp=1789&creative=9325) ($2.95). This project can cost you anywhere from $39 up to $140, not including your time. It took me 5 hours to complete this project (not including the initial idea, or shopping for the supplies). I wasted hours trying to learn how to sew leather + cut seams. You will have the advantage of learning from my mistakes. My friend completed his in about three hours. You can see them both on the bottom of the page. Let’s begin! 1. Remove speakers from padded enclosure: 2. Cut seams in three places on hat. Be sure to try the hat on, and figure out exactly where your ears are going to be. Once you know, cut the seam out in that location on each ear flap. Cut one additional hole on the very bottom of one ear flap... this will be where you attach the audio jack: [](http://www.flickr.com/photos/8645046@N03/526804399/ "View Flickr photo") [](http://www.flickr.com/photos/8645046@N03/526714196/ "View Flickr photo") 3. String speakers through hat. This is important, otherwise you will have wires hanging out. The idea is to insert one speaker into an ear flap, then pull the other one around the back of the hat on the inside until it comes out the other hole: [](http://www.flickr.com/photos/8645046@N03/526767900/ "View Flickr photo") 4. Sew speakers into hat. Be sure the speaker is pointing towards your ears. Make sure they are perfectly aligned for maximum listening pleasure: [](http://www.flickr.com/photos/8645046@N03/526803755/ "View Flickr photo") [](http://www.flickr.com/photos/8645046@N03/526713300/ "View Flickr photo") 5. Sew seams up. I used a little pokey thingie to push the seams in, using this method it appears to be sewn from the inside. The picture on the right shows how the audio jack should look once it's installed: [](http://www.flickr.com/photos/8645046@N03/526713206/ "View Flickr photo") [](http://www.flickr.com/photos/8645046@N03/526713606/ "View Flickr photo") 6. The project was a success. They sound great, and keep your head warm while you're up at the mountain. Try it out yourself: [](http://www.flickr.com/photos/8645046@N03/526804295/ "View Flickr photo") [](http://www.flickr.com/photos/8645046@N03/526713702/ "View Flickr photo") ---
<audio>