All Projects → ideoforms → Isobar

ideoforms / Isobar

Licence: mit
A Python library for creating and manipulating musical patterns, designed for use in algorithmic composition, generative music and sonification. Can be used to generate MIDI events, MIDI files, OSC messages, or custom events.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Isobar

Miti
miti is a musical instrument textual interface. Basically, its MIDI, but with human-readable text. 🎵
Stars: ✭ 103 (-50.24%)
Mutual labels:  music, midi
Otto
Sampler, Sequencer, Multi-engine synth and effects - in a box! [WIP]
Stars: ✭ 2,390 (+1054.59%)
Mutual labels:  music, sequencing
Radiance
Radiance is video art software for VJs. It supports beat detection, animated GIFs, YouTube video, OpenGL shader effects. It is designed for live performance and runs on Linux and MacOS.
Stars: ✭ 109 (-47.34%)
Mutual labels:  music, midi
Beet.js
Polyrhythmic Sequencer library for Web Audio API.
Stars: ✭ 87 (-57.97%)
Mutual labels:  music, sequencing
Supriya
A Python API for SuperCollider
Stars: ✭ 167 (-19.32%)
Mutual labels:  music, composition
Ble Midi For Android
MIDI over Bluetooth LE driver for Android 4.3 or later
Stars: ✭ 90 (-56.52%)
Mutual labels:  music, midi
Html Midi Player
🎹 Play and display MIDI files on the web
Stars: ✭ 158 (-23.67%)
Mutual labels:  music, midi
Audiokit
Swift audio synthesis, processing, & analysis platform for iOS, macOS and tvOS
Stars: ✭ 8,827 (+4164.25%)
Mutual labels:  music, midi
Signal
A friendly music sequencer built with web technology
Stars: ✭ 166 (-19.81%)
Mutual labels:  music, midi
Helio Workstation
One music sequencer for all major platforms, desktop and mobile
Stars: ✭ 2,257 (+990.34%)
Mutual labels:  midi, composition
Audiokitsynthone
AudioKit Synth One: Open-Source iOS Synthesizer App
Stars: ✭ 1,258 (+507.73%)
Mutual labels:  music, midi
Jamtaba
Jamtaba is a software to play online music jam sessions.
Stars: ✭ 174 (-15.94%)
Mutual labels:  music, midi
Minibae
The platform-neutral Beatnik Audio Engine, Mini Edition (miniBAE) is an exceptionally mature, well-rounded, and reliable computer music and sound system specially customized for small-footprint and embedded applications.
Stars: ✭ 82 (-60.39%)
Mutual labels:  music, midi
Webmidikit
Simplest MIDI Swift library
Stars: ✭ 100 (-51.69%)
Mutual labels:  music, midi
Atm Cli
Command line tool for generating and working with MIDI files.
Stars: ✭ 1,235 (+496.62%)
Mutual labels:  music, midi
Midi
Library for reading and writing of MIDI messages and MIDI files (SMF) with Go
Stars: ✭ 130 (-37.2%)
Mutual labels:  music, midi
Midichlorian
A Visual Studio extension that allows you to write code and automate the IDE using MIDI musical instruments.
Stars: ✭ 65 (-68.6%)
Mutual labels:  music, midi
Abcjs
javascript for rendering abc music notation
Stars: ✭ 1,141 (+451.21%)
Mutual labels:  music, midi
Openbook
Open source lilypond real book for Jazz musicians
Stars: ✭ 159 (-23.19%)
Mutual labels:  music, midi
Libatm
Library for generating and working with MIDI files
Stars: ✭ 171 (-17.39%)
Mutual labels:  music, midi

isobar

ci

isobar is a Python library for creating and manipulating musical patterns, designed for use in algorithmic composition, generative music and sonification. It makes it quick and easy to express complex musical ideas, and can send and receive events from various different sources including MIDI, MIDI files, and OSC.

The core element is a Timeline, which can control its own tempo or sync to an external clock. Onto this, you can schedule Patterns, which can be note sequences, control events, program changes, or other arbitrary events via lambda functions. Pattern are used as templates to generate Events, which trigger notes or control changes on an OutputDevice (Check out a diagrammatic overview.)

isobar includes a large array of basic compositional building blocks (see Pattern Classes), plus some advanced pattern generators for more sophisticated operations (arpeggiators, Euclidean rhythms, L-systems, Markov chains).

Usage

import isobar as iso

#------------------------------------------------------------------------
# Create a geometric series on a minor scale.
# PingPong plays the series forward then backward. PLoop loops forever.
#------------------------------------------------------------------------
arpeggio = iso.PSeries(0, 2, 6)
arpeggio = iso.PDegree(arpeggio, iso.Scale.minor) + 72
arpeggio = iso.PPingPong(arpeggio)
arpeggio = iso.PLoop(arpeggio)

#------------------------------------------------------------------------
# Create a velocity sequence, with emphasis every 4th note,
# plus a random walk to create gradual dynamic changes.
# Amplitudes are in the MIDI velocity range (0..127).
#------------------------------------------------------------------------
amplitude = iso.PSequence([50, 35, 25, 35]) + iso.PBrown(0, 1, -20, 20)

#------------------------------------------------------------------------
# A Timeline schedules events at a specified tempo. By default, events
# are send to the system's default MIDI output.
#------------------------------------------------------------------------
timeline = iso.Timeline(120)

#------------------------------------------------------------------------
# Schedule events, with properties generated by the Pattern objects.
#------------------------------------------------------------------------
timeline.schedule({
    "note": arpeggio,
    "duration": 0.25,
    "amplitude": amplitude
})

#------------------------------------------------------------------------
# Run the timeline.
# Call timeline.background() to run in a separate thread.
#------------------------------------------------------------------------
timeline.run()

Installation

The short answer: pip3 install isobar

The long answer: isobar Getting Started guide

Documentation

For complete documentation, see ideoforms.github.io/isobar.

Examples

Examples are available in the examples directory with this distribution:

Pattern classes

CORE (core.py)
Pattern              - Abstract superclass of all pattern generators.
PConstant            - Returns a fixed value.
PRef                 - Contains a reference to another pattern, which can be replaced dynamically.
PFunc                - Returns the value generated by a function.
PArrayIndex          - Request a specified index from an array.
PDict                - Construct a pattern from a dict of arrays, or an array of dicts.
PDictKey             - Request a specified key from a dictionary.
PConcatenate         - Concatenate the output of multiple sequences.
PAbs                 - Absolute value of `input`
PInt                 - Integer value of `input`
PAdd                 - Add elements of two patterns (shorthand: patternA + patternB)
PSub                 - Subtract elements of two patterns (shorthand: patternA - patternB)
PMul                 - Multiply elements of two patterns (shorthand: patternA * patternB)
PDiv                 - Divide elements of two patterns (shorthand: patternA / patternB)
PFloorDiv            - Integer division (shorthand: patternA // patternB)
PMod                 - Modulo elements of two patterns (shorthand: patternA % patternB)
PPow                 - One pattern to the power of another (shorthand: patternA ** patternB)
PLShift              - Binary left-shift (shorthand: patternA << patternB)
PRShift              - Binary right-shift (shorthand: patternA << patternB)
PEqual               - Return 1 if a == b, 0 otherwise (shorthand: patternA == patternB)
PGreaterThanOrEqual  - Return 1 if a != b, 0 otherwise (shorthand: patternA != patternB)
PGreaterThan         - Return 1 if a > b, 0 otherwise (shorthand: patternA > patternB)
PGreaterThanOrEqual  - Return 1 if a >= b, 0 otherwise (shorthand: patternA >= patternB)
PLessThan            - Return 1 if a < b, 0 otherwise (shorthand: patternA < patternB)
PLessThanOrEqual     - Return 1 if a <= b, 0 otherwise (shorthand: patternA <= patternB)

SCALAR (scalar.py)
PChanged             - Outputs a 1 if the value of a pattern has changed.
PDiff                - Outputs the difference between the current and previous values of an input pattern
PSkipIf              - If `skip` is false, returns `input`; otherwise, returns None.
PNormalise           - Adaptively normalise `input` to [0..1] over a linear scale.
PMap                 - Apply an arbitrary function to an input pattern.
PMapEnumerated       - Apply arbitrary function to input, passing a counter.
PLinLin              - Map `input` from linear range [a,b] to linear range [c,d].
PLinExp              - Map `input` from linear range [a,b] to exponential range [c,d].
PRound               - Round `input` to N decimal places.
PScalar              - Reduce tuples and lists into single scalar values,
PWrap                - Wrap input note values within <min>, <max>.
PIndexOf             - Find index of items from `pattern` in <list>

SEQUENCE (sequence.py)
PSeries              - Arithmetic series, beginning at `start`, increment by `step`
PRange               - Similar to PSeries, but specify a max/step value.
PGeom                - Geometric series, beginning at `start`, multiplied by `step`
PImpulse             - Outputs a 1 every <period> events, otherwise 0.
PLoop                - Repeats a finite `pattern` for `n` repeats.
PPingPong            - Ping-pong input pattern back and forth N times.
PCreep               - Loop `length`-note segment, progressing `creep` notes after `repeats` repeats.
PStutter             - Play each note of `pattern` `count` times.
PSubsequence         - Returns a finite subsequence of an input pattern.
PReverse             - Reverses a finite sequence.
PReset               - Resets `pattern` whenever `trigger` is true
PCounter             - Increments a counter by 1 for each zero-crossing in `trigger`.
PCollapse            - Skip over any rests in `input`
PNoRepeats           - Skip over repeated values in `input`
PPad                 - Pad `pattern` with rests until it reaches length `length`.
PPadToMultiple       - Pad `pattern` with rests until its length is divisible by `multiple`.
PArpeggiator         - Arpeggiator.
PEuclidean           - Generate Euclidean rhythms.
PPermut              - Generate every permutation of `count` input items.
PPatternGeneratorAction - Each time its pattern is exhausted, request a new pattern by calling <fn>.
PSequenceAction      - Iterate over an array, perform a function, and repeat.

CHANCE (chance.py)
PWhite               - White noise between `min` and `max`.
PBrown               - Brownian noise.
PCoin                - Coin toss, returning either 0 or 1 given some `probability`.
PWalk                - Random walk around list.
PChoice              - Pick a random element from `values`, weighted by optional `weights`.
PSample              - Pick multiple random elements from `values`, weighted by optional `weights`,
PShuffle             - Shuffled list.
PShuffleInput        - Every `n` steps, take `n` values from `pattern` and reorder.
PSkip                - Skip events with some probability, 1 - <play>.
PFlipFlop            - flip a binary bit with some probability.
PSwitchOne           - Capture `length` input values; loop, repeatedly switching two adjacent values.

TONAL (tonal.py)
PDegree              - Map scale index <degree> to MIDI notes in <scale>.
PFilterByKey         - Filter notes based on their presence in <key>.
PNearestNoteInKey    - Return the nearest note in <key>.
PMidiNoteToFrequency - Map MIDI note to frequency value.

STATIC (static.py)
PGlobals             - Static global value identified by a string.
PCurrentTime         - Returns the position (in beats) of the current timeline.

FADE (fade.py)
PFadeNotewise        - Fade a pattern in/out by introducing notes at a gradual rate.
PFadeNotewiseRandom  - Fade a pattern in/out by gradually introducing random notes.

MARKOV (markov.py)
PMarkov              - First-order Markov chain generator.

LSYSTEM (lsystem.py)
PLSystem             - integer sequence derived from Lindenmayer systems

WARP (warp.py)
PWInterpolate        - Requests a new target warp value from `pattern` every `length` beats
PWSine               - Sinosoidal warp, period `length` beats, amplitude +/-<amp>.
PWRallantando        - Exponential deceleration to <amp> times the current tempo over `length` beats.

Background

isobar was first designed for the generative sound installation Variable 4, in which it was used to generate musical structures in response to changing weather conditions. It was more recently used in The Listening Machine, taking live input from Twitter and generating musical output from language patterns, streamed live over the internet.

Many of the concepts behind Pattern and its subclasses are inspired by the brilliant pattern library of the SuperCollider synthesis language.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].