Giter VIP home page Giter VIP logo

sfzlint's People

Contributors

isomc-stone avatar jisaacstone avatar kmturley avatar redtide avatar spotlightkid avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

sfzlint's Issues

1/0

Hi,
thank you for your job and this useful tool. I would like to use it to list all the opcodes inside some SFZ files I have.

Everytime I try to use it from the command line like this:

sfzlist --path "/home/nicola/Musica/Samples/Sonatina Symphonic Orchestra/Brass - Bass Trombone Solo.sfz"

I get this error

Traceback (most recent call last):
  File "/usr/local/bin/sfzlist", line 11, in <module>
    load_entry_point('sfzlint==0.1.4', 'console_scripts', 'sfzlist')()
  File "/usr/local/lib/python3.6/dist-packages/sfzlint-0.1.4-py3.6.egg/sfzlint/cli.py", line 90, in sfzlist
    1/0
ZeroDivisionError: division by zero

So I've examined the sfzlint/cli.py at line 90 and I found something strange which I commented out before installing the tool again with the command sudo python3 setup.py install.

Now I don't see any error anymore but the command:

sfzlist --path "/home/nicola/Musica/Samples/Sonatina Symphonic Orchestra/Brass - Bass Trombone Solo.sfz"

returns nothing.

Why?
What Am I doing wrong?

Thank you so much for your support!

Setup.py install_requires and package_data issues

Thank-you for creating the linter. This could be really useful for my automated sfz GitHub workflows:
https://github.com/studiorack/salamander-grand-piano/blob/master/.github/workflows/release.yml

Installation
I needed to install yaml. Can you add this to the README documentation or the setup.py install_requires property?

pip install pyyaml

Usage
When running I get another error:

FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.9/site-packages/sfzlint/syntax.yml'
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.9/site-packages/sfzlint/sfz.lark'

Opening the folder, the file does not exist:
Screen Shot 2021-11-29 at 3 11 12 PM

Even thought the file is in the repo:
https://github.com/jisaacstone/sfzlint/blob/master/sfzlint/syntax.yml

Looks like this file needs to be included in the setup.py:

package_data={'sfzlint': ['*.ebnf','*.yml','*.lark']},

Copying the files manually fixed the issues.

Incorrect results when using https://github.com/sfz/tests/

Thanks for creating this great tool. I downloaded https://github.com/sfz/tests/ and was using it to test your tool:

git clone https://github.com/sfz/tests.git
cd ./tests
sfzlint "./sfz1 basic tests/01 - Amp LFO/01 - amp lfo freq.sfz" --spec-version=v1
sfz1 basic tests/01 - Amp LFO/01 - amp lfo freq.sfz:8:30:E opcode spec v2 is not one of {'v1'}
sfz1 basic tests/01 - Amp LFO/01 - amp lfo freq.sfz:8:46:E opcode spec v2 is not one of {'v1'}
sfz1 basic tests/01 - Amp LFO/01 - amp lfo freq.sfz:8:60:E opcode spec v2 is not one of {'v1'}

But when checking the opcodes on line 8 they are all valid v1 codes:

sample=..\..\samples\440.wav loopstart=12629 loopend=56728 loopmode=loop_continuous

https://github.com/sfz/tests/blob/master/sfz1%20basic%20tests/01%20-%20Amp%20LFO/01%20-%20amp%20lfo%20freq.sfz

Likewise if I check a v2 file:

sfzlint "./sfz2 basic tests/00 - syntax/00 - syntax introduction.sfz" --spec-version=v2
sfz2 basic tests/00 - syntax/00 - syntax introduction.sfz:27:2:W header spec v1 not in {'v2'} (region)
sfz2 basic tests/00 - syntax/00 - syntax introduction.sfz:27:10:E opcode spec v1 is not one of {'v2'}

line 27 has valid v2 codes:

<region> sample=..\..\samples\440.wav

Looks like a bug?

Update syntax.yml from source

Current syntax.yml file was last updated Feb 22, 2020:
https://github.com/jisaacstone/sfzlint/blob/master/sfzlint/syntax.yml

Latest version available was last updated May 28 2021:
https://github.com/sfzformat/sfzformat.github.io/blob/source/_data/sfz/syntax.yml

If I update the syntax.yml file manually there are errors in Python:

File "/usr/local/lib/python3.9/site-packages/sfzlint-0.1.2-py3.9.egg/sfzlint/spec.py", line 143, in op_to_validator
    ver=ver_mapping[op_data.get('version')],
KeyError: 'sfizz'

It seems that the new syntax.yml has breaking changes, which require Python code changes.

Put project on PyPI and create Github releases

It would be nice if this project was also listed on PyPI.

  • Create an account on PyPI.
  • Build source and wheel package: python setup.py bdist_wheel sdist --format=gztar
  • Upload the packages: twine upload --skip-existing dist/*

Also, if project releases were created on Github (not just tagged) it would be easier for interested parties, e.g. distribution package creators, to get notified of new releases (because there doesn't seem to be an option on Github to get notified only about new tags of a project).

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.