Code Monkey home page Code Monkey logo

maelzel's People

Contributors

gesellkammer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

tqmbanados

maelzel's Issues

Attribute errors on running Maelzel Tutorials -> missing attribute in maelzel\_util.py?

Hello, I am new to Maelzel and am trying to begin with the tutorials. Right from the start in I'm getting the following Exception:

Traceback (most recent call last):
    seq.show()
  File "...\maelzel\core\mobj.py", line 683, in show
    img = self._renderImage(backend=backend, fmt=fmt, scorestruct=scorestruct,
  File "...\maelzel\core\mobj.py", line 864, in _renderImage
    _renderImage(obj=self, outfile=outfile, backend=backend,
  File "...\maelzel\core\mobj.py", line 1772, in _renderImage
    tmpfile, renderer = _renderImageCached(obj=obj, fmt=fmt, config=config, backend=backend,
  File "...\maelzel\core\mobj.py", line 1798, in _renderImageCached
    renderer.write(outfile)
  File "...\maelzel\scoring\renderlily.py", line 1161, in write
    _util.imagefileAutocrop(tempout, cropfile, bgcolor="#ffffff")
AttributeError: module 'maelzel._util' has no attribute 'imagefileAutocrop'

It appears to happen when rendering the lilypond file, and I also get the following Error messages from lilypond:

[maelzel:lilytools.py:367:renderLily:ERROR] Error while running lilypond, failed to produce a png file: ...\AppData\Local\tmpk9ja2k6b\l6p69pgj.png
[maelzel:lilytools.py:368:renderLily:ERROR] Return code: 1
[maelzel:lilytools.py:369:renderLily:ERROR] Outfile: '...\AppData\Local\tmpk9ja2k6b\l6p69pgj.png', exists: False
[maelzel:lilytools.py:370:renderLily:ERROR] stdout: 

[maelzel:lilytools.py:371:renderLily:ERROR] stderr: 
!! 'C:\Program' is not recognized as an internal or external command,
!! operable program or batch file.

Could the _util.py file in the current version be older?

FileNotFoundError during the imageAutocrop functionality

When Maelzel attempts to render the lilypond file, it runs into the following Exception:

Traceback (most recent call last):
  File "...\testing.py", line 24, in <module>
    seq.show()
  File "...\maelzel\core\mobj.py", line 683, in show
    img = self._renderImage(backend=backend, fmt=fmt, scorestruct=scorestruct,
  File "...l\maelzel\core\mobj.py", line 864, in _renderImage
    _renderImage(obj=self, outfile=outfile, backend=backend,
  File "...\maelzel\core\mobj.py", line 1772, in _renderImage
    tmpfile, renderer = _renderImageCached(obj=obj, fmt=fmt, config=config, backend=backend,
  File "...\maelzel\core\mobj.py", line 1798, in _renderImageCached
    renderer.write(outfile)
  File "...\maelzel\scoring\renderlily.py", line 1162, in write
    _imgtools.imagefileAutocrop(tempout, cropfile, bgcolor="#ffffff")
  File "...\maelzel\_imgtools.py", line 45, in imagefileAutocrop
    imgobj = imageAutocrop(imgfile, bgcolor=bgcolor)
  File "...\maelzel\_imgtools.py", line 20, in imageAutocrop
    imgobj = img if isinstance(img, Image.Image) else Image.open(img)
  File "...\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\PIL\Image.py", line 3431, in open
    fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '...\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\LocalCache\\Local\\tmphgk9m3a_\\ckbcgml5.png'

Fiddling around, I found the filepath sent to PIL.Image is \AppData\Local\tmphgk9m3a_\ckbcgml5.png, which is different from the one called in builtins.open, so its likely changed in the os.path.realpath segment of the `PIL.Image`` file.
I am not familiar enough with how maelzel creates and works with the temp files, or how PIL works to sort this out myself, do you have any recommendations?

Mac .show ?

Hi Eduardo,

Just trying to test maelzel and in the first exemple got stuck with this:

from maelzel.core import *

seq = Chain([
    Note(60),
    Note("c#4+"),
    Note("4Eb"),
    Note("4E+20"),
    Note("4G-10hz"),
    Note("442hz"),
])
seq.show()

Error:

Default path for soundfonts only defined in linux
The file /Users/mypath/Library/Caches/tmpm9x0s0g0/4_dexb2d.png does not exist.

I am on macbook M1 Pro, Sonoma 14.4.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.