void PatternWillPlay( PatternSample sampleInfo, int indexInPattern, double dspTime ) { if( _vertexIndex > 7 ) return; StartCoroutine( PlaceVertex( _vertexIndex, sampleInfo.SemiTones, dspTime ) ); _vertexIndex++; }
void OnPAtternWillPlay(PatternSample info, int indexInPattern, double dspTime) { if (indexInPattern == observedPatternIndex) { _lerpFactor = 1f / ( float )(dspTime + ( double )additionalLatency - AudioSettings.dspTime); _lerpVal = 0f; _state = State.LerpIn; } }
void PatternAWillPlay(PatternSample sampleInfo, int indexInPattern, double dspTime) { if (_endOfStreak) //Time to maybe change harmonic state, and in all cases trigger the distorted longer sound { TryChangeChord(); PlayStreakEnd(sampleInfo, dspTime); //we'll use the same pitch shift and sample for the longer sound _endOfStreak = false; } }
void PatternWillPlay(PatternSample sampleInfo, int indexInPattern, double dspTime) { if (_vertexIndex > 7) { return; } StartCoroutine(PlaceVertex(_vertexIndex, sampleInfo.SemiTones, dspTime)); _vertexIndex++; }
void PlayStreakEnd(PatternSample sampleInfo, double dspTime) { _rtSample = new GATRealTimeSample(sampleBank.GetAudioData(sampleInfo.SampleName)); // grab the sample and wrap it in GATRealtimeSample for realtime pitch shifting _rtSample.Pitch = sampleInfo.Pitch; // set it's pitch to be the same as the end of streak pitch _rtSample.PlayScheduledThroughTrack(dspTime, 2); //play through track 2, which is panned to the right and distorted float deltaTime = ( float )(dspTime - AudioSettings.dspTime); particles.transform.localPosition = new Vector3(PARTICLES_X, PARTICLES_Y_FACTOR * sampleInfo.SemiTones, PARTICLES_Z); //Adjust the particle system's y to reflect the pitch's height Invoke("PlayParticles", deltaTime); //Fire at appropriate time }
void PlayStreakEnd( PatternSample sampleInfo, double dspTime ) { _rtSample = new GATRealTimeSample( sampleBank.GetAudioData( sampleInfo.SampleName ) ); // grab the sample and wrap it in GATRealtimeSample for realtime pitch shifting _rtSample.Pitch = sampleInfo.Pitch; // set it's pitch to be the same as the end of streak pitch _rtSample.PlayScheduledThroughTrack( dspTime, 2 ); //play through track 2, which is panned to the right and distorted float deltaTime = ( float )( dspTime - AudioSettings.dspTime ); particles.transform.localPosition = new Vector3( PARTICLES_X, PARTICLES_Y_FACTOR * sampleInfo.SemiTones, PARTICLES_Z ); //Adjust the particle system's y to reflect the pitch's height Invoke( "PlayParticles", deltaTime ); //Fire at appropriate time }
void PatternAWillPlay( PatternSample sampleInfo, int indexInPattern, double dspTime ) { if( _endOfStreak ) //Time to maybe change harmonic state, and in all cases trigger the distorted longer sound { TryChangeChord(); PlayStreakEnd( sampleInfo, dspTime ); //we'll use the same pitch shift and sample for the longer sound _endOfStreak = false; } }
bool DrawSampleInfo(PatternSample info, bool canPreview, int index) { Rect boxRect; bool press = false; bool isEditing = index == _editedSampleIndex; bool shouldCollapse = isEditing; if (isEditing) { GUI.backgroundColor = __editedBoxColor; boxRect = EditorGUILayout.BeginVertical(); GUI.Box(boxRect, "", __boxStyle); GUILayout.Space(5f); } Rect foldRect = EditorGUILayout.BeginHorizontal(); if (canPreview) { GUI.enabled = true; } else { GUI.enabled = false; } GUILayout.Space(20f); GUILayout.Label(index.ToString(), GUILayout.Width(20f)); isEditing = EditorGUI.Foldout(new Rect(foldRect.x + 15f, foldRect.y, 15f, foldRect.height), isEditing, ""); if (shouldCollapse && isEditing == false) { _editedSampleIndex = -1; } GUI.color = __purpleColor; if (GUILayout.Button(info.SampleName, GUILayout.Width(100f))) { press = true; } GUI.color = Color.white; GUI.enabled = true; EditorGUIUtility.labelWidth = 40f; EditorGUIUtility.fieldWidth = 25f; info.SemiTones = EditorGUILayout.FloatField(__transposeContent, info.SemiTones, GUILayout.ExpandWidth(false)); GUILayout.Space(5f); info.Gain = GUILayout.HorizontalSlider(info.Gain, 0f, 2f, GUILayout.Width(100f)); if (GUILayout.Button(info.Gain.ToString("0.00"), GUILayout.Width(35f))) { info.Gain = 1f; } GUILayout.Space(5f); EditorGUILayout.EndHorizontal(); if (isEditing) { if (_editedSampleIndex != index) { _editedSampleIndex = index; _changedSampleIndex = -1; } if (_changedSampleIndex == -1) { _changedSampleIndex = GetIndexOfSample(info.SampleName); } GUILayout.Space(10f); GUILayout.BeginHorizontal(); int cached = _changedSampleIndex; _changedSampleIndex = EditorGUILayout.Popup(_changedSampleIndex, _sampleOptions, GUILayout.Width(100f)); if (_changedSampleIndex != cached) { info.SampleName = _sampleOptions[_changedSampleIndex]; } GUILayout.Space(10f); GUI.color = Color.red; if (GUILayout.Button("Remove", __buttonOptions)) { _pulsedPattern.RemoveSampleAt(index); _samplesInfo = _pulsedPattern.Samples; _changedSampleIndex = -1; _editedSampleIndex = -1; } GUI.color = Color.white; GUILayout.EndHorizontal(); GUILayout.Space(5f); EditorGUILayout.EndVertical(); GUI.backgroundColor = Color.white; } GUILayout.Space(5f); return(press); }