SkillAgentSearch skills...

Celody

Celody is an open source, generative music system that uses the Web Audio Api and Pizzicato.js to create infinite music streams. Every stream is seeded with a programmable file that contains the ingredients for the music. Streams can be forked, merged, modified and published.

Install / Use

/learn @crypto5000/Celody

README

Celody

Celody is an open source, generative music system that uses the Web Audio Api and Pizzicato.js to create infinite music streams. Every stream is seeded with a programmable file that contains the ingredients for the music. Streams can be forked, merged, modified and published. Celody can also be self-hosted and run in a decentralized P2P manner - where streams are published to a decentralized storage mechanism like The Tangle.

Hear an Infinite Stream

Website Preview

Play Infinite Stream at Celody.com

Infinite Streams

An infinite stream is programmed by inputing a Celody stream file (a .json object) into the Celody core code. The stream file is analogous to a person's DNA and the Celody core code is analogous to a person's environment. Once the stream file is set, the final output is dynamically generated by the core code (which includes pseudorandomness that varies the music output). The core code is a simple javascript module that generates the music in real-time and runs only in the client's browser.

Celody Stream Files

Every stream file has editable parameters that affect the generated real-time music. You can change almost everything: from adding or deleting instruments; to the volume and timing of individual notes; to adding effect filters; to changing the tempo of the stream; to defining the music's density; to much more. See the "Modifying a Stream File" section below for further details.

Forks

A fork copies the Celody stream file from an existing stream. To fork, click on the "fork" button on the Celody website:

View Fork

Fork Stream at Celody.com

When you fork a stream, all the sound determining parameters get copied exactly. This includes the tempo, default play speed, base unit, bars, background level, dynamics, density, variety, spread, spice and instruments. For non-sound determining parameters, forks either clear the value or create a placeholder. This includes the stream name, artist, create date, prior fork data, prior merge data, tokens, and token addresses.

Merges

A merge combines information from 2 streams. It takes non-conflicting instruments from Celody stream B and copies it into the file from Celody stream A. The resulting stream file is a combination of both Stream A and Stream B. In comparison to a fork, which starts as an exact sound clone of a stream file, a merge starts as a different soundscape from either of the stream parents. To merge, click on the "merge" button on the Celody website. You will be prompted for the name of the second stream that you want to merge into the first stream:

View Merge

Merge Stream at Celody.com

Modifying a Stream File

If you fork or merge a stream file, you get a new file that you can further edit (and then publish). This provides you with a starting point for creating your own infinite streams. To understand how to control your stream's final shape, this section will walk through a "Hello World" stream file - discussing each key-value pair in the json object one by one.

Hello World Stream File:

{    
    "streamName": "Hello World",
    "artist": "Artist Name",                
    "createDate": "05-23-2019",    
    "tokens": ["IOTA","IOTA"],
    "tokenAddresses": ["99999999999...","ABC99999999..."],    
    "playSpeed": 1.0,
    "module": "core",
    "tempo": 100,
    "bars": 8,
    "beatsPerBar": 4,    
    "baseUnit": 128,
    "backgroundLevel": 0.85,
    "dynamics": 0.2,
    "density": 0.6,
    "variety": 0.3,             
    "spread": 0.4,                    
    "spice": 0.3,
    "instruments": {                                                            
        "0": [
            {
                "instrument": "drum",
                "type": ["primary"],
                "color": "rgb(255,123,255)",
                "fileSource": ["https://celody.com/sounds/drum/kick/k12d.mp3","https://celody.com/sounds/drum/kick/k13m.mp3",],
                "basePhrase": [0,1,0],
                "baseStart": [0.0010,0.5000,0.8750],                     
                "volumeStart": [0.5,0.6,0.5],
                "fxFla": [0,0,0],                      
                "fxLow": [0,0,0],                      
                "fxAtt": [0.4,0.4,0.4],                     
                "fxRel": [0.5,0.5,0.5],                     
                "fxPan": [0.65,0.65,0.65]
            }                            
        ],
        "1": [
            {
                "instrument": "bell",
                "type": ["primary"],
                "color": "rgb(0,123,255)",
                "fileSource": ["https://celody.com/sounds/bell/a1.mp3"],                                                
                "basePhrase": [0,0],                                
                "baseStart": [0.25,0.75],                     
                "volumeStart": [0.5,0.6],                     
                "fxFla": [0.0,0.0],
                "fxLow": [0.4,0.4],                                
                "fxAtt": [0.4,0.4],                     
                "fxRel": [0.5,0.5],                     
                "fxPan": [0.4,0.4]                                                     
            }
        ]        
    }
}    

Basic Structure

The stream file contains 2 basic sections: 1) the metadata settings for the stream (this includes the streamName up to the spice parameter); 2) the instruments (which contains details on the individual sounds). The Hello World steam only shows 2 instruments, but you can add as many as you want. To add another, you'd create an object "2" under the "1" object inside of the instruments object.

NOTE: Streams published to Celody.com include a few more key-value pairs in the metadata section. Mostly, these are just uuids to be able to uniquely identify the stream during search results. If you publish to the Tangle, you do not need these uuid values.

streamName (Type: String, Required, Min Length 1, Max Length 250)

The streamName is the display name for the infinite stream. This value will be displayed to the listener in the UI at celody.com.

artist (Type: String, Required, Min Length 1, Max Length 250)

The artist is the creator of the stream. It can be a pseudonymous user name. The artist is less prominent than the streamName on celody.com.

createDate (Type: String, mm-dd-yyyy format, Required, Min Length 10, Max Length 10)

The date the stream is published to either celody.com or the Tangle.

tokens (Type: Array) and tokenAddresses (Type: Array)

An artist can leave a cryptocurrency donation address for financial appreciation. The tokens array should match the address on a slot for slot basis. In other words, both arrays should have the same length. In the Hello World stream, the artist has left 2 IOTA donation addresses.

playSpeed (Type: Number, Required, Recommended 1.0, Min 0.5, Max 2.0)

The playSpeed parameter is a direct manipulation of the play rate and pitch for the audio. The default value is 1.0 - which plays all the audio at its normal speed. A value above 1.0 will play the audio quicker - which both increases the pitch of the audio and decreases the duration of the audio. A value below 1.0 will increase the audio duration and decrease the pitch.

Note: changing playSpeed does NOT hold pitch constant - as granular synthesis and phase-shift techniques do.

module (Type: String, Defaults to "core")

The module field specifies the logic used to generate the randomness. The current modules are all found under the src folder. They are "timeofday", "weekend", "location", "speed", "airplane", "compass", "core", "tight", "nutzo", "slowdeep", "chipmunk", "downhill", "uphill", and "seesaw". If you don't specify a module, it defaults to the core. Some modules require access to the geolocation/gps api of the device.

tempo (Type: Number, Required, Recommended between 30 and 150)

Every stream has a pulse in beats per minute called "tempo". The pulse is an equilibrium tempo that forms a backbone to the stream. A faster tempo is associated with "focus"-based music. A slower tempo is associated with "relaxation"-based music.

bars (Type: Number, Required, Recommended 8)

The Celody core code works on a loop. With each iteration of the loop, the core code generates a unique music stream based on the stream file parameters. The time length of the loop is determined by the number of bars and the tempo. More bars creates a longer loop canvas. And a faster tempo will create a shorter loop time.

beatsPerBar (Type: Number, Required, Recommended 4) and baseUnit (Type: Number, Required, Recommended 128)

The beatsPerBar is a metric that relates to the music signature. 4 refers to quarter notes. 8 refers to eighth notes. 16 refers to sixteenth notes. 64 refers to sixty-fourth notes. All these different beatsPerBar can used to translate music in standard notation form into the celody stream file format.

The baseUnit is the smallest subdivision of a single bar. 128 means 128th notes and is the recommended value. The baseUnit can be used as an quantized offset or to perform a swing beat. The current core code doesn't implement this feature, but it has been used in previous versions.

Adding Secondary Sounds to Hello World

The current Hello World stream only has primary sounds. For simplicity, any secondary sounds were excluded. Secondary sounds are shadow instruments that randomly mix to add variety. For example, there could be a secondary drum object

View on GitHub
GitHub Stars26
CategoryDevelopment
Updated27d ago
Forks5

Languages

JavaScript

Security Score

95/100

Audited on Mar 9, 2026

No findings