LEHELTOROK n order to receive the value in PD I have to remove "return true;" from the bool setup section otherwise I get a segmentation fault and Bela stops running.

yeah not a workaround that was ever going to work really ... there must be some real issue there that you are just somehow hiding.

You should not return early from setup() as it will skip all the Pd initialisation and subsequently crash. Your issue is that you are trying to instantiate another Scope object, when there is already one used by Pd. You should be getting the inputs into Pd and scope them from there by sending to the [dac~ 27 28 29 30] channels if you need to. Otherwise, if you want to use your own gScope in C++, then you should comment out all the instances of scope in the .cpp file.