Assistance with programming a physical metronome

I want to make a metronome for a personal project, and while I (pretty much!) know what I am doing with the hardware and wiring side of things, I am lost on the programming front. I found this article (the raw code is here). This shows a step-by-step approach to building a metronome application in Python.
My questions are:
1- Can Python be used as a programming language with an Arduino Nano?
2- If yes, would it be possible to use the basic metronome code (minus the UI code) to program a physical metronome that runs off of an Arduino Nano, uses separate potentiometers to set Volume, Tempo (BPM), Time signature, and sound; and separate switches to control On/Off, Accent first beat, Tempo estimation and pause/play?
3- What would be the first steps in converting this code into a workable Arduino program using the inputs stated before?

Thanks for reading, any and all help is appreciated!
Many Thanks.

If you mean a classic Nano then no

If you want to go down the python path, then you will need CircuitPython

and a board that is supported. Not the Nano, but something like the Raspberry Pi Pico

There are others as well.

Thanks! That is very helpful!

I looked at the Python code and I think the first step would be to toss it in the trash.

Then design and write a metronome program for some Arduino board or other.

Maybe someone did, if repurposing other ppls' code is how you wanna roll. Google "Arduino metronome" and poke around.

a physical metronome that runs off of an Arduino Nano, uses separate potentiometers to set Volume, Tempo (BPM), Time signature, and sound; and separate switches to control On/Off, Accent first beat, Tempo estimation and pause/play?

Sounds like a nice project. It would take you longer to rip the beating heart out of that Python pile than it would to write it from scratch.

a7

The article and code is for a laptop or desktop computer, with a keyboard and large screen, not an Arduino.

Yes, I knew that, sorry if there was a misunderstanding in my writing, but I was asking what I would need to change to get it to work with an Arduino. After reading the advice I have gotten, the consensus seems to be to throw that code in the garbage after all.

It may not even be possible. CircuitPython and MicroPython do not implement all the language features.

Some results at github Repository search results ยท GitHub

How do you change the volume on a metronome?

Here with a potentiometer, presumably to change the amplitude of whatever signal is being created or used as the tick or tock.

Real metronomes have a mechanical adjuster that has more control over the character of the sound than its volume.

a7

That's what I was asking about. I know you can change the speed of a metronome(duh!) and sometimes the timbre, but I didn't know that it was possible to change the volume.

Electronic versions of many things will have features difficult to find in the originals.

The extreme end of my metronome (real) adjustment makes just a very brief and not so loud click. I've never looked to see just what makes the sound.

a7

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.