How to code Axoloti objects


#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:


#22

solved on git

loopmasta is commenting on the version in git, this has a better text editor with syntax highlighting etc integrated.

Down the road, custom layouts (position of inlets, outlets, controls etc) will be added, and then you do not want to guess the coordinates to do the layout. I mean, I am not against external editors, but there are good reasons to develop the internal editor further.


#23

sure :smile: 100% for internal editing. But as long as we have the option to edit in external way, it is fine with me. I can live with that :smile:


#24

I agree. Since i discovered the build-in editor - the xml / c-code mix makes much more sense. And the sha key get updated on every save witch is very convenient and ... . Its just not so easy to let go of my beloved xcode editor.


#25

Yep. Works fine now.


#26

Some more questions about coding a axo.

  • What kind of inlets do we have?
  • What is there value range?
  • What is a bool32?
  • How often is a bool32.rising inlet called? 3kHz?
  • Does the BUFSIZE change or is it fixed?
  • Can i use control-rate and sample-rate code at the same time and access the same local data?
  • Why is a bool32.rising inlet displayed as int32_t in the code-editor?
  • Is it possible to debug my code?

    <inlets>
    <bool32.rising name="t" description="trigger"/>
    </inlets>

Custom Object Baby Steps
#27

Have you read this?


#28

Yellow = boolean at k-rate
Blue = fractional at k-rate
Green = integer at k-rate
Red = fractional at s-rate

The rising/positive/bipolar are only annotations to the inlet/outlets, and do not enforce anything.

fractional : -0x08000000 to 0x07FFFFFF corresponds to -64.0 .. 64.0

k-rate, yes

It's currently fixed in axoloti_defines.h at 16 samples.
Using different buffersizes is future work.

yes. Sample-rate code is just wrapped in a loop after control-rate code.

Where in the code editor?

For firmware development I use an STLink-V2 (hardware). Then you can use OpenOCD/GDB eventually integrated in Eclipse...

For "functional debugging", you can use
void LogTextMessage(const char* format, ...);
but printing text at k-rate or s-rate will trip the watchdog and cause a processor reset.
Often I add outlets during development and watch data with disp/hex or scope....