public void PlayNote(EntityAgent byEntity, EnumPitch pitch) { api.World.PlaySoundAt(new AssetLocation(Code.Domain + ":sounds/instrument/" + instrument), byEntity, null, GetNotePitch(pitch)); }
public void SetNote(EntityAgent byEntity, EnumPitch pitch) { byEntity.WatchedAttributes.SetInt("noteplayed", (int)pitch); }
public float GetNotePitch(EnumPitch pitch) { return((float)Math.Pow(2.0, noteValues[(int)pitch] * 1.0 / 12.0)); }