How to code Axoloti objects


#1

The Axoloti world is fairly new to me and i am trying to understand some basic concepts. Here are some questions i came across while reading through some Axoloti object code.

  • What kind of editor do you use to get syntax checking / highlighting / completion / formating?
  • How can i include source and header files into a xao file or is it the CDATA section the only way to add code?
  • Can i use floating-point arithmetic instead of fixed-point?
  • Can i use custom STM32F4xx DSP libraries from within a Axoloti object?

My Axoloti core will arrive next week and i appreciate any help i can get. Thanks a lot.


#2
  1. I have no options available currently, however I started integrating RSyntaxTextArea in Axoloti, but it is not integrated in the object editor yet (on git). The object editor in Axoloti needs more development than just this.
  2. The problem with including source and headers is that it can lead to conflicts when different objects refer to headers with the same name(space) that are really different. On the other hand it is needed to de-duplicate object code. wave/play etc use a header.
  3. Yes, but there is no inlet and outlet type for float. For performance it is best to avoid double precision float operations and avoid the standard math.h functions.
  4. You mean the CMSIS dsp libraries?

#3
  1. So i have to create the *.axh and *.axo files with my editor of choice, add some code and generate the uuid by hand for now?
  2. Makes sense.
  3. Would be great to have the option to choose between int and float types. Sometimes its easier to do a quick proof of concept in float and later on optimize it for fixed-point.
  4. The CMSIS lib was the one i was thinking of while posting my questions. I know by now that it comes with the Axoloti patcher. Cool.

#4

A little bit off topic but just in case somebody (like me) wants to build the axoloti patcher from git with no ant installed. The build works fine with these (quick hack) lines added to the build.sh script just before the ant call.

 # ---- binary distribution of Ant
 cd "${PLATFORM_ROOT}/src"
 ANT=apache-ant-1.9.6-bin.zip
 if [ ! -f $ANT ];
 then
    echo "downloading ${ANT}"
    curl -L http://apache.openmirror.de//ant/binaries/$ANT > $ANT
 else
    echo "$ANT already downloaded"
 fi
 tar xfz ${ANT}
 export PATH=${PLATFORM_ROOT}/src/apache-ant-1.9.6/bin:$PATH
 # ---

#5
  1. Yes. But watch progress on the integrated object editor, just added syntax highlighting there.
  2. You could convert from int to float inside your object. Exposing float type in- and outlets is possible but I fear the object library will double in size with seemingly meaningless variations.

#6

On Windows, Ant is already downloaded and extracted in build.sh, just not added to the path...
On Mac, I suggest to install Ant with brew. https://github.com/axoloti/axoloti/blob/master/doc/compiling%20from%20source%20on%20osx.html


#7
  1. It's a total noob question but where do i find the integrated object editor? I just did a new build to see the syntax highlighting but i can't find it in the menus.

  2. Fair enough.


#8

In the properties menu (right click the title bar, or the triangle icon left of the name) of an object instance in a patch, then select "edit object definition".


#9

Shame on me. I totally missed that triangle icon. But now if i select "edit object definition" i get this exception.

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/fife/ui/rtextarea/RTextArea
at axoloti.object.AxoObject.OpenEditor(AxoObject.java:298)
at axoloti.object.AxoObjectInstance$2.actionPerformed(AxoObjectInstance.java:160)
at java.awt.MenuItem.processActionEvent(MenuItem.java:669)
at java.awt.MenuItem.processEvent(MenuItem.java:628)
at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:351)
at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:339)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:761)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: org.fife.ui.rtextarea.RTextArea
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 24 more


#10

thanks, fixed it
git pull, and build again...


#11

Wow. Very nice. Works great now. Now the whole xml / c-code mix approach makes much more sense. :smile:


#13

I never really liked brew or macports for some reason but i like self-contained projects. I like the option to install ant within my axoloti project folder so that a uninstall is just a delete folder. But whatever works is ok.


#14

If you just want to do some basic editing of code, for example make a new version of an allready existing object, like these I made

You could use Text Wrangler on Mac. And I think Notepad++ on PC. But what you try to do seems more complicated than this.


#15

Added a file/save menu to the object editor in git. It does not allow creating objects, only save modifications. Feedback is welcome.


#16

The code editor seems to be a step behind on save. If i add code and save and than open the file with an external editor i only see the previous changes ?! In other words you have to save twice to see the changes.


#17

Well. I prefer to use an external editor, like textwrangler for editing objects. Maybe down the road when the editor is more capable I will use it for editing. Uou cannot save the object from Axo editor to new file...... you have to go external anyway, so might as well do it in external editor. But the idea is awesome and when implemented in a nice fashion I will use it :smile:


#18

Do you remember to reload object list? Or maybe that is not necessary when you edit in the Axoloti object editor.


#19

I would love to use a external editor but axoloti complains about a wrong sha or uuid if i edit my code with atom (textedit, Xcode, etc...) and than hit reload.


#20

But it still works if you just change a few letters. An example:
The uuid of ctrl/i:
a3786816db6ea5bc6ac4193a5cccdb2c83b83496

And I change it to:
a3786816db6ae5bc6ac4193a5cccdb2c83b83496

( only changed letter 12 and 13. Switched the A & E around Couldnt highlight it for some reason).

And I do the same with the sha....

It has worked everytime. It might come up as red in the Axoloti talkback window.. But it DOES work.... The problem is if you dont change the uuid and the sha axoloti thinks it is refering to the already exisiting object. THat also means everytime you try to reload a patch with the new verison in it will load the old version instead.. So change uuid, sha and also name and it will work :smile:

Don't use Textedit.. I tried that and it does not work for editing axo objects for some reason.. use Textwrangler. It is free and works very well :wink:


#21

Johannes says this about it: