Live data from Hacker News

I made a guitar tuner app using Flutter and Rust

justune.eu

71–80 of 153 posts

Re: I made a guitar tuner app using Flutter and Rust

#71

Earlier quoted context omitted.

Correlation is calculated using FFTs, so wouldn't that be just as slow?

Computations can be reduced if you only care about frequencies near 6 particular ones (and maybe some harmonics).

You'd get shit tuner if you do that. Ain't nobody got time to define scales on a fucking tuner

Re: I made a guitar tuner app using Flutter and Rust

#73
post #44

This might have an obvious answer for the more experienced here, but (potentially stupid question) why didn't you use dart for this? Nothing against rust, just interested is all considering the dart/flutter relationship.

Speaking only for myself, I'm considering Flutter + Rust because I want to write everything in Rust, but there aren't great GUI options for Rust atm. I've heard good things about the rust dart bridge so it seems like a reasonable compromise, esp. given the Dart code to write Flutter UIs seems fairly declarative. Hoping to keep most of the logic in Rust and just the view in Flutter/Dart.

Do you mean this https://github.com/fzyzcjy/flutter_rust_bridge ?

Re: I made a guitar tuner app using Flutter and Rust

#74
post #71

Earlier quoted context omitted.

Computations can be reduced if you only care about frequencies near 6 particular ones (and maybe some harmonics).

You'd get shit tuner if you do that. Ain't nobody got time to define scales on a fucking tuner

There's only 12 per octave, way fewer than doing FFT for all frequencies in Hz steps.

Re: I made a guitar tuner app using Flutter and Rust

#75
post #61

The movement is really choppy on my iPhone 13 Pro. Did you use requestAnimationFrame for the tuning movement? & CSS animations for switching instruments? Kinda just wondering how the performance could be so bad. Reminds me of PhoneGap circa 2013

I can confirm. It is extremely choppy and resource hungry for what it does. Since they use Flutter, the UI is rendered using 119 canvas elements. The same thing could be implemented using the web platform (no flutter and no rust) with better results.

I was thinking the same thing- I've seen many mobile performant, web based tuners before, it's a very common personal project. If the intention was to make a web based tuner from the start, Flutter and Rust was a big step down from just using HTML and JS.

I know the trend on HN is to upvote any project with Rust in the title, and to hate on native JS, but projects like this that have to use a bunch of tooling to eventually compile down to JS would have almost always been better just using JS in the first place IMO.

Re: I made a guitar tuner app using Flutter and Rust

#76
post #61

The movement is really choppy on my iPhone 13 Pro. Did you use requestAnimationFrame for the tuning movement? & CSS animations for switching instruments? Kinda just wondering how the performance could be so bad. Reminds me of PhoneGap circa 2013

Flutter is not web-based. It's all custom.

That is true (that Flutter builds natively on all platforms it supports, and controls every pixel on the screen, unlike React Native and similar).

But I suspect these people were trying the web version of this (pretty neat, IMO) app.

Flutter does build for the web but then it does (of course) use web technologies to deliver the UI. To get the native experience on iOS, you'd have to download the iOS version from the App Store or something like that.

Re: I made a guitar tuner app using Flutter and Rust

#78

Purchased for Android, love Flutter and been trying to learn guitar off/on, so this could be helpful. Question re: web (where I have not been impressed with Flutter as a platform) - I just get "Failed to start listening thread." I tried both Firefox and Chrome, latest versions. Side note: Also noticed I can't highlight/copy the text (common usability/accessibility issue with Flutter Web. I believe it's not that hard…

You may already be aware, but having a small clip-on digital hardware tuner you can use anywhere without involving a phone is a life upgrade if you're playing guitar on a regular basis.

Of course, this is a cool project for more insight into the technologies involved regardless.

Re: I made a guitar tuner app using Flutter and Rust

#79
There are two Drop D tunings listed and one is actually Drop C. There is no Drop D♭, you call it Drop C♯ which while it's technically the same set of tones, it's now how guitar players think of it. You have the same issue with E♭ Standard. Each of your notes in these tunings are listed as sharps instead of flats, which is not how guitar players think of the notes in these tunings.

Also, you might want to consider polyphonic tuning. That's what would set you apart from everybody else. I bought a TC Electronic PolyTune earlier this year and it's been a game changer. It's much faster and easier to get tuned

Re: I made a guitar tuner app using Flutter and Rust

#80
post #13

Looks very nice, would you tell us a little bit about what you used to build this? I am just getting started with Rust and it would be cool to hear what approach you went and what you would recommend when starting today.

Flutter for the UI. Rust for the listening, and pitch detecting backend. Connected the former with the latter using flutter_rust_bridge. More details on Rust backend: For listening (getting audio signal from microphone) I used: - Android: https://crates.io/crates/oboe - native desktop/iOS (not currently released): https://crates.io/crates/clap - Web: https://crates.io/crates/web-sys (so basically JS Web Audio API cal…

> - native desktop/iOS (not currently released): https://crates.io/crates/clap

I hope you didn't use a command line parser to stream audio...

Post reply on HN