0

macropad.start_tone function goes wonky above around 1850...
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

macropad.start_tone function goes wonky above around 1850...

by RufusVS2020 on Sun Aug 01, 2021 9:17 pm

I created this simple ascending frequency program to diagnose some strangeness I was
seeing in start_tone and verified that the tone jumps randomly at 1850 and up.

Code: Select all | TOGGLE FULL SIZE

# strange how the sound jumps around at around 1800 and on up
# Tested with CircuitPython 7, not with 6
from time import sleep
from adafruit_macropad import MacroPad
macropad = MacroPad()
for freq in range(200,10000, 50):
    print(f"freq: {freq}")
    macropad.start_tone(freq)
    sleep(.45)
    macropad.stop_tone()
    sleep(.05)
   


Edit: I verified play_tone has the same result, with this loop:

Code: Select all | TOGGLE FULL SIZE
for freq in range(200,10000, 50):
    print(f"freq: {freq}")
    macropad.play_tone(freq, .45)
    sleep(.5)

I'll dig deeper but maybe smarter folks than I can take a look at this one...

RufusVS2020
 
Posts: 35
Joined: Thu Nov 19, 2020 6:31 pm

Re: macropad.start_tone function goes wonky above around 185

by danhalbert on Tue Aug 03, 2021 10:44 pm

Thanks for the report. I've opened an issue to investigate this in more detail: https://github.com/adafruit/circuitpython/issues/5092

danhalbert
 
Posts: 2497
Joined: Tue Aug 08, 2017 12:37 pm

Re: macropad.start_tone function goes wonky above around 185

by RufusVS2020 on Thu Aug 19, 2021 1:31 pm

I have since added a comment to that ticket:
Even frequencies 666 and 670 drop out, though adjacent frequencies seem fine.

RufusVS2020
 
Posts: 35
Joined: Thu Nov 19, 2020 6:31 pm

Please be positive and constructive with your questions and comments.