Skip to content
Arne Brasseur edited this page Jan 15, 2024 · 5 revisions

Hacking Overtone

This page includes tips and tricks for getting around the Overtone code base.

Where the eff is X defined?!

overtone.core and overtone.live use a function (overtone.util.ns/immigrate) to suck all the Overtone vars into one namespace. This is great for using Overtone, but might leave you scratching your head about where the actual code is. Luckily, all the vars have the originating namespace in their metadata:

user=> (meta #'overtone.core/metronome)
{:arglists ([bpm]),
:ns #<Namespace overtone.core>,
:name metronome,
:orig-ns overtone.music.rhythm,
:doc
"A metronome is a beat management function. ...",
:line 73,
:file "overtone/music/rhythm.clj"}

or you could just grep for it.

Where is UGen xxx defined

UGens are generated from metadata specs, e.g. the sin-osc ugen is defined in overtone.sc.machinery.ugen.metadata.osc as

   {:name "SinOsc",
    :args [{:name    "freq",
            :default 440.0
            :doc     "Frequency in Hertz"}

           {:name    "phase"
            :default 0.0
            :doc     "Phase offset or modulator in radians"}

           {:name    "mul"
            :default 1.0
            :doc     "Output will be multiplied by this value."}

           {:name    "add"
            :default 0.0
            :doc     "This value will be added to the output."}]

Try grepping for the ugen name, but camelcased. sin-osc -> "SinOsc" , env-gen -> EnvGen, etc.

how do I build overtone locally

Sometimes you want the the latest version of overtone from the master branch.

See Overtone on the Edge! for how to do that.