{"id":13431121,"url":"https://github.com/jomarkow/Audio-to-MIDI","last_synced_at":"2025-03-16T06:32:23.208Z","repository":{"id":173124660,"uuid":"650271776","full_name":"jomarkow/Audio-to-MIDI","owner":"jomarkow","description":"Real time Audio to MIDI converter. Convert your sound into an editable music document.","archived":false,"fork":false,"pushed_at":"2023-08-17T14:40:06.000Z","size":1079,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-01T02:27:50.143Z","etag":null,"topics":["arduino","audio","audio-processing","cpp","fft","midi","music","stft","teensy","teensy40"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jomarkow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-06-06T18:00:45.000Z","updated_at":"2024-02-08T08:21:54.000Z","dependencies_parsed_at":"2023-09-27T16:55:57.891Z","dependency_job_id":null,"html_url":"https://github.com/jomarkow/Audio-to-MIDI","commit_stats":null,"previous_names":["julian0821/audio-to-midi","jomarkow/audio-to-midi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomarkow%2FAudio-to-MIDI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomarkow%2FAudio-to-MIDI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomarkow%2FAudio-to-MIDI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jomarkow%2FAudio-to-MIDI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jomarkow","download_url":"https://codeload.github.com/jomarkow/Audio-to-MIDI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221656503,"owners_count":16858784,"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":["arduino","audio","audio-processing","cpp","fft","midi","music","stft","teensy","teensy40"],"created_at":"2024-07-31T02:01:00.672Z","updated_at":"2024-10-27T09:31:48.848Z","avatar_url":"https://github.com/jomarkow.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# AUDIO TO MIDI in real time\n\n#### Convert your sound into an editable music document.\n\n### Index:\n\n* [Description](#description)\u003cbr\u003e\n* [Software](#software)\u003cbr\u003e\n* [Electronic Filter](#filter)\u003cbr\u003e\n* [Simulation](#simulation)\u003cbr\u003e\n* [BOM](#bom)\u003cbr\u003e\n* [Colaborate](#colab)\u003cbr\u003e\n\n\u003ca name=\"description\"\u003e\u003c/a\u003e\n# Description\n\nThe idea of this project originates from an interest on music and trying to find a way to make it easier to record and edit it at the moment. Since me and my teammates enjoy both music and electronics, we decided to go this way and create this project.\n\nThe objective of this project is to make the user able to convert real sounds, whether of instruments or voice, into a MIDI format in real time. With MIDI you can put these notes into a music editor, like Reaper, and saw them the while you are playing.\n\nThis was made in team with: \n[Joaquin Pimpignano](https://github.com/JoaquinPimpignano),\n[Iris Martinez](https://github.com/IrisMartinez05),\n[Juan Cruz Martinez]() and\n[Violeta Martinez]().\n\n#### Made with:\n\n[![Arduino](https://img.shields.io/badge/Arduino_IDE-00979D?style=for-the-badge\u0026logo=Arduino\u0026logoColor=white)](https://www.arduino.cc/)\n[![Teensy](https://img.shields.io/badge/Teensy_4.0-206922?style=for-the-badge)](https://www.pjrc.com/store/teensy40.html)\n[![Kicad](https://img.shields.io/badge/Kicad-1a2dc7?style=for-the-badge\u0026logo=kicad)](https://www.kicad.org/)\n\n\u003ca name=\"software\"\u003e\u003c/a\u003e\n# Software\n\nThe most important part of the project. We decide to do it on a teensy because of his memory and fast processment capacity, making posible to create a Fourier Transform for analize the signal and discover the notes in real time.\n\nIt tooks the audio and analize it with FFT and a windowing function for making it faster, it returns the dominant frequency. \n\n```\nfloat Calculate_FFT() {\n\n  FFT = arduinoFFT(vReal, vImag, SAMPLES, SAMPLING_FREQ);\n  FFT.Windowing(FFT_WIN_TYP_HAMMING, FFT_FORWARD);\n  FFT.Compute(FFT_FORWARD);\n  FFT.ComplexToMagnitude();\n\n  double dominantFrequency = FFT.MajorPeak();\n  return dominantFrequency;\n}\n```\n\u003cbr\u003e\n\nThen, it looks this frequency on a defined array with the corresponding notes for each frequency range.\n\n```\nfloat NOTES_FREQ[] = { 103.826, 110.000, 116.541, 123.471, 130.813, 138.591, 146.832, 155.563, 164.814, 174.614,\n                      184.997, 195.998, 207.652, 220.000, 233.082, 246.942, 261.626, 277.183, 293.665, 311.127,\n                      329.628, 349.228, 369.994, 391.995, 415.305, 440.000, 466.164, 493.883, 523.251, 554.365,\n                      587.330, 622.254, 659.255, 698.456, 739.989, 783.991, 830.609, 880.000, 932.328, 987.767 };\n                      }\n```\n\n[![e572ef3c-88bd-41c5-94be-9d13599bbda8.jpg](https://i.postimg.cc/PJHggxD0/e572ef3c-88bd-41c5-94be-9d13599bbda8.jpg)](https://postimg.cc/WF9YrsX7)\n\n```\n#define MAX_NOTE_FREQ 987.767\n#define MIN_NOTE_FREQ 103.826\n#define OCTAVES_FITTING 55\n\nfloat searchForNote(float freq) {\n\n  if (freq \u003e MAX_NOTE_FREQ || freq \u003c MIN_NOTE_FREQ) return 0;\n\n  for (int i = 1; i \u003c NOTES_LENGHT - 1; i++) {\n\n    if (freq \u003e NOTES_FREQ[i - 1] \u0026\u0026 freq \u003c NOTES_FREQ[i]) {\n      if (freq - NOTES_FREQ[i - 1] \u003c NOTES_FREQ[i] - freq) return i + OCTAVES_FITTING;\n      else return i + OCTAVES_FITTING + 1;\n    }\n  }\n}\n```\n\n\u003ca name=\"filter\"\u003e\u003c/a\u003e\n# Electronic filter\n\nThe project has also an electronic board who contains a circuit with:\n* Amplifier, for make the microphone signal stronger\n* Band pass filter between 100hz and 1Khz\n* Clamper circuit, for elevate the signal to the positive field\n\n[![69ea6844-90a0-43a4-9217-2764cb34e035.jpg](https://i.postimg.cc/MTbgxwq4/69ea6844-90a0-43a4-9217-2764cb34e035.jpg)](https://postimg.cc/Kkj0rdKr)\n\nBoard designed on kicad 7.0:\n\n[![Whats-App-Image-2023-08-16-at-16-10-43.jpg](https://i.postimg.cc/QCvqd6bW/Whats-App-Image-2023-08-16-at-16-10-43.jpg)](https://postimg.cc/tnt6rN8X)\n\n\u003ca name=\"simulation\"\u003e\u003c/a\u003e\n# Simulation:\n\nWe simulate the circuit on Proteus, here the results:\n\n[![image.png](https://i.postimg.cc/mk1MCLkp/image.png)](https://postimg.cc/p5xpttDK)\n\n\nAs you could see, as more amplitude on the input, the filter gets better on cutting the frequencies out of our range, but in general, it gives us a good result.\nOn \"simulation\" folder you will find the proteus file for simulate it yourself.\n\n\u003ca name=\"bom\"\u003e\u003c/a\u003e\n# BOM\n\nComponent|Quantity|\n|:-------------|:-------------|\n|Teensy 4.0|1|\n|Microfono Electret|1|\n|Pot 20K ohm|1|\n|R de 10K ohm|5|\n|R de 100K ohm|1|\n|R de 100 ohm|1|\n|R de 1,5K ohm|1|\n|R de 1M ohm|1|\n|Cap Elec 10u|1|\n|Cap Elec 100n|1|\n|Cap 100n|1|\n|Cap 1u|1|\n|Cap 10n|1|\n|Cap 33u|1|\n|Lm358n|2|\n|Lm7805|2|\n|2N4001|1|\n|L7806|1|\n|ld1117|1|\n\n\u003ca name=\"colab\"\u003e\u003c/a\u003e\n# Colaborate\n\nWe see in this project a great potencial for implementing diferent technologies in future versions, such as an IA for better sound recognition or a dedicated software platform for colaborative musical pieces. In any case we are open to listen your ideas.\n\nIf you want to colaborate on this project, you are invited to create a Pull Request with a descriptive text of the changes/updates.\n\nYou can also contact me: \n[jomarkow@gmail.com](mailto:jomarkow@gmail.com)\n\nWe hope you liked the project, if so, I invite you to leave a star ⭐, thanks for read :).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjomarkow%2FAudio-to-MIDI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjomarkow%2FAudio-to-MIDI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjomarkow%2FAudio-to-MIDI/lists"}