Skip to content

Commit

Permalink
Merge pull request #34 from cannc4/0.5-dev
Browse files Browse the repository at this point in the history
v0.5
  • Loading branch information
cannc4 authored Jan 21, 2018
2 parents 423291a + b0a9858 commit 9fc45ac
Show file tree
Hide file tree
Showing 89 changed files with 15,173 additions and 3,690 deletions.
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
node_modules/
node_modules/rx/ts/core/observable.ts
deps/
config/
dist/
build/
config/
server/public/
vis/
vis/media/
package-lock.json
asd
.DS_Store
vis/media/
166 changes: 75 additions & 91 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,151 +1,135 @@
# Updates
### Global controls and Pattern History (Experimental)
There are now two sections dedicated to appending and prepending to the running code. `ctrl+enter` activates the code and sections can be recalled by creating presets. `shift+click` overwrites the presets and pressing `rec` creates a new one.
These parameters directly access to the patterns in the history. (i.e active patterns)
There is now a dedicated channel called `G` to sequence the channels you want to include within global controls. You can specify the index of global and channels like : "1 `1 2 4`" where first `1` is the index of global and `1 2 4` are the channel numbers.
# Siren
*Siren*, is a tracker interface that embodies abstractions where programming is realized as the medium for pattern sequencing in a modular fashion. It is based on a hierarchical structure that consists of scenes and channels. Separate channels have independent patterns; a complete song consists of a master list of repeated patterns. In addition to pattern composition, *Siren* supports programming variations of and transitions between patterns.


# Siren
Supported programming languages :
SuperCollider
Haskell/TidalCycles

*Siren*, a software environment that fills the gap between live coding performance and algorithmic composition. It is based on a hierarchical structure and a tracker-inspired user interface on top of the [TidalCycles](https://github.com/tidalcycles/Tidal/) language for pattern programming. In addition to pattern composition, *Siren* supports programming variations of and transitions between patterns.

**Note:** This is a beta release (*v0.3*). If you come across a bug, please do submit an `issue` on this page, and/or create a `pull request` of you feel like participating in its development.

## Download
**Note:** This is a beta release (*v0.5*), and it has not been tested comprehensively. If you come across a bug, please do [submit an `issue` ](https://github.com/cannc4/Siren/issues/new), and/or create a `pull request` of you feel like participating in its development.

In order to download a copy of the repository, either download repository `as a ZIP file` at [https://github.com/cannc4/sq](github.com/cannc4/sq), or use command line to `clone` repository.
## Download
You can get *Siren* either by downloading repository `as a ZIP file` at [https://github.com/cannc4/siren](github.com/cannc4/siren), or by using the command line to `clone` the repository.

```
```shell
git clone https://github.com/cannc4/Siren.git
```

## Build and Run

### Dependencies:
#### Dependencies:
Make sure the latest versions of following software are installed for your system user

- [SuperCollider](http://supercollider.github.io/download.html)
- [NodeJS](https://nodejs.org/en/download/)
- [NodeJS](https://nodejs.org/en/download/)
+ Make sure `npm` is globally installed with `NodeJS`
- [TidalCycles](https://tidalcycles.org/getting_started.html)

Then follow these lines to install package dependencies:
```shell
cd path/to/downloaded/repo
npm i
```


```
cd path/to/siren
npm i
In order to bind software dependencies, edit full paths in config/config.json according to your file system formatting and save the file. Copy paste your startup files to scd-start-default.scd and tidal-boot-default.hs into config folder or set the appropriate paths in config.json
Note that it's possible to target required paths using the `Settings` module in the interface.
```

In order to bind software dependencies, edit full paths in `config/config.json` according to your file system formatting and save the file.

Copy paste your startup files to `scd-start-default.scd` and `tidal-boot-default.hs` into config folder or set the appropriate paths in `config.json`

**## Note:** Make sure SuperCollider is either idle or closed before moving on.
**Note:** Make sure SuperCollider is either idle or closed before moving on.

Now you can start the interface
```
```shell
npm start
```

and initialize the backend
```

```shell
npm run siren
```
then go to `http://localhost:3000/` or `http://127.0.0.1:3000/` in your browser (tested on Chrome)

*Tested on Windows 10 and MacOSX El Capitan*

## Usage
then go to `http://localhost:3000/` or `http://127.0.0.1:3000/` in your browser
*Tested with Chrome on Windows 10 and MacOSX El Capitan*

![](src/assets/readme_images/panel.png)
- Login / Logout to the system using Github authentication
- Boot `SuperCollider` by pressing the square button
+ The button will turn into a circle once it successfully boots (check console for possible errors)
- Start all timers with `play` button
## Modules

## Scenes
| ![](src/assets/readme_images/scenes.png) | ![](src/assets/readme_images/channel.png) | ![](src/assets/readme_images/patterns.png) |
|---|---|---|
| **Figure (a)** | **Figure (b)** | **Figure (c)** |
### Scenes

### Duration and Timer
Scenes are the core of `Siren` and a scene serves as a framework to the composition. Each scene comprises of unique channels, global modifiers and patterns.

Duration of each channel can be specified using the textarea next to channel number on top of the grid. Duration is the time it takes to reach the last step in seconds.
*example in Figure (a)*- Textbox for scene name - `Update`/`Add` button- `Clear Matrix` button

`ctrl + enter` starts selected timer and `shift + enter` stops it.

Alternatively, `ctrl + channel number` starts the desired channel and `shift + channel number` stops it.
### Sequencer (aka Matrix)
#### Channels

*examples in Figure (b)*
- Channel number (i.e. `2`)
- Channel duration (i.e. `20` seconds)
Channels can be added using the `Channel` module layout and consists of `type`, `name`, `step` and `transition` parameters. Once a channel is added to the sequencer, the parameters and layout can be adjusted dynamically. Each cell is a textbox allowing any type of text input. Patterns can be looked up from the dictionary with their names and parameters. When a cell is active, it triggers the pattern with appropriate name and applies parameters in an ordered fashion. See `parameters` for various types.
The syntax to be used for encoding patterns in each entry in the pattern dictionary is determined by the channel definition, which determines the language in which the pattern will be written.

### Dictionary
###Channel
Please note that channels has to be defined appropriately in `tidal-boot-default.hs` or compiled using `console`.

Tidal patterns are stored in the `dictionary` on the right hand side of the interface. Please omit the channel number and dollar sign on Tidal commands (instead of `d1 $ sound "bd"` just write `sound "bd"`).
**Transitions:** Transition functions for TidalCycles
*example in Figure (b)*- Transition function (i.e. `(clutchIn 4)`)
**Steps:** Initial step number of channel
**Type:** Channel type, possible types; SCSynth, MIDI, Visual

*example in Figure (c)*
- Patterns named `bt2`, `jvv`, `jvbass`, and `lax` with corresponding Tidal commands and 2, 1, 0 and 1 parameters, respectively.
#### Cells
Cells of the channels serve as a canvas for pattern names and pattern parameters.

### Pattern Functions
### Pattern Parameters

Patterns can be looked up from the dictionary with their names and parameters. See `parameters` for various types.
Siren allows patterns to be parameterized and can be called with different parameters from different cells in the channel.

*example in Figure (b)*
- Pattern functions in cells (i.e. ```bt2 `every 2(#coarse 12)` `c` ```)
### Random Parameters
`|x,y|` returns a random value within the `x` and `y`

## Patterns
Disclaimer: Please omit the channel number and dollar sign on Tidal commands (instead of `d1 $ sound "bd"` just write `sound "bd"`)

### Transitions
Transitions are stored in the bottom row of the grid and are unique for each scene.
Tidal patterns are stored in the `dictionary` on the right hand side of the interface. This dictionary is unique for each scene and interacts with the sequencer in terms of parameters and calls.

*example in Figure (b)*
- Transition function (i.e. `(clutchIn 4)`)
#### Temporal parameter
`t` represents the temporal parameter for each timer and it can be used in expressions to create complex values, especially with math expressions.

### Song mode
If toggled, scenes are iterated top-down fashion based on their ordering. It updates the active scene by writing its grid and dictionary once all timers reach to the last step of the scene.
#### Mathematical expressions
Mathematical expressions can be used in the patterns in the dictionary, parser evaluates the expressions when enclosed with `&` symbol.*example in Figure (c)*- Math expression enclosed by `& ... &` (i.e. in the body of `jvv`: ```... [~ f3 &`t`%3 &] ~ ...```)

- To save a new scene, input a name and click on `Add` button. It'll create a new item in the list below.
- Update your saved grid and dictionary by inputting the active scene's name to the textbox and clicking on `Update` button.
- Use `arrow keys` next to the item to reorder.
- Press ` x ` button if you want to delete the scene all together.

*example in Figure (a)*
- Textbox for scene name (i.e. `docs`)
- `Update`/`Add` button
- `Clear Matrix` button
- `Start`/`Stop Songmode` to enable above feature
- Scenes are itemized with `delete` and `reorder` functionalities
#### Value Parameters
Any character sequence inside Siren pattern can be parameterized by surrounding desired spot with \` symbol (like surrounding a phrase for Markdown code block). Using this feature, you can not only pass well-tuned values dynamically, but also pass anything you want.

## Parameters
### Mathematical expressions
Mathematical expressions can be used in the patterns in the dictionary, parser evaluates the expressions when enclosed with `&` symbol.
```haskell
n `x` # s `y`
```
This can be called with any `x`or `y` value such as (assume it's named as `sq`):
``` sq `"{3*4}%3"` `"bd"` ```
or
``` sq `"{3*4 4*2}%3"` `"bd"` ```

*example in Figure (c)*
- Math expression enclosed by `& ... &` (i.e. in the body of `jvv`: ```... [~ f3 &`t`%3 &] ~ ...```)
### Pattern History
This module stores the successfully compiled patterns to keep track of the running sequences and serves as a container for the global modifiers.

### Value Parameters
Any character sequence inside Tidal command can be parameterized by surrounding desired spot with \` symbol (like surrounding a phrase for Markdown code block). Using this feature, you can not only pass well-tuned values dynamically, but also pass anything you want.
### Console
This module serves as a CLI(Command-Line-Interface) to Haskell and SuperCollider

```n `x` # s `y` ```
### Global Modifiers

This can be called with any ``` `x` ``` or ``` `y` ``` value such as (assume it's named as `sq`):
``` sq `"{3*4}%3"` `"bd"` ``` or
``` sq `"{3*4 4*2}%3"` `"bd"` ``` or
``` sq `"{3*4 4*2}%3"` `"bd"` ```
This is an experimental module that can be toggled using right click menu. There are two sections dedicated to appending and prepending to the running code. `ctrl+enter` activates the code and sections can be recalled by creating presets. Pressing `Rec` button saves the active modifiers. `shift+ click` clears the desired slot and `alt+ click` overwrites it. These modifiers are applied to the patterns shown in the pattern history section. (i.e active patterns)Channels that you want to modify can also be specified using the `channel` section in the submenu. Writing `1 2` will make the modifiers only affect the first two channels, `0` is a special case and means that modifiers will be applied to all channels in the scene.

### Random Parameters
``` `[x,y]` ``` returns a random value within the `x` and `y` boundaries `[x,y)`.
### Settings
In this module, it’s possible to set various settings of Siren such as startup configs or various paths.

### Temporal Parameter
``` `t` ``` represents the temporal parameter for each timer and it can be used in expressions to create complex values, especially with math expressions.
### Debug Console
This module serves as a debug console for GHC.

## Notes
- Pause timers for a few seconds if you see too much flood in GHC terminal. (stack gets full)
- `npm run siren` starts up the server - it's not required if you want to refresh the interface however you need to manually close node and restart it if `scsynth` crashes
- As each cell contains a pattern, having a timer duration like 4 seconds doesn't really makes sense if you have 8 steps (i.e. 4/8 seconds per step)
##Notes

## Known Bugs
- Editing parameters in the patterns fails when timer is active

## TODO
- Config generator
- boot/shut down server from the interface


13 changes: 1 addition & 12 deletions config/config.json
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
{
"userpath": "/Users/canince",
"debug": true,
"ghcipath": "/Library/Frameworks/GHC.framework/Versions/8.0.1-x86_64/usr/bin/ghci-8.0.1",
"sclang": "/Applications/SuperCollider/SuperCollider.app/Contents/MacOS/sclang",
"scsynth": "/Applications/SuperCollider/SuperCollider.app/Contents/Resources/scsynth",
"sclang_conf": "/Users/canince/Library/Application Support/SuperCollider/sclang_conf.yaml",
"port": 3001,
"path" : "/Users/canince/Documents/git/Siren/config/config.json",
"tidal_boot": "/Users/canince/Documents/git/Siren/config/tidal-boot-default.hs",
"scd_start": "/Users/canince/Documents/git/Siren/config/scd-start-default.scd"
}
{"debug":true,"ghcipath":"/Library/Frameworks/GHC.framework/Versions/8.2.1-x86_64/usr/bin/ghci-8.2.1","path":"/Users/canince/Documents/github/Siren/config/config.json","port":3001,"samples_path":"/Users/canince/desktop/pool1/*","scd_start":"/Users/canince/Documents/github/Siren/config/scd-start-default.scd","sclang":"/Applications/SuperCollider/SuperCollider.app/Contents/MacOS/sclang","sclang_conf":"/Users/canince/Library/Application Support/SuperCollider/sclang_conf.yaml","scsynth":"/Applications/SuperCollider/SuperCollider.app/Contents/Resources/scsynth","tidal_boot":"/Users/canince/Documents/github/Siren/config/tidal-boot-default.hs","tidal_sync":"/Users/canince/Documents/github/Siren/server/sync.hs","userpath":"/Users/canince"}
74 changes: 5 additions & 69 deletions config/scd-start-default.scd
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,77 +1,13 @@
(
s.options.numInputBusChannels = 6;
s.options.numOutputBusChannels = 14;
s.options.numBuffers = 2048 * 32;
s.options.numOutputBusChannels = 16;
s.options.numBuffers = 2048 * 64;
s.options.maxNodes = 1024 * 32;
s.options.memSize_(65536 * 16);
//s.recorder.recHeaderFormat = "WAV";
s.options.memSize = 131072 * 16;
s.quit;

s.waitForBoot {

~dirt = SuperDirt(2, s);
~dirt.loadSoundFiles("/Users/canince/dropbox/whalehouse/99s/*");
s.sync;
~dirt.start(57120, (0,2 .. 7));
s.sync;
"SUPERDIRT LOADED".postln;
StageLimiter.activate;
3.wait;
SuperDirt.default = ~dirt;
TempoClock.default.tempo = 120/60;
1.wait;
s.makeGui;
s.meter;
s.scope;
s.latency = 0.3;
"/Users/canince/documents/git/Siren/deps/SynthDefs/experimentsc.scd".load;
0.2.wait;
"SIREN LOADED".postln;

//Compressor Side Chain
/*~bus1.free;
~bus2.free;
~bus3.free;
~bus1 = Bus.new('audio',5,2);
~bus2 = Bus.new('audio',6,2);
~bus3 = Bus.new('audio',7,2);
~dirt.orbits[4].outBus = ~bus1; // play into that bus.
~dirt.orbits[0].outBus = ~bus2; // play into that bus.
~dirt.orbits[1].outBus = ~bus3; // play into that bus.
b= Ndef(\b, {
var control = InBus.ar(~dirt.orbits[2].dryBus, 2).sum;
var dirt = InBus.ar(~bus1);
Compander.ar(dirt, control, thresh:0.03, slopeBelow:1, slopeAbove: 0.1, clampTime:0.002, relaxTime:0.05)
});
b.playN(
outs:[8,9]
);
a= Ndef(\a, {
var control = InBus.ar(~dirt.orbits[2].dryBus, 2).sum;
var dirt = InBus.ar(~bus2);
Compander.ar(dirt, control, thresh:0.04, slopeBelow:1, slopeAbove: 0.1, clampTime:0.02, relaxTime:0.1)
});
a.playN(
outs:[0,1]
);
c= Ndef(\c, {
var control = InBus.ar(~dirt.orbits[2].dryBus, 2).sum;
var dirt = InBus.ar(~bus3);
Compander.ar(dirt, control, thresh:0.04, slopeBelow:1, slopeAbove: 0.1, clampTime:0.02, relaxTime:0.1)
});
c.playN(
outs:[2,3]
);*/
/*~bus.free;
~bus = Bus.audio(s, numChannels:2); // assuming stereo, expand if needed
~dirt.orbits[0].outBus = ~bus; // play into that bus.
Ndef(\x, {
var control = InBus.ar(~dirt.orbits[1].dryBus, 2).sum;
var dirt = InBus.ar(~bus, 2);
Compander.ar(dirt, control, thresh:0.01, slopeBelow:1, slopeAbove: 0.1, clampTime:0.02, relaxTime:0.1)
}).play;
};*/
};
SuperDirt.start;
}
)
Loading

0 comments on commit 9fc45ac

Please sign in to comment.