protected void MakeSong() { SongComposer composer = new SongComposer(); IsFanfare = false; // TODO - CHANGE FOR TESTING // ShortestNote = 0.0625f; ShortestNote = 0.5f - (LevelNumber * 0.0035f); CurrentSong = composer .ComposeSong(CurrentNote.Name, CurrentNote.Octave, ShortestNote); CurrentSong.TotalTime += 1; SongPlayer .SetSong(CurrentSong); SongPlayer .StartPlaying(); SetSingerState(true); OnSongStarted(); }
protected override void Awake() { base .Awake(); /* * var chooser = new ProbabilityChooser<int>(); * chooser.AddItem(0, 0.1f); * chooser.AddItem(1, 0.2f); * chooser.AddItem(2, 0.3f); * chooser.AddItem(3, 0.4f); * * int[] chosens = new int[4]; * * for(int i = 0;i < 10000;i++) * { * int chosen = chooser * .ChooseItem(); * * chosens[chosen]++; * } * * * Debug * .Log($"0 had probability of 0.1 and was chosen {chosens[0]} times"); * * * Debug * .Log($"1 had probability of 0.2 and was chosen {chosens[1]} times"); * * * Debug * .Log($"2 had probability of 0.3 and was chosen {chosens[2]} times"); * * * Debug * .Log($"3 had probability of 0.4 and was chosen {chosens[3]} times"); */ LevelNumber = 0; BackgroundSprites = Resources .LoadAll <Sprite>("Images/UI/beachsunset"); SongComposer composer = new SongComposer(); SongPlayer.SongFinished += SongPlayer_SongFinished; CurrentNote = new MusicalNote("C", 5, NoteTimbre.Ah); SetSingerState(false); StartLevel(); }
protected override void Awake() { base .Awake(); SongComposer composer = new SongComposer(); float shortestNote = 0.25f; var song = composer .ComposeSong("C", 4, shortestNote); SongPlayer .SetSong(song); SongPlayer .StartPlaying(); }
public void StartLevel() { RoundOverPanel .SetActive(false); SongComposer composer = new SongComposer(); IsFanfare = true; var song = composer .ComposeFanfare(CurrentNote.Name, CurrentNote.Octave); SongPlayer .SetSong(song); SongPlayer .StartPlaying(); UpdateUI(); OnLevelStarted(); }