Search code examples
adcpuredata

Pure Data - Get adc value in a particular duration


I'm trying to get the adc values in says 50 seconds. I end up with the picture belowenter image description here

I set up the metro as 50 which is 0.05 sec and the tabwrite size 1000. I got a list of values as below

enter image description here

But I feel it isn't right as I speak louder for a few seconds, the entire graph changed. Can anyone point out what I did wrong? Thank you.


Solution

  • the [metro 50] will retrigger every 50 milliseconds (20 times per second). So the table will get updated quite often, which explains why it reacts immediately to your voice input.

    To record 50 seconds worth of audio, you need:

    • a table that can hold 2205000 (50*44100) samples (as opposed to the default 64)
    • a [metro] that triggers every 50 seconds:
        [tgl]
        |
        [metro 50000]
        |
        | [adc~]
        |/
        [tabwrite~ mytable]
    
        [table mytable 2205000]