public static float AdjustPitch(AudioClip song, int sampleKey) { int key = KeyFinder.KeyFind(song); Log.Write("the key of song is " + key); //int sampleKey = 21; //GMinor int minMajDiff = (sampleKey % 2 == 0) ? -3 : 3; minMajDiff = ((key % 2) == (sampleKey % 2)) ? 0 : minMajDiff; Log.Write("minMajDiff is " + minMajDiff); int diff = ((int)(key - sampleKey) / 2 + minMajDiff + 24) % 12; float pitch = 1f; if (diff <= 7) { for (int i = 0; i < diff; i++) { pitch *= SEMITONE; } } else { for (int i = 0; i < 12 - diff; i++) { pitch /= SEMITONE; } } return(pitch); }
public void Write_LogLevelGreaterThanConfigured_MessageWritten() { var sink = new FakeLoggingSink(); var logger = new DefaultLogger(sink); DefaultLogger.LogLevel = LogLevel.Info; logger.Write(LogLevel.Warning, "some message"); Assert.That(sink.LastEntry.Message, Is.EqualTo("some message")); }
public void Write_LogLevelLessThanConfigured_NoMessageWritten() { var sink = new FakeLoggingSink(); var logger = new DefaultLogger(sink); DefaultLogger.LogLevel = LogLevel.Warning; logger.Write(LogLevel.Info, "some message"); Assert.That(sink.LastEntry, Is.Null); }
public async UniTask <AudioClip> LoadAudioClipWithWebRequest(string filename, AudioType audioType = AudioType.OGGVORBIS) { Log.Write("LoadAudioClipWithWebRequest Start"); using (UnityWebRequest www = UnityWebRequestMultimedia.GetAudioClip("file://" + filename, audioType)) { await www.SendWebRequest(); // must wait originalClip = clip = DownloadHandlerAudioClip.GetContent(www); } //Log.Write("loadState = " + clip.loadState); //Log.Write("loadType = " + clip.loadType); //Log.Write("Clip Load Success"); return(originalClip); }
// Start is called before the first frame update async void Start() { string customLevelPath = "D:\\ProgramFiles\\Steam\\steamapps\\common\\Beat Saber\\Beat Saber_Data\\CustomLevels\\"; cutEffectPlayer.Init(gameObject); string cutEffectMapPath = customLevelPath + "2a7 (Night of Nights - squeaksies)\\ExpertPlusEffect.dat"; if (forPlay) { await cutEffectPlayer.TryLoadCutEffectMap(cutEffectMapPath); mapPlayer.OnSendNote.AddListener(cutEffectPlayer.Play); } if (forEdit) { await cutEffectPlayer.TryLoadCutEffects(); } string songPath = customLevelPath + "2a7 (Night of Nights - squeaksies)\\Night of Nights (Flowering nights remix).egg"; string mapPath = customLevelPath + "2a7 (Night of Nights - squeaksies)\\ExpertPlus.dat"; bool mapPlayerInited = await mapPlayer.TryInit(songPath, mapPath, gameObject); if (mapPlayerInited) { //if (forEdit) mapPlayer.InitCutEffectMapForEdit(); AdjustTapKey(mapPlayer.AudioManager_Song.GetAudioClip(), cutEffectPlayer); //必要なのはEditのときだけでは? mapPlayer.Play(); } else { Log.Write("mapPlayer is not Inited"); return; } if (pitchController != null) { pitchController.Init(CutEffectPlayer.TAP_NUM, cutEffectPlayer); mapPlayer.OnSendNote.AddListener(pitchController.ShowNote); } }
public static void Write(MvLoggerEventArgs ea, MvLoggerEnumLevel _level) { ea.Level = _level; DefaultLogger.Write(ea, _level); }
public static void Write(MvLoggerEventArgs ea) { DefaultLogger.Write(ea); }
public static void Warn(MvLoggerEventArgs ea) { DefaultLogger.Write(ea, MvLoggerEnumLevel.Warn); }
public static void Warn(string msg, params object[] args) { DefaultLogger.Write(string.Format(msg, args), MvLoggerEnumLevel.Warn); }
public static void Verbose(MvLoggerEventArgs ea) { DefaultLogger.Write(ea, MvLoggerEnumLevel.Verbose); }
public static void Info(MvLoggerEventArgs ea) { DefaultLogger.Write(ea, MvLoggerEnumLevel.Info); }
public static void Fatal(MvLoggerEventArgs ea) { DefaultLogger.Write(ea, MvLoggerEnumLevel.Fatal); }
public static void Error(MvLoggerEventArgs ea) { DefaultLogger.Write(ea, MvLoggerEnumLevel.Error); }
public static void Debug(MvLoggerEventArgs ea) { DefaultLogger.Write(ea, MvLoggerEnumLevel.Debug); }
public static void Verbose(string msg, params object[] args) { DefaultLogger.Write(string.Format(msg, args), MvaLoggerEnumLevel.Verbose); }
/// <summary> /// Event handler for the game exiting. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> protected override void OnExiting(object sender, System.EventArgs args) { DefaultLogger.Write(MessageType.Information, "Shutting engine down normally ....", 1); DefaultLogger.Close(); base.OnExiting(sender, args); }