Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| class-rhythmpattern [2022/03/19 04:13] – renick | class-rhythmpattern [2023/10/05 23:05] (current) – steve.wang | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== class: RhythmPattern ====== | ====== class: RhythmPattern ====== | ||
| - | ===== Description ===== | + | < |
| + | ### RhythmPattern | ||
| A RhythmPattern is a set of parameters bundled as an object which is used to create a rhythm pattern and mask pattern for a particular Player. | A RhythmPattern is a set of parameters bundled as an object which is used to create a rhythm pattern and mask pattern for a particular Player. | ||
| - | ===== Constructor ===== | + | #### Methods |
| + | ##### constructor | ||
| + | String -> Number -> [Number ...] -> [Boolean] -> Object | ||
| - | ===== Static Properties ===== | + | Creates the RhythmPattern |
| + | ##### Syntax | ||
| + | ``` | ||
| + | new RhythmPattern(n, | ||
| + | ``` | ||
| - | ===== Static Methods ===== | + | ##### Parameters |
| + | ###### n | ||
| + | Name of the rhythmPattern. | ||
| + | ###### l | ||
| + | Length of the rhythmPattern | ||
| + | ###### i | ||
| + | A number array filled with the booleans " | ||
| - | ===== Instance Properties ===== | + | ##### Examples |
| + | ``` | ||
| + | let testR = new RhythmPattern(' | ||
| + | ``` | ||
| - | ===== Instance Methods ===== | + | --- |
| - | ===== Examples ===== | + | --- |
| + | ##### addToPlayer | ||
| + | MusicalEnvironment -> String -> | ||
| + | Adds this RhythmPattern to a player. | ||
| + | ##### Syntax | ||
| + | ``` | ||
| + | testR.addToPlayer(env, | ||
| + | ``` | ||
| + | |||
| + | ##### Parameters | ||
| + | ###### env | ||
| + | MusicalEnvironment | ||
| + | ###### playerName | ||
| + | Name of the player to add to. | ||
| + | |||
| + | ##### Examples | ||
| + | ``` | ||
| + | testR.addToPlayer(e, | ||
| + | ``` | ||
| + | |||
| + | --- | ||
| + | |||
| + | --- | ||
| + | ##### add | ||
| + | MusicalEnvironment -> String -> | ||
| + | |||
| + | Adds to MusicalEnvironment but does not add to a player. | ||
| + | ##### Syntax | ||
| + | ``` | ||
| + | testR.add(env, | ||
| + | ``` | ||
| + | |||
| + | ##### Parameters | ||
| + | ###### env | ||
| + | MusicalEnvironment | ||
| + | ###### playerName | ||
| + | Name of the player to add to. | ||
| + | |||
| + | ##### Examples | ||
| + | ``` | ||
| + | testR.add(e, | ||
| + | ``` | ||
| + | |||
| + | --- | ||
| + | |||
| + | --- | ||
| + | </ | ||