Building The Piano Roll Widget In Unreal Engine

Unreal Musician features a robust piano roll widget built directly in unreal engine 5. This Piano Roll widget allows users to edit midi notes in MIDI tracks and channels but also helps display a MIDI based song or composition. If you’re seeking to add a similar system to your game or app, there’s a few things you must consider and we’ll cover them below.

Optimized Grid System

The foundation of a high-performing piano roll is an optimized grid system, which is paramount for managing MIDI data effectively. Let’s delve into the essential considerations and our recommended approach.

Prioritizing Performance

The grid system underlying your piano roll widget must emphasize performance above all. We’ll outline the grid system that met our stringent requirements for efficiency. 

Piano Roll Widget in Unreal engine

Ensuring Scalability for Extensive Compositions

Given that musical compositions can span extensive durations, your grid system must be scalable to virtually infinite lengths. While the Unreal Motion Graphics (UMG) editor allows for the creation of simple grid systems through the placement of images and borders, this method falls short in terms of scalability. Testing this with a significantly large grid size will quickly demonstrate a decline in performance, as the sheer number of widgets displayed can drastically reduce frame rates. Although using scroll boxes might seem like a viable option for managing smaller grids, they fail to meet the needs of a piano roll designed to accommodate hundreds of thousands or even millions of entries without compromising on performance targets, such as achieving 120 or even 60 frames per second.

Adopting a Specialized Grid System

The challenges of developing a grid that combines both infinite scalability and high performance necessitate a specialized solution. The optimal choice for such a demanding application is the Grid System provided by the Enhanced UI Plugin that we’ve built specifically for this task and are more than happy to share with you. This system is specifically engineered for high efficiency and scalability, making it the ideal foundation for your piano roll widget.

By addressing these critical aspects, you can ensure that your piano roll widget not only meets the expectations of today’s music production needs but also seamlessly integrates into the robust environment of Unreal Engine 5.

Zoom and Scroll Capabilities in Your UE5 Piano Roll Widget

Incorporating an intuitive and efficient means for users to navigate your piano roll is a critical next step after establishing your optimized grid system. Achieving a seamless user experience involves enabling users to precisely zoom and scroll through the piano roll, allowing for effortless note placement and detailed viewing. While the initial thought might lead to the utilization of the basic Slider Widget from Unreal Engine’s default toolkit for scrolling, it falls short in facilitating zoom capabilities.

Inspiration From Professional DAW Software

Professional Digital Audio Workstation (DAW) environments, such as FL Studio and Ableton Live, set a high standard for user interaction by offering a versatile Slider Widget capable of handling both zooming and scrolling. This dual functionality, achieved through resizing (for zoom) and moving (for scroll) the slider’s thumb, represents an industry benchmark that users have come to expect. Resorting to separate zoom in/out buttons may seem like a straightforward solution but can detract from the user interface’s professionalism, rendering it less appealing and intuitive.

Introducing the Smart Slider from the Enhanced UI Plugin

To address this challenge and elevate the user experience to professional standards, the Enhanced UI Plugin presents a perfect solution with its Smart Slider widget. This innovative tool is designed specifically for the dual tasks of zooming and scrolling within the piano roll widget. By adjusting the thumb size, users can seamlessly zoom in and out, while moving the thumb position facilitates smooth scrolling across the grid. The Smart Slider generates events or delegates in response to changes in thumb size and location, enabling straightforward integration with your grid system.

This approach not only simplifies the implementation of a sophisticated navigation system within your piano roll but also aligns with the high expectations set by professional DAWs, ensuring that your users enjoy a seamless and efficient creative process.

Implementing Grid Rulers and Labeling

As your users  compose or edit music within the piano roll, providing clear navigation aids becomes essential to ensure a fluid and frustration-free experience. Understanding their precise location within the grid—whether they’re adjusting notes in Bar 1, Bar 34, or pinpointing Beat 3 within Bar 2—is crucial for efficiency and accuracy. To address this need, most advanced grid systems incorporate a form of grid ruler or labeling system situated above the grid itself. Without such guidance, users may find the interface challenging to navigate, potentially leading to a less engaging experience.

Enhanced UI Plugin's Grid Ruler and Labeling System

The Enhanced UI Plugin steps in to offer a solution with its Grid Ruler/Labeling system, designed specifically for the piano roll widget. This feature empowers developers to provide their users with an intuitive and customizable navigation tool. Here are the highlights of what this system offers:

Customizable Labeling

The Grid Ruler can be tailored to fit the specific needs of your project. You have the freedom to design the labeling or ruler system to align with the aesthetic and functional requirements of your application or game, ensuring consistency with your overall design language.

Flexible Tick Marks

Adding tick marks for better granularity and navigation is straightforward with the Enhanced UI Plugin‘s system. Whether you need dense tick marks to indicate individual beats or more spaced-out ticks for bars, the system is flexible enough to accommodate your specifications. This flexibility ensures that users can easily identify their position within a composition, making the process of placing and editing notes as seamless as possible.

Incorporating the Enhanced UI Plugin‘s Grid Ruler and Labeling system into your piano roll widget not only enhances user satisfaction by simplifying grid navigation but also elevates the overall quality of your music production tool. By offering clear, customizable navigation aids, you empower users to focus more on their creative process, free from the distractions of trying to ascertain their exact location within their musical landscape.

Follow UnrealMusician Development

If you like the idea of unrealmusician, you can wishlist it on steam and/or join the discord with the links below.

Behind the Scenes: Crafting Unreal Musician

Ever wonder what makes Unreal Musician tick? It’s all powered by Unreal Engine, but the secret sauce? That’s the MidiEngine plugin. This little powerhouse is the backbone of Unreal Musician, giving it those slick DAW capabilities and the mind-blowing audio visualization magic.