Register audio buffer



  • @Christoph-Hart Is there a way to create an audio buffer, not using an audio file or sample?

    What I want to do is:

    • Record audio in scriptnode in some way (I don't know how yet)
    • And then analyze this buffer, either in HiseScript or SNEX (but since analyzing it can't be real-time, I wonder if SNEX can be a candidate)

    So I'd like a way to use this buffer in the main script.
    I've seen the core.recorder node, but it seems that it needs an audio file first, and anyway I can't seem to record anything 🙄



  • You can process a DSP network manually using these API calls:

    // Create a network for offline processing 
    // (make sure that the script FX is bypassed)
    const var dsp = Engine.createDspNetwork("dsp") ;
    
    // manually call the initialisation
    dsp.prepareToPlay(44100.0, 512);
    
    // create a buffer array
    const var channels = [Buffer.create(512), Buffer.create(512)];
    
    // process the DSP network offline
    dsp.processBlock(channels);
    
    // Analyse the buffer
    for(s in channels[0])
          Console.print(s);
    


  • @Christoph-Hart Simple and clever!
    But how could I trigger a recording from the interface (via scriptFX or scriptnode) and pass the result to these buffers to then trigger an analysis?


Log in to reply
 

8
Online

1.5k
Users

4.6k
Topics

42.1k
Posts