Skip to content

MIDITrackView could be implemented using SwiftUI canvas #47

Open

Description

@wtholliday

See https://developer.apple.com/documentation/swiftui/canvas

My machine beachballs for a few seconds when loading the cookbook example for MIDITrackView. After profiling, it seems this is due to it creating a CALayer for each note.

Activity

  1. emurray2 commented on Feb 27, 2022

    @emurray2
    Member

    See https://developer.apple.com/documentation/swiftui/canvas

    My machine beachballs for a few seconds when loading the cookbook example for MIDITrackView. After profiling, it seems this is due to it creating a CALayer for each note.

    Thanks for the feedback. I did notice that and was wondering why. I'll take a look at this soon and fix it when I can (school is busy now). But I also have an updated version of the code on my GitHub page as I mentioned. It doesn't include the canvas implementation, but feel free to adjust the code if you like.

  2. self-assigned this
    on Feb 28, 2022
  3. emurray2 commented on May 3, 2022

    @emurray2
    Member

    @wtholliday I saw the awesome piano roll you made. Is it still separate from what the midi track view does? If so, I can try to look at your code and match the style a bit to address this issue. I already did peek a bit, and now I understand what you mean by abstracting the model away from the view.

  4. emurray2 commented on Jan 3, 2023

    @emurray2
    Member

    See https://developer.apple.com/documentation/swiftui/canvas

    My machine beachballs for a few seconds when loading the cookbook example for MIDITrackView. After profiling, it seems this is due to it creating a CALayer for each note.

    @wtholliday Do you remember what tool you used to profile this?

  5. wtholliday commented on Jan 4, 2023

    @wtholliday
    MemberAuthor

    @emurray2 Time Profiler in Instruments

  6. added a commit that references this issue on Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions