{"id":18014844,"url":"https://github.com/zevv/piano","last_synced_at":"2025-04-04T15:14:24.382Z","repository":{"id":150599248,"uuid":"58272180","full_name":"zevv/piano","owner":"zevv","description":"Small polyphonic piano, replacement for Yamaha PSS-30 chip + firmware","archived":false,"fork":false,"pushed_at":"2016-05-07T16:28:46.000Z","size":26789,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T13:49:39.083Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/zevv.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-07T15:33:56.000Z","updated_at":"2016-05-07T15:35:51.000Z","dependencies_parsed_at":"2023-06-11T17:15:43.613Z","dependency_job_id":null,"html_url":"https://github.com/zevv/piano","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/zevv%2Fpiano","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fpiano/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fpiano/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fpiano/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zevv","download_url":"https://codeload.github.com/zevv/piano/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198466,"owners_count":20900081,"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":[],"created_at":"2024-10-30T04:11:23.029Z","updated_at":"2025-04-04T15:14:24.359Z","avatar_url":"https://github.com/zevv.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ATMega Polyphonic FM piano\n\nThis is a tiny project I did some years ago to upgrade a small Yamaha\nmonophonic toy keyboard to polyphonic sound. The sound generating chip was\nreplaced by an Atmel AVR ATMega644 with firmware to scan the keyboard and\ngenerate 4 channel polyphonic FM sound. It also contains a sequencer for\nrecording and playing back of tunes, and of course has a factory demo tune.\n\nUnfortunately I don't have any exact schematics of how things are connected, but\neverything is pretty basic: a keyboard scan matrix is connected to some GPIO, and\naudio output is generated using pulse width modulation on one of the timers.\n\n[![Demo](/media/video.jpg)](http://www.youtube.com/watch?v=Cgub3LqKo9w)\n![pss-30](/media/pss-30.jpg)\n![inside](/media/inside.jpg)\n\n\n## piano.c\n\nThis file contains the main() function, and handles the scanned keys. A switch\nstatement handles all the different keys: key 0 to 31 are the notes, which are\nsent to the sequencer. All other keys are handle depending on their function:\nchange volume, FM synthesis parameters or commands for the sequencer.\n\n## keyboard.c\n\nThe keyboard is connected to a scan matrix with a few rows and columns; The\nscan matrix is left as it was originally, but I needed to install diodes on all\nthe keys to allow scanning polyphonic keys. The function keyboard_scan() is\ncalled from the main loop, and scans a row each time it is executed.\n\n## audio.c\n\nThis file holds the code for the 4 channel polyphonic FM synthesizer. A struct\n'osc' is allocated for each channel, and holds the current state of the FM\noscillator: a pointer into the sine table (off), sine table step size for the\ncurrent note frequency (step), and an ADSR for modifying the note velocity\nduring the notes life time. Most of the work is done in the timer1 interrupt:\nhere the oscillator and ADSR states are updated, and the output samples are\ncalculated for each osc, summed together and sent to the PWM output which is\nconnected to the amplifier using a 1st order low pass filter.\n\n## sintab.c\n\nThe sine table for FM Synthesis\n\n## seq.c\n\nThe sequencer consists of a simple list of notes and timestamps, and can be sent\ncommands for inserting, deleting, editing and playing back notes.\n\n# Licence\n\nThe MIT License (MIT)\n\nCopyright (c) Ico Doornekamp\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzevv%2Fpiano","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzevv%2Fpiano","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzevv%2Fpiano/lists"}