Hi all,
after managing to have some nice values from the Trill Craft when running the C++ visual demo, I'm trying to use it in Supercollider for a project. Before working on my own code, I was trying to understand how its sensing is used in others' SC projects—as no SC demo is provided with the Bela—but I'm stuck somewhere. I followed this steps:

Firstly, I tried to follow the steps listed here https://github.com/giuliomoro/Trill_SC just to understand, lately that these instructions are outdated as explained by @giuliomoro in a reply to this post https://forum.bela.io/d/1733-bela-not-finding-trillcentroids-kr-on-boot/7

Therefore, I abandoned the instructions on the initial GitHub page to follow the ones in the forum post I linked. I went from top to bottom of the page at least two times with no luck.

Now, I tried to run this Supercollider example https://github.com/jreus/Trill_SC/blob/master/BelaProjects/SC_TrillCentroids_Example/_main.scd#L38. The only thing I touched was the i2c_address variabile at row #31, which I changed according to the address returned by my setup (0x30).

When I run the project, for what I say, Bela/SC tries to compile the classes but gets stuck in doing this—perhaps missing files? Missing directories? I copy-paste the output I get:

compiling class library...
Found 726 primitives.
Compiling directory '/usr/share/SuperCollider/SCClassLibrary'
Compiling directory '/usr/share/SuperCollider/Extensions'
Compiling directory '/root/.local/share/SuperCollider/Extensions'
numentries = 1110266 / 12500080 = 0.089
4223 method selectors, 2960 classes
method table size 8236276 bytes, big table size 50000320
Number of Symbols 11757
Byte Code Size 330762
compiled 454 files in 2.99 seconds
Info: 4 methods are currently overwritten by extensions. To see which, execute:
MethodOverride.printAll
compile done
localhost : setting clientID to 0.
internal : setting clientID to 0.
Class tree inited in 0.3 seconds
*** Welcome to SuperCollider 3.12.1. *** For help type ctrl-c ctrl-h (Emacs) or :SChelp (vim) or ctrl-U (sced/gedit).
ERROR: Class not defined.
in interpreted text
line 77 char 28:
centroids = TrillCentroids.kr(i2c_bus, i2c_address, noiseThreshold, prescalerOpt, t_recalibrate);

Worth to specify, I'm not at all a CMD wizard—is it possible that I've done some mistakes and created 'ghost' directories that confuse the compiler? Also, I work on a Windows machine and I updated the Bela software to the latest version.

    cimmi ERROR: Class not defined.

    I don't understand much of supercollider, but I think this means that the class files have not been installed properly.
    Can you run this command in the console at the bottom of the IDE and report the result here?

    ls -l /usr/share/SuperCollider/Extensions/TrillUGens

    Hi @giuliomoro , thanks! sure, the command returns this:
    cannot access '/usr/share/SuperCollider/Extensions/TrillUGens': No such file or directory

    That highlights that you haven't installed the class files and ugens where you had to.

    I understand you are not very practical with the command line, but were you able to attempt to follow the instructions (by me) in the post you linked to:

    ?
    You can do as follows:

    • open a project
    • download all the files to your computer and upload them into the project
    • run the following in the console at the bottom of the IDE, replacing PROJECT with the name of the project where you placed the files:
    mkdir -p /usr/share/SuperCollider/Extensions/TrillUGens
    mv /root/Bela/projects/PROJECT/Trill* /usr/share/SuperCollider/Extensions/TrillUGens

    Ensure that they both succeed without printing any errors. The first line creates the target folder, while the second line moves the files from the project folder to the target folder.

    That's should be enough, I think?

      giuliomoro
      Thanks for you help and instructions Giulio, this solved the issue. Apparently it was fairly straightforward but online I was only able to find bits of information—which didn't really help me—rather the full procedure