Circled numbers for live electronics

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Circled numbers for live electronics

Gilberto Agostinho
Hi all,

I just want to share two small functions I wrote to deal with live electronics. This type of notation is particularly useful when using a MIDI footpedal to activate events. The code is:

\version "2.19.37"

LE = #(define-event-function 
     (parser location text vlength)
     (string? number?)     
      #{
        -\markup { 
          \hspace #-1.2
          \center-column {                
            \raise #1
            \combine            
            \arrow-head #Y #UP ##t
            \draw-line #(cons 0 (* -1 vlength))
            \circle $text
          }
        }
      #}      
       )

LEtext = #(define-event-function 
     (parser location text vlength description)
     (string? number? string?)
      #{
        -\markup { 
          \hspace #-1.2
          \center-column {                
            \raise #1
            \combine            
            \arrow-head #Y #UP ##t
            \draw-line #(cons 0 (* -1 vlength))
            \circle $text
          }
          \raise #(+ -2 (* -1 vlength)) $description
        }        
      #}      
       )

{
  % arguments are: string to be circled, arrow length (and in the case of \LEtext, a string for FX description)
  % For the circle to be in a good size, I recommend using two spaces before and after one digit numbers,
  % one space before and after two digit numbers, and no spaces for three digit numbers
  \textLengthOn
  c'1\LE "  1  " #3
  g1\LE "  2  " #1.5
  c''1\LE " 10 " #4.4
  f'1\LE " 37 " #2
  c'1\LEtext "100" #8 "harmonizer"
  f1\LEtext "200" #6 "frozen reverb"
  c'1\LEtext "300" #3 "EQ -3.7 A +1.2"
}

Producing:



I hope someone will find this useful.

Cheers,
Gilberto
Reply | Threaded
Open this post in threaded view
|

Re: Circled numbers for live electronics

Gilberto Agostinho
A small revision of the functions above, the functions now take numbers as input and I then used Scheme to automatically ensure that all circles have the same size for inputs up to 999. For inputs larger than that, use some \override TextScript.extra-offset if the arrows are slightly off place in the horizontal axis.

\version "2.19.37"

LE = #(define-event-function 
     (parser location N vlength)
     (number? number?)
     (define Nstring (number->string N))
     (if (< N 10) 
         (set! Nstring (string-append "  " Nstring "  "))
     )
     (if (and (>= N 10) (< N 100)) 
         (set! Nstring (string-append " " Nstring " "))
     )
      #{
        -\markup { 
          \hspace #-1.2
          \center-column {                
            \raise #1
            \combine            
            \arrow-head #Y #UP ##t
            \draw-line #(cons 0 (* -1 vlength))
            \circle #Nstring
          }
        }
      #}      
       )

LEtext = #(define-event-function 
     (parser location N vlength description)
     (number? number? string?)
     (define Nstring (number->string N))
     (if (< N 10) 
         (set! Nstring (string-append "  " Nstring "  "))
     )
     (if (and (>= N 10) (< N 100)) 
         (set! Nstring (string-append " " Nstring " "))
     )
      #{
        -\markup { 
          \hspace #-1.2
          \center-column {                
            \raise #1
            \combine            
            \arrow-head #Y #UP ##t
            \draw-line #(cons 0 (* -1 vlength))
            \circle #Nstring
          }
          \raise #(+ -2 (* -1 vlength)) $description
        }        
      #}      
       )

{  
  \textLengthOn
  c'1\LE #1 #3
  g1\LE #2 #1.5
  c''1\LE #37 #4.4
  f'1\LE #123 #2
  c'1\LEtext #3 #8 "harmonizer"
  f1\LEtext #20 #6 "frozen reverb"
  c'1\LEtext #300 #3 "EQ -3.7 A +1.2"
}

Producing:

Reply | Threaded
Open this post in threaded view
|

Re: Circled numbers for live electronics

Simon Albrecht-2
Hi Gilberto,

sorry to say this, but the way you inserted the code here is _very_
impractical. Only the Nabble interface allows seeing it at all:
<http://lists.gnu.org/archive/html/lilypond-user/2016-12/msg00380.html>,
so many people will just skip the e-mail or miss the code. Don’t do that!
There’s nothing wrong with sending a _plain text_ e-mail with the code
inline, without any distinction (save maybe lines of %%%%%%). Or, if you
must, use an ordinary attachment.

Best, Simon

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

RE: Circled numbers for live electronics

Andrew Bernard
In reply to this post by Gilberto Agostinho
Hi Gilberto,

I was keen to see - and use - your code, but as Simon mentioned, it is not
visible. Would you post it again please?

Andrew



_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

RE: Circled numbers for live electronics

Michael Gerdau
> I was keen to see - and use - your code, but as Simon mentioned, it is not
> visible. Would you post it again please?

I had the same problem - luckily I could view it using the HTML interface via
http://lilypond.1069038.n5.nabble.com/Circled-numbers-for-live-electronics-tp197953p197968.html

Kind regards,
Michael
--
Michael Gerdau       email: [hidden email]
GPG-keys available on request or at public keyserver

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Circled numbers for live electronics

Gilberto Agostinho
In reply to this post by Simon Albrecht-2
Hi all,

I started using the raw tag for enclosing any LilyPond code because without it the Nabble interface often does not display the code properly (because it sometimes thinks the chords are tags and end up omitting part of it, making the code shown at Nabble uncompilable!). It happened to me in the past (see: http://lilypond.1069038.n5.nabble.com/Experiences-from-voice-handling-wanted-td157895.html#a158004 ), and it's a pity the Nabble interface and the mailing list conflict in something so relevant. Anyway, I will either use plain text or I will upload files from now on.

As for these functions for live electronics, I am pasting the code below, I hope this time you guys will be able to see it.

Cheers,
Gilberto

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\version "2.19.37"

LE = #(define-event-function
     (parser location N vlength)
     (number? number?)
     (define Nstring (number->string N))
     (if (< N 10)
         (set! Nstring (string-append "  " Nstring "  "))
     )
     (if (and (>= N 10) (< N 100))
         (set! Nstring (string-append " " Nstring " "))
     )
      #{
        -\markup {
          \hspace #-1.2
          \center-column {                
            \raise #1
            \combine            
            \arrow-head #Y #UP ##t
            \draw-line #(cons 0 (* -1 vlength))
            \circle #Nstring
          }
        }
      #}      
       )

LEtext = #(define-event-function
     (parser location N vlength description)
     (number? number? string?)
     (define Nstring (number->string N))
     (if (< N 10)
         (set! Nstring (string-append "  " Nstring "  "))
     )
     (if (and (>= N 10) (< N 100))
         (set! Nstring (string-append " " Nstring " "))
     )
      #{
        -\markup {
          \hspace #-1.2
          \center-column {                
            \raise #1
            \combine            
            \arrow-head #Y #UP ##t
            \draw-line #(cons 0 (* -1 vlength))
            \circle #Nstring
          }
          \raise #(+ -2 (* -1 vlength)) $description
        }        
      #}      
       )

{  
  \textLengthOn
  c'1\LE #1 #3
  g1\LE #2 #1.5
  c''1\LE #37 #4.4
  f'1\LE #123 #2
  c'1\LEtext #3 #8 "harmonizer"
  f1\LEtext #20 #6 "frozen reverb"
  c'1\LEtext #300 #3 "EQ -3.7 A +1.2"
}
Reply | Threaded
Open this post in threaded view
|

Re: Circled numbers for live electronics

SoundsFromSound
Gilberto Agostinho wrote
Hi all,

I started using the raw tag for enclosing any LilyPond code because without it the Nabble interface often does not display the code properly (because it sometimes thinks the chords are tags and end up omitting part of it, making the code shown at Nabble uncompilable!).

As for these functions for live electronics, I am pasting the code below, I hope this time you guys will be able to see it.

Cheers,
Gilberto
Gilberto,

Thank you for this very useful code! I can use this in my electro-acoustic works for sure.

I was able to see your code in the first post, but I usually access the mailing list from the nabble.com interface vs. a mailing list app like Thunderbird, for example.

Huge thanks for sharing this with us!


composer | sound designer | asmr artist
LilyPond video tutorials: http://bit.ly/LearnLilyPond
Reply | Threaded
Open this post in threaded view
|

Re: Circled numbers for live electronics

Gilberto Agostinho
SoundsFromSound wrote
Thank you for this very useful code! I can use this in my electro-acoustic works for sure.
I am glad to hear you found this useful! And because the function has a markup section, it should also be easily hackable depending on how you want your scores with live electronics to look like (e.g. some people prefer to use dashed lines instead of arrows for this sort of notation).

By the way, I also added it to the LSR.

Cheers,
Gilberto
Reply | Threaded
Open this post in threaded view
|

Re: Circled numbers for live electronics

Thomas Morley-2
2016-12-14 14:04 GMT+01:00 Gilberto Agostinho <[hidden email]>:

> SoundsFromSound wrote
>> Thank you for this very useful code! I can use this in my electro-acoustic
>> works for sure.
>
> I am glad to hear you found this useful! And because the function has a
> markup section, it should also be easily hackable depending on how you want
> your scores with live electronics to look like (e.g. some people prefer to
> use dashed lines instead of arrows for this sort of notation).
>
> By the way, I also added it to the LSR.



Hi Gilberto,

I had a look into your code here:
http://lsr.di.unimi.it/LSR/Item?u=1&id=1047
and now come up with the shortened version below.
What do you think?

\version "2.18.2"

LEtext = #(define-event-function
     (parser location N vlength description)
     (number? number? string?)
      #{
        -\markup {
          \hspace #-1.2
          \center-column {
            \raise #1
            \combine
            \arrow-head #Y #UP ##t
            \draw-line #(cons 0 (- vlength))
            \combine
            \halign #0 \circle \transparent "888"
            \halign #0 #(number->string N)
          }
          \raise #(+ -2 (- vlength)) $description
        }
      #})

LE = #(define-event-function (parser location N vlength)(number? number?)
     #{ \LEtext $N $vlength "" #})

{
  \textLengthOn
  c'1\LE #1 #3
  g1\LE #2 #1.5
  c''1\LE #37 #4.4
  f'1\LE #123 #2
  c'1\LEtext #3 #8 "harmonizer"
  f1\LEtext #20 #6 "frozen reverb"
  c'1\LEtext #300 #3 "EQ -3.7 A +1.2"
}

Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Circled numbers for live electronics

Gilberto Agostinho
Hi Thomas,

Thomas Morley-2 wrote
I had a look into your code here:
http://lsr.di.unimi.it/LSR/Item?u=1&id=1047
and now come up with the shortened version below.
What do you think?
Thanks a lot for the feedback, the shortened versions you posted are looking very nice. It's quite clever to call \LEtext from \LE as you did, and the use of a transparent string is better than all those conditionals of mine. Thanks a lot!

Cheers,
Gilberto
Reply | Threaded
Open this post in threaded view
|

Re: Circled numbers for live electronics

Thomas Morley-2
2016-12-23 12:46 GMT+01:00 Gilberto Agostinho <[hidden email]>:

> Hi Thomas,
>
>
> Thomas Morley-2 wrote
>> I had a look into your code here:
>> http://lsr.di.unimi.it/LSR/Item?u=1&id=1047
>> and now come up with the shortened version below.
>> What do you think?
>
> Thanks a lot for the feedback, the shortened versions you posted are looking
> very nice. It's quite clever to call \LEtext from \LE as you did, and the
> use of a transparent string is better than all those conditionals of mine.
> Thanks a lot!
>
> Cheers,
> Gilberto
>


Approved now as
"Circled numbers for live electronics"
http://lsr.di.unimi.it/LSR/Item?id=1047

Thanks,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Circled numbers for live electronics

Gilberto Agostinho
Thomas Morley-2 wrote
Approved now as
"Circled numbers for live electronics"
Great, thanks a lot, Thomas!

Cheers,
Gilberto