{"id":18419144,"url":"https://github.com/richard-hartmann/tuner","last_synced_at":"2026-05-02T06:34:44.464Z","repository":{"id":175778338,"uuid":"564288234","full_name":"richard-hartmann/tuner","owner":"richard-hartmann","description":"piano tuner (general pitch detection) in Python","archived":false,"fork":false,"pushed_at":"2022-11-25T10:22:13.000Z","size":1637,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T07:59:55.907Z","etag":null,"topics":["audio-processing","frequency-analysis","piano-utils","pitch-detection","pitch-estimation","python3","tuner"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/richard-hartmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-10T11:53:27.000Z","updated_at":"2022-11-25T10:19:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"ee79ba7d-4684-4ab1-b0a4-5bd352bc7d29","html_url":"https://github.com/richard-hartmann/tuner","commit_stats":null,"previous_names":["richard-hartmann/tuner"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richard-hartmann%2Ftuner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richard-hartmann%2Ftuner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richard-hartmann%2Ftuner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richard-hartmann%2Ftuner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richard-hartmann","download_url":"https://codeload.github.com/richard-hartmann/tuner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681480,"owners_count":21144700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio-processing","frequency-analysis","piano-utils","pitch-detection","pitch-estimation","python3","tuner"],"created_at":"2024-11-06T04:15:58.340Z","updated_at":"2026-05-02T06:34:44.395Z","avatar_url":"https://github.com/richard-hartmann.png","language":"Jupyter Notebook","funding_links":["https://www.paypal.com/donate/?hosted_button_id=E8LH2WMYGQCGG"],"categories":[],"sub_categories":[],"readme":"# Tuner\nby Richard Hartmann\n\nTuner - frequency analysis of the microphone input suitable to tune instruments.\n\n![image gui](doc/gui.png \"tuner-App\")\n\n## Install and Run\n\nif you have not, install `poetry`, dependency management and packaging in Python.  \n\nUse `poetry install` to install dependencies.\n\nRun the app by `poetry run python start_tuner.py`\n\n## Usage\n\n0) Make sure the desired microphone is selected.\n   If you do not want to tune to a at 440Hz, change the value\n1) Select the key you want to tune to. Use the 'next' and 'prev' to see how the\n   inputs 'key' and 'level' work. It also shows the target frequency of that key.\n2) Play a tone and tune such that the relative difference (upper right panel) \n   is well below 1% (0.01) for some time. \n   You can use the mouse (drag and scroll) to adjust the axes.\n\n## License\n\nGNU General Public License v3.0\n\n## Donation\n\nIf you like the tuner-App, feel free to \n[donate with PayPal](https://www.paypal.com/donate/?hosted_button_id=E8LH2WMYGQCGG).\nIf you don't like PayPal, contact me at richard_hartmann(at)gmx.\u0026#8574;\u0026#8519;.\n\n\n## Basic Idea of the Algorithm\n\n1) Perform Fourier integral (finite integral over several oscillations \n   of the recoded microphone signal) for frequencies in the vicinity of a given\n   target frequency \u0026Omega;, and multiples of that (higher harmonics contributions).\n2) Plot such spectra and shift the frequency axis by -n\u0026Omega; \n   (different shift for each higher harmonic!).\n   In that way, if the base frequency of the recoded signal \u0026omega;\u003csub\u003e1\u003c/sub\u003e \n   is resonant with \u0026Omega;, all maxima should align at \u0026omega;-n\u0026Omega; = 0.\n   In practice the maxima of the spectra vary much over time, \n   so their alignment is not well suited to judge the resonance, \n   i.e. the tuning to the target frequency \u0026Omega;.\n   (upper left plot)\n3) Use the amplitude and phase information from the Fourier integral as\n   initial condition to fit a harmonic model signal with base frequency \n   \u0026omega;\u003csub\u003e1\u003c/sub\u003e and its higher harmonics n\u0026omega;\u003csub\u003e1\u003c/sub\u003e to the \n   recoded input. \n   (lower plot)\n4) Show the relative difference of the optimal value \u0026omega;\u003csub\u003e1\u003c/sub\u003e with \n   respect to the target frequency \u0026Omega;.\n   Keep track of its value over some time.\n   Record no value if the least square fitting does not converge sufficiently fast.\n   (upper right plot)\n\n## Acknowledgements\n\nAs of the great collection of numeric routines provided by \n[numpy](https://numpy.org/) putting the algorithm in place was straight forward.\nThe plotting was made possible using [Qt](https://www.qt.io/) wrapped to \n[Python](https://www.python.org/) via [pyqtgraph](https://www.pyqtgraph.org/).\nThanks!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichard-hartmann%2Ftuner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichard-hartmann%2Ftuner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichard-hartmann%2Ftuner/lists"}