Index: apps/plugins/pitch_detector.c
===================================================================
--- apps/plugins/pitch_detector.c	(revision 28560)
+++ apps/plugins/pitch_detector.c	(working copy)
@@ -292,8 +292,9 @@
     unsigned lowest_freq;
     unsigned yin_threshold;
     int      freq_A;        /* Index of the frequency of A */
-    bool     use_sharps;
+    int      accidental_mode; /* 0=mixed 1=flats 2=sharps */
     bool     display_hz;
+    int      transposition_idx; /* 0=C, 1=D-flat, 2=D, ..., 11=B  */
 } settings;
 
 /*=================================================================*/
@@ -324,8 +325,9 @@
         .lowest_freq = period2freq(BUFFER_SIZE / 4),
         .yin_threshold = DEFAULT_YIN_THRESHOLD,
         .freq_A = DEFAULT_FREQ_A,
-        .use_sharps = true,
+        .accidental_mode = 2,           /* default to sharps */
         .display_hz = false,
+        .transposition_idx = 0,         /* C */
     };
 }
 
@@ -402,10 +404,27 @@
 
 static const struct opt_items accidental_text[] =
 {
+    { "Mixed", -1 },
     { "Flat", -1 },
     { "Sharp", -1 },
 };
 
+static const struct opt_items transpose_text[] =
+{
+    { "C (Concert Pitch)", -1 },
+    { "D-flat", -1 },
+    { "D", -1 },
+    { "E-flat", -1 },
+    { "E", -1 },
+    { "F", -1 },
+    { "G-flat", -1 },
+    { "G", -1 },
+    { "A-flat", -1 },
+    { "A", -1 },
+    { "B-flat", -1 },
+    { "B", -1 },
+};
+
 static void set_min_freq(int new_freq)
 {
     settings.sample_size = freq2period(new_freq) * 4;
@@ -441,6 +460,7 @@
                         "Lowest Frequency",
                         "Algorithm Pickiness",
                         "Accidentals",
+                        "Key Transposition",
                         "Display Frequency (Hz)",
                         "Frequency of A (Hz)",
                         "Reset Settings",
@@ -479,14 +499,19 @@
                 break;
             case 5:
                 rb->set_option("Display Accidentals As",
-                               &settings.use_sharps,
-                               BOOL, accidental_text, 2, NULL);
+                               &settings.accidental_mode,
+                               INT, accidental_text, 3, NULL);
                 break;
-            case 6:
+            case 6: /* transposition */
+                rb->set_option("Key Transposition",
+                              &settings.transposition_idx,
+                              INT, transpose_text, 12, NULL);
+                break;
+            case 7:
                 rb->set_bool("Display Frequency (Hz)",
                              &settings.display_hz);
                 break;
-            case 7:
+            case 8:
                 freq_val = freq_A[settings.freq_A].frequency;
                 rb->set_int("Frequency of A (Hz)",
                     "Hz", UNIT_INT, &freq_val, NULL,
@@ -494,13 +519,13 @@
                     NULL);
                 settings.freq_A = freq_val - freq_A[0].frequency;
                 break;
-            case 8:
+            case 9:
                 reset = false;
                 rb->set_bool("Reset Tuner Settings?", &reset);
                 if (reset)
                     tuner_settings_reset();
                 break;
-            case 9:
+            case 10:
                 exit_tuner = true;
                 done = true;
                 break;
@@ -581,10 +606,24 @@
 
     if(note[1] == '#')
     {
-        if(!(settings.use_sharps))
+        switch (settings.accidental_mode)
         {
-            i = (i + 1) % 7;
-            accidental_index = NOTE_INDEX_FLAT;
+            case 0: /* mixed */
+                if((note[0] == 'A') || (note[0] == 'D'))
+                {
+                    i = (i + 1) % 7;
+                    accidental_index = NOTE_INDEX_FLAT;
+                }
+                break;
+
+            case 1: /* flats */
+                i = (i + 1) % 7;
+                accidental_index = NOTE_INDEX_FLAT;
+                break;
+
+            case 2: /* sharps */
+            default: /* just in case */
+                break;
         }
 
         vertical_picture_draw_sprite(rb->screens[0],
@@ -702,7 +741,10 @@
     draw_bar(ldf);                /* The red bar */
     if(fp_round(freq) != 0)
     {
-        draw_note(notes[note].name);
+        int transposition = 12 - (settings.transposition_idx);
+
+        draw_note(notes[(note + transposition) % 12].name);
+
         if(settings.display_hz)
         {
 #if LCD_DEPTH > 1
