Releases: melanchall/drywetmidi
DryWetMIDI 6.0.1
This is a minor release containing following changes:
HighPrecisionTickGenerator
implementation for macOS uses less CPU now and comsume less power.GetAll
static method for InputDevice and for OutputDevice returnsICollection
now.- Fixed:
VirtualDevice.IsEnabled
doesn't work. - Fixed:
EndOfTrackEvent
written incorrectly in some cases if it present in a MIDI file withReadingSettings.EndOfTrackStoringPolicy
set toEndOfTrackStoringPolicy.Store
on reading the file. - Fixed: Events don't preserve order on transfer to next part on MIDI file splitting.
DryWetMIDI 6.0.0
Devices API available for macOS now
DryWetMIDI allows now work with MIDI devices on macOS! More than that, a couple of new classes are available for macOS only:
Also HighPrecisionTickGenerator implemented for macOS too so you can now use Playback with default settings on that platform. Its implementation for macOS is not good (in terms of performance) for now but will be optimized for the next release of the library.
Breaking changes
This version of the library has following breaking changes:
Melanchall.DryWetMidi.Devices
namespace renamed to Melanchall.DryWetMidi.Multimedia to reflect its content more precisely since not only devices are there.DriverManufacturer
,ProductIdentifier
andDriverVersion
properties were removed from the MidiDevice class and replaced byGetProperty
method for InputDevice and for OutputDevice.Channels
,DeviceType
,NotesNumber
,SupportsLeftRightVolumeControl
,SupportsPatchCaching
,SupportsVolumeControl
,VoicesNumber
andVolume
properties were removed from OutputDevice and replaced by GetProperty method.- Removed
InvalidSysExEventReceived
andInvalidShortEventReceived
events from InputDevice and replaced them with ErrorOccurred one. - All obsolete APIs were removed from the library.
New features
- Added VirtualDevice class which allows create virtual MIDI devices on macOS.
- Added
GetProperty
method for InputDevice and for OutputDevice. - Added
GetSupportedProperties
method for InputDevice and for OutputDevice. - Added DevicesWatcher class which allows watch adding or removing a MIDI device.
- Added
ConvertMultiple
methods to BytesToMidiEventConverter (#134). - Added FfStatusBytesPolicy property to BytesToMidiEventConverter.
- Implemented delta-times support in BytesToMidiEventConverter and MidiEventToBytesConverter (#134).
- Exploded
WritingSettings
property of MidiEventToBytesConverter into separate properties. - Exploded
ReadingSettings
property of BytesToMidiEventConverter into separate properties. - Added UnknownChannelEventPolicy property for BytesToMidiEventConverter.
- Added
GetByIndex
method for InputDevice and for OutputDevice.
Small changes and bug fixes
- MidiException class has been moved to Melanchall.DryWetMidi.Common namespace.
- MidiDeviceException is subclassed from MidiException now.
- Fixed:
GetObjects
methods of the GetObjectsUtilities sometimes return wrong chords when notes are gathered across different track chunks.
DryWetMIDI 5.2.1
New features and improvements
- Added
EventCallback
property toDevicesConnector
. - Added
CutPart
method toMidiFileSplitter
. - Improved performance of
GetNotes
,ProcessNotes
andRemoveNotes
methods ofNotesManagingUtilities
. - Improved
GetChords
,ProcessChords
andRemoveChords
methods ofChordsManagingUtilities
. - Improved performance of ticks to metric timespan conversion (#129).
- Added
DeviceErrorOccurred
event toPlayback
(#121). - Replaced
MidiClockSettings
parameter byPlaybackSettings
in all playback creation methods and putMidiClockSettings
insidePlaybackSettings
. - Removed
Playback
constructors byMidiEvent
s, addedGetPlayback
utility methods forMidiEvent
s to (with output device parameter and without it). - Tracked data will be now sent by
Playback
when value ofTrackControlValue
,TrackPitchValue
orTrackProgram
changed totrue
. - Added
IMetadata
interface. - Added
TryPlayEvent
andGetTimedEvents
protected virtual
method toPlayback
(please see Custom playback article). - Added
EndOfTrackStoringPolicy
toReadingSettings
(#17). - Added
Metadata
property toMidiEventPlayedEventArgs
(please see Custom playback article).
Small changes and bug fixes
- Made
TickGenerator.TickGenerated
eventpublic
. - Made
EndOfTrackEvent
classpublic
(#17). - Removed
sealed
modifier fromPlayback
. - Removed
sealed
modifier fromTimedEvent
,Note
andChord
classes, made theirClone
methodsvirtual
. - Fixed: Concurrent access to
Octave
andNote
caches is failed (#116). - Fixed:
NoteSearchContext
andChordSearchContext
are not respected inGetObjects
methods for track chunks collection and for MIDI file. - Fixed: Tracked data is sent by
Playback
when we jump to data change event.
DryWetMIDI 5.2.0
Performance
Methods to get, process and remove timed events and notes now work faster and consume less memory. Full tables with benchmarks results can be found here:
New features and improvements
- Added
GetObjectsUtilities
class containing methods that allow get objects of different types from the input ones (or MIDI file, for example). ProcessTimedEvents
andRemoveTimedEvents
methods return now count of processed/removed timed events.ProcessNotes
andRemoveNotes
methods return now count of processed/removed notes.ProcessChords
andRemoveChords
methods return now count of processed/removed chords.- Added
IsEnabled
property toMidiDevice
. - Added methods to
Playback
to move to snap points by data. - All move-to-by-snap-points methods of
Playback
returnbool
now to indicate whether time changed or not. - Added
PlaybackStart
andPlaybackEnd
properties toPlayback
. - Added
IsEnabled
toPlaybackSnapping
. - Added
PlaybackSnapping.Clear
method. - Added
TrackProgram
,TrackPitchValue
andTrackControlValue
toPlayback
. - Removed reading handlers API.
- Added
<
,>
,<=
,>=
operators forTempo
andTimeSignature
. BeatsPerMinute
property ofTempo
is now ofdouble
type.- Added
settings
parameter toSplitByChannel
method. - Added
settings
parameter toSplitByNotes
method. - Return type of
GetTimedEvents
,GetNotes
andGetChords
changed fromIEnumerable<T>
toICollection<T>
. - Added
NoteDetectionSettings
toGetNotes
,ProcessNotes
andRemoveNotes
. - Added
ChordDetectionSettings
toGetChords
,ProcessChords
andRemoveChords
. - Added
ChordDetectionSettings
toChordsQuantizingSettings
andChordsRandomizingSettings
. - Added
NoteDetectionSettings
toNotesQuantizingSettings
andNotesRandomizingSettings
. - Added
SilentNoteOnPolicy
property toInputDevice
. - Added
SplitByChunks
method toMidiFileSplitter
.
Small changes and bug fixes
- Some methods are now obsolete:
GetTimedEventsAndNotesUtilities
(OBS5);GetNotesAndRestsUtilities
(OBS6);TimedEventsManagingUtilities.ToTrackChunk
,NotesManagingUtilities.ToTrackChunk
,ChordsManagingUtilities.ToTrackChunk
(OBS7);TimedEventsManagingUtilities.ToFile
,NotesManagingUtilities.ToFile
,ChordsManagingUtilities.ToFile
(OBS8);TimedEventsManagingUtilities.AddTimedEvents
,NotesManagingUtilities.AddNotes
,ChordsManagingUtilities.AddChords
([OBS9](https://melanchall.github.io/drywetmidi/obsolet...
DryWetMIDI 5.1.2
Obsolete API
New section has been added to documentation site: Obsolete. This section contains the list of methods and classes that are obsolete and thus will be removed by a next release.
The current list of obsolete API:
- OBS1: WritingSettings.CompressionPolicy
- OBS2: ReaderSettings.ReadFromMemory
- OBS3: TempoMap.TimeSignature
- OBS4: TempoMap.Tempo
New features and improvements
- Added ReaderSettings.BufferingPolicy property.
- Increased speed of MidiFile.Read method.
- Increased speed of MidiFile.Write method.
- Implemented buffered MIDI file writing (see WriterSettings.UseBuffering).
- Decreased memory usage of MidiWriter.Write3ByteDword and MidiWriter.WriteVlqNumber.
- Reduced memory usage for ChannelEvent.
- Added ReadingSettings.ZeroLengthDataPolicy property.
- Added RPN classes (see RegisteredParameter).
- Added TempoMap.GetTimeSignatureChanges and TempoMap.GetTimeSignatureAtTime methods.
- Added WritingSettings.WriteHeaderChunk property (#94).
- Added GS standard percussion API (#93).
- Added SliceMidiFileSettings.Markers property (#99).
- Non-SMF events will be filtered out on saving to MIDI file or track chunk (#103).
Small changes and bug fixes
- Added value validation in setters of some MIDI events classes properties.
- Edge Note Off events will always be put to current part on MIDI file splitting (#99).
- Fixed: Events transferred incorrectly between parts on MIDI file splitting (#99).
- Fixed: SmpteOffsetEvent writes in wrong way.
- Fixed: SmpteOffsetEvent equality check is wrong.
- Fixed: Failed to use devices API in UWP app (#95).
DryWetMIDI 5.1.1
New features
- Removed
interval
parameter fromMidiClockSettings.CreateTickGeneratorCallback
. - Turned
ITickGenerator
toTickGenerator
abstract class. - Added
RepeatStarted
event toPlayback
. - Made constructors of
MidiEventReceivedEventArgs
andMidiEventSentEventArgs
public to have ability to fire corresponding events in custom input/output devices. DevicesConnector
now usesIInputDevice
instead ofInputDevice
.- Removed
IDisposable
fromDevicesConnector
. - Added
AreDevicesConnected
property toDevicesConnector
. - Added
Parse
/TryParse
toOctave
. - Added
INotifyTimeChanged
interface onTimedEvent
,Note
andChord
. - Added
INotifyLengthChanged
interface onNote
andChord
.
Small changes and bug fixes
- Chords parsing uses CNT now.
- Fixed: Multi-thread access to active notes metadata inside
Playback
can cause exceptions. - Fixed:
Playback.EventPlayed
not fired for meta events (#82). - Fixed: Slash chord name contains Sharp instead of # for sharped notes as result of
GetNames
.
DryWetMIDI 5.1.0
Performance
MidiFile.Read
and MidiFile.Write
methods now work much faster (#64). For MidiFile.Read
new setting ReadingSettings.ReaderSettings.ReadFromMemory
was added:
MidiFile.Read("file.mid", new ReadingSettings
{
ReaderSettings = new ReaderSettings
{
ReadFromMemory = true
}
});
With ReadFromMemory
set to true
entire MIDI file will be put to memory and read from there which gives big speed up.
New features
-
Added
IInputDevice
interface (#54), all methods that acceptInputDevice
as an argument accept nowIInputDevice
, which implemented byInputDevice
. This interface gives ability to create custom input device implementations. -
Added
IOutputDevice
interface, all methods that acceptOutputDevice
as an argument accept nowIOutputDevice
, which implemented byOutputDevice
. This interface gives ability to create custom output device implementations. -
Added
BytesToMidiEventConverter
class to convert bytes to MIDI events (#55). -
Added
MidiEventToBytesConverter
class to convert MIDI events to bytes. -
Added
Interaction.Chord.GetMusicTheoryChord
method. -
Added
Interaction.Note.GetMusicTheoryNote
method. -
Added
Interval.GetIntervalDefinitions
method returning collection ofIntervalDefinition
which is interval number and quality. -
Added
Interval.FromDefinition
method to createInterval
from interval number and quality. -
Added
MusicTheory.Chord.GetNames
method returning names of a chord (for example,A#
orDdim
) (#58). -
Added General MIDI Level 2 percussion API to
Melanchall.DryWetMidi.Standards
namespace (#65). -
Added
ReadingHandlers
property toReadingSettings
which provides collection of objects that handle MIDI data reading. Also added three handler classes:TimedEventsReadingHandler
NotesReadingHandler
TempoMapReadingHandler
These classes can speed up getting MIDI data from a MIDI file since information will be gathered during MIDI data reading rather than after data is read which involves additional iteration over MIDI data.
You can create custom reading handler and process MIDI file reading stages.
-
Added
UnknownChannelEventPolicy
property toReadingSettings
(#69) which specifies how reading engine should react on unknown channel event status byte. Also addedUnknownChannelEvent
property which specifies callback that will be called on unknown channel event ifUnknownChannelEventPolicy
set toUnknownChannelEventPolicy.UseCallback
. -
Added
ReaderSettings
property toReadingSettings
.ReaderSettings
holds I/O settings for MIDI data reader. -
Implemented reading MIDI file from non-seekable stream. Settings related to reading from such streams are placed at
ReadingSettings.ReaderSettings
. Names of properties corresponding to these settings are start withNonSeekableStream
. -
Added
Equals
static methods forMidiEvent
,MidiChunk
andMidiFile
classes. -
Added
PatternUtilities.TransformNotes
acceptingNoteSelection
which is predicate to select notes to transform. -
Added
PatternUtilities.TransformChords
acceptingChordSelection
which is predicate to select chords to transform. -
Added
PatternUtilities.SetNotesState
method (#74). -
Added
PatternUtilities.SetChordsState
method. -
Pattern.Clone
creates now deep copy instead of shallow one. -
Added
GetStandardChunkIds
static method toMidiChunk
. -
Added
GetStandardMetaEventStatusBytes
static method toMetaEvent
.
Small changes and bug fixes
- Implemented
IComparable
onInterval
. - Implemented
IComparable
onMusicTheory.Note
. - Prevent creation of sysex event with status byte as a first data byte.
- Fixed:
Playback
looped on current time change insideEventPlayed
event handler (#56). - Fixed:
CsvConverter
closes passed stream after data is read or written (#73). - Fixed:
OutputDevice.Volume
get/set fails (#75). - Fixed:
ResetEvent
not received by input device. - Fixed: Fixed CSV parsing with
\r
and\n
in texts of meta events.
DryWetMIDI 5.0.0
Breaking changes
This version of the library has breaking changes:
Melanchall.DryWetMidi.Smf
namespace renamed toMelanchall.DryWetMidi.Core
.Melanchall.DryWetMidi.Smf.Interaction
namespace renamed toMelanchall.DryWetMidi.Interaction
.- Pattern API moved to new namespace
Melanchall.DryWetMidi.Composing
. BarBeatTimeSpan
renamed toBarBeatTicksTimeSpan
.- Renamed
SetProgram
methods of thePatternBuilder
class toProgramChange
. - Changed type of the parameter of
SetOctave
method of thePatternBuilder
class fromint
toOctave
.
Documentation
From now you can read complete library documentation on https://melanchall.github.io/drywetmidi. Here you can find information about every class and members of the library. API documentation is placed in API Documentation section.
Right now it's not full replacement for the library Wiki so please don't forget to look at Wiki also when you want to get more information on some topic.
New features
- Added
Chord
class toMelanchall.DryWetMidi.MusicTheory
namespace. - Added
ChordProgression
class toMelanchall.DryWetMidi.MusicTheory
namespace. - Added
GetStep
method toScaleUtilities
that getsNoteName
corresponding to the specified step of a musical scale. - Added
GetNotesNames
method toScaleUtilities
that returns infinite collection of note names that belong to the specified scale. - Added
IntervalQuality
enum toMelanchall.DryWetMidi.MusicTheory
namespace. - Added
Get
method toInterval
class which accepts interval number and quality. - Implemented parsing of
Interval
by number and quality (for example, "P8" which is perfect eight). - Added
Transpose
method toNoteUtilities
class which returns theNoteName
transposed by the specified interval. Note
can be parsed now from string with any number of sharps and flats.- Added
NoteCallback
property toPlayback
class which allows to modify and filter every note to be played. - Added
EventCallback
property toPlayback
class which allows to modify and filter every MIDI event to be played. - Added
EventPlayed
event toPlayback
class to track MIDI events playing. - Added
PlaybackCurrentTimeWatcher
class which allows to watch current time of specified playbacks and report it in the specified units via corresponding event. - Added
BarBeatFractionTimeSpan
which represents a beat as a fraction (for example0.5
) instead of number of whole beats and number of MIDI ticks (used byBarBeatTicksTimeSpan
). - Added
BarBeatUitilities
which contains methods:GetBarLength
that allows to get length of specified bar in terms of MIDI ticks;GetBeatLength
that allows to get length of a beat of specified bar in terms MIDI ticks.
- Added
Filter
property to quantizing settings classes to filter out objects that should be quantized. - Added
Filter
property to randomizing settings classes to filter out objects that should be randomized. - Added
MidiClock
class which allows to report ticks with the specified interval and speed. - Added
NoteId
class that repesents a separately sounding note (note number and channel). - Added
PatternUtilities
class with methods:TransformNotes
that transforms notes within the specifiedPattern
producing new pattern;TransformChords
that transforms chords within the specifiedPattern
producing new pattern;SplitAtAnchor
that splits a pattern into subpatterns in points where the specified anchor inserted;
*...
DryWetMIDI 4.1.1
This is a minor release. Changes are listed below.
- Added
DecodeTextCallback
toReadingSettings
(#27). - Added
GetChannels
extension method forTrackChunk
andMidiFile
. DevicesConnector
allows connect one input device to several output devices now.- Added
EventType
property toMidiEvent
which allow to check MIDI event type without usingas
oris
operators. Playback.OutputDevice
is optional now and can be set tonull
.- Added
SmfConstants.DefaultEncoding
constant which holds default encoding of text in MIDI file. - Fixed: stream is disposed when passed to
MidiFile.Read
/MidiFile.Write
. - Fixed: playback events are sorted incorrectly which leads to some notes are dropped on MIDI file playback.
DryWetMIDI 4.1.0
New features
- Added
GetTimedEvents
,GetNotes
andGetChords
extension methods forIEnumerable<MidiEvent>
. - Added
IsEmpty
extension method forMidiFile
. - Added
GetDuration
extension method forMidiFile
. - Removed
NoteStopPolicy
property fromPlayback
. - Added
InterruptNotesOnStop
property toPlayback
. - Added
TrackNotes
property toPlayback
. - Added
NotesPlaybackStarted
/NotesPlaybackFinished
events toPlayback
. - Added
Playback
constructor withIEnumerable<ITimedObject>
as an argument. - Added
SetTime
extension method forTimedEvent
. - Added
SetTimeAndLength
extension method forNote
andChord
. - Added
channel
parameter to methods to get program change events by GM programs and to methods to get control change events. - Added
GetPlayback
/Play
extension methods forIEnumerable<Note>
andIEnumerable<Chord>
. - Added setter to
OutputDevice
property ofPlayback
. - Implemented parsing metric time spans in 'h m s ms' format (for example, 3h5m56s897ms).
- Added
BarBeatTimeSpan
constructor that takes bars number only. - Added
Notes
class that holds all availableNote
s. - Added
SkipPart
andTakePart
extension methods forMidiFile
. - Implemented snapping features for
Playback
. - Added
EndTimeAs
extension method forILengthedObject
.
Small changes and bug fixes
- Implemented
IConvertible
onFourBitNumber
andSevenBitNumber
. - Moved
IGrid
along with its implementations from Tools namespace to Smf.Interaction. - Fixed: channel not set on program change events in
Pattern
. - Fixed: last part of
MidiFile
is lost when splitting file withArbitraryGrid
. - Fixed:
sameTimeEventsComparison
is ignored when managing timed events. - Fixed: non-note events are not preceding note ones on exporting
Pattern
toTrackChunk
. - Fixed: quantizing with musical distance calculation type is failed.
- Fixed: musical time spans comparison can lead to
long
overflow.