Title: Redesigning ly.music · Issue #3 · frescobaldi/python-ly · GitHub
Open Graph Title: Redesigning ly.music · Issue #3 · frescobaldi/python-ly
X Title: Redesigning ly.music · Issue #3 · frescobaldi/python-ly
Description: Dear friends, I want to take the lead for redesigning ly.music. This issue is to continue the thread at frescobaldi/frescobaldi#492, which I'll close. ly.music currently has two shortcomings: it is not easy to build a tree from scratch i...
Open Graph Description: Dear friends, I want to take the lead for redesigning ly.music. This issue is to continue the thread at frescobaldi/frescobaldi#492, which I'll close. ly.music currently has two shortcomings: it is...
X Description: Dear friends, I want to take the lead for redesigning ly.music. This issue is to continue the thread at frescobaldi/frescobaldi#492, which I'll close. ly.music currently has two shortcomings: i...
Opengraph URL: https://github.com/frescobaldi/python-ly/issues/3
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Redesigning ly.music","articleBody":"Dear friends, I want to take the lead for redesigning `ly.music`. This issue is to continue the thread at wbsoft/frescobaldi#492, which I'll close.\n\n`ly.music` currently has two shortcomings:\n- it is not easy to build a tree from scratch\n- it is not possible to create LilyPond code from scratch (from a tree).\n\nIt was initially designed to create a tree structure from an existing document, which is done in the `ly.music.read` module.\n\n@crantila emphasizes on the fact that basing `ly.music` around `xml.etree` or `lxml` would make it much faster as not a python object is created for every single tree item, and we would have powerful search possibilities for free.\n\nI am willing to design the `ly.music` tree such that it adheres to simple principles, maybe even without creating a class for every type of element.\n\nWe need the following:\n1. build a tree from scratch and have it render a valid LilyPond document from scratch\n2. build a tree from tokenized source (from a `ly.document.Document`) and have all tree items know the originating tokens (and thus source position, as every token has the position in the source file in the `pos` attribute)\n3. make changes to a tree by changing attributes or adding/removing child nodes\n4. deep copy (parts of) a tree\n5. when making changes to a tree that was build from a tokenized source, precisely know what changes need to be done to the originating document.\n6. fast iteration over the tree and understanding the music, time etc like it is currently. This is currently handled inside the Item class and subclasses, but it should move outside the tree node classes.\n7. very quick find the node that is at a certain source position.\n8. (if possible) for a tree that is created from tokenized source: update the tree from the position where source text changes without recreating the whole tree.\n\nFunctions like transpose or translate currently iterate over tokens, but they should operate on the tree in the future, and simply change the tree.\n\nWhen the tree was built from a tokenized source (i.e. the originating tokens are attached to the tree nodes, while their current value has changed) a dedicated module should be able to find out which changes need to be done to the originating document to have it reflect whatever is changed in the tree. (We won't dump a new LilyPond document because that would bluntly overwrite things that a user might have done different, like whitespace or comments that may or may not be present in the tree, and also that would destroy markings or cursor positions for point-and-click when a document is overwritten inside an editor such as Frescobaldi.)\n","author":{"url":"https://github.com/wbsoft","@type":"Person","name":"wbsoft"},"datePublished":"2015-01-26T09:07:38Z","url":"https://github.com/frescobaldi/python-ly/issues/3"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4ed42705-3044-fc17-d28c-2a092c6b5d53 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 90A6:1CDF3F:991326:C33F85:6B09BA3D |
| html-safe-nonce | b9497226bd6805bc9c818f8a3b1bf71e3790f967c64999b13f5877923f9dacac |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEE2OjFDREYzRjo5OTEzMjY6QzMzRjg1OjZCMDlCQTNEIiwidmlzaXRvcl9pZCI6IjQyOTI2NzgyMjUyMzgyNDcwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 90d05d7b109da79dbc729678f3aabc034d4688c165189444b30334531e1a72d7 |
| hovercard-subject-tag | issue:55459761 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/frescobaldi/python-ly/3/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b6f9ada3bbcab796f492ec14da50675574fed8c03f30687235c2d36a6170db01/frescobaldi/python-ly/issues/3 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b6f9ada3bbcab796f492ec14da50675574fed8c03f30687235c2d36a6170db01/frescobaldi/python-ly/issues/3 |
| og:image:alt | Dear friends, I want to take the lead for redesigning ly.music. This issue is to continue the thread at frescobaldi/frescobaldi#492, which I'll close. ly.music currently has two shortcomings: it is... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wbsoft |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29e6866c4c5b6697a062df08d37fa80bbfb75810ca4280c0d277f04956012d39 |
| turbo-cache-control | no-preview |
| go-import | github.com/frescobaldi/python-ly git https://github.com/frescobaldi/python-ly.git |
| octolytics-dimension-user_id | 19853952 |
| octolytics-dimension-user_login | frescobaldi |
| octolytics-dimension-repository_id | 29728425 |
| octolytics-dimension-repository_nwo | frescobaldi/python-ly |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 29728425 |
| octolytics-dimension-repository_network_root_nwo | frescobaldi/python-ly |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e72aac8801621433bb0313888fbbe243f5998abc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width