{"id":13862166,"url":"https://github.com/ekm507/mahdiO","last_synced_at":"2025-07-14T11:32:37.654Z","repository":{"id":110283051,"uuid":"250899145","full_name":"ekm507/mahdiO","owner":"ekm507","description":"Generate music and sound effects by python and mathematics (digital signal processing)","archived":false,"fork":false,"pushed_at":"2020-10-17T15:59:15.000Z","size":138,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-05T06:05:21.130Z","etag":null,"topics":["audio","digital-signal-processing","harmonics","midi","music","sound-effects","wave"],"latest_commit_sha":null,"homepage":"","language":"Python","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/ekm507.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}},"created_at":"2020-03-28T21:40:58.000Z","updated_at":"2023-11-01T21:13:44.000Z","dependencies_parsed_at":"2023-04-28T00:01:23.545Z","dependency_job_id":null,"html_url":"https://github.com/ekm507/mahdiO","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekm507%2FmahdiO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekm507%2FmahdiO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekm507%2FmahdiO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekm507%2FmahdiO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ekm507","download_url":"https://codeload.github.com/ekm507/mahdiO/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225974335,"owners_count":17553933,"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","digital-signal-processing","harmonics","midi","music","sound-effects","wave"],"created_at":"2024-08-05T06:01:38.541Z","updated_at":"2024-11-22T22:30:39.516Z","avatar_url":"https://github.com/ekm507.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# MahdiO: generate music\n\nGenerate music sound effects using mathematics.\n\n## how to use\n\nwell, this project is not written the best way of it. I mean It works, but using this is a bit difficult.\n\nthere are some functions in this project. working with each other to craft you a music.  \nthe file `audio4.py` shows you an example how to use it.  \nit simply gets a midi file as input and generates a music based on notes the file provides.\n\nbut I will make a better wiki for this later! I promise!\n\n\n## files in this repo\n\n* `functions.py` for generating basic audio functions.\n* `notes.py` for generating notes.\n* `midi_conversions.py` for converting note number to frequency.\n* `instruments.py` for describing each instrument.\n* `music.py` for generating music.\n* `write.py` for writing generated audio into a wave file\n* `read_midi.py` for reading notes data from `.mid` files\n* `audio*.py` for test.\n\n## how it works\n\nany note we hear is consisted of a sine function with a main frequency summed up with it's harmonics- each with it's own amplitude.  \nadding up sine functions, we create a new function for each instrument which is it's basic sound. see `harmonics` function in `functions.py`.\n\nbut this is not enough by itself to make a nice sound.  \namplitude of a sound changes dampingly over time. this is also a unique property of an instrument.\nsee `instrument*` and `push_instrument*` functions in `instruments.py`.\n\ndifferent notes have different frequencies. harmonics change respecting to main frequency. see `notes.py` to learn more.\n\ncombining notes by synthesizing them, we create a music. each note has a duration and a note number. look up `music.py` to see how it works.\n\nso now we can generate sounds but we need notes! the funcion `read_midi` in file `read_midi.py` gets a midi file as input and extracts notes out of it to use.\n\nnow we are ready to generate a music from zero!  \nlook up `audio*.py` to see how a list of notes by time and some more details can make a nice music!  \nfinally we should save generated audio wave into a .wav (wave) file. the function `write_to_file` in `write.py` does it. and  when done, it's done!\n\n## TODO\n\n1. different tracks in midi file, each have their own instrument. add a support for this\n\n2. get timing info from midi file\n\n3. write better instruments.\n\n4. make documentation for code. maybe rewrite this README file too.\n\n5. make a wiki for developers so it will be easier to develope.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekm507%2FmahdiO","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fekm507%2FmahdiO","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekm507%2FmahdiO/lists"}