Generative Flamenco

An experiment in generative music creation

(Processing, Ableton Live)

generative_flamenco

Generative Flamenco analyzes an image of a couple dancing to flamenco music pixel by pixel and translating it into MIDI signals, filtered by range, scale and key.

generative_flamenco_processing

The small white square indicates the current position. The square loops through the picture line by line horizontally from left to right and top to bottom. Clicking anywhere in the picture will move the square.

Pixel to MIDI

The brightness value will be mapped to pitch and duration, saturation to velocity. The MIDI signals are sent to Ableton Live and output with a layer of filters and effects. Tempo, and transport control (Play, Stop) can be controlled from within Generative Flamenco.

generative_flamenco_processing

In Action

Download

Download the Processing sketch and Ableton Project on github.

Learning Regex

Regex, Regexp or Regular expressions are a special syntax used in programming to search for patterns in a text. They are often used to validate form input, or for intelligent search and replace. The Regex markup looks very complicated as it is often a long string of characters.

(\d{5}([\-]\d{4})?)
This Regex pattern validates the US-postal code format

Regex itself follows a very logical pattern and can be very powerful and much easier than other attempts at parsing text. Whether you need simple format conversion (US to European numbers, “–” to “—”), email address validation in web forms, or validate if the password your users create matches your required format, Regex can be of help.

Learn:

Watch Lea Verou’s Talk

The internet is full of resources for learning this wizardry. A good starting point is Lea Verou’s celebrated presentation at O’Reilly’s Fluent Conference 2012: /Reg(exp){2}lained/: Demystifying Regular Expressions

Try it out at Regexplained

She also created Regexplained, a nifty tool to help you learn.

Learn it step by step at RegexOne

Regex One

RegexOne is a short little course that helps you earn Regex with simple, interactive examples and a comprehensive list of exercises.

Reference

HTML5 Pattern

Don’t reinvent the wheel. Learn from and build on existing patterns at html5pattern.com

HTML5 Pattern

Mozilla Developer Network – Regex Reference

The group at mozilla has put together a Regex reference that will come in handy, especially if you work with JavaScript.

Apps

Oyster ($4.99)

Oyster

Oyster calls itself an IDE for Regex. It serves as a reference, a development environment as well as a library for your Regex patterns. It also allows you to export your patterns for a large number of programming languages. (Unfortunately Regex has been implemented slightly different across languages). You can get Oyster on the Mac App Store. 

Reggie (Free)

Reggy

Reggie is an open-source Regex tester/viewer.

 

Too complicated?

Try VerbalExpressions by JehnaVerbalExpressions create RegEx using natural language in JavaScript.

 

Have you used Regex?

What was your experience? How did you learn it? Do you find it useful?