How to activate an audiofile through the data from a sensor

Hello everybody!

I’m a beginner TD student and I’d like to know to activate an audio according to the data received from a outer sensor. It is for a installative project where audio must be off until the data of the sensor is received. From then on the audio must sound continously.

Thank you so much in advance

Hi @MACABA69,

I’m assuming you are outputting the audio via the Audio Device Out CHOP?
Basically you want to control the incoming signal - easiest would be to have a Math CHOP in between the audio input and the audio output and use the data from your sensor to multiply the signal by 0 or 1.
To give you more specific help, please share more details like your project file or information on how you receive the sensor data, what kind of sensor and other things that could be relevant for a solution.

cheers
Markus

Hi Markus

First of all thanks for your rapid answer.
I’m using an audio dev out. For input I’m using the signal from a MAX30102 sensor connected to TD through an Arduino UNO R3 controller.

If you need more info please tell me

Best regards

Manuel

Hi @MACABA69,

I’m imagining you are getting the values from the Arduino via the Serial CHOP?

cheers
Markus

Yes I’ve done it that way. You can also see the operators used for the audio…

image

Thanks!!!

Hi @MACABA69,

you are receiving the data via a Serial DAT. As a good next step, you could convert the value from the Select DAT to a CHOP using a DAT to CHOP. Since you will have to rerange it from whatever value range you are getting to a normalized 0-1 range (Math CHOP) before controlling the volume of the Audio Device Out.

I would recommend to look at some of the lessons in our curriculum at learn.derivative.ca - especially the section on CHOPs:

cheers
Markus

Thank very much for your help Markus

I will try to put into practice all your advice and have a look at the lessons in the curriculum.

Thanks again

Manuel