Guitar to CV/gate project issue

Started by Mick Bailey, January 17, 2022, 06:08:15 PM

Previous topic - Next topic

potul

The timeout will cause the note recognition to fail, but will not add latency, as fas as I know. It will fail to detect the note but will not retry until a new note is plucked.

Mick Bailey

I'm looking through the code trying to understand what's happening, but without programming skills it's a slow process. Going back through the original posts when the project was launched, there are some changes proposed that are unclear - I experimentally recompiled the code and I can't tell any difference. What effect do the changes have?

Quote from: Diodac on December 04, 2013, 09:45:56 PM

Waveform Peak Level Detection,   line 222  change to 250

;--- WAVEFORM PEAK LEVEL DETECTION ---

PEAKS
CLRF PEAKH
MOVLW 255
MOVWF PEAKL
MOVLW 4
MOVWF DELAY1
CL2 MOVLW 250
MOVWF DELAY2


Turn on line 439

;Insert here code to keep tracking frequency

CALL    NOTE_CHANGE
movwf TEMP
btfss TEMP,0
    GOTO NOTE_OFF ;KEEP READING ADC
BCF MARKER,0 ;AMPLITUDE DETECTION ACTIVE
goto NEXT2



potul

I don't recall all the changes and modifications. At some point we also modified the code to work with Bass Guitar and this required a longer sampling of the wave (due to the lower frequency).

In this code, the numbers 255 and 250 determine the sampling size (in fact the time that we sample the incoming audio), so these will have an impact into latency. DELAY1 and DELAY2 are nested decrementing counters during sampling of the signal. I don't remember why this was changed, maybe to correct some errors in detection for the low E string. If I recall correcty the orignal code was using around 12ms, which is a little short to cover the 82Hz of the low E.


PEAKS
CLRF PEAKH
MOVLW 255
MOVWF PEAKL
MOVLW 4
MOVWF DELAY1
CL2 MOVLW 250
MOVWF DELAY2


Regarding the other change, I remember at some point we played with the "amplitude detection flag" to avoid some undesired behaviours. But I don't recall exactly how the flag works.