Music editors
From Arnout Engelen
Editing musical data (whether you're arranging, composing, etc) is a lot like programming in the sense that you're manipulating a structured document.
Many principles from programming, such as DRY, seem to apply to writing music, too. However, most music editors lack the features IDE's have to support such techniques.
Would be interesting to see if we could design an arrangement/compositional aide 'programming style'. Eclipse's EMF and Xtext libraries seem like interesting building blocks.
[edit] Eclipse EMF / Xtext
So far I've writting a small musical DSL, and Xtext generated an editor with linking, validation, syntax highlighting and an 'outline' view for me.
Now we'd like some other 'views':
- show the complete timeline.
- linking the timeline to the editor might be tricky: something in the editor might appear multiple times in the timeline, and a location in the timeline will typically consist of several layers of blocks in the editor
- visualize the current selection
Good inspiration:
- XtextEditor has a IXtextDocument
- we can add an IDocumentListener to the IXtextDocument (?), which will call 'documentChanged' etc
- we can add an IXtextModelListener to the IXtextDocument, which will call 'modelChanged' with the XtextResource
- AbstractTextEditor has a getSourceViewer(), ISourceViewer has a getTextWidget(), that has a getCaretOffset()
With the caretOffset and the XtextResource, we can:
IParseResult parseResult = resource.getParseResult(); Assert.isNotNull(parseResult); CompositeNode rootNode = parseResult.getRootNode(); AbstractNode currentNode = ParseTreeUtil.getLastCompleteNodeByOffset(rootNode, caretOffset);
- XtextContentOutlinePage
- XtextDocument
