Making new objects - The basics


#1

Hello,

In order to be able to use Axoloti for what I intend to do I'm going to need to make a new object.
I read somewhere that there is going to be an object editor in the future, but in the meantime we can use a text editor.
The thing is I have been fooling around with it, and I can't make my new object appear in the objects window. Obviously I'm doing something wrong (many things, I presume), but before I continue hitting my face against the window like a fly I would like to make sure my suckiness is in the code, and not in the procedure.
So my question is, as long as I write the code and save the file as 'whatever.axo' in one of the objects folders, and then in Axoloti I go to File-reload objects, it should appear where I put it, right?

Oh and another question: What language are objects written in? I learnt c++ back in the day and I seem to be able to read the logic in the factory objects, but there are some things that I just don't recognize, and I would like to be able to know which ones are part of the object and which are part of the languaje and should be included.

Sorry about the newbie questions blush


#2

I can't make my new object appear in the objects window.

If you copy an existing .axo file, replace id, uuid and sha with an unique (random) value.

Objects are defined in c++ without function headers, the headers are auto-generated depending on inlets, outlets and parameters.
What things do you not recognize?
___SMMLA, __SSAT, ___SMMUL etc. are intrinsic functions, they map to processor instructions.

And out of curiosity: what do aim to achieve?


#3

Heyy thanks, I'll try that sunny .

The things I don't recognize are, for example, this: <code.declaration><![CDATA[ int32_t _scaleVal;
I don't know what that CDATA does, and if I should include that in my object.

What I'm aiming for is something like the "Scale" midi effect on ableton. We have made this DIY midi version of an ancient basque instrument, and it always sends the same 12 notes: 60-71. Right now we use the scale midi effect on ableton so we can assign any note we want to each board, and then we use Sylenth1 to generate the sound. I would like to get the computer out of the way and get Axoloti to be the core of the instrument (instead of Sylenth1). So I need to make an object that receives midi notes 60-71 and lets you choose what notes are going to come out of it.
For example, if you receive C1, change it to D#3, if you receive C#1, change it to F3, etc.
I guess I could use twelve midi/in/keyb zone touch (C1-C1, C#1-C#1...), and transpose each one separately, but I think if I make my own object for that I'd be saving some ram and cpu.

Thanks again smile


#4
<![CDATA[.....]]>

is XML, and means unparsed character data. Without this, you'd need to write & as &amp; and < as &lt; etc.

To map midi notes to different pitches, you can use a table. Check demos/midi_fx-alternate_tuning.axp , this shows how to use a one table for microtonal (de)tuning.
Alternatively, the "harmony/note quantizer" object may be of interest.


#5

Thanks for the help smile
I had seen those objects but they didn't quite do what I wanted, so I have made one that does exactly what I need:

This way I can assign a note to each one of the boards in our instrument. The assignation in the image is just an example, normally we use scales.
I think this object is not worth sharing because it is too specific in its function, but if anyone is interested just tell me smiley