Skip to content

Project for the Tiva C EK-TM4C123GXL that plays retro video game music.

License

Notifications You must be signed in to change notification settings

utkarsh-maheshwari/Tiva-C-MusicPlayer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Music Player

Overview

This project uses the Tiva C EK-TM4C123GXL board to build a device that plays retro video game music. The music data comes from MIDI files, and is converted to an optimized format that is downloaded to the Tiva's Flash memory from the PC's serial port. Up to 224Kib of song data can be downloaded (about 8 to 12 songs). The firmware uses FreeRTOS, and is an example of a soft real-time system.

The buttons on the Tiva are used to cycle to the next and previous songs in the song list, and the blue button on the board toggles between Play and Stop. An LCD displays information about the current song, such as its name, song index, track count, size, and length. Each second, a time marker is incremented as the song plays.

To produce the musical sounds, the Tiva's PWM channels are used to generate square waves at the audio frequencies of the musical notes. The square waves are summed together and amplified by an LM386. The player board supports up to four monophonic, instrument tracks, one of which can be used as a percussion track. The percussion track generates a sound using white noise that simulates a closed hi-hat.

The firmware was designed as a state machine with a total of six states, five events, and four actions. Zero or more actions are invoked when an event causes a transition from one state to another. The main program is implemented by two interrupt service routines (ISRs) and eight FreeRTOS tasks. The tasks can be in a running or blocked state at any given time. The tasks and ISRs synchronize by giving/taking binary semaphores.

This project builds on the work from Experiments 14-16, as well as Experiments 6 & 13.


Watch the video

Music Samples

These mp3s were created by connecting the speaker terminal from the music player board to the mic input of the PC and recording the accompanying song (MIDI) file.

Batman Returns - Stage 1 Sequenced by Johnnyz
Castlevania 3 - Stage 1 Beginning Sequenced by JILost
Golvellius - Title Screen Sequenced by Johnnyz
Lemmings - Level 11 Ronda Alla Turca Sequenced by Joo Johnnyz Buaes
R. C. Grand Prix - Main Theme Sequenced by Joo Johnnyz Buaes
Renegade - Mission 1 Inside Train Sequenced by Joo Johnnyz Buaes
Sonic the Hedgehog - Bonus Stage Sequenced by Joo Johnnyz Buaes
Sonic the Hedgehog 2 - Scrambled Egg Zone Sequenced by Joo Johnnyz Buaes
Sonic the Hedgehog 2 - Green Hills Zone Sequenced by Joo Johnnyz Buaes
Sonic Chaos - Sleeping Egg Zone Sequenced by Joo Johnnyz Buaes
Super Mario Bros. Theme Sequenced by PJ Barnes
Tetris - Music A Sequenced by King Meteor
Vs. Excitebike - Track 3 Sequenced by Chow
Wizardry II: The Legacy of Llylgamyn - Title Theme Sequenced by Yatorl Ogalbana
Wonder Boy in Monster World - Shore Sequenced by Johnnyz
Zelda II: The Adventure of Link Sequenced by JILost

Video game MIDI files were downloaded from:


This project uses the Midifile library from https://midifile.sapp.org/ to parse the MIDI files.

Images

Music Player

MusicPlayer MusicPlayer

Downloader Screen

DownloaderScreen

Circuit Diagram

CircuitDiagram

State Diagram

StateDiagram

Task Diagram

TaskDiagram

Track Task Flowchart

TrackTaskFlow

About

Project for the Tiva C EK-TM4C123GXL that plays retro video game music.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 66.7%
  • C++ 32.4%
  • Other 0.9%