One-liner Guitar Tuner in Python


On windows, assuming imports are free:

import winsound
winsound.Beep(220*((2**(1/12.0))**7), 2000)

But that’s just because I like to tune to E. If you prefer a more “natural looking” note, you can use A:

winsound.Beep(110, 1000)

But why choose at all when you can go for all of them?

[winsound.Beep(220*((2**(1/12.0))**i), 500) for i in [7, 2, -2, -7, -12, -17]]

Image by Keela84

This entry was posted in Python, Sound and tagged , , , . Bookmark the permalink.

2 Responses to One-liner Guitar Tuner in Python

  1. Inger says:

    Nice! But it’s not a deaf-friendly guitar tuner as the FFT tuner you wrote a few years ago :)

    Got a new project for ya: check the influences of this one-liner on mosquitoes.

  2. Pingback: 用Python奏出吉他声 | Code之行人

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.