Skip to content

felixroos/doughbat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

doughbat

doughbat is a very minimal livecoding editor. Principles:

  • Minimal API
  • Bring your own abstractions
  • Just a single HTML file

You can use it here: https://felixroos.github.io/doughbat/

doughbat is the spiritual successor to doughbeat, using AssemblyScript instead of JavaScript.

Usage

The application is very simple, you just have to write a dsp function that uses its only argument t (time in seconds) to calculate a number between -1 and 1. The returned number represents the speaker position for that moment in time: 0 is the resting position while -1 and 1 are maximum in / out. The dsp function will be called 44100 times per second! Example:

Example:

export function dsp(t: f64): f64 {
  return ((110 * t * 1.0) % 1.0) - 0.5;
}

This is a simple sawtooth wave... The returned numbers will rise from -0.5 to 0.5 at a frequency of 110Hz. This is just a very basic example. You can actually write full music pieces with this abstraction.

Examples

Read More

To understand more about making music with maths, read my blog post series:

Credits

About

minimal live coding dsp with assemblyscript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages