{"id":20522853,"url":"https://github.com/anachrocomputer/avrmidi2cv","last_synced_at":"2025-07-15T01:05:44.219Z","repository":{"id":225914158,"uuid":"767226645","full_name":"anachrocomputer/AvrMidi2CV","owner":"anachrocomputer","description":"MIDI to Control Voltage converter to run on ATmega4809 AVR microcontroller","archived":false,"fork":false,"pushed_at":"2024-03-27T22:10:31.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T00:44:35.453Z","etag":null,"topics":["ad5676","ad8804","atmega4809","avr","control-voltage","dac","digital-to-analog-converter","midi"],"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/anachrocomputer.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}},"created_at":"2024-03-04T23:13:13.000Z","updated_at":"2024-03-26T20:06:52.000Z","dependencies_parsed_at":"2024-03-27T23:24:28.967Z","dependency_job_id":null,"html_url":"https://github.com/anachrocomputer/AvrMidi2CV","commit_stats":null,"previous_names":["anachrocomputer/avrmidi2cv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anachrocomputer/AvrMidi2CV","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anachrocomputer%2FAvrMidi2CV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anachrocomputer%2FAvrMidi2CV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anachrocomputer%2FAvrMidi2CV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anachrocomputer%2FAvrMidi2CV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anachrocomputer","download_url":"https://codeload.github.com/anachrocomputer/AvrMidi2CV/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anachrocomputer%2FAvrMidi2CV/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265382928,"owners_count":23756433,"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":["ad5676","ad8804","atmega4809","avr","control-voltage","dac","digital-to-analog-converter","midi"],"created_at":"2024-11-15T22:37:06.954Z","updated_at":"2025-07-15T01:05:44.190Z","avatar_url":"https://github.com/anachrocomputer.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AvrMidi2CV #\n\nSimple MIDI to Control Voltage (CV) converter.\nA work-in-progress at the moment,\nwith a basic MIDI state machine and CV, Velocity, and Pitch Bend\noutputs via AD5676 DAC.\nThis DAC is an 8-channel 16-bit SPI type,\nand should be accurate enough for 1V-per-octave note control voltages.\nIt's fine for Pitch Bend signals, too, which are 14-bit.\nBut it's not cheap and only available in a 20-pin TSSOP package\nwith 0.65mm pitch leads.\nOf the eight analog output channels, we're only using three so far.\nWe need lots more channels for MIDI messages such as Control Change\nand they're handled by a 12-channel 8-bit DAC, the AD8804 (also SPI).\n\nThe microcontroller has plenty of spare GPIO pins which we can use\nfor on/off controls,\nand to trigger analog rhythm sound generators.\nThis latter facility is not yet implemented,\nbut will be added later.\n\nRuns on ATmega4809. Code in C, compiled with GCC.\n\n## Connections ##\n\n| Signal     | MCU Port | ATmega4809 DIP-40 pin | AD5676 TSSOP-20 pin | AD8804 TSSOP 20-pin |\n|:-----------|:---------|:----------------------|:--------------------|:--------------------|\n| UPDI       | UPDI     | 30                    |                     |                     |\n| MIDI_OUT   | TxD1     | 1 (PC0)               |                     |                     |\n| MIDI_IN    | RxD1     | 2 (PC1)               |                     |                     |\n| SQWAVE     | PC2      | 3                     |                     |                     |\n| LED        | PC3      | 4                     |                     |                     |\n| GATE       | PC4      | 7                     |                     |                     |\n| TRIGGER    | PC5      | 8                     |                     |                     |\n| SUSTAIN    | PD7      | 16                    |                     |                     |\n| MOSI       | PA4/MOSI | 37                    | 7 (SDI)             | 13 (SDI)            |\n| MISO       | PA5/MISO | 38                    | n/c                 | n/c                 |\n| SCK        | PA6/SCK  | 39                    | 6 (SCLK)            | 12 (CLK)            |\n| DAC16_CS   | PA7/SS   | 40                    | 5 (/SYNC)           |                     |\n| DAC8_CS    | PA3      | 36                    |                     | 9 (/CS)             |\n| RxD        | RxD0     | 34 (PA1)              |                     |                     |\n| TxD        | TxD0     | 33 (PA0)              |                     |                     |\n| CV         |          |                       | 2 (Vout0)           |                     |\n| VELOCITY   |          |                       | 1 (Vout1)           |                     |\n| PITCHBEND  |          |                       | 20 (Vout2)          |                     |\n| MODULATION |          |                       |                     | 2 (O1)              |\n| PAN        |          |                       |                     | 3 (O2)              |\n\nPower and ground pins not shown.\n\nCV must be amplified by a non-inverting op-amp circuit to achieve\n1V per octave over a useful range.\nI used an LM324 which gives the capacity for four CV signals.\n\n## AVR Toolchain ##\n\nThe program has been compiled, linked and tested using a Linux version\nof the 'avr-gcc' toolchain.\nThis can be installed directly or as part of the Arduino IDE.\n\nThe compiler, linker and programmers are invoked from the Makefile in\nthe usual way.\nVarious parameters in the Makefile may be altered to suit the development\nsetup, e.g. the type of programmers used and the ports that they connect to.\nThe full pathname to the toolchain is also configured in the Makefile.\n\nA special target in the Makefile is provided to invoke the programming\ndevice(s) and write the ELF files into the Flash memory in the chips.\nThis target is called 'prog4809'.\nThe 'prog4809' target invokes the UPDI programmer.\n\nThere's a Makefile target called 'clean' that deletes the object code files\nand the ELF binary files.\nIt leaves the source code files untouched, of course.\n\n## AVR Programmers ##\n\nI have tested the code with a 'jtag2updi' implemented on an ATmega328P.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanachrocomputer%2Favrmidi2cv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanachrocomputer%2Favrmidi2cv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanachrocomputer%2Favrmidi2cv/lists"}