soundvision/UnityProject/Assets/Scripts/PdConnection/MidiClockCounter.cs
2019-10-27 11:21:33 +01:00

21 lines
399 B
C#

using UnityEngine;
using UnityEngine.UI;
public class MidiClockCounter : MonoBehaviour
{
[SerializeField] private Text counter;
private int count_ = 0;
public void onClockReceived()
{
count_++;
var tick = count_ % 24;
var beat = count_ / 24;
var measure = beat / 4;
counter.text = (measure+1) + ":" + (beat%4+1) + ":" + tick;
}
}