Code Monkey home page Code Monkey logo

c64_digiplay's Introduction

digiplay.asm

Sample player code for playing digis on the volume register of the Commodore 64 SID chip SID6581, in kickass assembly syntax.
Works only on the old C64, not the C64C, which has the newer SID8580 builtin.

This small demo code plays a loop from the old techno song "L.A. Style - James Brown is dead".

I use this occasionally to record "C64 distorted" samples, I love the crunchyness :)

Wav-samples must be prepared first: converted to 4bit/4kHz, and the raw sound data extracted (no file header). This is done in 2 steps: using sox to convert sample- and bit-rate. sox can not convert to 4bit well, so the 2nd step uses a quick'n'dirty c executable to do so from 8-bit encoding.
The output ("out.raw") is uncompressed and does not pack 2 4-bit digis into a byte.

The assembly code sources the binary file "out.raw".

Assemble

The player is written in kickass assembly syntax - see kickass assembler: http://www.theweb.dk/KickAssembler/Main.html

use kickass to assemble:

java –jar /your/path/to/KickAss.jar digiplay.asm -o digiplay.prg

Convert sample to 4bit/4kHz (2 steps):

1) Use sox to convert to 8bit/4kHz:

sox -S jb.wav -r 4000 -b 8 -e unsigned-integer -t raw in.raw

2) Use 8to4bit to convert to 4bit/4kHz

The small utility 8to4bit.c can be used to create the final output file (creates out.raw):

cat in.raw | ./8to4bit 

Get / compile sox

get sox from source: http://sox.sourceforge.net/

git clone git://git.code.sf.net/p/sox/code sox
cd sox
autoreconfig -i
# configure script: remove warning definitions from 13540, 3 lines
./configure
make

or

apt-get install sox libsox-fmt-all

Demo video

vice-video-20220621112224287764_1.mp4

c64_digiplay's People

Contributors

m64github avatar

Stargazers

 avatar Rene Schallner avatar

Watchers

 avatar

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.