Recent Commits to AudioNoise:main

  • 18/01/2026 0:18

    convert: add somewhat realtime control interface

    convert: add somewhat realtime control interface
    
    This is pretty raw and stupid, but I wanted to try changing the
    conversion parameters on the fly with a "control file descriptor".
    
    This is currently very limited, and doesn't have an interface for
    switching the effect itself at runtime (like I do on the hardware:
    long-press the foot-switch for one second), but at least allows for
    sending "pot commands" to change the pot values dynamically.
    
    The format is a five-byte ASCII packet of 'pXYY\n', which sets put X to
    value YY (X being in the range '0'..'3', and YY being '00'..'99').
    
    Why that format? Because right now the only testing I've done is from
    the terminal, doing something like this:
    
        $ ./convert --control=0 phaser input.raw |
                    aplay -c1 -r 48000 -f s32 -B 100
    
    and then you can just type in those commands at the terminal by hand:
    the "--control=0" is the magic that says that fd 0 is a control channel.
    
    Very combersome, very stupid, but hey, it works.
    
    Note that I'm back to using 'aplay' for this, because with ffplay the
    latency is absolutely horrible.  Something like three seconds of audio
    later does any pot command take effect, because ffplay has slurped in a
    lot of data into its input buffers.
    
    In contrast, with 'aplay', the effect is basically instantaneous,
    particularly with that "-B 100" that keeps the buffering to a very
    reasonable 100ms.
    
    If there is a flag for ffplay that makes it not buffer input very much,
    I haven't found it (and yes, I tried the obvious ones, but no, I didn't
    do any exhaustive search since aplay works fine for me).
    
    It should be very possible to wrap a UI around this, and I should also
    add some command to switch the effect at runtime too.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Log in