Author Topic: Guitar to CV/gate project issue  (Read 1191 times)

potul

Re: Guitar to CV/gate project issue
« Reply #20 on: January 31, 2022, 10:34:05 AM »
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

Re: Guitar to CV/gate project issue
« Reply #21 on: February 01, 2022, 09:46:59 AM »
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?


Waveform Peak Level Detection,   line 222  change to 250

Code: [Select]
;--- WAVEFORM PEAK LEVEL DETECTION ---

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

Turn on line 439

Code: [Select]
;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

Re: Guitar to CV/gate project issue
« Reply #22 on: February 01, 2022, 10:01:52 AM »
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.
 
Code: [Select]
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.