Hello
somebody nows how tomake a script in OSX to load a PD patch selecting a specific sound decive ( MOTU sound card) and 8 channells?....
When I start PD manually it select by default the Imac soundcard so
I have to select the device (MOTU) in media>portaudio manually ....
I need to make a script with a especific configuration because is for a sound installation
any advance is welcome, sorry for bad english regards chrs!
On 28 Oct 2008, at 4:21 AM, Gal Chris wrote:
Hello
somebody nows how tomake a script in OSX to load a PD patch
selecting a specific sound decive ( MOTU sound card) and 8
channells?....When I start PD manually it select by default the Imac soundcard so I have to select the device (MOTU) in media>portaudio manually ....
I need to make a script with a especific configuration because is
for a sound installation
try something like:
/Applications/Pd.app/Contents/Resources/bin/pd -audiodev 2
depending of course on where your Pd is, and what it is called.
you could save that line in a .command file.
alternatively save the CL flags in your Pd startup preferences,
remember to 'apply' then 'save all settings', then restart pd.
to find out which device numbers correspond to which audio devices
use -listdev as a startup flag and look at the console output. To
find out available startup flags, for more control of devices
channels etc, try:
/Applications/Pd.app/Contents/Resources/bin/pd -help
in Terminal.
When all is set, make sure the MOTU is plugged in before Pd is
started. 'Open at Login' in the dock can be useful if you want
automated launch, as can 'restart after power failure' hidden away in
'options'
in 'energy saver' preference panel
simon
I find that the Pd command line functionality is broken in many
versions of Pd for OSX. (at least i can't get it to work)
The latest Pd extended (0.40.3) DOES seem to work for the command line
though, which is good news.
However, once you save preferences, they are saved into ~/Library/
Preferences/org.puredata.pd.plist and will be picked up by every Pd
that you launch - e.g. the plain Pd versions.
So saving preferences only works if you only ever need one Pd setup.
This is fine if you only use the full Pd extended.
For my purposes, I like to write Pd preferences directly into the
preferences file and then move it into the Pd.app bundle. This works
for every Pd version, and if you never actually save preferences from
within Pd, you can run different Pd.app bundles for different needs.
OR, if you do save preferences, you can just re-move the
org.puredata.pd.plist back into the appropriate bundle to restore
separate preferences for different Pd.app bundles.
I went so far as writing a bash script that downloads Pd, writes
preferences, moves them into the bundle, copies any libraries,
abstractions or patches I want into the bundle, and renames the bundle
to a custom name.
I think this is similar result to Hans' standalone app generator,
though I haven't checked out how that works. (i think it's a build
process, more than plain script).
I've copied my template script below in case anyone wants to use it.
You would have to customise it to your needs though. Also, if you
want to start a given patch at runtime, there are some limitations
with moving the .app bundle to different locations.
cheers Nick
#!/bin/sh
current_dir=pwd
date_time=date "+20%y%m%d_%Hh%M"
echo
echo - current directory is:
echo ${current_dir}
# edit CUSTOM_PD_NAME to name your new customised Pd .app bundle CUSTOM_PD_NAME="Pd_Custom.app" ## edit PD_PATCH to name patch to load on starting the Pd. #PD_PATCH="start_patch.pd" ## edit PD_PATCH_DIR to name patch directory within custom Pd bundle. #PD_PATCH_DIR="custompath/patches"
# edit PD_INST_ORIGINAL to match Pd .app version and location PD_INST_ORIGINAL="${current_dir}/Pd-0.41-4.app" PD_INST="${current_dir}/${CUSTOM_PD_NAME}" PD_BUNDLE_PATCH_DIR="/Contents/Resources/${PD_PATCH_DIR}" echo sudo cp ${current_dir}/${PD_PATCH} ${PD_INST_ORIGINAL}$ {PD_BUNDLE_PATCH_DIR}
## NOTE - in bash script file testing, spaces are important!
## NOTE also -f tests specifically for file, -e for existance of
anything (eg app bundle)
## example:
#if [ -f testfilename ]
#then
# echo testfilename exists!
#fi
#if [ ! -f testfilename ]
#then
# echo testfilename doesn't exist!
#fi
# clean up previous raw Pd app if [ -e $PD_INST_ORIGINAL ] then echo - Delete the old vanilla Pd app just in case it has been modified. sudo rm -rf $PD_INST_ORIGINAL else echo - No old Pd app bundle exists. fi
# clean up previous customised Pd app if [ -e $PD_INST ] then echo - Delete the existing customised Pd in case it has been modified. sudo rm -rf $PD_INST else echo - No existing customised Pd app bundle exists. fi
# download new Pd if needed (if it doesn't already exist) if [ ! -e pd-0.41-4.mac.tar.gz ] then echo - Downloading fresh vanilla Pd. curl -o pd-0.41-4.mac.tar.gz http://crca.ucsd.edu/~msp/Software/pd-0.41-4.mac.tar.gz else echo - No need to download fresh vanilla Pd. fi
# unzip the pd vanilla app that was either just downloaded or already
existed
echo - Untar the fresh vanilla Pd.
tar -zxf pd-0.41-4.mac.tar.gz
# backup any old plist as before, and then remove it
if [ -e ~/Library/Preferences/org.puredata.pd.plist ]
then
echo - Backing up old org.puredata.pd.plist and deleting it ready for
new one.
echo - Backup file is: ~/Library/Preferences/org.puredata.pd.backup_$
{date_time}.plist
cp ~/Library/Preferences/org.puredata.pd.plist ~/Library/Preferences/
org.puredata.pd.backup_${date_time}.plist
rm ~/Library/Preferences/org.puredata.pd.plist
fi
# copy any libraries you wish from /copy_to_externs/ directory into Pd
bundle extras...
echo - Copying externals and patches into the Pd app bundle.
cp -R ${current_dir}/copy_to_externs/* ${PD_INST_ORIGINAL}/Contents/
Resources/extra/
# make directory for patches
sudo mkdir -p ${PD_INST_ORIGINAL}${PD_BUNDLE_PATCH_DIR}
# copy custom patches into this directory
sudo cp ${current_dir}/${PD_PATCH} ${PD_INST_ORIGINAL}$
{PD_BUNDLE_PATCH_DIR}
echo - Preparing permissions in the Pd app bundle. # prepare file and directory permissions sudo chmod -R 0755 ${PD_INST_ORIGINAL}/Contents/Resources/extra/* sudo chmod -R 0744 ${PD_INST_ORIGINAL}/Contents/Resources/extra/*.pd sudo chmod -R 0755 ${PD_INST_ORIGINAL}${PD_BUNDLE_PATCH_DIR}/* sudo chmod -R 0744 ${PD_INST_ORIGINAL}${PD_BUNDLE_PATCH_DIR}/*.pd
# create the new plist below. Make sure to get npath and nloadlib
numbers correct
echo - Writing new Pd plist file.
defaults write org.puredata.pd audioapi 4
defaults write org.puredata.pd audiobuf 50
# audiodev number num_channels (eg audioindev1 "0 2")
defaults write org.puredata.pd audioindev1 "0 2"
defaults write org.puredata.pd audiooutdev1 "0 2"
defaults write org.puredata.pd callback 0
defaults write org.puredata.pd defeatrt 0
# make the customised Pd open the Pd patch on startup - IMPOSSIBLE!
except for a fixed directory, which will break if the .app is moved
#defaults write org.puredata.pd flags "${PD_AUDIO} -open ${PD_PATCH}"
defaults write org.puredata.pd flags ""
defaults write org.puredata.pd nloadlib 0
#defaults write org.puredata.pd loadlib1 iemlib1
defaults write org.puredata.pd noaudioin False
defaults write org.puredata.pd naudioout False
defaults write org.puredata.pd nomidiin True
defaults write org.puredata.pd nomidiout True
defaults write org.puredata.pd npath 0
## make sure the custom path is in the Pd path - IMPOSSIBLE! except
for a fixed directory, which will break if the .app is moved
#defaults write org.puredata.pd path1 "../${PD_PATCH_DIR}"
defaults write org.puredata.pd rate 44100
# move the new plist into the .app and remove it
if [ -e ~/Library/Preferences/org.puredata.pd.plist ]
then
echo - Moving new plist file into the vanilla Pd app bundle then
deleting it from Library.
sudo cp ~/Library/Preferences/org.puredata.pd.plist $
{PD_INST_ORIGINAL}/Contents/org.puredata.pd.plist
sudo rm ~/Library/Preferences/org.puredata.pd.plist
sudo chmod 0755 ${PD_INST_ORIGINAL}/Contents/org.puredata.pd.plist
else
echo - Looks like you didnt make a new pd.plist so there isnt one to
copy to the new Pd app bundle.
fi
# last thing - move and rename the Pd .app echo - Renaming the new customised Pd app bundle. sudo mv ${PD_INST_ORIGINAL} ${PD_INST}
echo - Finished! echo
On Oct 28, 2008, at 2:25 AM, Simon Wise wrote:
On 28 Oct 2008, at 4:21 AM, Gal Chris wrote:
Hello
somebody nows how tomake a script in OSX to load a PD patch selecting a specific sound decive ( MOTU sound card) and 8 channells?....
When I start PD manually it select by default the Imac soundcard so I have to select the device (MOTU) in media>portaudio manually ....
I need to make a script with a especific configuration because is for a sound installation
try something like:
/Applications/Pd.app/Contents/Resources/bin/pd -audiodev 2
depending of course on where your Pd is, and what it is called.
you could save that line in a .command file.
alternatively save the CL flags in your Pd startup preferences, remember to 'apply' then 'save all settings', then restart pd.
to find out which device numbers correspond to which audio devices use -listdev as a startup flag and look at the console output. To find out available startup flags, for more control of devices channels etc, try:
/Applications/Pd.app/Contents/Resources/bin/pd -help
in Terminal.
When all is set, make sure the MOTU is plugged in before Pd is started. 'Open at Login' in the dock can be useful if you want automated launch, as can 'restart after power failure' hidden away in 'options' in 'energy saver' preference panel
simon
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
hi, so you mean that pd will read its preference file in
/Contents/org.puredata.pd.plist
does it override the ~/Library/Preferences/ one?
it's been a while since i managed to use pd command line on osx the only way i found was to compile it and move the extras from Pd-extended
anyway this preferences trick sounds really good. thanks
vincent
On Oct 28, 2008, at 3:10 PM, Vincent Rioux wrote:
hi, so you mean that pd will read its preference file in
/Contents/org.puredata.pd.plist
yes - but only if no preference file exists in ~/Library/Preferences/
does it override the ~/Library/Preferences/ one?
no. therefore you have to rename (backup) or delete this version of
the org.puredata.pd.plist if you want Pd to find its version in
Pd*.app/Contents/
it's been a while since i managed to use pd command line on osx the only way i found was to compile it and move the extras from Pd- extended
yeah, this is essentially what i do - starting with a plain Pd .app
bundle, and copying in only the externals i need from Pd-extended.
This way I have a purpose-made Pd.app without the bloat.
anyway this preferences trick sounds really good. thanks
it's not bad, but does have some limitations if you want to load a
patch from within the bundle. basically, you can only refer to
absolute paths, so if you put a patch in the bundle, designed for a
path of /Applications/Pd*.app/Contents/Resources/my-patch.pd then it
will only work when the Pd app is in /Applications directory.
I think Hans' Pd standalone app maker overcomes this problem, but I
haven't tried it yet.
hope this script helps some anyway.
Nick
vincent
I know this is old, but I just found a really handy way to embed
these settings in the patch:
.hc
On Oct 28, 2008, at 9:21 AM, Nicholas Mariette wrote:
On Oct 28, 2008, at 3:10 PM, Vincent Rioux wrote:
hi, so you mean that pd will read its preference file in
/Contents/org.puredata.pd.plist
yes - but only if no preference file exists in ~/Library/Preferences/
does it override the ~/Library/Preferences/ one?
no. therefore you have to rename (backup) or delete this version of the org.puredata.pd.plist if you want Pd to find its version in Pd*.app/Contents/
it's been a while since i managed to use pd command line on osx the only way i found was to compile it and move the extras from Pd- extended
yeah, this is essentially what i do - starting with a plain Pd .app bundle, and copying in only the externals i need from Pd-extended. This way I have a purpose-made Pd.app without the bloat.
anyway this preferences trick sounds really good. thanks
it's not bad, but does have some limitations if you want to load a patch from within the bundle. basically, you can only refer to absolute paths, so if you put a patch in the bundle, designed for a path of /Applications/Pd*.app/Contents/Resources/my-patch.pd then it will only work when the Pd app is in /Applications directory.
I think Hans' Pd standalone app maker overcomes this problem, but I haven't tried it yet.
hope this script helps some anyway.
Nick
vincent
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Terrorism is not an enemy. It cannot be defeated. It's a tactic.
It's about as sensible to say we declare war on night attacks and
expect we're going to win that war. We're not going to win the war
on terrorism. - retired U.S. Army general, William Odom
Old? That's a new one on me. Genius Hans! Most useful, thankyou for sharing.
On Wed, 12 Nov 2008 13:37:23 -0500 Hans-Christoph Steiner hans@eds.org wrote:
I know this is old, but I just found a really handy way to embed
these settings in the patch:
Hans-Christoph Steiner wrote:
I know this is old, but I just found a really handy way to embed these settings in the patch:
nice. however, i don't understand the complicated way to build the message-box.
attached is a simplified version (really nothing new) with minor added functionality and to be used as GOP. an even better version would use iemgut's [saveargs] functionality to make the abstraction re-usable.
fmgads IOhannes
dear list, i noticed that on Lenny (debian unstable), Pd-extended could not get installed unless you find libmpeg1 somewhere (which i found difficult to get).
there sould be other solutions but for the moment i found that installing: http://debian.mirror.inra.fr/debian/pool/main/libm/libmpeg1/libmpeg1_1.3.1-2... would solve the problems...
so in eight steps :
deb http://www.debian-multimedia.org lenny main 2) update repo sudo apt-get update 3) install debian-multimedia sudo apt-get install debian-multimedia-keyring 4) download pd-extended wget http://downloads.sourceforge.net/pure-data/Pd-0.40.3-extended-debian-testing... 5) install it sudo dpkg -i http://downloads.sourceforge.net/pure-data/Pd-0.40.3-extended-debian-testing... 5bis) ignore dependencies errors 6) install missing depencies sudo apt-get -f install 7) get the missing one wget http://debian.mirror.inra.fr/debian/pool/main/libm/libmpeg1/libmpeg1_1.3.1-2... 8) install it sudo dpkg -i libmpeg1_1.3.1-2.1_i386.deb
et voilà...
best regards, vincent