<commit_before>import { Loop, LoopOptions } from "./Loop";
import { PatternGenerator, PatternName } from "./PatternGenerator";
import { ToneEventCallback } from "./ToneEvent";
import { optionsFromArguments } from "../core/util/Defaults";
import { Seconds } from "../core/type/Units";
import { noOp } from "../core/util/Interface";

export interface PatternOptions<ValueType> extends LoopOptions {
	pattern: PatternName;
	values: ValueType[];
	callback: (time: Seconds, value?: ValueType) => void;
}

/**
 * Pattern arpeggiates between the given notes
 * in a number of patterns. 
 * @example
 * import { Pattern } from "tone";
 * const pattern = new Pattern((time, note) => {
 * 	// the order of the notes passed in depends on the pattern
 * }, ["C2", "D4", "E5", "A6"], "upDown");
 */
export class Pattern<ValueType> extends Loop<PatternOptions<ValueType>> {

	readonly name: string = "Pattern";
	
	/**
	 * The pattern generator function
	 */
	private _pattern: Iterator<ValueType>;

	/**
	 * The current value
	 */
	private _value?: ValueType;

	/**
	 * Hold the pattern type
	 */
	private _type: PatternName;
<commit_msg>adding the category<commit_after>import { Loop, LoopOptions } from "./Loop";
import { PatternGenerator, PatternName } from "./PatternGenerator";
import { ToneEventCallback } from "./ToneEvent";
import { optionsFromArguments } from "../core/util/Defaults";
import { Seconds } from "../core/type/Units";
import { noOp } from "../core/util/Interface";

export interface PatternOptions<ValueType> extends LoopOptions {
	pattern: PatternName;
	values: ValueType[];
	callback: (time: Seconds, value?: ValueType) => void;
}

/**
 * Pattern arpeggiates between the given notes
 * in a number of patterns. 
 * @example
 * import { Pattern } from "tone";
 * const pattern = new Pattern((time, note) => {
 * 	// the order of the notes passed in depends on the pattern
 * }, ["C2", "D4", "E5", "A6"], "upDown");
 * @category Event
 */
export class Pattern<ValueType> extends Loop<PatternOptions<ValueType>> {

	readonly name: string = "Pattern";
	
	/**
	 * The pattern generator function
	 */
	private _pattern: Iterator<ValueType>;

	/**
	 * The current value
	 */
	private _value?: ValueType;

	/**
	 * Hold the pattern type
	 */
	private _type: PatternName;

{'fraction_non_alphanumeric': 0.14518257809062912, 'fraction_numerical': 0.0035195776506819184, 'mean_word_length': 4.087248322147651, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2090800', 'n_tokens_mistral': 686, 'n_tokens_neox': 651, 'n_words': 218}