isobar
A Python package 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 actions.
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 7 committers (14.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.6%) to scientific vocabulary
Keywords
Repository
A Python package 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 actions.
Basic Info
- Host: GitHub
- Owner: ideoforms
- License: mit
- Language: Python
- Default Branch: master
- Homepage: http://ideoforms.github.io/isobar/
- Size: 2.95 MB
Statistics
- Stars: 401
- Watchers: 20
- Forks: 54
- Open Issues: 11
- Releases: 7
Topics
Metadata Files
README.md
isobar
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
```python from isobar import *
------------------------------------------------------------------------
Create a geometric series on a minor scale.
PingPong plays the series forward then backward. PLoop loops forever.
------------------------------------------------------------------------
arpeggio = PSeries(0, 2, 6) arpeggio = PDegree(arpeggio, iso.Scale.minor) + 72 arpeggio = PPingPong(arpeggio) arpeggio = 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 = PSequence([50, 35, 25, 35]) + 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 = 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:
- 00.ex-hello-world.py
- 01.ex-basics.py
- 02.ex-subsequence.py
- 03.ex-euclidean.py
- 04.ex-permutations.py
- 05.ex-piano-phase.py
- 06.ex-walk.py
- 07.ex-static-pattern.py
- 10.ex-lsystem-stochastic.py
- 11.ex-lsystem-rhythm.py
- 12.ex-lsystem-grapher.py
- 20.ex-midi-input.py
- 21.ex-midi-clock-sync-in.py
- 22.ex-midi-markov-learner.py
- 23.ex-midi-monitor.py
- 24.ex-link-clock.py
- 25.ex-fluid-synth.py
- 30.ex-midifile-read.py
- 31.ex-midifile-write.py
- 32.ex-midifile-markov.py
- 40.ex-osc-send.py
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 the input 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.
PScaleLinLin - Map `input` from linear range [a,b] to linear range [c,d].
PScaleLinExp - 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.
PRandomExponential - Random uniform on exponential curve between `min` and `max`,
PRandomImpulseSequence - Random sequence of impulses with probability `probability`.
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.
Contributors
Thanks to the following contributors:
- Giacomo Loparco): for auto-generated documentation, type hinting, logging and comprehensive
__repr__implementations - Greg White: for documentation improvements
- Piotr Sakowski: for fixes in
KeyandScalehandling - Dan Tenenbaum: for example and documentation fixes
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.
Owner
- Name: Daniel Jones
- Login: ideoforms
- Kind: user
- Location: London, UK
- Website: http://www.erase.net/
- Twitter: ideoforms
- Repositories: 43
- Profile: https://github.com/ideoforms
sound/systems
GitHub Events
Total
- Create event: 5
- Release event: 1
- Issues event: 6
- Watch event: 30
- Delete event: 1
- Issue comment event: 12
- Push event: 30
- Pull request review event: 1
- Pull request event: 3
- Fork event: 2
Last Year
- Create event: 5
- Release event: 1
- Issues event: 6
- Watch event: 30
- Delete event: 1
- Issue comment event: 12
- Push event: 30
- Pull request review event: 1
- Pull request event: 3
- Fork event: 2
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Daniel Jones | d****l@j****k | 376 |
| Daniel Jones | d****s@g****k | 24 |
| PlatonBJS | 4****s | 3 |
| Dan Tenenbaum | d****a@f****g | 3 |
| Jones/Bulley Studio | s****o@J****l | 1 |
| Mauro | m****o@s****g | 1 |
| Daniel Jones | d****l@l****l | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 41
- Total pull requests: 22
- Average time to close issues: 9 months
- Average time to close pull requests: 10 months
- Total issue authors: 26
- Total pull request authors: 11
- Average comments per issue: 1.88
- Average comments per pull request: 0.68
- Merged pull requests: 15
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 1
- Average time to close issues: 5 days
- Average time to close pull requests: about 1 hour
- Issue authors: 2
- Pull request authors: 1
- Average comments per issue: 2.5
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ideoforms (8)
- piotereks (4)
- dtenenba (4)
- muteboy (1)
- hnspn (1)
- datadave (1)
- woudsma (1)
- mark-zarandi (1)
- youssefavx (1)
- lvm (1)
- TheOncomingStorm (1)
- lambdamusic (1)
- Squls (1)
- HappyGlitch (1)
- vzack2001 (1)
Pull Request Authors
- piotereks (11)
- loparcog (7)
- dtenenba (3)
- rvega (2)
- giohappy (2)
- gregwht (1)
- mmarchini (1)
- jackdreilly (1)
- cprosser (1)
- platonbjs (1)
- lvm (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 134 last-month
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 3
(may contain duplicates) - Total versions: 16
- Total maintainers: 1
proxy.golang.org: github.com/ideoforms/isobar
- Documentation: https://pkg.go.dev/github.com/ideoforms/isobar#section-documentation
- License: mit
-
Latest release: v0.2.1
published 7 months ago
Rankings
pypi.org: isobar
A Python library to express and manipulate musical patterns
- Homepage: https://github.com/ideoforms/isobar
- Documentation: https://isobar.readthedocs.io/
- License: mit
-
Latest release: 0.2.1
published 7 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v2 composite
- mido *
- python-osc *
- python-rtmidi *