{"id":18132016,"url":"https://github.com/cemolcay/midipianorollview","last_synced_at":"2025-04-15T23:10:18.262Z","repository":{"id":62446801,"uuid":"159171477","full_name":"cemolcay/MIDIPianoRollView","owner":"cemolcay","description":"Customisable UIScrollView subclass for rendering/editing MIDI notes on a piano roll view.","archived":false,"fork":false,"pushed_at":"2019-11-27T15:39:13.000Z","size":6639,"stargazers_count":83,"open_issues_count":3,"forks_count":9,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-15T23:10:06.330Z","etag":null,"topics":["audio-unit","ios","midi","piano-roll","swift","uiscrollview"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cemolcay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-26T13:09:24.000Z","updated_at":"2024-09-02T11:22:22.000Z","dependencies_parsed_at":"2022-11-01T23:01:41.941Z","dependency_job_id":null,"html_url":"https://github.com/cemolcay/MIDIPianoRollView","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemolcay%2FMIDIPianoRollView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemolcay%2FMIDIPianoRollView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemolcay%2FMIDIPianoRollView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cemolcay%2FMIDIPianoRollView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cemolcay","download_url":"https://codeload.github.com/cemolcay/MIDIPianoRollView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249167445,"owners_count":21223506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio-unit","ios","midi","piano-roll","swift","uiscrollview"],"created_at":"2024-11-01T12:10:03.053Z","updated_at":"2025-04-15T23:10:18.235Z","avatar_url":"https://github.com/cemolcay.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"MIDIPianoRollView\n====\n\nCustomisable UIScrollView subclass for rendering/editing MIDI notes on a piano roll view.\n\nDemo\n----\n\n![alt tag](https://github.com/cemolcay/MIDIPianoRollView/raw/master/demo.gif)\n\nRequirements\n----\n\n* iOS 9.0+\n* Swift 4.2+\n* Xcode 10.0+\n\n\nInstall\n----\n\n#### CocoaPods\n\n``` ruby\npod 'MIDIPianoRollView'\n```\n\nUsage\n----\n\nCreate a `MIDIPianoRollView` either from storyboard (subclass from `UIScrollView`) or programmatically.\n\n#### `MIDIPianoRollView.Keys`\n\n- An enum that represents the data source of the piano roll's keys.\n- It can be either\n\t-  A range of `UInt8` MIDI notes like `30...50` (30th note to 50th note)\n\t-  A `Scale` of notes between specified octave range\n\t-  Or custom unordered pitches.\n\n#### `MIDIPianoRollView.Bars`\n\n- An enum that represents the bar count on the piano roll.\n- It can be either\n\t- A fixed value by `.fixed(barCount)` \n\t- Or `.auto` that auto-calculating bar count by the data source.\n\n#### `MIDIPianoRollNote`\n\n- Set the `notes` data source array in order to pop the notes. \n- It is a `[MIDIPianoRollNote]` array that has the start position, duration, midi note and velocity data for each note. \n\n#### `MIDIPianoRollPosition`\n\n- This represents both position and duration values for the notes on the piano roll. Contains `bar`, `beat`, `subbeat` and `cent` values.\n- Each of them are `Int` and confomrs to `Comparable`, `Equatable`, `Codable` and custom `+` and `-` operatros.\n- Each `bar` has a number of `beat`s that the piano roll's `timesingature` has.\n- Each `beat` has 4 `subbeat`s.\n- Each `subbeat` has 240 `cent`s for fine tuning.\n\n#### `MIDIPianoRollCellView`\n\n- Each cell on the piano roll is a subclass of the `MIDIPianoRollCellView`.\n- You can basically create your custom cell view by subclassing it.\n\n#### `MIDIPianoRollRowView`\n\n- Each key view on the right side of the piano roll is a subclass of `MIDIPianoRollRowView`.\n- You can create your custom subclass may be with some piano key images and render it on the piano roll.\n\n#### `MIDIPianoRollMeasureView`\n\n- Measure is a custom view with bunch of `CALayer`s that rendering the position texts and guide lines.\n- You can set grid line width and colors.\n- You can set measure position label font and text colors.\n- If you don't want to render measure, then you can set the `isMeasureEnabled` property to false.\n\n#### `MIDIPianoRollView.ZoomLevel`\n\n- Zoom level represents the currently rendering beat value on the piano roll.\n- It has a customisable `minZoomLevel` and `maxZoomLevel` range.\n- Each zoom level have note rate, for example,   \n\t- `.halfNotes` means a bar have 2 beats with 2 half notes, \n\t- `.quarterNotes` means a bar have 4 beats with 4 quarter notes.\n- If `isZoomingEnabled` is set true, then you can horizontally pinch-to-zoom in or out between customisable `minBeatWidth` and `maxBeatWidth` values to set current `beatWidth`. \n- When a `beatWidth` hits the limit, the zoom level advances the next level depending on the zooming in or out. \n- You can disable this behaviour by setting `isZoomingEnabled` property to false.\n- The same behavior also controls the row height zooming. If you vertically pinch-to-zoom, then current `rowHeight` will scale between `minRowHeight` and `maxRowHeight` properties.\n\n#### `MIDIPianoRollView.GridLine`\n\n- Contains line properties for grid line styling.\n- You can set each line's width, color or dash pattern styling.\n\n#### Editing\n\n- You can enter the cell editing mode by setting `isEditing` property to true.\n- When you are in the edit mode, you can not scroll the view but you can pan the cells to move or resize.\n- You can enable/disable the multiple editing by setting the `isMultipleEditingEnabled` property to true. \n\t- When it's enabled, you can drag your finger to render a multiple selection view to select all cells that under the drag-to-select box.\n\t- Then you can move or resize the selected cells.\n- When editing is done, piano roll will informs its delegate.\n\n#### `MIDIPianoRollViewDelegate`\n\n- Informs the delegate when the cell is edited.\n- You can update your `notes` data source in the delegate calls.\n\n``` swift\n  func midiPianoRollView(_ midiPianoRollView: MIDIPianoRollView,\n                         didMove cellView: MIDIPianoRollCellView,\n                         to newPosition: MIDIPianoRollPosition,\n                         pitch: UInt8)\n```\n\n- Informs delegate about that the cell is moved a new position and/or row. \n- You can use the `pitch` value to determine which row is the cell moved.\n\n\n``` swift\nfunc midiPianoRollView(_ midiPianoRollView: MIDIPianoRollView,\n                         didResize cellView: MIDIPianoRollCellView,\n                         to newDuration: MIDIPianoRollPosition)\n```\n\n- Informs delegate about that the cell's duration changed.\n- Called when cell is resized.\n\n``` swift\nfunc midiPianoRollViewMultipleEditingDraggingView(_ midiPianoRollView: MIDIPianoRollView) -\u003e UIView?\n```\n\n- Return a custom UIView if you want to render your custom drag-to-select view.\n\n#### Example Project\n\n- Check out the example project for getting more information about the implementation.\n\n\nDocumentation\n----\n\nYou can find the documentation [here](https://cemolcay.github.io/MIDIPianoRollView).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcemolcay%2Fmidipianorollview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcemolcay%2Fmidipianorollview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcemolcay%2Fmidipianorollview/lists"}