- Make
neoscore.setup()
warn and skip if it detects it has been called more than once. - Add
neoscore.render_to_notebook()
for conveniently emitting rendered images to Jupyter Notebook and compatible environments. Thanks @demithetechie for helping with this!
- Update dependencies
- Pin pyqt5-qt5 to 5.15.2 to fix build failures on non-Mac systems. It seems that recent releases of this package do not support all systems.
- Fix bug with transform origin on
Text
objects with non-default text alignment.
- Fix
breakable_length
on all built-in spanners. Users with custom spanners should see the updated documentation on proper superclass declaration order. - Make
PaintedObject.parent
no longer a kwarg providing a default= None
. This aligns the class with how we do this everywhere else. This is technically a breaking change, but it's largely an internal class so we don't expect any users will be affected.
- Add support for 8va treble clefs ('treble_8va') and bridge clefs ('bridge'). Bridge clef acts like percussion clefs - it uses the center staff position as middle C regardless of staff line count.
- Add support for image transparency with new
opacity
field. The field is accessible through theImage
constructor and a newopacity
property. - Add built-in tremolo support with new
Tremolo
class (by @craigvear) - Replace
Chordrest.notehead_column_width
with more generalChordrest.notehead_column_bounding_rect
. This new method corrects some bugs with the implementation of the old method.
- Fix bug where viewport scales were set and got incorrectly (#89)
- Fix viewport scaling support in Python < 3.8
- Slightly improve initial scene render performance by not clearing the scene before rendering.
- Support optimizing refresh functions when the scene doesn't change in every frame. This is done with a new class
neoscore.RefreshFuncResut
, which provided refresh functions can return. The class has a field,scene_render_needed: bool = True
which tells neoscore whether it needs to clear and re-render the scene after the refresh function returns. This can be set toFalse
in situations where the scene did not change in the frame, a significant optimization in complex scenes. It should be noted though that in complex scenes this could result in a noticeable frame rate drop when the scene does change. Theinput_scene_interaction
example has been updated to demonstrate this capability. - Fix bounding rects on qt paths not starting at local origin, causing clipping errors on many objects, especially text objects.
- Dataclass tweaks to support Python 3.11 breaking changes.
- Create a dedicated
Tie
class for ties. Both it andSlur
now inherit from a sharedAbstractSlur
class which provides common drawing functionality.Tie
is a nice convenience class in that it is automatically kept horizontal; in the future it may also be shaped slightly differently than a slur. (by @craigvear) - Add a new method
PositionedObject.distance_to
which provides a convenient way to find the Euclidean distance to another object. - Add document-space positions to mouse events
- Add a new
Tuplet
class for simple notation of tuplets. (by @craigvear) - Add a new method
Spanner.point_along_spanner
for easily finding points along the spanner's line. - Switch to using the pre-commit framework for our precommit hooks, improving stability and cross-platform dev environment support. See the updated
CONTRIBUTING.md
file for new pre-commit setup instructions. You can easily migrate by first installing new dependencies withpoetry install
then setting up the new pre-commit hook withpre-commit install -f
. - Fix a bug where
PedalLine
without half-lift positions errored. (by @craigvear)
This release includes substantial breaking changes. See the announcement post for more information.
- Fix clipping of thick pens thanks to help from @Xavman42.
- Add a new field
transform_origin
to all graphical objects and corresponding interface classes, with help from @Xavman42. This new field sets the origin point (relative to the object'spos
) for rotation and scaling. - Explicit z-index support has been removed. Stacking order is now strictly set by the order of the document tree's depth-first traversal.
- The interface and Qt layer now reflects the document parent-child tree outside of flowable contexts. Interface classes now have a
parent
field. Outside flowables, interfaces are now given positions relative to their parent, another interface set with the parent object's position and transform properties. Inside flowables, interfaces are given no parent and they still receive global document-based positions. SeePositionedObject.render_complete()
andPositionedObject.interface_for_children
for more. - Rotation and scaling transforms are now inherited by children outside flowable contexts.
- Paths now support scaling
- Fix bug affecting path resolution in image export on Windows with Python 3.7
- Fix bug breaking support on Python 3.7
- Fix bug where chordrest flags were not properly reset when rebuilding chords after mutations
- Added built-in support for mouse event handlers with
neoscore.set_mouse_event_handler
. - Added built-in support for keyboard event handlers with
neoscore.set_key_event_handler
.
- Reduce minimum Python version to 3.7
- Fix bug where arrowkeys still scrolled the viewport with
neoscore.show(auto_viewport_interaction_enabled=False)
- Support disabling automatic viewport interaction with
neoscore.show(auto_viewport_interaction_enabled=False)
. This disables scroll-zooming, drag-moving, and the appearance of window scrollbars. - Support setting the preview window size with new
neoscore.show()
optionsmin_window_size
andmax_window_size
. - Support launching the preview window in fullscreen mode with
neoscore.show(fullscreen=True)
. - Support programmatically controlling the viewport's center position, scale (zoom), and rotation with
neoscore.set_viewport_center_pos()
,neoscore.set_viewport_scale()
, andneoscore.set_viewport_rotation()
. Corresponding getters are also provided.
- Fixed PDF export on Windows
- Updated
neoscore.render_image()
to block by default. Set the new kwargwait=False
to finalize export asynchronously. - Fixed bug where image and PDF export exceptions could be ignored. Exceptions in image export threads now propagate on join via the new
PropagatingThread
class.
Initial release! ❤️❤️❤️