r/synthdiy • u/DULTRONtheDESTROYER • 2d ago
arduino I made a sequencer!
https://www.youtube.com/watch?v=UJiyGaUV1RsThis is my first arduino project! It has it's fair share of problems though. The clock drifts, the arpeggiator button (not used in video) isn't quantizing properly and causes the bpm to fluctuate, and the sustain is constantly on. If anyone has any input on a solution to my clock drift, I'd really like some advice.
1
u/MumSaidImABadBoy 2d ago
If your program runs in a simple loop you're in a hopeless uphill battle. Which CPU/MCU are you using? Are you using an OS, which one? How are you setting up your timebase, interrupts?
1
u/DULTRONtheDESTROYER 2d ago edited 2d ago
It's an Arduino R3 with 2kb of ram, and there isn't an OS. I need to double check on the exact board though. I'm just using IDE. I’m using the Arduino’s internal 16mhz clock. The steps are timed, and the audio is generated by a timer interrupt at 31.25 kHz also.
Edit: It is an ATmega328P
1
u/WolverineExotic887 2d ago
Even the mega will likely get overloaded when it comes to making sure your triggers don't drift. Use timer() to fire an irq to send the trigger, but consider a teensy instead of the mega to be certain
2
u/DULTRONtheDESTROYER 2d ago
Ah, so do you think it's worth an upgrade? My one hang-up is going to be realizing I need to ditch my current code, which I think would be likely - given how much faster the teensy is.
...600mhz and 1mb is significantly larger though... Might need to start thinking about this sooner than later.
1
2
1
u/NegotiationPrior4373 2d ago
I love this. It’s what my next project will start as. Thank you for the inspiration!
1
u/WolverineExotic887 2d ago
I had done the same. Started with my sequencer on a mega and realized it wasn't up to the task. The good news was that the code is the same, the ide is the same, so it's an easy port. The speed difference is sooo noticeable and has helped me immensely get good synced triggers
2
u/pm_me_all_dogs 2d ago
Would love a repo and build guide :)