Skip to content

Releases: melanchall/drywetmidi

DryWetMIDI 4.0.0

30 Jan 13:39
Compare
Choose a tag to compare

Devices API

DryWetMIDI 4.0.0 introduces API for working with MIDI devices. Now it is possible to send MIDI data to and receive it from a MIDI device. Also added methods to play MIDI files and capture incoming events from a device.

Read about working with devices on the library Wiki:

New features

  • Added GetTimedEventsAndNotes and GetNotesAndRests extension methods for TrackChunk and MidiFile.
  • Added conversion notes to/from CSV.
  • Added Parse/TryParse methods to FourBitNumber and SevenBitNumber.
  • Added ShiftEvents extension methods for TrackChunk and MidiFile which shifts MIDI events inside MidiFile by the specified distance.
  • Implemented resizing notes by ratio.
  • Added Resize extension method for MidiFile which resizes MidiFile to the specified length or by specified ratio (for example, 0.5 means shrinking to the half of the original length).
  • Implemented splitting notes/chords at distance.
  • Added GetChords extension method for IEnumerable<Note> which makes chords from notes collection.
  • Added new MIDI events classes: system common and system real-time.

Small changes and bug fixes

  • Fixed last chord missing on chords collection (#15).

DryWetMIDI 3.1.0

08 Jul 19:24
Compare
Choose a tag to compare

New features

  • New tools:
  • ResizeNotes method to resize group of notes to the specified length treating all notes as single object.
  • GetNotesAndRests method to iterate through the specified collection of notes returning instances of Note and Rest where rests calculated using the specified policy.
  • OnObjectQuantizing method of the quantizer classes has now quantizedTime parameter of the QuantizedTime type which holds information about new time for an object (see Custom quantizing to learn more).
  • QuantizingLevel setting was added to quantizer settings which allows to specify how close an object should be moved to nearest grid time.

Minor changes

  • MakeNotes method was renamed to GetTimedEventsAndNotes.
  • Added Clone method to MidiFile and MidiChunk.
  • Added Divide method to MidiTimeSpan, MetricTimeSpan and MusicalTimeSpan which takes another time span of the same type to produce ratio between time spans.
  • Added ChangeDenominator method to MusicalTimeSpan which returns an instance of the MusicalTimeSpan that represents the same time span as original one but with the specified denominator.
  • Removed setters from ITimedObject.Time and ILengthedObject.Length properties (setters on implementations still exist).
  • Implemented IEnumerable<T> on ValueLine and removed Values property.

DryWetMIDI 3.0.0

11 Jun 16:31
Compare
Choose a tag to compare

New features

  • Added tools to perform complex tasks. Please read Tools section of the Wiki to learn more and check Melanchall.DryWetMidi.Tools namespace. These tools are:
  • 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.

DryWetMIDI 2.0.1

03 Dec 19:46
Compare
Choose a tag to compare

This a minor release which has the following changes:

  1. Target .NET Framework version was changed to 4.5 from 4.6.1.
  2. C# language version was changed to 6 from 7.

.NET Framework 4.5 and C# 6 allow to cover more development cases. For example, it's now possible to use the library in Unity 2017.x.

DryWetMIDI 2.0.0

06 Nov 19:14
Compare
Choose a tag to compare

Breaking changes

Time and length classes were generalized with time span classes. Now there is no difference between time and length since time is just a length started at zero. Time span describes both time and length and has following representations:

  • MetricTimeSpan for time span in terms of microseconds;
  • BarBeatTimeSpan for time span in terms of number of bars, beats and ticks;
  • MusicalTimeSpan for time span in terms of a fraction of the whole note length;
  • MidiTimeSpan exists for unification purposes and simply holds long value in units defined by the time division of a file.

Read updated section of the Wiki about time and length to learn more.

Minor changes

  • Lyrics and Marker methods were added to the PatternBuilder.
  • Chord methods taking root note's name were added to the PatternBuilder.
  • Fixed combining of LSB and MSB of the PitchBendEvent's PitchValue.

DryWetMIDI 1.3.0

24 Aug 10:49
Compare
Choose a tag to compare

Pattern

DryWetMIDI provides now a way to program music compositions based on MIDI. The PatternBuilder allows to insert notes, chords and another Pattern objects built with the PatternBuilder. See more details in the Pattern page of the library Wiki.

A quick example of what you can do with patterns:

Pattern pattern = new PatternBuilder()
     
    // Insert a pause of 5 seconds
    .StepForward(new MetricLength(0, 0, 5))

    // Insert an eighth C# note of the 4th octave
    .Note(OctaveDefinition.Get(4).CSharp, (MusicalLength)MusicalFraction.Eighth)

    // Set default note length to triplet eighth and default octave to 5
    .SetNoteLength((MusicalLength)MusicalFraction.EighthTriplet)
    .SetOctave(5)

    // Now we can add triplet eighth notes of the 5th octave in a simple way
    .Note(NoteName.A)
    .Note(NoteName.B)
    .Note(NoteName.GSharp)

    // Get pattern
    .Build();

MidiFile midiFile = pattern.ToFile(TempoMap.Default);

Minor changes

  • Added MathTime and MathLength.
  • Added ability to manage new tempo map.
  • Added ability to replace existing tempo map with another one.
  • Added Channel, Velocity and OffVelocity properties to the Chord.
  • Added setter to Chord's Length property.
  • Methods of LengthConverter can now take ITime as time argument.
  • Removed Equals and GetHashCode overridings from the event classes.

Fixed bugs

  • Fixed chords search ignores channel of notes.
  • Fixed wrong conversion to MusicalTime if time is exact start of a bar.

DryWetMIDI 1.2.0

01 Aug 13:18
Compare
Choose a tag to compare

New features

  • MusicalLength available now. This length class gives ability to specify lengths of objects in terms of fractions of the whole note length, for example, 1/8. You can learn more in Length section of the Wiki.
  • Added new extension methods for managing of timed events, notes and chords:
    • ProcessTimedEvents to perform the specified action on each TimedEvent;
    • RemoveTimedEvents to remove all the TimedEvent that match the conditions defined by the specified predicate;
    • ProcessNotes to perform the specified action on each Note;
    • RemoveNotes to remove all the Note that match the conditions defined by the specified predicate;
    • ProcessChords to perform the specified action on each Chord;
    • RemoveChords to remove all the Chord that match the conditions defined by the specified predicate;
  • Read and Write methods of the MidiFile can now take a Stream as an argument to read/write MIDI file.
  • MetricTime and MetricLength now implement IFormattable so you can use them in string.Format or during string interpolation with format strings supported by TimeSpan.
  • SevenBitNumber and FourBitNumber now implement IComparable<SevenBitNumber> and IComparable<FourBitNumber> respectively so they can be used as key in OrderBy for example.

Fixed bugs and improvements

  • Fixed #2: Non-ASCII encoding is not supported by text-based meta events.
  • Fixed invalid combining of LSB and MSB in PitchValue of PitchBendEvent.
  • Fixed null notes were not filtered out in Chord's constructor.
  • Fixed Time was set to 0 by Chord's constructor that takes only notes as an argument.
  • Improved accuracy of metric time conversion.
  • ToTomeSpan method of MetricTime and MetricLength was replaced with implicit cast operator.

DryWetMIDI 1.1.0

07 Jul 12:28
Compare
Choose a tag to compare

DryWetMIDI 1.1.0 provides a lot of new features. See short description of most notable changes below.

High-level data managing

DryWetMIDI 1.1.0 introduces new namespace – Melanchall.DryWetMidi.Smf.Interaction – that contains a lot of new objects which purpose is to provide a way to manage MIDI data at the higher level. Key features provided by classes from this namespace are:

Events managers

Now you can work with absolute time of MIDI events and manage specific events via dedicated events managers:

Custom time objects

All times are presented in a MIDI file as some integer values meaning of which is defined by the time division of the file. In practice it can be more useful to operate by time expressed in more understandable format such as hours, minutes and seconds. DryWetMIDI provides now following time classes:

Custom length objects

As with time DryWetMIDI provides custom class for lengthMetricLength for hours, minutes, seconds.

Minor changes

  • MidiEvent doesn't implement ICloneable now. It still has Clone method but now it returns MidiEvent instead of object.
  • NoteEvent class added as the base class for NoteOnEvent and NoteOffEvent.
  • TrackChunkUtilities static class added with extension methods for TrackChunk:
    • IEnumerable<TrackChunk> GetTrackChunks(this MidiFile midiFile);
    • TrackChunk Merge(this IEnumerable<TrackChunk> trackChunks);
    • IEnumerable<TrackChunk> Explode(this TrackChunk trackChunk).
  • IndexOf method added to EventsCollection and ChunksCollection.

DryWetMIDI 1.0.0

26 May 04:22
Compare
Choose a tag to compare

It's the first release of the DryWetMIDI. It allows:

  • Read, write and create Standard MIDI Files (SMF). It is also possible to read RMID files where SMF wrapped to RIFF chunk.
  • Finely adjust process of reading and writing. It allows, for example, to read corrupted files and repair them, or build MIDI file validators.
  • Implement custom meta events and custom chunks that can be written to and read from MIDI files.
  • Easily catch specific error when reading or writing MIDI file since all possible errors in a MIDI file are presented as separate exception classes.

You can get the library of this version via NuGet, download archive with dll below this message or build it from sources.