Re: [PD] Script in osx
I know this is old, but I just found a really handy way to embed these settings in the patch: save-audio-settings.pd Description: Binary data .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 ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Script in osx
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 [EMAIL PROTECTED] wrote: I know this is old, but I just found a really handy way to embed these settings in the patch: -- Use the source ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Script in osx
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 http://soundsorange.net here's the script --- #!/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
Re: [PD] Script in osx
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 ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Script in osx
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
Re: [PD] Script in osx
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 mediaportaudio 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
Re: [PD] Script in osx
Hello Boby, If you use Pd or the last Pd-extended release (0.40-3), you can edit startup option directly in Pd in the PreferencesStartup menu. Options are listed here under the command line option paragraph: http://crca.ucsd.edu/~msp/Pd_documentation/x3.htm#s4 notably: -open your_patch.pd : opens a patch -audiodev n : select your soundcard -outchannels n : configure the number of out channels -inchannels n ... Don't forget to press apply... Greetings, Nicolas Boby Peru Dafoe a écrit : Hello PD list!!! I wrote from Mexico DF I hope you can help me, I am working in a sound installation with Imac and PD , and I want to know if it is possible make a script that statr up my patch selecting the sound card and the number of input and outputs that I will use ((I use a Motu via firewire , 8 channels). I only get call my patch and start it but with the defaults configuration of PD. To launch the Motu soundcard I have to make the configration manually: mediaportaudio select the sound card and channels please let me know any advance sorry my bad english chrs ¡Buscá desde tu celular! Yahoo! oneSEARCH ahora está en Claro http://ar.mobile.yahoo.com/onesearch ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list -- http://nim.on.free.fr ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list