gsapi.GSPatternTransformers

gsapi.GSPatternTransformers.GSBasePatternTransformer module

class gsapi.GSPatternTransformers.GSBasePatternTransformer.GSBasePatternTransformer[source]

Base class for defining a transform algorithm.

such class needs to provide the following functions:
  • configure: configure current transformer based on implementation

specific parameters passed in the dict argument - transformPattern: return a transformed version of GSPattern

configure(paramDict)[source]

Configure current transformer based on implementation specific parameters passed in paramDict argument.

Parameters:paramDict – a dictionary with configuration values.
transformPattern(pattern)[source]

Return a transformed GSPattern

Parameters:pattern – the GSPattern to be transformed.

gsapi.GSPatternTransformers.AgnosticDensity module

class gsapi.GSPatternTransformers.AgnosticDensity.AgnosticDensity(mode='random', numSteps=32)[source]

Bases: gsapi.GSPatternTransformers.GSBasePatternTransformer.GSBasePatternTransformer

Agnostic transformation algorithm.

Parameters:
  • numSteps – number of steps to consider
  • mode – [‘random’,’syncopation’] : algorithm used
globalDensity

float (0..2) the desired global density,

(0 = empty pattern, 1 = origin pattern, 2 = pattern with all events)
individualDensities

dict[tag]=density : a per Tag density, densities should be in the same range as globalDensity

mode

[‘random’,’syncopation’] : algorithm used

originPattern

the origin pattern, e.g : the one given if all densities are equals to 1

configure(paramDict)[source]
transformPattern(pattern, paramDict)[source]
updateNormalizedDensities(normalizedDict)[source]
addEventForTag(tag, targetDensity)[source]
removeEventForTag(tag, targetDensity)[source]
createCurrentState()[source]
resetDensities()[source]
buildDensityMap(pattern)[source]