• Hi there :)

    Thanks for the link on capacitive sensing on the Pico -> it seems to be precisely what I've been looking after :D
    I wonder how close the same code 'd be for the original Espruino board ..

    Now, while your suggestions are worth the look, I did find a "softpot" in my mess & took that as an opportunity for a quick hardware POC / to focus on the software ( on the laptop ).

    The softpot used seems pretty sensible from the test I ran, & right now I'm trying to think of the simplest way to track "cross limit" finger movements:https://github.com/stephaneAG/Espruino_t­ests/tree/master/SoftPotTest

    The idea is to periodically read the analog value coming from the sensor & forward it's state
    If it's smaller than previous one, then we are moving CW, else CCW.
    Depending on the difference between the previous value and the current one, we can deduce the speed of the movement.

    Once the above is done "correctly" ( handling some special cases & thresholds .. ), I have an ongoing http://stephaneadamgarnier.com/ScratchyW­AA/playMp3.htmlPOC for the software running on the laptop

    The idea is basically to load an audio file, get its buffer's channels data & build up a reversed version, and then allow to mess with the playbackRate of both while "playing" ( actually connecting to the speakers as AudioContext.destination ) one of those alternatively.
    ( the above seems needed since we can't set the playbackRate.value to negative values .. ).

    The end goal being able to either change playback rate & direction as well as "seek" to specific parts of the buffer or it's reversed version.

    As far as I could check, the "seek()" fcn is available for elements, and the only way to do the same stuff with the Web Audio API is to create another buffer ( since we can't use "start(time)" more than once on a specific audio buffer ) for each "seeking action".

    Since we're talking about the Web Audio API, I started to digg the code used for Audio Jack Rx, to learn a little more about the "ScriptProcessor" & "onaudioprocess" stuff ( .. ) :)

    As I was wondering if it may be better to save a reversed audio file & then load both original & reversed in separate elements, I started diggin how to save audio files from stuff done using the web audio APi, and ended up to a link pointing to some PCM stuff :)
    -> I wonder if we can make use of that to be able to write a little tool that'd convert audio for proper playback from SD ( instead of overkill Audacity .. ) ?

    -> so, any experience on saving audio files / Web Audio API "seek" / above stuff anyone ? :D


    1 Attachment

    • usingSoftpot.png
About

Avatar for stephaneAG @stephaneAG started