Heyy,

Is it possible to read the values from the 8 adc~ ports at the same time?

Currently i have 8 potentiometers and the wiring is correct but when i try to read the values from all the 8 potentiometers i can only read 4 at a time.

Is there a way i can read all of the 8 potentiometers?

This is how my pd patch looks like

And this is an example of the prints. The last 4 are just 0.

Thank you

it may be that you have set the number of analog inputs to 4 and/or the sampling rate of the analog inputs to 44100 in the project settings. Revert it to 8 resp 22050 and it should work fine.

Nicee it works. Thank youuuu

4 days later

Heyy,

Im connecting all the electronics with bela and pure data and i run out of CPU. Is there a way we can use external CPU to run the code or i don't have another option but make a smaller project?

try setting the "User command line arguments" box in project settings to --board Batch --codec-mode=s=1,p=95,t=1 . Then run the program. It won't actually run, but it will print the actual CPU usage to the console. Knowing that, we can look into how to optimise things. (to revert to actually running the program, make sure you remove the content of the box)

ok ill try

So this is the console print

And i also have this error i dont know what they mean.

The "freeverb~" is something i installed in puredata so idk how to include them in bela

And this was the settings now. but even with higher block size it wouldnt work.

actually i forgot to had the trill sensor of the player 2 of this game. now that i did this is the output.

you can get freeverb here, following instructions: https://github.com/BelaPlatform/Bela/issues/621

96% means that you are currently using 96% of the CPU for running audio processing, though in practice it's about 15% more than that because there's some overhead in getting audio in and out. It wouldn't be impossible to try to optimise things from this point until it can run in real-time: you are not very far off. Note however, that each freeverb channel you'd add would probably add 20% or so.

Those listbox errors are probably due to the old Pd version that's on Bela. I have a new one if you want to try it out which should support it - unless it requires an external.

Can you share the whole patch?

Regarding the second sensor, check with i2detect -y -r 1 what Tril devices you have connected.

  • Ari replied to this.

    As context, I'm basically turning the game "Guess Who?" into a drum machine. So theres 2 players.

    Theres more explanation on how to play the game on this github page : https://github.com/ArianaMarta/music-game/blob/main/README.md

    Right now this is all the patches i have:

    main.pd
    196kB
    acid.pd
    4kB
    clap.pd
    4kB
    claves.pd
    1kB
    clip-calculation-ply1-pot1.pd
    5kB
    clip-calculation-ply1-pot2.pd
    5kB
    clip-calculation-ply1-pot3.pd
    6kB
    clip-calculation-ply2-pot1.pd
    6kB
    clip-calculation-ply2-pot2.pd
    6kB
    clip-calculation-ply2-pot3.pd
    6kB
    cowbell.pd
    1kB
    cymbal.pd
    3kB
    gatemode0.pd
    545B
    gatemode1.pd
    550B
    hithat.pd
    5kB
    kick.pd
    3kB
    snare.pd
    3kB
    threshold.pd
    322B

    And this one is a simulation of the algorithm of the game without the eltronics (meaning that i use Toggles and Slidders to simulate buttons and potentiometers)

    I was also suggested to try using bela just for the eletronics and use my computer for the audio processing via MIDI(https://learn.bela.io/tutorials/pure-data/communication/midi-send-and-receive/) or OSC (https://learn.bela.io/tutorials/pure-data/communication/open-sound-control/)

    I was also wondering if i should just take the freeverb~ out or optimize the audio somehow.

    Hope to hear from you,
    Thank you

    in the console at the bottom of the IDE

    Hello,

    I manage to reduce to 85% CPU. Its still not enough.

    This is the sounds i have at the moment. Do you have any recommendations how can i made them less CPU heavy?

    4pole.pd
    404B
    acid.pd
    3kB
    clap.pd
    4kB
    claves.pd
    992B
    cowbell.pd
    1kB
    cymbal.pd
    2kB
    hithat.pd
    4kB
    kick.pd
    2kB
    snare.pd
    3kB

    also i still have that error. Do you think will be a problem for the program to run? or can i ignore?

    If you update your core code to the latest dev branch , you will get Pd 0.55 which should run with about 75% CPU here, also thanks to some improvements I made to the Pd core for you.

    Instructions to update are here: https://learn.bela.io/using-bela/bela-techniques/updating-bela/#updating-to-an-experimental-release

    Unfortunately, I still see periodic dropouts when running at 64 samples per block. You can maybe downsample slightly: edit ~/Bela/core/I2c_Codec.cpp and replace 44100 with something lower, such as e.g.: 40000.

    Regarding the Trill I2C error, can you show the output of i2cdetect -y -r 1 ? It may well be that it gets fixed by the above update, so try that first.

    Hello,

    Thank you for your reply. I manage to simplify my audio quite a lot so i think ive improved the CPU issues. But regardless i would love to update the core code.

    So i have to choose the "dev" branch and then download and follow the steps. Is that the branch you meant ("dev")?

    Also, where and how do i edit the I2c_Codec.cpp file. I guess this is the file from the dev branch:

    Does that mean that after downloading this branch i first change the file and then i update the board? Or is it something we can do after ?

    thank youuuu