Skip to content
  • Home
  • Account
  • Restricted content
  • OBEX
  • Chips Tips
  • Logout
  • Shop
  • QuickBytes
Propeller OBEX
  • OBEX
  • Forum
Login
Propeller OBEX

Propeller 2

  • Configuring Visual Studio Code for Programming the P2 on Mac, Windows, and Linux
  • Breakout Board Options for P2 Edge Modules
  • Solar Panel Monitoring Demo (Intro to Using Video 3 of 3)
  • Wireless Programming with the ESP8266 WX Module
  • Brushless DC Motor Control Demo
  • Colorful Terminal Output with ANSI Escape Sequences
  • XBee RF Transparent and API Mode Demo
  • DS3231 Real Time Clock I2C Demo
  • Multiple Servo Control (up to 64) Object
  • Multiple Serial Port (8 UART – 16 Tx/Rx) Object
  • Goertzel Operation with Ultrasonic Transducers
  • Web Page Control of WS2811 LEDs Using the IoT Gateway on Raspberry Pi
  • 320×240 LCD Driver for ILI9341 Controller and XPT2046 Touch Screen
  • Digital Sample ADC to DAC + Analog Frequency to DAC
  • Using Smart Pins to Measure Frequency Output of TSL235R Light-to-Frequency Sensor
  • Ping))) Ultrasonic Distance Sensor with Graphical Debug Demo
  • Simple Analog Input
  • P2 Edge 16 MB Flash Reader and Explorer Utility
  • LED Matrix used as an I/O Test Utility
  • Arlo Conversion to P2 with the Universal Motor Controller
  • Five Buttons On One Pin
  • P2 RTC Add-on Board Demo
  • Simple Video Driver – Using Images (Intro to Using Video 2 of 3)
  • Starting Your P2 Project with a Spin2 Template
  • E-Ink Display Demo
  • MAX7219 LED Display SPI Demo
  • DHT11, DHT22, CM2302 Humidity and Temperature Sensor Object
  • NMEA GPS String Parsing
  • Floating Point Math: DEBUG and Terminal Display Example
  • LEDs – Beyond the Basics
  • Quadrature Encoder Object
  • P2 RTC Add-on with GPS Module
  • DVI/VGA Text Driver Demo
  • PCF8574 I2C LCD Demo
  • Simple Sound Engine Demo
  • 1-Wire Driver with DS18B20 Temperature Sensor Demo
  • Send Email from the Propeller 2 Using the IoT Gateway on Raspberry Pi
  • I2C Device Bus Scanner Utility
  • 32-Channel ADC Object
  • Tetris
  • Video Hardware with Character Map Demo (Intro to Using Video 1 of 3)
  • WS2811, WS2812, WS2812b, WS2813, SK6812x NeoPixel Object
View Categories
  • Home
  • Docs
  • Quick Bytes
  • Propeller 2
  • Simple Sound Engine Demo

Simple Sound Engine Demo

Reading Time: 4 min read

Description #

simpleSound is an extension of the reSound object for playing MOD file formats (the first file format for tracked music on the Commodore Amiga, created with ProTracker). The reSound object was originally created in September 2020 and has a forum thread, under Additional Resources.

The simpleSound files are most well recognized for their use in video games, sound effects, and synthesized dance music. SimpleSound provides a quick and interesting way to add these sound effects to your Propeller 2 project.

This was created by forum member Ahle2 and posted as a beta in February 2021 (see Additional Resources for a forum thread). The code runs in both Propeller Tool and FlexProp (Windows, Mac, Linux). The examples use one cog for the sound engine and one to run the top file.

Technical notes about Simple Sound:

  • Adapts its internal mixing frequency to whatever system clock you would want to run at, so it always sounds right while maximizing the sound quality (try changing _clkfreq)
  • 12 sound channels by default, but you can have up to 64 by changing some constants
  • 4 sound channels are dedicated to playback Protracker Modules
  • 8 sound channels (default setting) is dedicated to sound effects
  • Play s16, u16, s8, u8, little or big endianess samples, configurable per channel
  • Play looped samples
  • Play user-defined waveforms (small looped samples)
  • Change volume, frequency, panning in realtime individually per sound channel
  • Handles almost all available Protracker modules and Protracker commands
  • You can pollTick() the music routine for asynchronous music processing, or you can do a tick() for synchronous processing locked to the main loop (needs to be 50 Hz for like 99% of available music modules)
  • Runs the heavy sound processing (using the reSound driver) in a dedicated cog
  • The music routine and the thin API/abstraction layer to trigger reSound sample playbacks runs in the calling COG and leaves most of the cycle free for other things

If you aren’t ready to pull a Commodore Amiga and find Protracker, there are plenty of ways to edit and create music and sound effects on a modern PC running any OS! Save any sound bite to raw 8 or 16-bit format using any sample rate and you should be able to use simpleSound to play it back with pitch, volume, and panning parameters applied individually per channel. In the normal configuration, you can play 8 samples with applied parameters at the same time, but by changing a constant you can have up to a total of 64 at the same time using just a single cog. If you only want to playback samples, you don’t need to call any tick() or pollTick() method at all. That is only to process the music data.

Examples of several programs used for creating sound files are listed below, under Additional Resources.

For the example simpleSound demos, four zip files are available:

  • kg_simpleSound(beta)_example1_just_music.zip – simple demo uses Parallax Serial Terminal and menu-driven system to select and playback individual music files from the collection in the next zip (and shown above in the video)
  • simpleSound(beta)_example1_just_music.zip – individual playback of sound files including axel f, gnu, elimin, house my kolsch up, let’s party, pyr and smarioa
  • simpleSound(beta)_example2_simple_game_sound.zip – game sounds for fights, space, and related effects
  • simpleSound(beta)_example3_advanced.zip – advanced effects of the sounds used in the above zip

To run the examples, you’ll need the A/V accessory (available alone or in the P2-ES Accessory Set), a speaker, or earbuds. Set the audio channels and volume in the source code.

Parts Used #
  • P2 Edge Module
  • P2 Edge Breadboard
  • P2-ES A/V Breakout Add-On Board (#64006H)
Source Code #
  • kg_simpleSound(beta)_example1_just_music.zip
  • simpleSound(beta)_example3_advanced.zip
Programming Language #
  • Spin 2
  • PASM2
Tools and Operating System #
  • Propeller Tool for Windows
  • FlexProp for Windows, Mac and Linux
Additional Resources #
  • Propeller 2 Spin Documentation
  • simpleSound - A simple to use sound engine for the P2 (P2 discussion forum link)
  • reSound - A sound driver and mixer for the P2 (P2 discussion forum)
  • MOD file format (Wikipedia)
  • Audacity (well-known sound creation and output)
  • Protracker 2 Clone (sound creation and output software similar to original)
  • OpenMPT (modern sound editor)
  • MilkyTracker (open source, multi-platform sound editor)
Document Author #
  • Ken Gracey (from Ahle2's description)
Source Code Author #
  • Ahle2
Was this useful ?

Share This Article :

  • Facebook
  • X
  • LinkedIn
Still stuck? How can we help?

Still stuck? How can we help?

Updated on September 29, 2026
PCF8574 I2C LCD Demo1-Wire Driver with DS18B20 Temperature Sensor Demo
Table of Contents
  • Description
  • Parts Used
  • Source Code
  • Programming Language
  • Tools and Operating System
  • Additional Resources
  • Document Author
  • Source Code Author

Copyright © 2026 - Parallax Inc.
599 Menlo Drive | Rocklin, CA 95765 | USA