Detecting frequency ranges for differing inputs

Hi I am new to coding as a whole and have been looking to do a fun project with my trombone. I would like to try and use my trombone to play video games by detecting notes with audio ranges such as if between x frequency and x frequency input W on keyboard. I am having issues though finding a library that works to detect frequency. All the libraries I have found so far break what code I have showing error code 1 which I have assumed is an error with the library not being up to date. Does anyone have any libraries or other similar ways that can achieve this goal?

Which libraries have you tried?
What Arduino are you using?

Please post your code using code tags <CODE/> along with the error messages.
No images or screen shots please. :slightly_smiling_face:

This is the code I've been putting it into was planning on using an uno R4 and this was just code I was planning to experiment with to see what would happen with different keyboard inputs

#include <Keyboard.h>



void setup() {
  Keyboard.begin();

  

}

void loop() {
  // Read frequency and then have algorithm that says
  // if frequency = x or x Keyboard.press("w")
  Keyboard.press('W');
  delay(100);
  Keyboard.release('W'); 
  delay(100);
  Keyboard.press('S');
  delay(100);
  Keyboard.press('D');
  delay(100);
  Keyboard.release('D');

 

}

ummm so in the process of getting this on my pc from my laptop I somehow managed to break the code only on my pc. for whatever reason on my laptop it works fine/verify's with no issues but on my computer the exact same code, with this library downloaded for sure, will give me error messages asking me to make sure I have the Keyboard.h or saying that keyboard wasn't declared. But that aside I've used these libraries https://docs.arduino.cc/libraries/freqcount/
https://docs.arduino.cc/libraries/freqmeasure/
https://docs.arduino.cc/libraries/audiofrequencymeter/#Compatibility
This is the error status that I got with each one of them after simply trying to include it into the sketch

In file included from C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:27:0:
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\util/FreqCountTimers.h:64:4: error: #error "Unknown chip, please edit me with timer+counter definitions"
   #error "Unknown chip, please edit me with timer+counter definitions"
    ^~~~~
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp: In static member function 'static void FreqCountClass::begin(uint16_t)':
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:44:2: error: 'counter_init' was not declared in this scope
  counter_init();
  ^~~~~~~~~~~~
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:44:2: note: suggested alternative: 'count_ready'
  counter_init();
  ^~~~~~~~~~~~
  count_ready
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:45:16: error: 'timer_init' was not declared in this scope
  gate_length = timer_init(msec);
                ^~~~~~~~~~
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:45:16: note: suggested alternative: 'timer_t'
  gate_length = timer_init(msec);
                ^~~~~~~~~~
                timer_t
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:46:19: error: 'SREG' was not declared in this scope
  uint8_t status = SREG;
                   ^~~~
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:47:2: error: 'cli' was not declared in this scope
  cli();
  ^~~
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:47:2: note: suggested alternative: 'ceil'
  cli();
  ^~~
  ceil
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:48:2: error: 'timer_start' was not declared in this scope
  timer_start();
  ^~~~~~~~~~~
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:48:2: note: suggested alternative: 'timer_t'
  timer_start();
  ^~~~~~~~~~~
  timer_t
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:50:2: error: 'counter_start' was not declared in this scope
  counter_start();
  ^~~~~~~~~~~~~
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:50:2: note: suggested alternative: 'count_ready'
  counter_start();
  ^~~~~~~~~~~~~
  count_ready
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp: In static member function 'static uint32_t FreqCountClass::read()':
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:64:11: error: 'SREG' was not declared in this scope
  status = SREG;
           ^~~~
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:65:2: error: 'cli' was not declared in this scope
  cli();
  ^~~
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:65:2: note: suggested alternative: 'ceil'
  cli();
  ^~~
  ceil
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp: In static member function 'static void FreqCountClass::end()':
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:74:2: error: 'timer_shutdown' was not declared in this scope
  timer_shutdown();
  ^~~~~~~~~~~~~~
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:74:2: note: suggested alternative: 'timer_t'
  timer_shutdown();
  ^~~~~~~~~~~~~~
  timer_t
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:75:2: error: 'counter_shutdown' was not declared in this scope
  counter_shutdown();
  ^~~~~~~~~~~~~~~~
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:75:2: note: suggested alternative: 'count_output'
  counter_shutdown();
  ^~~~~~~~~~~~~~~~
  count_output
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp: At global scope:
C:\Users\drfun\OneDrive\Documents\Arduino\libraries\FreqCount\FreqCount.cpp:79:4: error: expected constructor, destructor, or type conversion before '(' token
 ISR(TIMER_ISR_VECTOR)
    ^
Multiple libraries were found for "Keyboard.h"
  Used: C:\Users\drfun\OneDrive\Documents\Arduino\libraries\Keyboard
  Not used: C:\Users\drfun\AppData\Local\Arduino15\libraries\Keyboard
exit status 1

Compilation error: exit status 1```
Sorry I put it into the code thing I just figured that would be better since it's so long. But this is the error status I've gotten with each of the libraries. I have tried including different libraries other than these 3 with my keyboard one and they've worked fine. Here is the keyboard library https://docs.arduino.cc/libraries/keyboard/. I've only just looked at these forum's for help with this problem after trying to research on my own so I apologize for any mistakes with the post.

Unknown chip

Many libraries are not compatible with the R4, this library is not.
See this for a library compatibly list

If it's not on the list or the Author has not tested on the R4 it probably won't work.

You might consider buying a different board.

@jim-p

That list is not 100% accurate, so use with care.
It reports one of my libs - DHTNew - as failing on UNO R4, which actually works.
Problem (with DHTNew) is that the link in the list points to a complete different library.
So I reported this and that issue is now open for about a year :frowning: without action.
(and there are more open issues…)

Thanks I looked through it more carefully and found a board that will be compatible with both libraries!

I sure that the R4 will go down in history as one of the bad Arduinos