ITimeSpan conversion to float or int #291
-
Docs: https://melanchall.github.io/drywetmidi/api/Melanchall.DryWetMidi.Interaction.TimeConverter.html So I'm trying to use MIDI ticks to keep my scripts in sync with audio. (if there is a better way to do this please let me know). So I'd like to convert ITimeSpan to a float or int. What I'm trying to do:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi,
What the type Please don't force me to pull the information from you. I have no time for this. Thanks, |
Beta Was this translation helpful? Give feedback.
Sorry if I wasn't clear what I'm trying to do. There is surprisingly little resources for this sort of thing so I appreciate what you've done here. I ended up just converting it to a string and then to a number. You're quite the one-man-band.
private float convertToFloat(ITimeSpan timeSpan){
return Int32.Parse(Regex.Match(timeSpan.ToString(), @"\d+").Value);
}