Coder Social home page Coder Social logo

musicsequencertest's Introduction

MusicSequencerTest

Multi-track music sequencer using the Texas Instruments SN76849 sound chip

This quick-and-dirty example allows sequencing multitrack music on the SN76849 sound chip. It is made up of three components plus some support routines:

  1. SN76849 "driver" - This has routines to poke bytes out to the chip, and some functions that use this routine to start a tone and adjust the volume of it. It works by mapping note values (0-87) to match the 88 piano keys. There is a frequency table matching the values when using a 4mhz crystal. There is no real support for the fourth white noise channel yet, but that will be coming soon. (This is basically my first pass at the code.) There is also a routine which fades out the notes, simulating decay. It will eventually become an ADSR feature so tones can do more than just beep or fade out.
  2. MusicSequencer - This is a simple track sequencer where you can place notes (using defines for the note value and defines for the length) like sheet music and then have the tune played. It's very simple right now. It has a handler function that gets called repeatedly in a loop to handle the actual sequencing.
  3. MusicSequencerTest - A simple program that uses the above two items to playt he Pac-Man intro music. Sort of.
  4. LineInput - A simple line input routine, that has a hook inside to call the tone handler so it can keep processing tones while waiting for input. Quick and dirty. I'll be fixing this up soon, too.

It was built with the current 1.8.1 version of the Arduino IDE. I'll be adding a few more things to it, as well as white noise support (and some form of drum track method), as soon as I have a moment.

REVISION

  • 2017-03-03 allenh - Initial, hastily created README file.
  • 2017-03-05 allenh - Added notes about what the three main compoents are and what they do.
  • 2018-02-18 allenh - Updates for Arduino Nano (4MHz timing on pin 3).

FILES

  • README.md - this file
  • LineInput.ino - simple line input routine that calls the player while waiting for input.
  • MusicSequencer.h
  • MusicSequencer.ino
  • MusicSequencerTest.ino - test program that plays the 2-voice Pac-Man intro music.
  • SN76849.ino - code to send commands to the Texas Instrument SN76849 sound chip.
  • SN76849.h

CONFIGURATION

Edit the SN76849.h as appropriate:

/*      Chip Pin        Arduino Pin */
#define SN76489_D0      2  //D2
#define SN76489_D1      3  //D3
#define SN76489_D2      4  //D4
#define SN76489_D3      6  //D6
#define SN76489_D4      7  //D7
#define SN76489_D5      12 //D12
#define SN76489_D6      11 //D11
#define SN76489_D7      10 //D10

#define SN76489_WE      5  //D5

Notes are in the source code, until I have time to update this README.

RUNNING

More to come...

musicsequencertest's People

Contributors

allenhuffman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

w-v hoesslin

musicsequencertest's Issues

No support for the noise channel.

The code currently treats all four channels the same (piano notes 0-87), which is not how channel 3 (noise) works. The noise channel will have to have it's own function or values to take advantage of it.

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.