What is KVR Audio? | Submit News | Advertise | Developer Account

Options (Affects News & Product results only):

OS:
Format:
Include:
Quick Search KVR

"Quick Search" KVR Audio's Product Database, News Items, Developer Listings, Forum Topics and videos here. For advanced Product Database searching please use the full product search. For the forum you can use the phpBB forum search.

To utilize the power of Google you can use the integrated Google Site Search.

Products 0

Developers 0

News 0

Forum 0

Videos 0

Search  

Scripting

Official support for: photosounder.com

Moderator: A_SN

KVRian
 
670 posts since 6 May, 2008, from Berlin, Germany
 

Postby A_SN; Fri Apr 08, 2011 8:19 am

The new version of Photosounder is entirely scriptable, so let's make some scripts! Here are some examples, some very simple, some more advanced: http://photosounder.com/scripts.php

You can make your own scripts using Photosounder's recording feature (every action done is saved to an history/script file called history.pha in the program's folder, you can easily turn a full history into a versatile script by removing and editing a few lines in your favourite text editor) and using this reference: http://photosounder.com/PHA_spec_v1.1.pdf

This thread's purpose is to help anyone who would like to script or even for script requests.
Developer of Photosounder (a spectral editor/synth), SplineEQ and Spiral
KVRist
 
464 posts since 26 Nov, 2009

Postby jonahs; Thu Apr 28, 2011 10:49 pm

Example scripts and documentation are great, but I don't understand a few things.

What am I "supposed" to do to do with base85? Looking at wikipedia is interesting... I can turn text into Ascii85, which I can then turn into sound!? That's cool. :love: I found a free tool for osx that I'll try later. If this works you could do some really bizarre and novel things. Is there a way to get photosounder to do the conversion of my file to base85? I'd be really interested to see an example I could tweak.

In my very limited testing of base85 I wasn't able to do much. I got some ultra high frequencies(pink diamonds) and sound similar to if you open a data file in a wave editor, which makes sense. The drawing tools seemed to have broken and the image only showed up on the main canvas when I zoomed in.

I haven't been able to figure out the usage of Multiply layer by <ratio>, New original image and New original sound. I don't think I've seen these in files I made in photosounder. If you could whip some super simple pha's using them as well I think I could figure them out.

Right now what I'm doing is ultra simple mostly just using the duplicate layer + move layer commands. You can build harmonies, chords and sequences that you have very precise control over editing later. I'm still researching the most musically relevant numbers to use. My only disappointment is that you can't(or I haven't figured it out) do really in depth changes over time because the number of layers is too great. Maybe in 10 years when computers are better. :lol:

I am unsure of the best way deal with all the layers that get created. I've been counting them and then running a script to merge that many times.

It's funny that photosounder records in the pha file you saving the pha file itself. :-o I make lots of version of files to test things and I have to go through and get rid of many occurrences of this.

As far as script requests, is it possible to do pitch bends? It seems like it would be. If so, any pointers to get started? Scaling the image seems unlikely, but I'll ask.:lol:

I also have some scripting functionality requests, but maybe they should be moved to the main request thread?

I would like an option to disable photosounder asking me to save when I hit the "r" button to reload. I open up the pha file while photosounder is open to do things like rename my layers and things would feel faster if I didn't have to do that.

A menu of our scripts in photosounder would be gold. Using something like /* */ to comment out large areas would be useful. The ability to enter height as note or semitone. I'm not sure if it's possible becasue you can have multiple layers with the same name currently, but selecting a layer by name would help. Maybe each layer should get a hard coded # as well?
KVRian
 
670 posts since 6 May, 2008, from Berlin, Germany
 

Postby A_SN; Thu Apr 28, 2011 11:27 pm

Base85 is a translation of the binary representation of buffers. Note that implementations of Base85 aren't mutually intelligible, mine uses its own coding (which is described in the specification). Basically you'll want to use that if you have a program that'll generate full images to write its pixels. Photosounder uses Base85 when you save to a status PHA file as it saves raw pixel data.

'Multiply layer by <ratio>' does what it says it does, but you won't see it if you have only one layer as the end result is normalised. It changes the volume of a layer with respect to the others. It's the command written by the Layer intensity knob. New original image and New original sound will show up when you save a sound to a status PHA file. It contains the data necessary for the lossless mode to work, copies of the original sound and of the image that came out of it after analysis.

jonahs wrote:Right now what I'm doing is ultra simple mostly just using the duplicate layer + move layer commands. You can build harmonies, chords and sequences that you have very precise control over editing later. I'm still researching the most musically relevant numbers to use. My only disappointment is that you can't(or I haven't figured it out) do really in depth changes over time because the number of layers is too great. Maybe in 10 years when computers are better. :lol:

Even when scripting the best approach is to do things the way you would do them in Photosounder. That means that instead of duplicating a lot of layers you use one Convolution layer and you put dots on it, each dot representing one copy, the dot at the same place as the convolution centre representing the original. By the way careful with the Move layer commands, just today I've realised that the sign of the vertical offset is inverted (I've written in the specification about it). No big deal, you just have to write with the opposite sign, and in the future it'll be corrected although if your document says it's a Photosounder Archive v1.1 it will interpret the offset the old way. Don't worry about it though as now at the end of the specification I note those type of forward-compatibility issues. If you use the latest beta it already says v1.1.1 but the sign hasn't been changed whereas it will actually be changed when it's all released. For scripting I strongly recommend to stick to the latest official release.

Anyway remember, all you have to do to figure out how to do anything is merely to actually do it in Photosounder and then look at how it's written.

jonahs wrote:It's funny that photosounder records in the pha file you saving the pha file itself. :-o I make lots of version of files to test things and I have to go through and get rid of many occurrences of this.

It's always commented out with //, so you don't have to remove that. It's made so that you can easily enable the saving and recording what you've done without systematically doing it. Although in the case of saving an history file it doesn't really make sense since a Save command to a .pha file defaults to a status file.

Concerning pitch bends, you can already do that. All you need is a Vertical Propagation layer on which you draw a curve that represents your pitch bend. In the future I will make a function to scale the image, although most likely only in time. And you can already enter height as a note. That's what all the notes in the blue examples in the specification are about.

You can make your requests here. I intend to have a Scripts menu where the scripts in one folder would be listed and so you could run them without having to go through Open. How about a Shift+R to Resume Last Session without asking if you want to save?

And the way to select a layer is a tricky problem, mostly because of what you can do with edits to an history file that would mess things up. As you said the problem with selecting by name is that you can have several layers with the same name, and the problem with the numbers thing is how do you get a consistent and unique number? Let's say you do a New layer command, how do you get a consistent number for it that you know of? By specifying it? And let's say you have a New layer command in a script and you run with the script twice, creating two same numbered layers twice. You see what I mean. That's why I prefer to keep it as it is, with the option to select layers either using their absolute index or index relative to the currently selected layer.
Developer of Photosounder (a spectral editor/synth), SplineEQ and Spiral
KVRian
 
518 posts since 27 Jun, 2011

Postby wasi; Fri Oct 19, 2012 1:32 pm

Sorry for being so dense, but is the usage of these scripts like this:

I open the file I want to apply the script to, then I chose "open file" again, it prompts me to save the current file, I say no? yes? (does ist matter?).

Then I open the script (which is a history file with the file loading portions removed), because it's a script, instead of loading a new file it applies the script to the current file?

Honestly that's not really intuitive and it has taken me until now to understand that that is apparently what I'm supposed to do (the manual is cryptic and the website says nothing).

Couldn't you make a 'Scripts' folder in the main Photosounder folder that you can drop the scripts into and then select them from a submenu of the 'tools' menu or something? They are tools, ultimately, and could enhance photosounder but as it is you feel like you're hacking.
KVRian
 
670 posts since 6 May, 2008, from Berlin, Germany
 

Postby A_SN; Wed Oct 31, 2012 12:47 pm

wasi wrote:Sorry for being so dense, but is the usage of these scripts like this:

I open the file I want to apply the script to, then I chose "open file" again, it prompts me to save the current file, I say no? yes? (does ist matter?).

Then I open the script (which is a history file with the file loading portions removed), because it's a script, instead of loading a new file it applies the script to the current file?

Honestly that's not really intuitive and it has taken me until now to understand that that is apparently what I'm supposed to do (the manual is cryptic and the website says nothing).

Couldn't you make a 'Scripts' folder in the main Photosounder folder that you can drop the scripts into and then select them from a submenu of the 'tools' menu or something? They are tools, ultimately, and could enhance photosounder but as it is you feel like you're hacking.

Sorry about the awkwardness of loading scripts, scripting was a brand new thing in the last public release of Photosounder and then it wasn't a feature as much as a by-product of the history saving thing. The reason why it asks you if you want to save is that it opens a script like it opens a document, and depending on what the script does it might destroy all you have in memory. My idea would be indeed to have a Script menu that would list all the scripts in a script folder, and it would make using them much faster. It would have been pretty hard to do with the current code base, but like I just said in another thread I took the decision to rewrite Photosounder with a more complete framework which will allow me to do that easily, so I guess you can count on that in the next version.
Developer of Photosounder (a spectral editor/synth), SplineEQ and Spiral

Moderator: A_SN

Return to Photosounder