protected virtual void Awake() { try { HelperNoteLabel.Init(); //MidiPlayerGlobal.Init(); audiosources = new List <AudioSource>(); } catch (System.Exception ex) { MidiPlayerGlobal.ErrorDetail(ex); } }
void Awake() { //Debug.Log("Awake InfinityMusic"); HelperNoteLabel.Init(); // Event set in Inspector //if (MidiPlayerGlobal.OnEventPresetLoaded != null) // MidiPlayerGlobal.OnEventPresetLoaded.AddListener(() => EndLoadingSF()); instance = this; LastDateTick = DateTime.Now; ScaleDefinition.Init(); HelperNoteLabel.Init(); HelperNoteRatio.Init(); }
private void LogInfoSample(MidiNote note, ImSample sample, string info = null) { //TimeSpan playtime = TimeSpan.Zero; //if (miditoplay != null) playtime = miditoplay.CurrentMidiTime(); //string time = string.Format("[{0:00}:{1:00}:{2:00}:{3:000}]", playtime.Hours, playtime.Minutes, playtime.Seconds, playtime.Milliseconds); string time = ""; if (sample != null) #if DEBUGPITCHNOTE { Debug.Log(string.Format("{0} C:{1,2} P:{2,3:000} D:{3} Note:{4,3:000} OriginalPitch:{5} PitchCorrection:{6} FineTune:{7} CoarseTune:{8} Duration:{9,4} sec. Velocity:{10} Wave:{11}", time, note.Chanel, note.Patch, note.Drum, note.Midi, sample.OriginalPitch, sample.PitchCorrection, sample.FineTune, sample.CoarseTune, Math.Round(note.Duration / 1000d, 2), note.Velocity, sample.WaveFile)); } #else { Debug.Log(string.Format("{0} C:{1,2} P:{2,3:000} D:{3} Note:{4,3:000} {5,-3} Duration:{6,4} sec. Velocity:{7} Pan:{8} Wave:{9}", time, note.Channel, note.Patch, note.Drum, note.Midi, HelperNoteLabel.LabelFromMidi(note.Midi), Math.Round(note.Duration / 1000d, 2), note.Velocity, sample.Pan, sample.WaveFile)); }