{"id":19703321,"url":"https://github.com/intelorca/arm-audio-player","last_synced_at":"2026-02-04T07:08:53.795Z","repository":{"id":148312883,"uuid":"58674898","full_name":"IntelOrca/arm-audio-player","owner":"IntelOrca","description":"A micro-controller audio player written in ARM assembly.","archived":false,"fork":false,"pushed_at":"2016-05-12T20:38:33.000Z","size":83,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T16:54:17.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PostScript","has_issues":false,"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/IntelOrca.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-12T20:34:14.000Z","updated_at":"2023-12-08T16:06:11.000Z","dependencies_parsed_at":"2023-05-19T18:15:23.529Z","dependency_job_id":null,"html_url":"https://github.com/IntelOrca/arm-audio-player","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/IntelOrca/arm-audio-player","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntelOrca%2Farm-audio-player","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntelOrca%2Farm-audio-player/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntelOrca%2Farm-audio-player/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntelOrca%2Farm-audio-player/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IntelOrca","download_url":"https://codeload.github.com/IntelOrca/arm-audio-player/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IntelOrca%2Farm-audio-player/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264923399,"owners_count":23683738,"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-11-11T21:17:32.208Z","updated_at":"2026-02-04T07:08:53.591Z","avatar_url":"https://github.com/IntelOrca.png","language":"PostScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"The University of Manchester  \nCOMP22712 Microcontrollers Project  \nTed John, May 2013  \nhttp://intelorca.co.uk\n\n***\n\n# Description\nAn audio player which uses the piezo-electric buzzer (usually on a keypad) to\nplay music. The music is played by controlling the time period that the buzzer\nwill play a tone at. The music is represented by tracks, channels and sequences.\n\nThe code was written to deal with multiple channels but was not tested due to\ntime constraints. Tracks contain channels which are a playlist of sequences.\nSequences are a playlist of notes stored as words.\n\nThe FPGA was adapter to allow hardware timing for the buzzer output. The PIO_8\nschematic was edited to use my own PIO schematic. This PIO schematic implemented\na hardware timer to pulse the buzzer output automatically using a time period\nrepresented by a 16 bit integer in microseconds.\n\nThe keypad is used to control the player. The digit buttons, 1 to 9 select which\ntrack to play. Asterisk pauses the current track. Hash resumes the track.\n0 stops the track and shows the about screen.\n\n# Technicalities\nExamples of the music formatting can be seen at the bottom of this file. A\ncompiler was written in C# to parse the sequence files and generate an assembly\nfile defining the binary data representing the music. The notes are formatted as\nfollows:\n```\n\u003ckey\u003e[accidential][octave][timing]\n```\n\nKey must always be specified... C, D, E, F, G, A, B or ~ for a rest.\nAccidentals can be placed after # for sharp, flat was not implemented. The\noctave and timing are optional parameters. If either is omitted then the\nprevious octave or timing state is maintained. Timing is measured in bars of\nwhich there are always four beats in. It must be formatted as a fraction in\nsquare brackets. For example: [1/2] for a minim, [1/4] for a crotchet, [1/32]\nfor a hemidemisemiquaver. [4/1] for a longa etc.\n\nEach note is stored as a word.\n```\n  |-------------- bar fraction (value of 128 0x80 represents 1/2 bar)\n  |  |----------- bars\n  |  |  |-------- octave\n  |  |  |  |----- key (0 for rest, 1 for C, 2 for D etc.)\n  |  |  |  |\n 80 01 05 01\n```\nThe above is **C5[3/2]**.\n\nThe assembly code itself implements a small operating system on the board. There\nare various unused functions which are not used and left there from previous\nexercises. Most of the code sticks to a code convention.\n\nRegisters are used to pass arguments to a subroutine. A subroutine will always\npreserve the contents of registers unless the registers are used as output\narguments. Typically registers are always used in order from R0. Subroutines\nwill usually push registers it uses for local variables at the start, onto the\nstack and pop them before returning back to the caller address. If registers\nneed to be pushed or another subroutine is called within the subroutine, then\nthe link register will be pushed too and popped into the program counter\nregister as a return mechanism.\n\nTo help organise code, variables and reduce address constants, structures are\nused. The project, player and user interface are separated into modules which\nuse structures to contain their relevant variables. Subroutines are then called\nwith the address of their module structure as the first argument. This is then\nuse as a base pointer to reference structure members.\n\nThe buzzer time period data bus is hard-wired to `0x20000000`. Storing a byte at\n`0x20000000` and `0x20000001` will control the buzzer. The bytes are little endian.\nThe most significant bit in `0x20000001` is the enable pin for the buzzer.\n\nThe LCD functions allow double buffered writing to the screen as well as\nscrolling. The LCD is only called to write over characters that have changed.\n\nAs programming in assembly can be quite tedious, breaking the program down\ninto many small subroutines helps reduce errors and debugging time in expense\nfor call and register preservation overhead.\n\n# Running\nTo run the project, simply use komodo to load fpga.bit into the fpga using the\nfeatures dialog. Then load project.kmd into the board memory and run.\n\n# File list\n```\nnoteseq/*                      - noteseq, the C# application for compiling\n                                 sequence files into ARM assembly. Also a\n                                 simulator.\n\npio.eps                        - postscript of the altered PIO\nfpga.bit                       - fpga netlist for changing buzzer on PIOA\n\nkeypad.s                       - functions for reading the keypad\nlcd.s                          - functions for controlling the LCD\nmath.s                         - mathematical functions (just udivision really)\nos.s                           - operating system and os functions\nplayer.s                       - player module, functions for reading and\n                                 playing the music tracks\nproject.s                      - main program loop\nstring.s                       - functions for manipulating strings\nui.s                           - user interface module, functions for displaying\n                                 things on the LCD and reading user input\n\nmusic_data.s                   - the data \"file\" containing the music tracks\n\nproject.kmd                    - pre-compiled copy of the program\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintelorca%2Farm-audio-player","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintelorca%2Farm-audio-player","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintelorca%2Farm-audio-player/lists"}