lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: midi2ly on Mac OS X


From: Hans Aberg
Subject: Re: midi2ly on Mac OS X
Date: Sat, 28 Mar 2009 18:50:19 +0100

On 28 Mar 2009, at 18:00, James E. Bailey wrote:

Additionally, since midi2ly, like convert-ly, lilypond-book, and lilysong are python scripts, at least on OSX 10.4, in addition to installing a newer version of python, the first line of those files needs to be changed to: #!/usr/bin/env python

On Mac OS X 10.5, there is a fairly up-to-date /usr/bin/python.

I call this and other programs with scripts containing:
 exec /Applications/LilyPond.app/Contents/Resources/bin/midi2ly "$@"

Possibly (I haven't checked it), one might change that on 10.4 to:
 alias python='env python'
 exec /Applications/LilyPond.app/Contents/Resources/bin/midi2ly "$@"
and take down the python in Fink or MacPorts.

One simple way to create them is, in Terminal, to go to the directory where you want to have the script (I put it in ~/local/bin/ as do not want to clutter ~) and type
  cat > midi2ly
  exec /Applications/LilyPond.app/Contents/Resources/bin/midi2ly "$@"
  ^D
where the last is <ctrl>D. Then set it as executable by
  chmod +x midi.ly

Edit the script your using
  open -a 'My Text Editor' midi2ly

One needs to set the environmental variables, which can be done in .profile, or using the RCEnvironment from http://www.rubicode.com/Software/ .

My .profile file uses the text below, which enables using programs in / usr/local, MacPorts, Fink, and user, plus MacTex.

It might be useful to have a .bashrc file as well, as X11 doesn't read .profile (it doesn't make a bash login shell, see 'man bash'), which might contain:
  source ~/.profile
That is, it just reads .profile.

When all this is done, you have a midi2ly which works as as any other UNIX program.

  Hans Aberg


----
# Add to end of searchpath:
append_path()
{
if ! eval test -z "\"\${$1##*:$2:*}\"" -o -z "\"\${$1%%*:$2}\"" -o - z "\"\${$1##$2:*}\"" -o -z "\"\${$1##$2}\"" ; then
    eval "$1=\$$1:$2"
  fi
}

# Add to beginning of searchpath:
prepend_path()
{
if ! eval test -z "\"\${$1##*:$2:*}\"" -o -z "\"\${$1%%*:$2}\"" -o - z "\"\${$1##$2:*}\"" -o -z "\"\${$1##$2}\"" ; then
    eval "$1=$2:\$$1"
  fi
}

# Set system searchpaths:

# In the case a directory may exist (depending on the program) both with and without # parent directory 'share/' (like in the cae of MANPATH and INFOPATH), the 'share/' # version is put first, as it is what is used in /usr on Mac OS X FreeSD UNIX. # The idea is that if a program is somehow adapted to this platform, the the stuff will # be moved to the 'share/' variation, and should thus be ovverride the unadapted versions.

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
MANPATH=/usr/share/man:/usr/X11R6/man
INFOPATH=/usr/share/info
LIBPATH=/usr/lib:/usr/X11R6/lib

# Prepend Fink searchpaths:
test -r /sw/bin/init.sh && . /sw/bin/init.sh

# Prepend MacPorts (former DarwinPorts) searchpaths:
prepend_path PATH /opt/local/bin:/opt/local/sbin
prepend_path MANPATH /opt/local/share/man:/opt/local/man
prepend_path INFOPATH /opt/local/share/info:/opt/local/info
prepend_path LIBPATH /opt/local/lib

# Prepend MacTeX paths
prepend_path PATH /usr/texbin
prepend_path MANPATH /usr/local/texlive/2007/texmf/doc/man
prepend_path INFOPATH /usr/local/texlive/2007/texmf/doc/info

# Prepend /usr/local/ searchpaths:
prepend_path PATH /usr/local/bin:/usr/local/X11R6/bin
prepend_path MANPATH /usr/local/share/man:/usr/local/man
prepend_path INFOPATH /usr/local/share/info:/usr/local/info
prepend_path LIBPATH /usr/local/lib

# Prepend $HOME searchpaths:
prepend_path PATH $HOME/local/bin
prepend_path MANPATH $HOME/local/share/man:$HOME/local/man
prepend_path INFOPATH $HOME/local/share/info:$HOME/local/info
prepend_path LIBPATH $HOME/local/lib


# Export changed paths:
export PATH
export MANPATH
export INFOPATH
export LIBPATH
----





reply via email to

[Prev in Thread] Current Thread [Next in Thread]