Hello,
Does anyone know the currently working syntax to set the PGA gain in supercollider?
The IDE settings are ignored and the "s.options.pgaGainLeft = " doesn't seem to work any more.
Thanks
Hello,
Does anyone know the currently working syntax to set the PGA gain in supercollider?
The IDE settings are ignored and the "s.options.pgaGainLeft = " doesn't seem to work any more.
Thanks
Hmmm I thought pgaGainLeft would still work. I will have a look next week.
The console as if confirms that the pga gain has been set, "HeadphoneLevel (0.000000 dB), pga_gain_left (45.000000 dB) and pga_gain_right (45.000000 dB)", but it is not set in reality...
giuliomoro sorry to bug, do you have any news for me? I downloaded the last Bela image, but am still unable to set the PGA gain.
sorry I forgot about this ... did some other Sc thing last week.
It looks like this is a regression that causes a weird interaction with the adcLevel
, where the latter always "wins" over pgaGainLeft/Right due to a change in the Bela API which turns out is only partly backwards compatible. The workaround is to use a positive value for adcLevel
so that it is considered out of range and then ignored. Then pgaGainLeft/Right should work as expected.
Thanks!!
giuliomoro, Is it possible to set the gain for channels [2-7] on the Mini Multichannel Expander directly in SuperCollider as well? The pgaGainLeft/Right method works for me for channels [0,1] (even without the adcLevel > 0 hack), but I can't seem to find any documentation about how to set the other channels, and the IDE has no effect on the level.
Thanks!
scientificsound (even without the adcLevel > 0 hack),
I am wondering if that means your Bela core code is not modern enough ... Make sure you update as per https://learn.bela.io/using-bela/bela-techniques/updating-bela/
You should be able to set the gains you need by creating file /root/.bela/belaconfig
on the board and setting its content to:
CL=-I2,12,3,13,4,14,5,15,6,16,7,17
the ,
separated list is composed of channel,gain
pairs, so in this case it is setting channel 2's gain to 12, channel 3's gain to 13 and so on (againI think you need the adcLevel hack). The gain of the first two channels can be set via pgaGainLeft/Right from the scd
file.
Thanks for the quick reply giuliomoro!
I updated bela and am still having no luck, although now s.options.adcLevel = 1;
is now necessary to get channels [0,1] to respond to changes in s.options.pgaGainLeft/Right
.
I added the config file like this:
root@bela:~# echo "CL=2,30,3,0,4,30,5,0,6,30,7,0" > /root/.bela/belaconfig
root@bela:~# cat /root/.bela/belaconfig
CL=2,30,3,0,4,30,5,0,6,30,7,0
and here's the code i'm running:
s = Server.default;
s.options.numAnalogInChannels = 8;
s.options.numAnalogOutChannels = 8;
s.options.numDigitalChannels = 16;
s.options.numInputBusChannels = 8;
s.options.numOutputBusChannels = 8;
s.options.maxLogins = 4;
s.options.bindAddress = "0.0.0.0"; // allow anyone on the network connect to this server
s.options.adcLevel = 1; // workaround so .pgaGainLeft/Right works (must be out of range > 0) --> (https://forum.bela.io/d/2810-pga-gain-in-supercollider/3)
s.options.pgaGainLeft = 30.0; // THIS WORKS! (default is 10 dB)
s.options.pgaGainRight = 0.0; // (but only for positive numbers...!)
s.options.belaMaxScopeChannels = 8;
s.waitForBoot({
SynthDef("help-scope",{ arg out=0;
// var in = SoundIn.ar([0,1,2,3,4,5,6,7]).belaScope(0); // input from channels [0,1,2,3,4,5,6,7]
var in = SoundIn.ar((0..7)).belaScope(0); // a bit of shorthand...
Out.ar(out, in); // output starting at ch 0
}).play;
});
ServerQuit.add({ 0.exit }); // quit if the button is pressed
and the console output
Building project ...
Build finished
Running project ...
Warning: bela_startup.service changed on disk. Run 'systemctl daemon-reload' to reload units.
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 = 1111862 / 12516972 = 0.089
4223 method selectors, 2964 classes
method table size 8244668 bytes, big table size 50067888
Number of Symbols 11767
Byte Code Size 331042
compiled 455 files in 3.07 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).
Booting server 'localhost' on address 127.0.0.1:57110.
Found 0 LADSPA plugins
Warning in SC_BelaDriver::DriverSetup(): hardware buffer size (16) different from SC audio buffer size (64). Changed the hardware buffer size to be equal to the SC audio buffer size .
SC_BelaDriver: >>DriverSetup - Running on PRU (1)
Configured with
(8) analog input and (8) analog output channels, (16) digital channels, and (0) multiplexer channels.
HeadphoneLevel (-6.000000 dB), pga_gain_left (30.000000 dB) and pga_gain_right (0.000000 dB)
DAC Level (0.000000 dB), ADC Level (999999.000000 dB) oscilloscope channels (8)
Speakers are not muted.
SC_AudioDriver: sample rate = 44100.000000, driver's block size = 64
SuperCollider 3 server ready.
Requested notification messages from server 'localhost'
localhost: server process's maxLogins (4) matches with my options.
localhost: keeping clientID (0) as confirmed by server process.
Shared memory server interface initialized
Bela stopped
I get the volume boost on i/o [0,1], but not on any of the [2,3] or any of the other high pairs. Do you have any idea what could be going wrong? Perhaps I need to manually tell it to read the new settings file or something?
thanks!
I was and you are missing -I
after CL=
(see my
amended example above)
that works, thanks!
are these functions documented somewhere? I wasn't able to find any info on learn.bela.io, and it would be nice to access other missing functions like turning the led off.
Well ... they are documented here, but the list is out of date because it doesn't get updated regularly. The most up-to-date list is by running any Bela C++ program with --help
. Just pick any C++ example from the IDE and add to the command line options
box in the Project setttings tab of the IDE --help
. The program will run but exit immediately and print all available options.