gsapi.GSStyles¶
gsapi.GSStyles.GSBaseStyle module¶
-
class
gsapi.GSStyles.GSBaseStyle.
GSBaseStyle
[source]¶ Base class for defining a style. Such class needs to provide following functions:
- generateStyle(self, PatternClasses)
- generatePattern(self, seed=None)
- getDistanceFromStyle(self, Pattern)
- getClosestPattern(self, Pattern, seed=None)
- getInterpolated(self, PatternA, PatternB, distanceFromA, seed=None)
- getInternalState(self)
- loadInternalState(self, internalStateDict)
- isBuilt(self)
-
generatePattern
(seed=None)[source]¶ Generates a new random pattern using seed if not “None” (Ideally same seeds should lead to same patterns.)
-
getDistanceFromStyle
(Pattern)[source]¶ Returns a normalized value representing the “styliness” of a pattern 1 being farthest from style.
gsapi.GSStyles.GSDBStyle module¶
-
class
gsapi.GSStyles.GSDBStyle.
GSDBStyle
(generatePatternOrdering='indexed')[source]¶ Bases:
gsapi.GSStyles.GSBaseStyle.GSBaseStyle
A database based style. It generates GSPatterns from existing patterns
Parameters: generatePatternOrdering – {‘indexed’, ‘increasing’, ‘random’}. Defines the generatePattern behaviour
gsapi.GSStyles.GSMarkovStyle module¶
-
class
gsapi.GSStyles.GSMarkovStyle.
GSMarkovStyle
(order, numSteps, loopDuration)[source]¶ Bases:
gsapi.GSStyles.GSBaseStyle.GSBaseStyle
Computes a style based on markov chains.
Parameters: - order – order used for markov computation
- numSteps – number of steps to consider (binarization of pattern)
-
order
¶ order used for markov computation
-
numSteps
¶ number of steps to consider (binarization of pattern)
-
generateStyle
(PatternList)[source]¶ Generates a style based on list of GSPatterns.
Parameters: PatternList – list of GSPatterns