An object in Axoloti is an .axo file, which stores the object definition (like the name, a unique ID, inlets & outlets ) and some code.
The code and object definitions are combined as an XML file and therefore every XML tag needs to be closed properly in order to function correctly.
XML tag with content:
Empty XML tag:
Note that tags can not be left empty like this:
Some tags may be left out, but some are mandatory.
An XML tag can have attributes . Some of the (mandatory) attributes used in Axoloti objects are id, uuid and sha , and in the inlets and outlets sections you'll find things like name and description,
In XML the content (= data between tags) can not contain certain characters, these are: " ' < > &
The work-around for this is to use CDATA formatting, which means that the data in between these tags is content , and not part of a tag.
This is a definition of a empty Axoloti object:
id: a unique name for your object.
uuid , sha : a unique ID (SHA1) . If the ID already exists , or when it has not the correct value, Axoloti will suggest the correct value when reloading the objects (File > Reload Objects).
inlets , outlets simply define the inputs and outputs of your object.
<frac32 name="in" decription="in" />
<frac32 name="out" decription="out" />
Inlets and outlets have a name, can have a description and have a numeric type (tagname).
generates this dial:
Some parameter types employ a "pfunction", to scale/map/warp a linear parameter space into a range (-64...64) that can be more directly used by the dsp function.
All parameters result in a 32 bit type.
The definitions in the Displays section will show up as data visualizers in the GUI, only reading back from patch to GUI. The value of a Display element can not be changed by the GUI.
<frac32.s.dial name="v" noLabel="true">
The definitions in the Attributes section are used to define constant values or strings (like table name )
Attributes are known at compile time.
<spinner name="delay" MinValue="1" MaxValue="10000" DefaultValue="100"/>
results in :
In the code section the attribute can be used by adding the prefix attr_ , so in this example that would be attr_delay
This is where the actual code lives.
There are three code sections :
code.krate : control rate, 3000Hz
code.srate : audio rate , 48000Hz
Code sections can be used together, or left out
Sample rates are defined in the firmware app/firmware/axoloti_defines.h
The sample rate is defined by the macro SAMPLERATE.
The number of audio samples corresponding to one control rate sample is defined by the macro BUFSIZE , so a buffersize 16 results a krate of 48000/16 = 3000.
This example code simply adds the value of in2 to in1 , and send it to out (3000 times per second):
Note that the names are prefixed with inlet_ and outlet_ , this means they were defined in the outlet/inlet section of the XML.
If you look at existing objects, you'll notice a lot of operators. If you're not familiar with C syntax, this list might be useful: C operators
declaration , init
Sometimes the values used in the code need to be declared and initialized.
This is where the code.declaration and code.init sections are for.
This is code is only executed once, when the program starts.
102 creating a first object