The MIDI Forum

  1. Max Dobroselsky
  2. MIDI Software
  3. Monday, 11 June 2018
  4.  Subscribe via email
DryWetMIDI 3.0.0 has been released.

New features

  • Added tools to perform complex tasks. Please read Tools section of the library Wiki to learn more and check Melanchall.DryWetMidi.Tools namespace. These tools are notes/chords splitter, quantizer, randomizer.
  • Added music theory API. Check Melanchall.DryWetMidi.MusicTheory namespace. Also NoteDefinition, IntervalDefinition and OctaveDefinition classes were renamed to Note, Interval and Octave respectively and moved to this new namespace.
  • Added General MIDI Level 1/2 support API. Check Melanchall.DryWetMidi.Standards namespace.
  • Added SetProgram method to PatternBuilder class. This method can be used in conjunction with the new GM 1/2 support API mentioned above.
  • Added AddNotes, AddChords and AddTimedEvents methods to TimedEventsManagingUtilities, NotesManagingUtilities and ChordsManagingUtilities classes respectively.
  • Added ToFile and ToTrackChunk methods to TimedEventsManagingUtilities, NotesManagingUtilities and ChordsManagingUtilities classes respectively.
  • Added Clone method to Note, Chord and TimedEvent classes.
  • Added TimeAs and LengthAs non-generic methods where the desired type of result should be passed as an argument of the TimeSpanType type. Added non-generic versions of methods inside TimeConverter and LengthConverter classes that take TimeSpanType too.
  • Implemented IComparable, IComparable<T> and IEquatable<T> on time span classes.
  • Added MakeNotes method to the NotesManagingUtilities class which iterates through the specified collection of TimedEvent returning Note for Note On/Note Off events pairs and original TimedEvent for all other events.

Minor changes

  • Time and length conversions between different representations were significantly speeded up.
  • Eliminated unnecessary resorting in ValueLine.Values getter.
  • Eliminated reordering in GetNotes, GetChords and GetTimedEvents methods.
  • FourBitNumber and SevenBitNumber moved to the Melanchall.DryWetMidi.Common namespace.
References
  1. https://github.com/melanchall/drywetmidi
Comment
There are no comments made yet.
nazim Accepted Answer Pending Moderation
0
Votes
Undo
You can take a look at other .NET libraries that provide MIDI file parsing. For example, with DryWetMIDI you can get all notes contained in a MIDI file with this code:

MidiFile file = MidiFile.Read("Great Song.mid";);
IEnumerable<Note> notes = file.GetNotes();
Note has Time and Length properties. Units of values returned by these properties defined by the time division of a MIDI file. But you can get time and length of a note in more understandable format. For hours, minutes, seconds you can write:

TempoMap tempoMap = file.GetTempoMap();
MetricTimeSpan metricTime = note.TimeAs<MetricTimeSpan>(tempoMap);
MetricTimeSpan metricLength = note.LengthAs<MetricTimeSpan>(tempoMap);
Using TimeAs and LengthAs methods you don't need to do any calculations by yourself. Instance of MetricTimeSpan can be implicitly casted to TimeSpan.
Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.