Jump to content

Controlling the score layout with ps (combining separate instruments with brackets, braces etc.)

Recommended Posts

The functions ps and def-instrument-set allow some control over the resulting layout of the score (grouping of instruments by brackets etc.), e.g., by using some predefined ensemble "instruments" like :sq for string quartet.


Is it perhaps also possible to somehow set the layout options supported by def-score in this context? For example, would it be possible to specify the music for the left and right hand of a piano separately (i.e. not together in a triple-nested list), but then have both parts notated on a grand staff? Here is an example (not working) -- amended from the ps documentation. How can I define an instrument set such that this score would wrap the two parts below in a grand staff?


(ps 'my-instrument-set
    :rh '(((s a4 leg d5 leg fs4 leg d5 leg g4 leg d5)
           (s a4 leg d5 leg fs4 leg d5 leg g4 leg d5)
           (s a4 leg d5 leg cs5 leg b4 leg a4 leg g4 leg)
           (s fs4 leg d4 leg e4 leg cs4 leg e d4)))
    :lh '(((e fs3 d3 e3)
           (e fs3 d3 e3)
           (e fs3 g3 a3)
           (e d3 a2 d2))))

Another example would be the four strings of a string quartet specified separately etc. 


I know of course that I could include both parts in a triple nested list for the instrument :p with the gm instrument set, or the strings with the instrument :sq (as demonstrated in the ps documentation). However if possible, I would prefer to specify the left and hand right hand (upper and lower stave) separately, e.g., because I am further processing partial polyphonic scores before they are given to ps (e.g., appending multiple partial scores into a larger score), and for this processing it would help me to know which part is which by its keyword label. 



Link to comment
Share on other sites

Thanks! Yes, as I said I know that I can write the following, where rh and lh etc. are standard single-nested OMN sequences. 

(ps 'my-instrument-set :p (list rh lh))
(ps 'gm :sq (list vl1 vl2 va vc))


Perhaps I just need to define some custom function that automatically translates my preferred representation -- where all parts (including rh and lh) are represented individually for simplifying further processing -- into the representation above 🙂 

Link to comment
Share on other sites

Just for context: my function preview-score (link to doc) in the tot library -- which was perhaps the inspiration for the later function ps -- expands in the background simply into a call to def-score. In def-score, we can specify a layout of nested brackets, braces etc. separately of the actual music, which is expressed by individual single-nested OMN sequences. The function preview-score retained this separation: individual single-nested OMN sequences on the one hand, and the specification of the nested layout separately. 


By contrast, in the function ps this separation of concerns -- the actual music and the nested layout -- is seemingly gone. The input to ps seemingly must already be nested as required by the layout. That may be more convenient in some situations, but is limiting in others. For example, in a full orchestral score we can have a layout of multiple nesting levels (e.g., brackets for orchestral sections wrapped in "squares" for divisions or the standard combination of the violins in a string section, below is an example). 

  (violin1-layout 'vl1)
  (violin2-layout 'vl2))
 (viola-layout 'va)
 (violoncello-layout 'vc)
 (contrabass-layout 'cb))

Can the function ps handle such nested layouts, or is it only designed for sketches and a full score should be created separately afterwards? In principle, it would be possible with shorthand functions like ps to allow for arbitrary layouts when it expands to def-score in the background (again, as demonstrated by preview-score), but keeping the actual music and the layout separately would likely then be preferable. 


... I am just trying to make a switch from preview-score to ps to unify efforts, but I don't want to loose too much functionality 😊


I will soon share a version of ps that supports the tot score format (https://tanders.github.io/tot/sources/score.html) so that we can have ps together with various score processing functions.  


Link to comment
Share on other sites

  • 7 months later...
On 8/23/2020 at 9:08 AM, opmo said:

Every layout from the "Instrument Layout Presets" document can be used in the DEF-INSTRUMENT-SET function i.e., PS.

Dear Janusz,


Please, I´d like to make an acoustic guitar quartet, all with treble octave down clefs.

I did´t find this configuration in the Instrument Layout Presets document.

How can I proceed ?


Thanks  !

Best !



Link to comment
Share on other sites

Dear Janusz,


Maybe a good update would be the possibility of customizing the ensembles and its related clefs.

For example, somebody may want to write a extended technique violin piece using a percussion clef or something like this.

Or maybe a Pierrot Ensemble with some added instrument,  a prepared piano piece with three or four staves,

or a strange combination of instruments/clefs.


The ability of customizing specific groups and bracketsis interesting.




Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Terms of Use Privacy Policy