I2c Opcode for Csound on Bela

Hi all, I am doing a project with Dr.B for my senior thesis right now. Basically what I am doing is running a granular instrument on the Bela controller and using sensors to control the parameters, and I wonder if we could have a opcode for general sensors using i2c (like a gyroscope). I do know that Csound has a number of Opcodes for reading datas on the Trill sensors, and the trills use i2c as well. It might be achieved by modify the Trill opcodes, but I don’t know how to do that. Bela and Csound is a perfect match and having a opcode like that would open a lot more possibilities and conveniency. Does anyone have any thoughts on that? :smiley:

I’ve no experience with the Bela, or the Trill opcodes, but as far as I recall, building for the Bela is not as straightforward as other platform. So the chances of getting a new opcodes developed for it might be a little low. Is there no other way of accessing the data from the controllers? Do any of the serial opcodes work?

I’ve been working with the Bela for some time and I use the trill opcode only for basic applications since it doesn’t work when sensoring more than one finger.
I also think it would be a great step to have a general purpose I2C opcode. This would open new possibilities for using lots of widely spread digital sensors.
@rory: which serial opcodes do you mean? serialRead? I never tried this one. I’ll try this next week.

Hi @luisantunespena, I’ve no idea how the Bela board transfers data from its controls. I know it’s possible to communicate with Arduino controls over a serial connection, so I thought perhaps it’s also possible here. Probably not though, as otherwise new opcodes wouldn’t need to have been written!

Hi @rory , thank you very much for the reply! Csound Bela do has an opcode for sending and receiving OSC data. I was intended to using an arduino to read the i2c data and send to Bela via OSC, but my arduino board is in short of memory and I am waiting for a board with larger memory to arrived. I’ll test and update in this thread once my new board has arrived. But I’m still looking forward to any thoughts and advices on Csound i2c!