Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

A Clojure implementation of an Alda sound engine

Notifications You must be signed in to change notification settings

alda-lang/alda-sound-engine-clj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alda-sound-engine-clj

NOTE: This was a component of Alda 1.x. It is no longer in use.

A Clojure implementation of an Alda sound engine.

The alda.sound namespace functions as a library focused on playing a fully realized Alda score map.

Development

alda.sound

The alda.sound namespace handles the implementation details of playing the score.

There is an "audio type" abstraction which refers to different ways to generate audio, e.g. MIDI, waveform synthesis, samples, etc. Adding a new audio type is as simple as providing an implementation for each of the multimethods in this namespace, i.e. set-up-audio-type!, refresh-audio-type!, tear-down-audio-type!, start-event! and stop-event!.

The play! function handles playing an entire Alda score. It does this by using a Sequencer to schedule all of the note events to be played, and a Synthesizer to play them. The time that each event starts and stops is determined by its :offset and :duration.

What happens, exactly, at the beginning and end of an event, is determined by the start-event!/stop-event! implementations for each instrument type. For example, for MIDI instruments, start-event! sets parameters such as volume and panning and sends a MIDI note-on message at the beginning of the score plus :offset milliseconds, and stop-event! sends a note-off message :duration milliseconds later.

License

Copyright © 2012-2019 Dave Yarwood et al

Distributed under the Eclipse Public License version 1.0.

About

A Clojure implementation of an Alda sound engine

Resources

Stars

Watchers

Forks

Packages

No packages published