designcoding
About Table of Contents Keywords Monthly Archive
Support designcoding!

MusicXML to Grasshopper

July 20, 2012 | Algorithms
#grasshopper #music #timer

We can model a musical composition using native Grasshopper components. After the experiments with the timer component (here and here), I managed to build a definition that allows us to produce outputs in various time intervals. I converted a small part of Bach’s Bouree in E-Minor into Grasshopper as a guitar tablature.

I used Guitar Pro 5’s MusicXML export function to convert classical guitar tablature into XML data, then organized that file in Excel to suit my data tree design in Grasshopper. The Vb.net script is freaking small here just sending number “1” out again and again… The tempo of 90 (90 hits in 1 minute) and a minimum of half notes, which means there “could” be 180 beats in one minute. To be brief, I have to scale the speed of tablature at a minimum of 3 beats in 1 second. That is an excellent part of Bach’s music, solid, intended to be faster but still exploratory at varying tempos. Here is how I re-modeled MusicXML in Excel to make data understandable in Grasshopper:

MusicXML to Grasshopper grasshopper, music
MusicXML to Grasshopper timer, grasshopper

Above is GuitarPro tablature (left), exported to Excel in MusicXML format (right).
and finally, the timer component flows guitar notation into Grasshopper:

MusicXML to Grasshopper Grasshopper definition

I’ll work on a geometric output along with the song. We can change the timer intervals and see the song at different speeds. And of course, the second layer of the tablature (that is the lower notes following the melody) should be added. This can now be done by copying another couple of lists containing other strings and frets. This means, we can add as many guitars as possible to the same time configuration, and they would play all together!!

Yes, I know it is not an automatic process of getting real-time audio data into Grasshopper to make it rock and roll, but in fact, design with computational methods is not just to make things faster or even better, in contrast, we need a designerly consciousness to allow us to get slower and deeper, having a different kind of crafting in a digital environment. Maybe not having audio, but the mathematics behind it is better for now.

“Music is the hidden arithmetical exercise of the soul unconscious that it is calculating.”
Gottfried Wilhelm von Leibniz

I call architecture frozen music.
Attributed to Johann Wolfgang von Goethe and Friedrich Schiller

Talking about music is like dancing about architecture
Steve Martin

Grasshopper definition (GHX)Download

Cite this post

Yazar, T. (2012, July 20). MusicXML to Grasshopper. designcoding. Retrieved August 24, 2026, from https://www.designcoding.net/musicxml-to-grasshopper/

Related Posts

Headbanging Points

December 20, 2013

In this fun experiment, points rock and roll! It should be based on a sound input of course but this is only a test to see if I can handle a timer and graph input at the same time. I’ll modify this definition to actuate with sound.  The use of the timer component gives a certain degree of randomness to the overall formation. To run this definition we need a VB script to update a certain value. The code inside of…

Karyokinesis

November 2, 2013

While searching for a way to work with random points and growing populations, this idea appeared accidentally. I wasn’t trying to mimic the behavior of Karyokinesis of biological cells (in fact I’m in serious doubt about biomimicry in general). The trick is to use a timer + data recorder + a knob for the arbitrary user input. It starts to breed when you start the timer, but to change the evolution speed, just roll the knob!  Of course, the knob…

Regenerating Random Numbers

January 2, 2013

Just a quick tip as I thought might be useful in some cases. Generating random numbers in architectural scripting is not a too catchy thing for designers. It is for sure, we want every parameter to be under our control (as if it were possible!). I was thinking about that in Grasshopper. A dataflow graph such as in Grasshopper regenerates whenever necessary (a change on an input value “fires” every connected component), therefore random number component requires your action (for…

Animate Sketching of a Parametric Truss

July 25, 2012

Previous studies on the timer component were based on understanding its use. This time, I tried to implement it in a geometric design task. Moreover, manipulating the timer component to change the regular animation of parameters. Time does not have to be equally divided into sequences. Rather, new possibilities may emerge with different time flows. A simple triangulation system is developed with a potential manipulation, based on a timer. This definition is exciting and new for me because I’m not…

Metronome Continued

July 19, 2012

Here is today’s improvement on my metronome with the timer component, which started here. It’s straightforward to tell Grasshopper about seconds and organize it according to it. Using an interval smaller than 1 second, this small script catches every second and returns a different value. However, it’s much harder to implement smaller values than seconds. It seemed easy at first sight but getting accurate results smaller than seconds requires working with milliseconds. You can output the current millisecond’s value, but…

  • Chapters

    • Algorithms
    • Discourses
    • Fabrications
    • Studios
  • Explore

    • All Keywords
    • Table of Contents
    • Monthly Archive
    • #rhino-python
    • #polyhedra
    • #parametric-surface
    • #robot
    • #tessellation
    • #boolean
    • #kuka-prc
    • #dome
    • #design-object
    • #image-sampler
    • #terrain
    • #sandblasting
    • #stone
    • #parametric-curve
    • #animation
    • #cycloid
    • #art
    • #aperiodic
    • #tiling
    • #dodecahedron
  • Search

  • Support designcoding!

  • Enjoying designcoding? Support me on Patreon to keep it growing. Thank you!

  • copyright 2026 designcoding.net | about | privacy policy | end user license agreement