Chysn / O_C-HemisphereSuite

Hemisphere Suite is alternate-alternate firmware for Ornament and Crime, featuring a dual-applet framework with dozens of different modular functions.
324 stars 153 forks source link

Adds frequency display to HEM_Tuner #32

Closed Mdashdotdashn closed 5 years ago

Mdashdotdashn commented 5 years ago

In some cases, it's useful to know the raw frequency of a signal. This PR shifts the cents/offset display one line up and displays the frequency in hertz at the bottom of the display

Chysn commented 5 years ago

Hi! This is a great idea, thank you. I'll review, and probably merge within a day or two.

Mdashdotdashn commented 5 years ago

You are totally right. I'll do a fixup

Le mer. 13 mars 2019 à 12:53, Chysn notifications@github.com a écrit :

@Chysn commented on this pull request.

In software/o_c_REV/HEM_Tuner.ino https://github.com/Chysn/O_C-HemisphereSuite/pull/32#discussion_r265090463 :

             }
         }

+

  • // Draw frequency
  • const int f = int(floor(frequency_ * 100));
  • const int value = f / 100;
  • const int cents = f % 100;
  • gfxPrint(6 + pad(10000, value), 54, value);
  • gfxPrint(".");
  • gfxPrint(cents);

I think cents might need to be left-padded with 0 zero. That is, if value=440 and cents=5, the display will read 440.5 when it should read 440.05. If I'm thinking about this wrong, let me know. Thanks again!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Chysn/O_C-HemisphereSuite/pull/32#pullrequestreview-213904257, or mute the thread https://github.com/notifications/unsubscribe-auth/AHLB2N7FjEw5XzUIw1E4aPkllNyPVulkks5vWObWgaJpZM4bs3xb .

Mdashdotdashn commented 5 years ago

I've corrected the issue. FWIW, I've several times wished for something akin to printf(...) for formatting. There's one in the original O_C code, maybe it'd be worth adding one sometimes to the gfxXXX list ?