Ejemplo n.º 1
0
        private void SetTempo(string text)
        {
            Tempo newTempo = new Tempo();
            var   result   = Regex.Match(text, @"^(\d+)=(\d+)$");

            newTempo.noteDuration = int.Parse(result.Groups[1].Value);
            newTempo.bpm          = int.Parse(result.Groups[2].Value);
            noteBuilder.SetTempo(newTempo);
        }
Ejemplo n.º 2
0
        private void handleTempo(MetaMessage metaMessage)
        {
            byte[] tempoBytes = metaMessage.GetBytes();
            int    tempo      = (tempoBytes[0] & 0xff) << 16 | (tempoBytes[1] & 0xff) << 8 | (tempoBytes[2] & 0xff);
            var    _bpm       = 60000000 / tempo;

            noteBuilder.SetTempo(new Tempo()
            {
                bpm = _bpm
            });
        }