GithubHelp home page GithubHelp logo

music-box's Introduction

music-box

Chiptune music player featuring SN76489 and ATtiny861/ATtiny84

music-box in action

Overview

This project grew out of a Wikipedia surfing session. In reading about the computers of my childhood, I came across an article about the TI SN76489 sound chip, used by two of the machines I used as a kid (the TI 99/4A and IBM PCjr). I wondered if you can readily buy this IC, and if you can talk to it reasonably easily with modern hardware. The answer to both questions is yes!

How it works

All eight pins of PORTA are connected to the SN76489's data lines. PB4 connects to /WE and latches a value to the chip. PB5 (CLKO) outputs the ATtiny861's clock signal directly to the sound chip's clock input. /OE is permanently tied low and READY is ignored. I'm not sharing a bus with anything else...

The MCU firmware plays music from an array of bytes stored in program memory (in songs.c). It's a very simple binary format with three one-byte commands that play a note, play a noise, and sleep. To keep things simple, I ignore note-off events and simply make each note decay at a constant linear rate after it is struck. Much like an actual music box!

Loading music

util/process_midi_file.cpp will take a MIDI file and output a set of arrays for songs.c. It makes use of light-midi-parser as a submodule.

ATtiny84

This project can also be built for the ATtiny84, via make -e DEVICE=attiny84. With this target there will be just one blinking light, rather than one per channel. See main.c for wiring differences.

See also

I've also created a more elaborate stereo two-chip player using the Raspberry Pi Pico, pico-player.

music-box's People

Contributors

jstanley0 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

m4k3r-org

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.