Customisable UIScrollView subclass for rendering/editing MIDI notes on a piano roll view.
Customisable UIScrollView subclass for rendering/editing MIDI notes on a piano roll view.
pod 'MIDIPianoRollView'
Create a MIDIPianoRollView
either from storyboard (subclass from UIScrollView
) or programmatically.
MIDIPianoRollView.Keys
UInt8
MIDI notes like 30...50
(30th note to 50th note)Scale
of notes between specified octave rangeMIDIPianoRollView.Bars
.fixed(barCount)
.auto
that auto-calculating bar count by the data source.MIDIPianoRollNote
notes
data source array in order to pop the notes.[MIDIPianoRollNote]
array that has the start position, duration, midi note and velocity data for each note.MIDIPianoRollPosition
bar
, beat
, subbeat
and cent
values.Int
and confomrs to Comparable
, Equatable
, Codable
and custom +
and -
operatros.bar
has a number of beat
s that the piano roll's timesingature
has.beat
has 4 subbeat
s.subbeat
has 240 cent
s for fine tuning.MIDIPianoRollCellView
MIDIPianoRollCellView
.MIDIPianoRollRowView
MIDIPianoRollRowView
.MIDIPianoRollMeasureView
CALayer
s that rendering the position texts and guide lines.isMeasureEnabled
property to false.MIDIPianoRollView.ZoomLevel
minZoomLevel
and maxZoomLevel
range..halfNotes
means a bar have 2 beats with 2 half notes,.quarterNotes
means a bar have 4 beats with 4 quarter notes.isZoomingEnabled
is set true, then you can horizontally pinch-to-zoom in or out between customisable minBeatWidth
and maxBeatWidth
values to set current beatWidth
.beatWidth
hits the limit, the zoom level advances the next level depending on the zooming in or out.isZoomingEnabled
property to false.rowHeight
will scale between minRowHeight
and maxRowHeight
properties.MIDIPianoRollView.GridLine
isEditing
property to true.isMultipleEditingEnabled
property to true.
MIDIPianoRollViewDelegate
notes
data source in the delegate calls. func midiPianoRollView(_ midiPianoRollView: MIDIPianoRollView,
didMove cellView: MIDIPianoRollCellView,
to newPosition: MIDIPianoRollPosition,
pitch: UInt8)
pitch
value to determine which row is the cell moved.func midiPianoRollView(_ midiPianoRollView: MIDIPianoRollView,
didResize cellView: MIDIPianoRollCellView,
to newDuration: MIDIPianoRollPosition)
func midiPianoRollViewMultipleEditingDraggingView(_ midiPianoRollView: MIDIPianoRollView) -> UIView?
You can find the documentation here.