<commit_before>define(["../core/Tone", "../signal/Signal", "../source/Source",
	"../core/Transport", "../source/OscillatorNode"],
function(Tone){

	"use strict";

	/**
	 *  @class Tone.Oscillator supports a number of features including
	 *         phase rotation, multiple oscillator types (see Tone.Oscillator.type),
	 *         and Transport syncing (see Tone.Oscillator.syncFrequency).
	 *
	 *  @constructor
	 *  @extends {Tone.Source}
	 *  @param {Frequency} [frequency] Starting frequency
	 *  @param {string} [type] The oscillator type. Read more about type below.
	 *  @example
	 * //make and start a 440hz sine tone
	 * var osc = new Tone.Oscillator(440, "sine").toMaster().start();
	 */
	Tone.Oscillator = function(){

		var options = Tone.defaults(arguments, ["frequency", "type"], Tone.Oscillator);
		Tone.Source.call(this, options);

		/**
		 *  the main oscillator
		 *  @type {OscillatorNode}
		 *  @private
		 */
		this._oscillator = null;

		/**
		 *  The frequency control.
		 *  @type {Frequency}
		 *  @signal
		 */
		this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);

		/**
		 *  The detune control signal.
		 *  @type {Cents}
		 *  @signal
		 */
		this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);

		/**
		 *  the periodic wave
		 *  @type {PeriodicWave}
		 *  @private
		 */
		this._wave = null;

		/**
		 *  The partials of the oscillator
		 *  @type {Array}
		 *  @private
		 */
		this._partials = options.partials;

		/**
		 *  The number of partials to limit or extend the periodic wave by
		 *  @type {Number}
		 *  @private
		 */
		this._partialCount = Tone.defaultArg(options.partialCount, 0);

		/**
		 *  the phase of the oscillator
		 *  between 0 - 360
		 *  @type {number}
		 *  @private
		 */
		this._phase = options.phase;

		/**
		 *  the type of the oscillator
		 *  @type {string}
		 *  @private
		 */
		this._type = options.type;

		//setup
		if (options.partialCount){
			this.type = options.type + options.partialCount.toString();	
		} else {
			this.type = options.type;
		}
		this.phase = this._phase;
		this._readOnly(["frequency", "detune"]);
	};

	Tone.extend(Tone.Oscillator, Tone.Source);

	/**
	 *  the default parameters
	 *  @type {Object}
	 */
	Tone.Oscillator.defaults = {
		"type" : "sine",
		"frequency" : 440,
		"detune" : 0,
		"phase" : 0,
		"partials" : [],
	};

	/**
	 *  The Oscillator types
	 *  @enum {String}
	 */
	Tone.Oscillator.Type = {
		Sine : "sine",
		Triangle : "triangle",
		Sawtooth : "sawtooth",
		Square : "square",
		Custom : "custom"
	};

	/**
	 *  start the oscillator
	 *  @param  {Time} [time=now]
	 *  @private
	 */
	Tone.Oscillator.prototype._start = function(time){<commit_msg>making sure that the type is never set to custom+partialCount<commit_after>define(["../core/Tone", "../signal/Signal", "../source/Source",
	"../core/Transport", "../source/OscillatorNode"],
function(Tone){

	"use strict";

	/**
	 *  @class Tone.Oscillator supports a number of features including
	 *         phase rotation, multiple oscillator types (see Tone.Oscillator.type),
	 *         and Transport syncing (see Tone.Oscillator.syncFrequency).
	 *
	 *  @constructor
	 *  @extends {Tone.Source}
	 *  @param {Frequency} [frequency] Starting frequency
	 *  @param {string} [type] The oscillator type. Read more about type below.
	 *  @example
	 * //make and start a 440hz sine tone
	 * var osc = new Tone.Oscillator(440, "sine").toMaster().start();
	 */
	Tone.Oscillator = function(){

		var options = Tone.defaults(arguments, ["frequency", "type"], Tone.Oscillator);
		Tone.Source.call(this, options);

		/**
		 *  the main oscillator
		 *  @type {OscillatorNode}
		 *  @private
		 */
		this._oscillator = null;

		/**
		 *  The frequency control.
		 *  @type {Frequency}
		 *  @signal
		 */
		this.frequency = new Tone.Signal(options.frequency, Tone.Type.Frequency);

		/**
		 *  The detune control signal.
		 *  @type {Cents}
		 *  @signal
		 */
		this.detune = new Tone.Signal(options.detune, Tone.Type.Cents);

		/**
		 *  the periodic wave
		 *  @type {PeriodicWave}
		 *  @private
		 */
		this._wave = null;

		/**
		 *  The partials of the oscillator
		 *  @type {Array}
		 *  @private
		 */
		this._partials = options.partials;

		/**
		 *  The number of partials to limit or extend the periodic wave by
		 *  @type {Number}
		 *  @private
		 */
		this._partialCount = options.partialCount;

		/**
		 *  the phase of the oscillator
		 *  between 0 - 360
		 *  @type {number}
		 *  @private
		 */
		this._phase = options.phase;

		/**
		 *  the type of the oscillator
		 *  @type {string}
		 *  @private
		 */
		this._type = options.type;

		//setup
		if (options.partialCount && options.type !== Tone.Oscillator.Type.Custom){
			this.type = options.type + options.partialCount.toString();	
		} else {
			this.type = options.type;
		}
		this.phase = this._phase;
		this._readOnly(["frequency", "detune"]);
	};

	Tone.extend(Tone.Oscillator, Tone.Source);

	/**
	 *  the default parameters
	 *  @type {Object}
	 */
	Tone.Oscillator.defaults = {
		"type" : "sine",
		"frequency" : 440,
		"detune" : 0,
		"phase" : 0,
		"partials" : [],
		"partialCount" : 0
	};

	/**
	 *  The Oscillator types
	 *  @enum {String}
	 */
	Tone.Oscillator.Type = {
		Sine : "sine",
		Triangle : "triangle",
		Sawtooth : "sawtooth",
		Square : "square",
		Custom : "custom"
	};

	/**
	 *  start the oscillator
	 *  @param  {Time} [time=now]
	 *  @private
	 */
	Tone.Oscillator.prototype._start = function(time){
{'fraction_non_alphanumeric': 0.15626705475714026, 'fraction_numerical': 0.005821357103874841, 'mean_word_length': 2.7173766058147395, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1519237', 'n_tokens_mistral': 2208, 'n_tokens_neox': 1837, 'n_words': 437}