Releases: melanchall/drywetmidi
DryWetMIDI 4.0.0
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
andGetNotesAndRests
extension methods forTrackChunk
andMidiFile
. - Added conversion notes to/from CSV.
- Added
Parse
/TryParse
methods toFourBitNumber
andSevenBitNumber
. - Added
ShiftEvents
extension methods forTrackChunk
andMidiFile
which shifts MIDI events insideMidiFile
by the specified distance. - Implemented resizing notes by ratio.
- Added
Resize
extension method forMidiFile
which resizesMidiFile
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 forIEnumerable<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
New features
- New tools:
- notes merger to merge nearby notes;
- MIDI file splitter to split a MIDI file in different ways;
- CSV converter to convert MIDI objects to CSV representation and read them back.
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 ofNote
andRest
where rests calculated using the specified policy.OnObjectQuantizing
method of the quantizer classes has nowquantizedTime
parameter of theQuantizedTime
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 toGetTimedEventsAndNotes
.- Added
Clone
method toMidiFile
andMidiChunk
. - Added
Divide
method toMidiTimeSpan
,MetricTimeSpan
andMusicalTimeSpan
which takes another time span of the same type to produce ratio between time spans. - Added
ChangeDenominator
method toMusicalTimeSpan
which returns an instance of theMusicalTimeSpan
that represents the same time span as original one but with the specified denominator. - Removed setters from
ITimedObject.Time
andILengthedObject.Length
properties (setters on implementations still exist). - Implemented
IEnumerable<T>
onValueLine
and removedValues
property.
DryWetMIDI 3.0.0
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. AlsoNoteDefinition
,IntervalDefinition
andOctaveDefinition
classes were renamed toNote
,Interval
andOctave
respectively and moved to this new namespace. - Added General MIDI Level 1/2 support API. Check
Melanchall.DryWetMidi.Standards
namespace. - Added
SetProgram
method toPatternBuilder
class. This method can be used in conjunction with the new GM 1/2 support API mentioned above. - Added
AddNotes
,AddChords
andAddTimedEvents
methods toTimedEventsManagingUtilities
,NotesManagingUtilities
andChordsManagingUtilities
classes respectively. - Added
ToFile
andToTrackChunk
methods toTimedEventsManagingUtilities
,NotesManagingUtilities
andChordsManagingUtilities
classes respectively. - Added
Clone
method toNote
,Chord
andTimedEvent
classes. - Added
TimeAs
andLengthAs
non-generic methods where the desired type of result should be passed as an argument of theTimeSpanType
type. Added non-generic versions of methods insideTimeConverter
andLengthConverter
classes that takeTimeSpanType
too. - Implemented
IComparable
,IComparable<T>
andIEquatable<T>
on time span classes. - Added
MakeNotes
method to theNotesManagingUtilities
class which iterates through the specified collection ofTimedEvent
returningNote
for Note On/Note Off events pairs and originalTimedEvent
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
andGetTimedEvents
methods. FourBitNumber
andSevenBitNumber
moved to theMelanchall.DryWetMidi.Common
namespace.
DryWetMIDI 2.0.1
This a minor release which has the following changes:
- Target .NET Framework version was changed to 4.5 from 4.6.1.
- 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
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
andMarker
methods were added to thePatternBuilder
.Chord
methods taking root note's name were added to thePatternBuilder
.- Fixed combining of LSB and MSB of the
PitchBendEvent
'sPitchValue
.
DryWetMIDI 1.3.0
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
andMathLength
. - Added ability to manage new tempo map.
- Added ability to replace existing tempo map with another one.
- Added
Channel
,Velocity
andOffVelocity
properties to theChord
. - Added setter to
Chord
'sLength
property. - Methods of
LengthConverter
can now takeITime
as time argument. - Removed
Equals
andGetHashCode
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
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 eachTimedEvent
;RemoveTimedEvents
to remove all theTimedEvent
that match the conditions defined by the specified predicate;ProcessNotes
to perform the specified action on eachNote
;RemoveNotes
to remove all theNote
that match the conditions defined by the specified predicate;ProcessChords
to perform the specified action on eachChord
;RemoveChords
to remove all theChord
that match the conditions defined by the specified predicate;
Read
andWrite
methods of theMidiFile
can now take aStream
as an argument to read/write MIDI file.MetricTime
andMetricLength
now implementIFormattable
so you can use them instring.Format
or during string interpolation with format strings supported byTimeSpan
.SevenBitNumber
andFourBitNumber
now implementIComparable<SevenBitNumber>
andIComparable<FourBitNumber>
respectively so they can be used as key inOrderBy
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
ofPitchBendEvent
. - Fixed null notes were not filtered out in
Chord
's constructor. - Fixed
Time
was set to 0 byChord
's constructor that takes only notes as an argument. - Improved accuracy of metric time conversion.
ToTomeSpan
method ofMetricTime
andMetricLength
was replaced with implicit cast operator.
DryWetMIDI 1.1.0
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:
- TimedEventsManager to manage MIDI events by absolute time;
- NotesManager to manage notes of a MIDI file;
- ChordsManager to manage chords of a MIDI file;
- TempoMapManager to manage tempo map of a MIDI file.
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:
- MetricTime for hours, minutes, seconds;
- MusicalTime for bars, beats, ticks.
Custom length objects
As with time DryWetMIDI provides custom class for length – MetricLength for hours, minutes, seconds.
Minor changes
MidiEvent
doesn't implementICloneable
now. It still hasClone
method but now it returnsMidiEvent
instead ofobject
.NoteEvent
class added as the base class forNoteOnEvent
andNoteOffEvent
.TrackChunkUtilities
static class added with extension methods forTrackChunk
:IEnumerable<TrackChunk> GetTrackChunks(this MidiFile midiFile)
;TrackChunk Merge(this IEnumerable<TrackChunk> trackChunks)
;IEnumerable<TrackChunk> Explode(this TrackChunk trackChunk)
.
IndexOf
method added toEventsCollection
andChunksCollection
.
DryWetMIDI 1.0.0
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.