Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DigitalOut ugens have problems #68

Open
giuliomoro opened this issue Jun 20, 2018 · 5 comments
Open

DigitalOut ugens have problems #68

giuliomoro opened this issue Jun 20, 2018 · 5 comments

Comments

@giuliomoro
Copy link

https://forum.bela.io/d/562-salt-and-supercollider/27

giuliomoro added a commit to giuliomoro/supercollider that referenced this issue Oct 3, 2018
@TheTechnobear
Copy link

DigitalIn.kr(20) will "crash" server...

perhaps could check limits

s.options.numDigitalChannels = 16;

also as far as I could tell, the issues with DigitalOut remain the same :(
So, Ive stuck with DigitalIO as a workaround (as details in above topic of bela.io forum)

(testing latest master branch on Salt)

@giuliomoro
Copy link
Author

the issues with DigitalOut remain the same :(

yes, I did spend some time looking at it, and fixed a minor issue, but I could not reproduce the problem I think (also I did not have a scope at hand when I did that). I tried again now with as cope and I cannot find it. Could you please guide me through reproducing the error? Thanks

@sensestage
Copy link

Both DigitalIn and DigitalOut do perform a check at construction (the _Ctor functions of the Ugen) of the pin number, print out a warning, calculate the first (dummy) sample and then set the next_calculation to a dummy function.

Or they should... I see indeed that there is an error in DigitalIn.kr, as I did do a calculation of the first sample, but not do a SETCALC.

In /server/plugins/BelaPlugins.cpp lines 580 to 585 should be:

          // initiate first sample
          DigitalIn_next_dummy_k( unit, 1);  
          if (unit->mCalcRate == calc_FullRate) { // ugen running at audio rate;
            SETCALC(DigitalIn_next_dummy_a);
          } else {
            SETCALC(DigitalIn_next_dummy_k);
          }

@sensestage
Copy link

this way the DigitalIn will print out a warning and then just output 0.

@giuliomoro
Copy link
Author

I think the issue now happens for larger block sizes and I can see why: the backend doesn't properly persist the digital buffer when the Context FIFO is enabled. https://forum.bela.io/d/3957-supercollider-digitalout-erratic-behaviour-on-high-bock-size Not sure what the issue was back in 2018 when large block sizes were not handled this way ... This should be fixed in the core.

Another issue with the digital ugens seems to be that digitalWrite() is used in place of digitalWriteOnce() at least once, with consequent wasted CPU time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants