Releases: melanchall/drywetmidi
DryWetMIDI 8.0.3
This small release is the last in this year. And the last one with support of 32-bit processes for Multimedia API on Windows.
Happy New Year! 🎄 🎉
Important
You can help to make the library better! Please take a quick survey.
Small changes
- Stabilized
Playback. - Handled exceptions within
Playback. DeviceErrorOccurredevent ofPlaybackhas been replaced withErrorOccurredone.- Changed the type of the
timeparameter toITimeSpaninTimeSpanUtilities.RoundforBarBeatTicksTimeSpanandBarBeatFractionTimeSpan(#333). - Improved
TempoMapoperations performance. - Improved performance of
BarBeatTicksTimeSpanconversion for simple cases. - Handled
nullcustom timed events in timed events processing utilities. - Handled
nullcustom notes in notes processing utilities. - Handled
nullcustom chords in chords processing utilities.
Bug fixes
- Fixed:
Playback.NoteCallbackis still applied to already played notes after it has been set tonull. - Fixed: Result of
GetObjectsis not sorted when chords and timed events requested, and notes and chords passed. - Fixed:
GetTempoMapreturns wrong tempo map after events were set onEventsCollectionby index.
DryWetMIDI 8.0.2
DryWetMIDI 8.0.1
This minor release addresses issues with the Playback.
First of all, performance of Playback instance creation was degraded in the 8.0.0 version. Now that is fixed. More than that, Playback's constructor is faster and consumes less memory than in the 7.2.0 version. It's highly recommended to switch to the new version of the library.
Also, a couple of bugs were fixed:
- If you create an instance of the
Playbackvia passing an objects collection, playback can work unexpectedly if input objects are not sorted by their times. - If you change the time of a playback (for example, via
MoveToTime) and there is a note in the new position,NoteCallbackwon't be applied.
DryWetMIDI 8.0.0
Major playback improvements
Now it’s possible to change playback’s data on the fly (#78)! It was a big challenge to implement this functionality (do you even use red-black trees?). But now you can add, remove and change objects without needing to recreate an instance of the Playback or even stop it. You’ll find the detailed guide on how to use the feature in the Dynamic changes article of the library docs.
Also a bunch of bugs related to the Playback were fixed:
- currently playing note is not interrupted when
PlaybackEndreached; MoveToTimehas no effect if it’s executed just before the firstStartmethod call;IsRunningcan return invalid value due to race conditions whenLoopproperty is set totrue;Startand thenStopcalls in the middle of a note can cause unexpected behavior whenInterruptNotesOnStopandTrackNotesare set totrue.
Data tracking is now on by default. So in case of jumps in time you’ll get correctly applied program, pitch and control values. TrackNotes is now true by default too. Of course you can turn the feature off via corresponding properties if you want.
Several new things were added:
Playback: addedSendNoteOffEventsForNonActiveNotesandSendNoteOnEventsForActiveNotesproperties;PlaybackSettings: addedCalculateTempoMapproperty;NotesPlaybackStartedandNotesPlaybackFinishedevents args: added original notes (seeNotesEventArgs.OriginalNotes).
Please note that there are some breaking changes:
Playmethod has been removed. It causes confusion and does nothing but just callingStartand thenSpinWait.SpinUntil(() => !IsRunning). You can do these actions by yourself if you for some reason want the blocking playback.PlaybackHinthas been removed fromPlaybackSettings. There was no noticeable performance gain in using this feature. You can just disable data tracking if you want.- Snapping has been reworked. First of all, there is no
Snappingproperty within thePlaybackanymore. Snapping functionality was moved just right into thePlayback.Snapping.IsEnabledis replaced withIsSnappingEnabled.SnapToNotesStartsandSnapToNotesEndsmethods are replaced with the much more flexibleSnapToEventsone.
New features and improvements
- Split
CsvSerializerSettingsintoCsvSerializationSettingsfor serialization methods andCsvDeserializationSettingsfor deserialization ones. - Time, length and note formats can be resolved automatically on CSV deserialization (which is the default behavior now).
- Added
UnknownRecordPolicyproperty toCsvDeserializationSettings. - Introduced
CsvExceptionwhich replacesFormatExceptioninCsvSerializer. - Added
BytesArrayDelimiterproperty toCsvSerializationSettingsandCsvDeserializationSettings. - Added
RemoveDuplicatedControlChangeEventsproperty toSanitizingSettings. - Replaced
RemoveOrphanedNoteOnEventsproperty ofSanitizingSettingswithOrphanedNoteOnEventsPolicywhich provides more ways to handle orphaned Note On events.
Small changes and bug fixes
- Implemented piano roll multi-cell custom actions.
- Print line and symbol indices in piano roll errors.
- Handle empty collections in
ManageTempoMapmethods of the [TempoMapManagingUtilities](https://melanchall.github.io/dr...
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/GetChordsProcessTimedEvents/ProcessNotes/ProcessChordsRemoveTimedEvents/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.RemoveDuplicatedNotesproperty. - Added
SanitizingSettings.RemoveDuplicatedSequenceTrackNameEventsproperty. - Added
SanitizingSettings.NoteMinVelocityproperty. - Changed default value of the
SanitizingSettings.Trimproperty tofalsesince trimming can be undesirable. settingsparameter of the methods fromRestsUtilitiesis 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
EventRecordedevent to theRecording. - Allow zero repeats number for
Repeater. - Added the
Trimfeature toSanitizer.
DryWetMIDI 7.0.2
DryWetMIDI 7.0.1
New features and improvements
- Concept of the
IObjectIdremoved. Please read updated SplitByObjects section of the docs. - Added
filterparameter toSplitObjectsAtDistance,SplitObjectsByGrid,SplitObjectsByPartsNumberandSplitObjectsByStepmethods of theSplitter. - Added
PlaybackHint. - Improved performance of the
TimedObjectsManager.SaveChangesmethod. - Improved performance of the
TimedObjectUtilities.AddObjectsmethod 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
MidiClockwhen there are speed changes. - Fixed:
NotesPlaybackStartedandNotesPlaybackFinishedevents of thePlaybackcan 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
NoteSearchContextandChordSearchContext. - Renamed
CombineInSequenceandCombineInParallelmethods ofPatternUtilitiestoMergeSequentiallyandMergeSimultaneouslycorrespondingly.
New features and improvements
- Added
Sanitizertool. - Added
MergeSequentiallyandMergeSimultaneouslymethods to theMergertool. - Added
StopReadingOnExpectedTrackChunksCountReachedproperty toReadingSettings(#244). - Added
ChordProcessingHint(#256). - Added
NoteProcessingHint. - Added
TimedEventProcessingHint. - Added
FromDoublemethod forMusicalTimeSpan. - Added
PositionandLengthproperties toMidiToken.
Small changes and bug fixes
- Improved
Quantizerperformance. - Set default pitch value for
PitchBendEventto8192. - Fixed:
GetTimedEventsmethods 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
GetTempoMapmethods. - Added
WaitForCompleteSysExEventproperty toInputDevice. - Fixed:
AccessViolationExceptionthrown sometimes onHighPrecisionTickGeneratorstop on Windows. - Fixed: Multipacket SysEx is not received correctly on macOS (#232).