Hello all -
I urgently need (well ... I would like to have) a tool that creates single voices from chords ... and I'll write it myself (already started), but I found that I have a few questions:
a) I write it in PHP, because I also wrote my previous tool in it - but I must say I hate the language and am not fluent in it (whatever here is the cause and what the effect, I do not know). Which other language could I use which gives me a sensible object model for items, like the one in lib/nwc2clips.inc? (yes, I could write my own string splitter - but I rather would not).
b) What I need is actually a little more than single voices: I want to extract some voices from chords, according to some heuristics (e.g., in a chord with 3 notes, "take voices 1 and 2" will select the upper most two notes, whereas "voices -1 and -2" will take the lowermost; and with rules for what to take when there is chord with 2 notes or a single note; etc...). So, I sometimes have to rewrite RestChords to Chords or Notes or Rests ... and for that, I would like to have an overview over the options I have to copy into the new object. In the attachment is my current draft of such a model - but: Is there one documented and more complete somewhere around?
c) And last but not least: Is there already such a tool around - or something near it which I could modify according to my ideas?
Thanks a lot!
Harald M.
There is a user tool in the starter kit called "Parts (adp)" that appears to do some of what you are asking. It's not as fancy as the tool you are describing, but as you say, perhaps it would be a suitable starting point, or at least give you a few ideas.
Thanks! .. 540 lines or so ... so it seems not too simple to do this :-\ - I will dive into it!
Regards
Harald
I would suggest looking at the recently posted TabStaffMaker.lua (which is part of this post (https://forum.noteworthycomposer.com/?topic=9191.0)) as a good example Lua user tool.
Hello Harald,
Here are some useful links if you want to go for Lua:
- Lua 5.3 Reference Manual - contents (http://www.lua.org/manual/5.3/)
- Programming in Lua (first edition) (http://www.lua.org/pil/contents.html)
- https://lua.noteworthycomposer.com/
In my tools I prefer to use level2 (see https://lua.noteworthycomposer.com/nwcut.html##(nwcut).setlevel (https://lua.noteworthycomposer.com/nwcut.html##(nwcut).setlevel)), wich is the most expanded representation of a NWC text line.
In attachment you find a little tool 'ShowCliptext'. If you select a part of a staff and run this tool, it shows the internal representation in level 2.
I use "Parts (adp)" quite a bit - so much so that I have created various invocations so I can just select one to do what I want without having to remember the syntax:
Extract from "nwc2UserTools.ini"
Used in combination it is also easy to extract interior notes.
I've lately been playing with concert band arrangements - to make life easy I create each set of voices on one staff in concert pitch (Saxes, trumpets, flutes/oboe etc.) then copy the staff to each instrument to extract the parts later using "Parts (adp)".
This way I can have a condensed conductor score as well as extractable parts, just by choosing what is visible, all in one file.
Hi Lawrie -
with your posting (thank you!), I should immediately give up writing my own tool - because that's exactly what I want to do.
Right now, I still do not really understand these "bottom" and "top" things - instead of just saying what I want ("keep the second voice from the bottom"), this implies an "operational way" of doing things (wait ... I have to think ... probably it is: "remove bottom, then retain bottom").
What I do not understand at all, was that "position thing", including accidentals?? - this lead me to the conclusion that this tool was used for something else which I did not understand ... maybe I should have asked instead :-[ And the "nosingle" also makes me stumble - what is special about a single voice? Why is there no "nodouble", when chords are written with 3 voices?
But is seems that I will split my programming play-arounds (be they in PHP or, more likely, in Lua) from my musical ones (which, however, have a higher priority - I am years behind with the things I want to do there ...).
Many thanks!
Harald
Assuming you mean:
It is used to extract percussion parts.
Well ... I would have come to that requirement somewhen, wouldn't I? ;) .. just right now, I didn't think far enough.
Many thanks!
So my musical enterprises will continue now ... re programming, I might switch back a little, or, maybe, just add a little this and that to the - it seems - very useful Parts tool.
Regards
Harald