Music and Visuals

If slipmat at its core is a general purpose programming language augmented with advanced timing and scheduling capabilities, then slipmat would be well suited for both music and visuals.

This isn’t really too much of a stretch. Audio unit generators won’t be built into the core language, but instead will be stored as separate modules and imported as needed; The same would be true for visual modules. Musical GUI elements such as sliders are already visual in nature. There are existing audio/visual systems out in the wild, such as Max/MSP/Jitter and Impromptu. Various functions and objects designed for music could also be applied to visuals; The same envelope that controls frequency can be used to control the position of a circle:

t = 10                          # time = 10 beats
my_circle = Circle(0, 200, 15)  # x position, y position, radius
env = line(0, t, 1)             # start value, duration, end value
sine(1.0, 440 * env)            # amp, frequency
my_circle.xpos(env * 400)       # x position over time

The example is a bit crude and omits many practical things, but the idea of syncing visuals with audio is there.

Beyond music and visuals, anything that is time-based would theoretically work in slipmat, providing a module is written.

On the Importance of Docstrings

sine_arp visual object

Docstrings can do wondrous things. Wikipedia describes a docstring as “a string literal specified in source code that is used, like a comment, to document a specific segment of code.” I’ve rewritten sine_arp() to demonstrate a theoretical docstring example:

def sine_arp(dur, amp, pitch, lfo_freq):
    '''Generates an arpeggiated sine tone.
    
    dur - Duration
    amp - Amp
    pitch - Pitch, in pitch-class format
    lfo_freq - Frequency of lfo arpeggiator    
    output - Audio signal
    '''
    
    self['dur'] = dur                            # Set life of instance
    notes = [0, 3, 7, 8]                         # List of half-steps
    arp = Wavetable.osc(1, lfo_freq, notes)      # Cycle through note list
    pitch = cpspch(pitch) * 2 ** (arp / 12.0)    # Modulate pitch with arp    
    osc = Wavetable.osc(amp, pitch, sine(1000))  # Generate audio
    output osc                                   # Return audio

The docstring is the string block between the matching triple quotes. It gives a basic description of what the function/opcode/unit generator does and descriptions for the inputs and output.

What are the advantages of building docstring capabilities directly into a computer music language?

One. A proper description of a function and its interface will allow other users to import and reuse code with ease, propagating a remix culture within the community.

Two. With a utility like the Sphinx Python Documentation Generator, complete documentation can be auto-generated in the form of HTML, PDF, LaTeX, etc. This gives users the opportunity to browse a library of synths, patterns, note generators without ever having to browse the code.

Three. They can provide interactive help from within an integrated development environment. For example, if your cursor is resting in the middle of a function, the description can automatically be displayed from somewhere within the IDE.

Four. Imagine if a visual GUI environment, such as Max or PD or Reaktor, was built on top of with slipmat. Docstring data could automatically be relayed to the visual object, as seen in the picture above. Furthermore, I have a hunch that if slipmat is designed properly, than all text function definitions could be visual objects, and vice versa, without modificaiton.

Question: Are there any other music languages that utilize a Docstring-like system. If so, I want to study them.

Thing-a-day 17: Binary Clicker

Binary Clicker

Today’s device translates the wonderful world of binary into sound. Inspired by THINGS – COUNTING IN BINARY ON YOUR FINGERS by Bre.

Listen – Day17-Binary_Clicker.mp3

Download – day17.max.zip (requires Max 5)

For Thing-a-day 2009.

UPDATE: Added a Creative Commons License to the mp3.

Creative Commons License
Day17-Binary_Clicker.mp by Jacob Joaquin is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

Thing-a-day Day 1: Single-Grain Synth

So I’ve decided to participate in Thing-a-day 2009. Which means that starting yesterday, I will create ten things over ten days, and share it with the world. Here’s a repost from my entry from yesterday:

Single Grain Presentation

Single-Grain is a simple granular synthesizer/audio processor built with Max 5.

You can download the original Max 5 Single-Grain patches here. If you don’t own Max 5, but own a Mac, you can download the stand-alone application here. Mileage may vary.

Single Grain Final Patch