Code Monkey home page Code Monkey logo

repetition.sc's Introduction

Repetition.sc

A set of tools to build a Stream of Events`.

Current version: 0.3

Installation

Simply open a new document on your SC IDE and type:

Quarks.install("https://github.com/lvm/Repetition.sc");

This should print something like this in the Post window:

Installing Repetition
Installing PercSymbol
PercSymbol installed
Installing FluidSynth
FluidSynth installed
Installing Bjorklund
Bjorklund installed
Repetition installed
-> Quark: Repetition[0.1]

Getting started

Once Repetition is properly installed and everything working correctly, type the following:

(
p = ProxySpace.push(s);
p.makeTempoClock;
p.clock.tempo = 2;
p.quant = 4
;
r = Repetition(p);
m = r.initMIDI("Midi Through", "Midi Through Port-0");
r.midiEventTypes;
)

So, pretty much that's it.

The language

The parser recognizes the following symbols:

  • Parallel: a|b, plays symbols simultaneously. Kind of a Chord.
  • Groups: a+b, plays symbols sharing the duration. If the duration is 1, each will have a duration of 1/2.
  • Accent: a@, sums a quarter of the original amplitude to it. That is: amplitude/4.
  • Shift octave up: a', Current Octave +1.
  • Shift octave down: a,, Current Octave -1.
  • Repeat once: a!, Repeats the symbol once.
  • Repeat N times: a*N (N -> Int), Repeats symbols N times.

All of them are "chainable". For example, a Pattern (ab)using every option available:

"a*3 b@+c' d@!, e+f".asRepetitionStream.nextNRP(23);
-> [ ( 'dur': 0.14285714285714, 'symbol': a, 'shift': 0, 'midinote': 9,
  'typeof': note, 'accent': 0 ), ( 'dur': 0.14285714285714, 'symbol': a, 'shift': 0, 'midinote': 9,
  'typeof': note, 'accent': 0 ), ( 'dur': 0.14285714285714, 'symbol': a, 'shift': 0, 'midinote': 9,
  'typeof': note, 'accent': 0 ), ( 'dur': 0.071428571428571, 'symbol': b@, 'shift': 0, 'midinote': 11,
  'typeof': note, 'accent': 0.25 ), ( 'dur': 0.071428571428571, 'symbol': c', 'shift': 1, 'midinote': 0,
  'typeof': note, 'accent': 0 ...etc...
~x[0] =  "c a f e".pbind(\instrument, \default, \amp, 0.5);
~x.play;

A more in-depth documentation is available in SCDoc format browseable through the SCIde Help Browser. If you feel anything is missing, don't hesitate to report an issue asking for clarification.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/lvm/Repetition.sc. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

LICENSE

See LICENSE

repetition.sc's People

Contributors

lvm avatar munshkr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

munshkr

repetition.sc's Issues

Add schelp

The docs are already written but they still need to be converted to schelp format.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.