Re: Using a variable with \relative

2011-09-11 Thread Basso Ridiculoso
Apoligies about the nbsp's, not sure if it was Safari or gmail that
put those in there.

Is there a way to access the pitch variable and put that where I have
the \x so something like (and sorry about the javascript-y syntax) but
something like

x.pitch (but in scheme syntax of course)

so

\relative #( x.pitch #) {.} or however it would look.

I am tying to generate a bunch of exercise files of which there will
be hundreds (and potentially thousands) of groups of notes and I want
them arranged a certain way. And the note that I want the groups to be
relative to changes based on the note that starts the group, and there
are far too many to put the specific relative note in by hand. So I
was hoping for a way to pass the entire group of notes into a function
and use whatever note starts that group as the \relative note by way
of a variable.

There are probably other ways to skin this cat, and I may just have to
change the way I generate the notes, but if I can access the pitch
value and make \relative see it somehow, that might work.

Thanks for the help!

Daniel

 Is there a way to do something similar to this:


 \include english.ly

 x = { c }
 y = { g }

 \score {
 
 \new Staff {
     \clef bass

     \relative \x { d e f g a }

     \relative \y { bf a c d }

     }
  }

No (and please don't use unbreakable space in examples, since it makes
copy and paste impossible).

Pitches can't be placed into identifiers.

 Perhaps I need to write a function that sends in a variable?

Music functions return music expressions.  The newfangled scheme
functions (did I commit them already?) don't support ly:export (that
would have been real hard to do), and anyway, ly:export only works for
things that can be put into an identifier.

You can't expect \relative \x to work, but you could make \x { ... }
work in itself for making things relative to something.  And
\relative is a noop for unrelativable music.

 How does one dereference a variable inside of a function?

 For instance if I sent in \x how do I say use the value of x? Or is
 that necessary?

I have no idea what you are talking about.


 This doesn't seem to work either

 MyTestFunction =
 #(define-music-function
 ?? ? (parser location firstnote secondnote thirdnote fourthnote
 fifthnote sixthnote )
 ?? ? ( ly:music? ly:music? ly:music? ly:music? ly:music? ?ly:music? )
 ?? #{ ? ?
 ?? ? ? ? ? ? ? ?\relative $firstnote { $firstnote ? ?$secondnote ? ?
 $thirdnote ?}
 ?? ? ? ? ? ? ? ?\relative $sixthnote { $fourthnote ?$fifthnote
 $sixthnote }
 ?? #})

\relative takes a _pitch_ argument, not a music argument.  What problem
are you actually trying to solve?

I don't see that this makes much sense.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Using a variable with \relative

2011-09-09 Thread Basso Ridiculoso
Is there a way to do something similar to this:

\include english.ly

x = { c }
y = { g }

\score {

\new Staff {
\clef bass

\relative \x { d e f g a }

\relative \y { bf a c d }

}

}


Perhaps I need to write a function that sends in a variable?

How does one dereference a variable inside of a function?

For instance if I sent in \x how do I say use the value of x? Or is that
necessary?

This doesn't seem to work either -

MyTestFunction =
#(define-music-function
 (parser location firstnote secondnote thirdnote fourthnote fifthnote
sixthnote )
 ( ly:music? ly:music? ly:music? ly:music? ly:music?  ly:music? )
   #{
\relative $firstnote { $firstnote$secondnote
$thirdnote  }
\relative $sixthnote { $fourthnote  $fifthnote $sixthnote }
   #})


Any help would be appreciated, I have looked at some other functions, but
haven't seen anything similar.

Thanks,
Daniel
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Extra white space for Chordnames

2011-08-24 Thread Basso Ridiculoso
I would like to increase the amount of whitespace between the chordnames and
the staff below them, but am having no success. I have tried some variation
of all of the following with no results.

\override Staff.VerticalAxisGroup #'minimum-Y-extent = #'( 4 . 4) (with
negative and positive values)
\override Staff.VerticalAxisGroup #'Y-extent = #'( 10 . -10)
\override VerticalAxisGroup #'staff-affinity = #DOWN (also tried up)
\override VerticalAxisGroup #'nonstaff-relatedstaff-spacing #'padding = #20
 \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing =
#'((basic-distance . 10))

\score{

 \new ChordNames  {
% \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing =
#'((basic-distance . 10))
 \chordmode {  c2 f c f }
 }

 \new Staff {
%%\override Staff.VerticalAxisGroup #'minimum-Y-extent = #'( 4 . 4)
 %%\override Staff.VerticalAxisGroup #'Y-extent = #'( 10 . -10)
%  \override VerticalAxisGroup #'staff-affinity = #DOWN
 %  \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing #'padding =
#20

 \override VerticalAxisGroup #'nonstaff-relatedstaff-spacing =
#'((basic-distance . 10))

\relative c'{ c4 d f a c4 d f a}
 }

}


What the heck is the magic command to add some space? Am I putting in the
wrong place?

Daniel
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Compile your .ly from BBEdit with this AppleScript

2011-08-10 Thread Basso Ridiculoso
I use BBedit, the great text editor for MacOS, for all of my editing of .ly
files since it gives me things like grep, search and replace over a
selection, keyboard shortcuts, and many many other features that make text
editing more efficient. Highly recommended.

However, I grew tired of switching back and forth between Lilypond and
BBedit to compile output, so I created this small script that lets you
assign it a hot key and will compile the front most window using Lilypond
from within BBedit.

This script will work with any application that lets you get the name and
location of the front most window, but you will need to change that to match
the program you are using yourself.

You also will need to add where your copy of Lilypond is (mine is in the
applications folder) and this script currently puts the output .pdf file on
the Desktop, where Preview then opens it.

To use this script:

1) Copy the text below
2) Paste into Script Editor
3) Change the path to your copy of Lilypond
4) Modify the output destination to another folder if you don't want it on
the desktop.
5) Place the script in BBedits Scripts folder
6) Edit your file in BBedit and when you want to see the output, select the
script

I assigned this script a keyboard command (shift-control-R) so I edit, hit
that command, and in a few seconds, my output appears in Preview.

Lilypond does not even launch (the UI anyway). However, I still need to
launch Lilypond with the file sometimes, since it offers better error
reporting. Usually only at the beginning of a project, just to get the
errors are ironed out.

I am trying to figure out how to get the console output of Lilypond back
into BBedit, so any errors appear there and that will eliminate the need to
have to launch the Lilyond app.

##

set TheOutputPath to the POSIX path of (path to desktop)
set ThelilyPath to POSIX path of
/Volumes/HD01/Applications/LilyPond.app/Contents/Resources/bin/lilypond -o


tell application BBEdit

copy file of window 1 to TheFile
copy name of window 1 to TheFilename

end tell


set TheUnixPath to the POSIX path of TheFile
set FinalPath to quoted form of the POSIX path of (TheOutputPath 
TheFilename)

set TheCommand to ThelilyPath  FinalPath quoted form of the POSIX
path of TheUnixPath

try
do shell script TheCommand
end try

set TheOutputFile to TheOutputPath  TheFilename  .pdf

try
do shell script open   quoted form of the POSIX path of TheOutputFile
end try

###
-- 


Daniel
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Arpeggios from chordmode?

2011-08-02 Thread Basso Ridiculoso
HA!!

Yes! That is very close indeed.

Now I can enter in chord changes, and with just a very simple search/replace
make an arpeggio sheet for them.

See enclosed file for example (requires Giles code below as an \include)

 To get the chord changes and the arps, I just double the chord progression
with a longer duration. It still is less typing than what I was doing.

And can I just say, this list is *always* helpful. I wish some software that
I have paid for had people as responsive as this list has. Every time I have
asked a question it has been answered!

Thank you Giles!

Daniel


 --

 Message: 8
 Date: Mon, 01 Aug 2011 17:00:29 +0200
 From: Gilles gilles.thiba...@free.fr
 To: lilypond-user@gnu.org
 Subject: Re: Arpeggios from chordmode?
 Message-ID: op.vzjim3mpdfrkz2@pc64
 Content-Type: text/plain; charset=iso-8859-15; Format=flowed;
DelSp=yes


  Is there as simple way to get chord mode to return:
 
  c4 e g
 
  instead of
 
  c e g4
 

 Is something like that what you wanted ?

 
 #(use-modules (ice-9 receive))
 %% see http://www.gnu.org/software/guile/manual/guile.html#Multiple-Values

 #(define (chords-list-seq-list lst)
 (receive (notes others)
  (partition (lambda(x) (ly:duration? (ly:music-property x
 'duration)))
 lst)
  (map (lambda(x)
 (let ((elts (list x)))
   (if (pair? others)(begin
  (set! elts (append elts others))
  (set! others '(
   (make-music 'EventChord 'elements elts)))
notes)))

 chordsToSeq = #(define-music-function (parser location music)(ly:music?)
 (music-map
 (lambda (x)
   (if (eq? 'EventChord (ly:music-property x 'name))
 (make-music 'SequentialMusic 'elements
 (chords-list-seq-list (ly:music-property x 'elements)))
 x))
 music))


 music = \chordmode {d4:min7\f g:7 c:maj7}

 \new Voice \chordsToSeq \music
 %%

 Gilles
 -- next part --
 A non-text attachment was scrubbed...
 Name: chordsToSeq.png
 Type: image/png
 Size: 906 bytes
 Desc: not available
 URL:
 /archive/html/lilypond-user/attachments/20110801/094c80c9/attachment.png

 --




Arpblueschart.ly
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Arpeggios from chordmode?

2011-07-30 Thread Basso Ridiculoso
Hello all,

I am trying to generate some exercise files and I realized all I need is a
way to make chordmode render those chord names as arpeggios, instead of
vertical chords. Not in the classical notation, in otherwords, not the kind
showing the playing of notes simultaneously with the arpeggio symbol, but
returning the notes without them being grouped vertically and simultaneous.

Is there as simple way to get chord mode to return:

c4 e g

instead of

c e g4

I realize that this feature is called chordmode for a reason :) But this
ability to get back the arpeggios of a chord progression would be
exceedingly helpful for improvisational charts.

Then one could enter in

harmonies = d:min7 g7 c:maj7

and get back

d4 f a c
g b d f
c e g b

I am not brave enough to modify any built in .ly files that Lilypond depends
on..(yet).

Just checking to see if anyone else has already solved this one yet!

Thanks for any help.

Daniel
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Function to limit range down?

2011-07-21 Thread Basso Ridiculoso
Thank you! Merci! This looks like exactly what I want to do.

However, the file is a .bin archive of some kind? What can I decompress that
with? I am running Mac OS 10.4.

This list is always very helpful!

Daniel


Message: 7
Date: Thu, 21 Jul 2011 17:50:06 +0200
From: Gilles gilles.thiba...@free.fr
To: lilypond-user@gnu.org
Subject: Re: Function to limit range down?
Message-ID: op.vyy7ls2ldfrkz2@pc64
Content-Type: text/plain; charset=iso-8859-15; Format=flowed;
   DelSp=yes

 I am transposing some arpeggio exercises and need to make sure notes do
 not
 go below e, on the bass clef.


Here (see joined file) is a set of 3 functions which can be useful for
that purpose.
  \correctOctave
  \correctOctaveRange
  \colorizeOutOfRange

See comments in code source for an explanation of each of them.

Gilles
-- next part --
A non-text attachment was scrubbed...
Name: check-pitch.ly
Type: application/octet-stream
Size: 3362 bytes
Desc: not available
URL: /archive/html/lilypond-user/
attachments/20110721/280fb335/attachment.obj
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Function to limit range down?

2011-07-21 Thread Basso Ridiculoso
Never mind! I just had to change the .extension to .ly and it is fine.
apologies!
Daniel

On Thu, Jul 21, 2011 at 9:15 AM, Basso Ridiculoso 
basso.ridicul...@gmail.com wrote:

 Thank you! Merci! This looks like exactly what I want to do.

 However, the file is a .bin archive of some kind? What can I decompress
 that with? I am running Mac OS 10.4.

 This list is always very helpful!

 Daniel


 Message: 7
 Date: Thu, 21 Jul 2011 17:50:06 +0200
 From: Gilles gilles.thiba...@free.fr
 To: lilypond-user@gnu.org
 Subject: Re: Function to limit range down?
 Message-ID: op.vyy7ls2ldfrkz2@pc64
 Content-Type: text/plain; charset=iso-8859-15; Format=flowed;
DelSp=yes


  I am transposing some arpeggio exercises and need to make sure notes do
  not
  go below e, on the bass clef.
 

 Here (see joined file) is a set of 3 functions which can be useful for
 that purpose.
   \correctOctave
   \correctOctaveRange
   \colorizeOutOfRange

 See comments in code source for an explanation of each of them.

 Gilles
 -- next part --
 A non-text attachment was scrubbed...
 Name: check-pitch.ly
 Type: application/octet-stream
 Size: 3362 bytes
 Desc: not available
 URL: /archive/html/lilypond-user/
 attachments/20110721/280fb335/attachment.obj







-- 
I remain,
*The Bassist Ridiculoso*
*http://bassoridiculoso.blogspot.com/*
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Function to limit range down?

2011-07-20 Thread Basso Ridiculoso
I have been trying to use \Octavecheck but I think I need the inverse - I
want to move a range *up* if it is too low, not down if it is too high.

Is there way to this?

I am transposing some arpeggio exercises and need to make sure notes do not
go below e, on the bass clef.

-- 
Daniel
*http://bassoridiculoso.blogspot.com/*
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user