/// <summary> /// Plays the dot connect sound of the 1-index based number of dots in connection /// </summary> /// <param name="dotsInConnection">Dots in connection.</param> public void PlayDotConnectedSound(int dotsInConnection) { #if UNITY_EDITOR _dotSoundConfig.SendValues(); #endif dotsInConnection = PingPongInt(dotsInConnection, _MAX_DOT_SOUND_NOTE); int octaves = (dotsInConnection - 1) / dotProgressionScale.Length; float octaveStart = _DOT_START_FREQ * Mathf.Pow(2, octaves); int scaleNote = (dotsInConnection - 1) % dotProgressionScale.Length; Debug.Log(octaveStart + " " + scaleNote); float freq = octaveStart * dotProgressionScale[scaleNote]; UnityPD.SendFloat("playNote", freq); }
public void SendValues() { UnityPD.SendFloat("setAttack", attack); UnityPD.SendFloat("setSustain", sustain); UnityPD.SendFloat("setDecay", decay); UnityPD.SendFloat("adder-1-vol", adder1Vol); UnityPD.SendFloat("adder-1-control-freq-multiply", adder1FreqMultiply); UnityPD.SendFloat("adder-1-freq-mod-freq", adder1ModFreq); UnityPD.SendFloat("adder-1-freq-mod-amount", adder1ModAmount); UnityPD.SendFloat("adder-2-vol", adder2Vol); UnityPD.SendFloat("adder-2-control-freq-multiply", adder2FreqMultiply); UnityPD.SendFloat("adder-2-freq-mod-freq", adder2ModFreq); UnityPD.SendFloat("adder-2-freq-mod-amount", adder2ModAmount); UnityPD.SendFloat("lop-cutoff", lopCutoff); }