I'd like to create a kind of tone link to a pulse oscillator from the audio lib. In other words, I'd like to create an output object (or twist an existing one) and digitalWrite(high) if the incoming signal is >= 0 and digitalWrite(low) when the signal is < 0.
Of course this has to be compare at the audio rate (44100) so it isn't possible to do it within the update function that run every 2.9ms . I try to understand how the 128 samples array is used to read data at audio rate in view to compare it to zero and ask for digitalwrtie high or low depending on the currently read value but I have to admit that the code in outpout objects is a bit obscur to me.
Any help is welcome, thanks.
Of course this has to be compare at the audio rate (44100) so it isn't possible to do it within the update function that run every 2.9ms . I try to understand how the 128 samples array is used to read data at audio rate in view to compare it to zero and ask for digitalwrtie high or low depending on the currently read value but I have to admit that the code in outpout objects is a bit obscur to me.
Any help is welcome, thanks.