musikinformatik / SuperDirt

Tidal Audio Engine
GNU General Public License v2.0
525 stars 76 forks source link

MIDI bug with Tidalcycle chords #178

Open ovitus opened 4 years ago

ovitus commented 4 years ago

So I'm trying out some chord progression stuff with:

d1 $ struct "t(8,16)" $ n ("c3 d3 e3" |+ "<'maj>") # "midi" # chan 2

but that plays notes 2 octaves down for some reason, so to compensate I do:

do
all $ (+ note 24)
d1 $ struct "t(8,16)" $ n ("c3 d3 e3" |+ "<'maj>") # "midi" # chan 2

and that's what breaks things. I get just repeated c5 notes with that last one and afterwards until I restart Tidal.

telephon commented 4 years ago

Currently, the midi note value is derived from the freq value via cpsmidi in DirtEventTypes:

~midinote = (freq.cpsmidi).round(1).asInteger;

The freq value is calculated as follows:

~midinote = #{ ~note ? ~n + (~octave * 12) };
~freq = #{ ~midinote.value.midicps };

do you see if that is consistent with what you do?