Releases: melanchall/drywetmidi
DryWetMIDI 7.2.0
Objects managing methods are unified
Now it's possible to process objects of different types simultaneously. Thus now you can call, for example, just midiFile.ProcessObjects(ObjectType.Chord | ObjectType.Note, ...)
instead of ProcessChords
after ProcessNotes
. The same story for objects removal. So in addition to this set of methods
GetTimedEvents
/GetNotes
/GetChords
ProcessTimedEvents
/ProcessNotes
/ProcessChords
RemoveTimedEvents
/RemoveNotes
/RemoveChords
we have
Also objects detection settings were decoupled. So ChordDetectionSettings
doesn't contain NoteDetectionSettings
from now, as well as NoteDetectionSettings
doesn't contain TimedEventDetectionSettings
. Methods shown in the first list accept those settings as separate parameters now.
PatternBuilder
improvements
Now you can insert simple patterns more quickly – via new PianoRoll
method. For example:
var midiFile = new PatternBuilder()
.SetNoteLength(MusicalTimeSpan.Eighth)
.PianoRoll(@"
F#2 ||||||||
D2 --|---|-
C2 |---|---")
.Repeat(9)
.Build()
.ToFile(TempoMap.Default, (FourBitNumber)9);
midiFile.Write("pianoroll-simple.mid", true);
Please read the PianoRoll section of the Pattern article to learn more.
Also a couple of new methods have been added to the PatternBuilder
: ControlChange
and PitchBend
.
Small changes
- Added
SanitizingSettings.RemoveDuplicatedNotes
property. - Added
SanitizingSettings.RemoveDuplicatedSequenceTrackNameEvents
property. - Added
SanitizingSettings.NoteMinVelocity
property. - Changed default value of the
SanitizingSettings.Trim
property tofalse
since trimming can be undesirable. settings
parameter of the methods fromRestsUtilities
is optional now.
DryWetMIDI 7.1.0
Rests redesigned
Now you can get rests between different types of objects and by any logic you will describe. Please read updated Rests section of the docs. This entails a breaking change – there is no ObjectType.Rest
option anymore. So to get, for example, notes and rests between them you need to write following code:
var notesAndRests = midiFile
.GetNotes()
.WithRests(RestDetectionSettings.NoNotesByChannel);
To feel the power of the new approach, just take a look to the snippet:
var notesAndChordsAndRests = midiFile
.GetObjects(ObjectType.Note | ObjectType.Chord)
.WithRests(new RestDetectionSettings
{
KeySelector = obj => obj is Note note && note.NoteNumber > 100
? (object)note.NoteNumber
: null
});
Here we get notes, chords and rests between notes with note number > 100 separately for each note number. Rests won't be built for chords and notes with note number <= 100.
CSV serialization redesigned
CSV serialization and deserialization have been completely reworked with the new CsvSerializer class. Please read CSV serializer article to learn more.
Small changes
- Supported flats in chord progressions to parse.
- Added the
EventRecorded
event to theRecording
. - Allow zero repeats number for
Repeater
. - Added the
Trim
feature toSanitizer
.
DryWetMIDI 7.0.2
DryWetMIDI 7.0.1
New features and improvements
- Concept of the
IObjectId
removed. Please read updated SplitByObjects section of the docs. - Added
filter
parameter toSplitObjectsAtDistance
,SplitObjectsByGrid
,SplitObjectsByPartsNumber
andSplitObjectsByStep
methods of theSplitter
. - Added
PlaybackHint
. - Improved performance of the
TimedObjectsManager.SaveChanges
method. - Improved performance of the
TimedObjectUtilities.AddObjects
method when target events collection is empty. - Improved performance of time changing methods of the
Playback
.
Small changes and bug fixes
- Implemented
TempoMap.Equals
. - Added max value constants in the
SmpteOffsetEvent
. - Fixed: Current time is managed improperly in the
MidiClock
when there are speed changes. - Fixed:
NotesPlaybackStarted
andNotesPlaybackFinished
events of thePlayback
can be fired with empty notes collection.
DryWetMIDI 7.0.0
Breaking changes
This version of the library has following breaking changes:
- Removed obsolete API:
- OBS19: Use Splitter.SplitByObjects method;
- OBS18: Use Resizer class;
- OBS17: Use Merger class;
- OBS16: Use TimedEvent constructor and add an object manually;
- OBS15: Use SetTime/SetLength methods from TimedObjectUtilities/LengthedObjectUtilities;
- OBS14: Use SetTime method from TimedObjectUtilities;
- OBS13: Use Quantizer class;
- OBS12: Use Splitter class;
- OBS11: Use TimedObjectsManager class;
- OBS10: Use Quantizer class passing QuantizingSettings with its RandomizingSettings property set.
- Removed
NoteSearchContext
andChordSearchContext
. - Renamed
CombineInSequence
andCombineInParallel
methods ofPatternUtilities
toMergeSequentially
andMergeSimultaneously
correspondingly.
New features and improvements
- Added
Sanitizer
tool. - Added
MergeSequentially
andMergeSimultaneously
methods to theMerger
tool. - Added
StopReadingOnExpectedTrackChunksCountReached
property toReadingSettings
(#244). - Added
ChordProcessingHint
(#256). - Added
NoteProcessingHint
. - Added
TimedEventProcessingHint
. - Added
FromDouble
method forMusicalTimeSpan
. - Added
Position
andLength
properties toMidiToken
.
Small changes and bug fixes
- Improved
Quantizer
performance. - Set default pitch value for
PitchBendEvent
to8192
. - Fixed:
GetTimedEvents
methods for multiple track chunks returns original events if a single track chunk is in the collection. - Fixed: Exception on
Chord
's length setting below the distance between chord's start and its last note's time.
DryWetMIDI 6.1.4
Small changes and bug fixes
- Improved performance of
GetTempoMap
methods. - Added
WaitForCompleteSysExEvent
property toInputDevice
. - Fixed:
AccessViolationException
thrown sometimes onHighPrecisionTickGenerator
stop on Windows. - Fixed: Multipacket SysEx is not received correctly on macOS (#232).
DryWetMIDI 6.1.3
Lazy reading/writing API
DryWetMIDI now provides ways to read/write data from/to a MIDI file sequentially token by token which allows to keep low memory consumption. Here the new methods and classes aimed for this task:
Small changes and bug fixes
- Added
EnumerateObjects
method to theGetObjectsUtilities
. - Fixed:
MidiFile.Equals
don't respectTimeDivision
. - Fixed:
Merger
skips objects sometimes (#225).
DryWetMIDI 6.1.2
Apple Silicon support
DryWetMIDI multimedia API now supports Apple Silicon chips when used on macOS (#204). Thanks to @ThaddeusChristopher for testing!
Nativeless version
The library has now nativeless version where all native-dependent API is cut out. More info in the Nativeless package article.
New features and improvements
- Added BytesFormat property to BytesToMidiEventConverter.
- Added BytesFormat property to MidiEventToBytesConverter.
- Removed
FfStatusBytePolicy
property from BytesToMidiEventConverter. - IInputDevice/IOutputDevice are now derived from
IDisposable
(#205).
DryWetMIDI 6.1.1
This release continues unifying API to work with different MIDI objects finishing the work done in the previous release.
New features and improvements
- Added Resizer tool which can resize groups of objects of different types or entire MIDI files.
- Added Merger tool to merge nearby objects of different types.
- Added SplitByObjects method to the Splitter class.
- Added TimeSpanUtilities.Round method.
- Added TimeSpanUtilities.IsZeroTimeSpan method.
- Added Count property to the TimedObjectsCollection class.
- Added SplitFileByChunksSettings.PreserveTempoMap property.
- Added ILengthedObject.EndTime property.
- Added GetDuration methods for TrackChunk.
Small changes and bug fixes
- All exception classes are now serializable.
- Fixed: ReplaceTempoMap throws an exception for empty track chunks collections / MIDI file.
DryWetMIDI 6.1.0
This release focuses on unifying API to work with different MIDI objects.
Tools
First of all, new tool added – Repeater
. It allows repeat MIDI data specified number of times with different options applied.
Also, some old tools were unified into single ones:
TimedEventsQuantizer
,NotesQuantizer
andChordsQuantizer
have been replaced by newQuantizer
tool which can quantize objects of different types simultaneously. More than that, it can now quantize start and end times at the same time, applying randomization if specified (and thusRandomizer
tool is now obsolete). More info in the Quantizer article.NotesSplitter
andChordsSplitter
have been replaced by newSplitter
tool which can split objects of different types simultaneously. Also all methods fromMidiFileSplitter
class have been moved to theSplitter
one. More info in the Splitter articles.
Objects managers
Also the work has been done on unifying separate manager classes for each object type. So now TimedEventsManager
, NotesManager
and ChordsManager
classes are now obsolete. You should use TimedObjectsManager
class now which can manage objects of different types simultaneously. More info in the Objects managers article.
New features and improvements
Clone
method has been moved from separate classes (likeNote
orTimedEvent
) toITimedObject
interface.Split
method has been moved from separate classes (likeNote
orChord
) toILengthedObject
.- Added
SetTime
method toTimedObjectUtilities
(SetTime
withinTimedEventsManagingUtilities
is obsolete now). - Added
SetLength
method toLengthedObjectUtilities
(SetTimeAndLength
methods withinNotesManagingUtilities
andChordsManagingUtilities
are obsolete now). - Added
MoveToStart
method toPatternBuilder
class. - Added parameter of
RepeatSettings
type toPatternBuilder
'sRepeat
methods. - Added
Note
methods by a note string toPatternBuilder
. - Added
Chord
methods by a chord string toPatternBuilder
. - Changed default value of the
Playback.InterruptNotesOnStop
property totrue
. - Parsing of
MusicTheory.Note
ignores case now. - Parsing of
Chord.GetNames
method supports7b9
,add11
,7#11
,7+11
,7(#11)
and7aug11
chords now (see complete list of supported chords here). - Added
TimeType
property to thePlaybackCurrentTimeWatcher
. - Constructor of the
PlaybackCurrentTimeWatcher
is now public so you can create different watchers. - Added
WatchOnlyRunningPlaybacks
property to thePlaybackCurrentTimeWatcherSettings
. - Added
SetPlaybackTimeType
method to thePlaybackCurrentTimeWatcher
. - Added
Note
's constructor by pair of timed events. - Added parameter of the
TimedEventDetectionSettings
type to timed events managing methods. - Added
Constructor
andTimedEventDetectionSettings
properties toNoteDetectionSettings
. - Added
Constructor
property toChordDetectionSettings
.
Small changes and bug fixes
- Added new total properties for
MetricTimeSpan
(#144). - Handled big internal values within time spans conversions.
- Fixed:
NotEnoughBytesPolicy
is ignored on reading some events. - Fixed: [
TrackChunk
](https://melanchall.github.io/drywetmidi/a...