lucblender / lx-euclid-001

A Euclidean Rhythm eurorack module with circular screen and circular capacitive touch interface
1 stars 0 forks source link

Create presets and initial rhythm #38

Closed lucblender closed 2 months ago

lucblender commented 2 months ago

1.5.0_pre

Describe the bug or feature enhancement Create the first presets and initial rhythm displayed when the module boot.

A rhythm can be created with the EuclideanRhythmclass with the following constructor:

def __init__(self, beats, pulses, offset, pulses_probability, prescaler_index=0, gate_length_ms=T_GATE_ON_MS, randomize_gate_length=False, algo_index=0):

The current code to create the preset and initial rhythm is:

self.euclidean_rhythms = []
self.euclidean_rhythms.append(EuclideanRhythm(8, 4, 0, 100))
self.euclidean_rhythms.append(EuclideanRhythm(8, 2, 0, 100))
self.euclidean_rhythms.append(EuclideanRhythm(4, 3, 0, 100))
self.euclidean_rhythms.append(EuclideanRhythm(4, 2, 0, 100))

self.presets = []
self.presets.append([EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(
    8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100)])
self.presets.append([EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(
    8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100)])
self.presets.append([EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(
    8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100)])
self.presets.append([EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(
    8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100)])
self.presets.append([EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(
    8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100)])
self.presets.append([EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(
    8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100)])
self.presets.append([EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(
    8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100)])
self.presets.append([EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(
    8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100), EuclideanRhythmParameters(8, 4, 0, 100)])

Note: on the current code, only length, pulse, offset and probability are set while other parameters are set to their default value. a rhythm can be created with additonal parameters. For example we can set the algorithm index like so:

EuclideanRhythm(8, 4, 0, 100, algo_index = 1)

Other parameters value:

prescaler_index can take the following values with default value of 0:

gate_length_mscan take the gate length value from 10 to 250ms, default 10ms

randomize_gate_length can be set to True or False, set randomization on output gate length, default False

algo_indexcan take the following values, default value of 0:

lucblender commented 2 months ago

@ArthurGibert, you can propose value for the rhythm in comment to this issue

lucblender commented 2 months ago

let's do 16:4:0, 8:1:4, 4:1:2 9:5:0 (lenght:beat:rotation) for the preset

lucblender commented 2 months ago

In release v1.10.0