Renoise Forums: Xrns-php Using Bash On Os X - Renoise Forums

Jump to content

Page 1 of 1

Xrns-php Using Bash On Os X OS X 10.4 and below

#1 User is online   Conner_Bw 

  • Composes without Wires burns Directly from Brain to DVD that is already in Store Member
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: Normal Members
  • Posts: 4123
  • Joined: 31-August 03
  • Gender:Male
  • Location:Montreal, Quebec, Canada

Posted 20 October 2007 - 05:53 PM

EDIT: MAC OS X Leopard (10.5) has PHP 5.2.x out of the box. If you are using Leopard you can download the scripts (or do a CVS checkout) and ignore the PHP advice below.

Members of the Renoise community are writing some pretty cool PHP scripts that do awesome stuff with the XRNS file format.

http://xrns-php.sourceforge.net/

Unfortunately, there is no GUI for XRNS-PHP on the mac at this time. XRNS-PHP requires PHP 5.2.3 or higher. This is currently not included on OS X 10.4, the default in /usr/bin/php is version 4 which is too old.

All of these factors make it difficult to use for people not familiar with the command prompt. That being said, it's very easy to learn the command prompt. The amount of time spent making and maintaining the scripts is far greater than the amount of time it takes to learn the command prompt. Blah blah blah, command prompt.

1) OS X 10.4 Tiger users and below, get a PHP5 package:

* http://www.entropy.c...are/macosx/php/
* http://www.apachefri...mpp-macosx.html
* http://www.mamp.info/en/download.html <- I use this one

2) download xrns-scripts (Edit: Currently at version 1.06) and extract in a new folder. Optionally if you have terminal rocking (see below) you can:

cd ~
mkdir xrns-php
cd xrns-php
cvs -z9 -d:pserver:anonymous@xrns-php.cvs.sourceforge.net:/cvsroot/xrns-php co -P xrns-php/scripts/



The first three lines make a folder in your home dir named xrns-php, the fourth line downloads the scripts from CVS. Warning! These are work in progress and probably unstable, use at your own risk. But if you want the latest and greatest, cvs is the way to go.

3) Download the missing third party tools.

* Vorbis Tools for MacOS X : http://www.rarewares.../ogg-oggenc.php
* FLAC: http://flac.sourceforge.net/

4) Make a directory in your home dir named "bin", put the files in there, here's my bin:

[dac514@iMac][~/bin]
[13:46:07]$ pwd
/Users/dac514/bin
[dac514@iMac][~/bin]
[13:46:08]$ ls -al
total 7664
drwxr-xr-x   12 dac514  dac514	  408 Aug 26 11:27 .
drwxr-xr-x   25 dac514  dac514	  850 Oct 18 18:37 ..
-rw-r--r--	1 dac514  dac514	12292 Aug 26 11:27 .DS_Store
-rwxr-xr-x	1 dac514  dac514   352348 Feb 14  2007 flac
-rwxr-xr-x	1 dac514  dac514   233376 Feb 14  2007 metaflac
-rwxr-xr-x	1 dac514  dac514   215796 Nov 19  2005 oggdec
-rwxr-xr-x	1 dac514  dac514  1319344 Nov 19  2005 oggenc
-rwxr-xr-x	1 dac514  dac514   199240 Nov 19  2005 ogginfo
-rwxr-xr-x	1 dac514  dac514   727464 Jul  6 00:19 rar
-rwxr-xr-x	1 dac514  dac514   440100 Jul  6 00:19 unrar
-rwxr-xr-x	1 dac514  dac514   182716 Nov 19  2005 vcut
-rwxr-xr-x	1 dac514  dac514   220824 Nov 19  2005 vorbiscomment
[dac514@iMac][~/bin]
[13:46:11]$ 



5)

:panic:

Find the Terminal application, this is your command prompt.

Desktop -> Hard Drive -> Applications -> Utilites -> Terminal

Change the preferences so that you are using bash:

Terminal -> Windows Settings

Shell: Should be bash
Color: Change to white on black for 3l1t3 k00l factor
Change the other stuff if you want, too
Click "Use Settings as Defaults"
Click "X"

In Terminal, type:

cd ~
pico -w .bash_profile



Pay attention to the dot at the start of the file name, this means "hidden file". If not already there, paste the following into pico.

if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi



Press CTRL-X, look at the bottom, agree to save.


In Terminal, type:

whoami



Remember this value, write it down somewhere if you have poor memory.

cd ~
pico -w .bashrc



Again, pay attention to the dot at the start of the file name, this still means "hidden file". Paste the following into pico:


# COLOURS
TEMP="\[\033[1;30m\]"
BLACK="\[\033[0;30m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[0;32m\]"
ORANGE="\[\033[0;33m\]"
BLUE="\[\033[0;34m\]"
PURPLE="\[\033[0;35m\]"
CYAN="\[\033[0;36m\]"
LIGHT_GRAY="\[\033[0;37m\]"
LIGHT_BLACK="\[\033[1;30m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
YELLOW="\[\033[1;33m\]"
LIGHT_BLUE="\[\033[1;34m\]"
LIGHT_PINK="\[\033[1;35m\]"
LIGHT_CYAN="\[\033[1;36m\]"
WHITE="\[\033[1;37m\]"
NO_COLOUR="\[\033[0m\]"
BLUE_BG="\[\033[0;44m\]"

# PROMPT
PS1="$LIGHT_BLUE[$WHITE\u$NO_COLOUR@$LIGHT_GREEN\h$LIGHT_BLUE][$WHITE\w$LIGHT_BLUE]\n$LIGHT_BLUE[$WHITE\t$LIGHT_BLUE]$NO_COLOUR\$ "

#PATH
export PATH="$PATH:/Users/dac514/bin/:/Applications/MAMP/bin/php5/bin/"

# ALIASES
alias "ls"="ls -G"
alias "dir"="ls -alG"

# OS X 10.4 Tiger and below
alias php=/Applications/MAMP/bin/php5/bin/php
alias pear=/Applications/MAMP/bin/php5/bin/pear



Look above, replace all the "dac514" with the result you got when you did `whoami` just before. Replace the paths with the whatever version of PHP you downloaded.

Exit terminal.

Start terminal again.

:drummer:

6) go to command line and navigate to the xrns-scripts folder i.e. `cd ~/xrns-php` without the backticks.

7) launch script with

(/path/to)php -n script_name.php /path/to/input.ext (/path/to/)output.ext



Where (/path/to) is optional i.e. you don't have to type it and if you do lose the parenthesis. Where script_name.php is the actual file name of a script. Some scripts have extra options. Open the script in a text editor to read which parameters it expects when running it from the command-line.

Cool OS X text editors:

http://smultron.sourceforge.net/
http://www.jedit.org/
http://www.eng.hawai...u/Tutor/vi.html
http://www.gnu.org/software/emacs/

Command prompt tutorials:

http://www.hypexr.or...sh_tutorial.php
http://www.macdevcen.../terminal1.html
http://www.oreilly.c.../terminal2.html
http://www.macdevcen.../terminal3.html
http://www.macdevcen.../terminal4.html
http://www.macdevcen.../terminal5.html

Although I'm snarky and sardonic, provided you actually made some effort and aren't a lazy pile of tard, I'm more than willing to help, so post questions here. Who knows, maybe you could start writing your own scripts and be part of the kingdom of nerds!

:yeah:

This post has been edited by Conner_Bw: 23 June 2008 - 07:42 PM

cpu MacBook Pro 2.53 GHz Intel Core 2 Duo os MacOSX 10.6.x audio Edirol FA-66
ONE MILLION CLICKS! » Normalize Your Sig » PHP Scripts for Renoise » My homepage »
STOP BROWSING THE FORUMS AND MAKE MORE MUSIC INSTEAD
0

#2 User is online   Conner_Bw 

  • Composes without Wires burns Directly from Brain to DVD that is already in Store Member
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: Normal Members
  • Posts: 4123
  • Joined: 31-August 03
  • Gender:Male
  • Location:Montreal, Quebec, Canada

Posted 17 February 2008 - 11:29 PM

It has come to my attention that MAC OS X Leopard (10.5.X) has PHP 5.2.x with the SimpleXML extension out of the box. So, if you are using Leopard you can download the scripts (or do a CVS checkout) and ignore most of the advice above. Can someone confirm this?

Sorry, no OS X Script Frontend as of yet.

This post has been edited by Conner_Bw: 17 February 2008 - 11:31 PM

cpu MacBook Pro 2.53 GHz Intel Core 2 Duo os MacOSX 10.6.x audio Edirol FA-66
ONE MILLION CLICKS! » Normalize Your Sig » PHP Scripts for Renoise » My homepage »
STOP BROWSING THE FORUMS AND MAKE MORE MUSIC INSTEAD
0

#3 User is offline   airlab:am 

  • New Member
  • Pip
  • Group: Normal Members
  • Posts: 2
  • Joined: 10-April 08

Posted 10 April 2008 - 01:48 PM

I can verify this works. I'm particularly fond of piping the output (not literally, I'm not an ultra power user yet) from xrns2midi to midi2ly to lilypond...typeset scores from what i input with tracker notation = wonderful. unfortunately, the midis that xrns2midi generates do not seem to work with sibelius 4, which i fired up so i could check for the sorts of silly mistakes that it is good at showing. it still works out fine at the end of the day, but i'd really like to get sibelius working with xrns2midi output...that would just about do it for me.

Oh, by the way, to anyone who wants to try to get lilypond working: go to http://hans.fugal.ne...pond-on-leopard and create the shell launcher script as it advises. Then, download and install the intel version of leopard to a separate directory, and create another launcher script in the same manner as the last one, but pointing to the intel version of lilypond. Why should you do this? Well, it seems to be broken right now. I can use lilypond but not midi2ly with the ppc(g4, etc) version. I can use midi2ly but not lilypond with the intel version. Because i need to use both, I just installed both and made a script that launches xrns2midi then each respective part of the lilypond and midi2ly chain. It is very hacky, but it works. The end result is something like this (note, this is not universal and you should use common sense and change filenames as is necessary):


#! /bin/sh
php -n ~/xrns-scripts-1.06/xrns2midi.php ee.xrns ee.mid; change as necessary for your xrns file
sh ly2 midi2ly ee.mid; again change as is necessary
sh ly lilypond ee-midi.ly; and again change as is necessary, appending '-midi.ly' to whatever you named your file


This post has been edited by airlab:am: 10 April 2008 - 01:58 PM

0

#4 User is online   Conner_Bw 

  • Composes without Wires burns Directly from Brain to DVD that is already in Store Member
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: Normal Members
  • Posts: 4123
  • Joined: 31-August 03
  • Gender:Male
  • Location:Montreal, Quebec, Canada

Posted 10 April 2008 - 02:47 PM

Thanks for sharing names of software I had never heard of before. Good stuff.

View Postairlab:am, on Apr 10 2008, 09:48 AM, said:

the midis that xrns2midi generates do not seem to work with sibelius 4


I Googled for "sibelius 4" since this was the first time I heard of it, and I ended up on this page, which is sibelius 5. I won't be buying this software anytime soon, so before I download the trial and debug the scripts in a time limited trial window of time, can you also confirm it's not working in sibelius 5?

View Postairlab:am, on Apr 10 2008, 09:48 AM, said:

Oh, by the way, to anyone who wants to try to get lilypond working: go to http://hans.fugal.ne...pond-on-leopard and create the shell launcher script as it advises. [...]
#! /bin/sh
php -n ~/xrns-scripts-1.06/xrns2midi.php ee.xrns ee.mid; change as necessary for your xrns file
sh ly2 midi2ly ee.mid; again change as is necessary
sh ly lilypond ee-midi.ly; and again change as is necessary, appending '-midi.ly' to whatever you named your file



Cool, thanks for the tip.
cpu MacBook Pro 2.53 GHz Intel Core 2 Duo os MacOSX 10.6.x audio Edirol FA-66
ONE MILLION CLICKS! » Normalize Your Sig » PHP Scripts for Renoise » My homepage »
STOP BROWSING THE FORUMS AND MAKE MORE MUSIC INSTEAD
0

#5 User is offline   Bantai 

  • Probably More God or Borg Than Human Member
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: Renoise Team
  • Posts: 7613
  • Joined: 29-May 03
  • Gender:Male
  • Location:In your Renose

Posted 10 April 2008 - 02:57 PM

The XRNS2MIDI script produces MidiXML files that validate against the MidiXML schema. The MIDI files are generated by the same library that produces the valid MidiXML. Ofcourse, neither fact guarantees correctness - for example, the schema may be broken, or the MID export doesn't match the MidiXML export. As the author of XRNS2MIDI, I would like to see an example .MID and .XML that doesn't work in Sibelius, so I can trace any bugs in the script or library.
[cpu] AMD 4850e 2.4 GHz [ram] 4 GB DDR2 [hdd] 2TB [gpu] ATI HD4670
[audio] M-Audio Firewire Audiophile @ TI [os] WinXP SP2, Win7 x64, Ubuntu 9.04, MacOSX 10.5.8

>move sig for great justice!
0

#6 User is offline   jasper 

  • Advanced Member
  • PipPipPip
  • Group: Normal Members
  • Posts: 80
  • Joined: 13-March 08

Posted 04 May 2008 - 10:35 PM

hi there,
are these directions suitable for linux operation also?
thanks in advance!
These scripts are very useful and offer a lot of creativity.
Many thanks for the work of all involved.
jasper
0

#7 User is online   Conner_Bw 

  • Composes without Wires burns Directly from Brain to DVD that is already in Store Member
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: Normal Members
  • Posts: 4123
  • Joined: 31-August 03
  • Gender:Male
  • Location:Montreal, Quebec, Canada

Posted 04 May 2008 - 11:28 PM

Yes, I would assume the directions are suitable for linux too.

Get back to me/us if they aren't?

Thanks!
cpu MacBook Pro 2.53 GHz Intel Core 2 Duo os MacOSX 10.6.x audio Edirol FA-66
ONE MILLION CLICKS! » Normalize Your Sig » PHP Scripts for Renoise » My homepage »
STOP BROWSING THE FORUMS AND MAKE MORE MUSIC INSTEAD
0

Page 1 of 1


Fast Reply