How to get started with with objects programming?


#1

Are there any instructions on how to get started with Objects programming?
or is someone planning to write something tutorial?


#2

I am also very interested in this. I asked a question in my thread about making a BPM based object:

Johannes answer:
C++ books will teach you a lot of things that are
hardly relevant for Axoloti. The programming constructs used in the
objects are most elementary. The harder part is expressing what you want
to do, where the difficulty is not so much in programming but in the
math and DSP.
If you want to learn about music-dsp, not sure what to recommend. I
learned from many different resources over a long time, I don't know
where to start.

Mostly interested in programming that is relevant for Axoloti. But from what Johannes wrote, I don't really know where to begin. It would be really great if us "beginners" could help each other with this, but we need a place to start smile


#3

I read that, but there is a lot more than that.
For example the XML, how is it constructed and what are the possible elements. what should go where? what are the attributes to choose from, etc etc.
Some things seem to be generated (the sha), how/where does this happen? there are .axo and .axh files, what should go where? ...etc.

(btw, for an introduction to music/DSP coding I'd recommend The computer Music Tutorial https://mitpress.mit.edu/books/computer-music-tutorial. )


#4

i guess over time it will be documented, but as always i guess its a matter of priorities.

the idea is, in the future, the users will not have to interact with the XML, as the Object Editor will allow parameters/attributes and code all to be entered.

I learnt, by simply looking at existing objects and also the java code, it was not that hard really.

sha/uuid, yeah we need to abstract so this can be called from the command line.
basically uuid can be anything, and if you put an sha that is wrong, it will tell you its wrong, and what the correct one is.
(so I usually , when I'm not generating from java, copy an existing object, change the uuid and then just load it to get the correct sha)


How are UUID and SHA generated
#5

Try compiling a simple patch and look at build/xpatch.cpp, this is the file that gets constructed from the objects you instantiate in the patcher.


#6

Thanks Alex. Have found a PDF version of that book. Will look through it before I buy it.

Technobear. Sure no worries. I don't expect you guys to teach me/us, maybe just point us in direction of some resources. Anyway, have got that book and that is a place to start.

Rvense: thanks, will do that too smile Also a good place to start....


#7

If your not familiar with C++, Id avoid looking at xpatch.cpp.
most of the code you need for writing objects will be in C, which is much easier to learn that C++ smile

you should also get a 'passing familiarity' with XML, so you can understand the structure of the axo files.

once you understand a few basics in C/XML, just dive in... look at existing axos, try to figure out how they work, just don't (initially) get hung up on understanding all the code... the start creating a few objects, by taking existing ones as a starting point.

(again, assuming you have read the first few chapters of a book on dsp or similar)


#8

@thetechnobear

Thanks mate.

That is very useful. I already dug out a lot of tutorials on c++ but will leave them for now and find some introduction to C instead. And also the XML I will look into.


#9

I think to start it is also really simple just to take an object and modify it's code in the object editor and reload the patch. (than it'll load the modified code)


#10

Hey guys smile

Reaktor 6 was just released today. And with Reaktor 6 came a bunch of articles about DSP programming. Just thought I wanted to share it with you guys. Here you go:

https://www.native-instruments.com/en/products/komplete/synths/reaktor-6/dsp-articles/


#11

Yeah, Ive now gotta read the new Blocks Framework manual...

but been playing with Reaktor 6 this evening, and its really is nice, the blocks idea/implementation could really revitalise Reaktor, and the NI user library... gonna be some fun times ahead smile


#12

Hi! I'm trying to make a simple object that allow to display a positive integer from different buttons, to have a selector for mux object. I don't know how to program in C++, but i'm trying editing parameters from already made objects.
I did something but I cannot reach to hold the output value, when I release the button it get's to 0.
I'm editing klab's bin8_to_int_1
If someone can help me...


#13

You're resetting "result" to 0 at each cycle, so if an inlet stops being "1" (or !=0), its value is lost.
If you delete the line result = 0;, result will add up; but you need to make sure each button only adds once while pressed. For that you need a variable like ntrig, which is set to 1 when a button is pressed, and back to 0 when it isn't. Schematically
if ((inlet_i0!=0)&&(!ntrig)){
ntrig = 1;
result = result + 0;
}
else if (inlet_i0==0){
ntrig = 0;
}

If you want to be able to press several puttons at the same time, you need to do this for each inlet, with a different ntrig variable for each inlet. If you know that only one button will be pushed at a time, you can put the whole if (inlet_... block inside the if, i.e. replace inlet_i0 in the above with inlet_i1+inlet_i2+...+inlet_i7