Updating Soundscapes

<= Previous Change

Diff Summary
Title
Date 2009-01-15 20:33 2009-01-15 20:38
Editor Andrew Plotkin (zarf) Andrew Plotkin (zarf)

2009-01-15 20:33 by Andrew Plotkin
2009-01-15 20:38 by Andrew Plotkin
f1This is my quick and dirty summary of what you neef1This is my quick and dirty summary of what you nee
>d to do to take an old (Boodler 1.x) soundscape -->d to do to take an old (Boodler 1.x) soundscape --
> as Python code -- and update it to work with Bood> as Python code -- and update it to work with Bood
>ler 2.0. This is not a substitute for reading the >ler 2.0. This is not a substitute for reading the 
>new Designing Soundscapes tutorial.>new Designing Soundscapes tutorial.
22
n3Create a directory. Put in a [Metadata] file whin3Create a directory. Put in a [Metadata] file which
>ch includes the name of your package (`boodler.pac> includes the name of your package (`boodler.packa
>kage: ...`) and a `boodler.main: main` line.>ge: ...`) and a `boodler.main: main` line.
44
n5Copy in your Python file, and rename it `main.pyn5Copy in your Python file, and rename it `main.py` 
>` (to match the `boodler.main:` line in `Metadata`>(to match the `boodler.main:` line in `Metadata`.)
>.>
66
n7Delete all the `name="..."` lines in your Agent n7Delete all the `name="..."` lines in your Agent cl
>classes. Put that information in the `Resources` f>asses. Put that information in the `Resources` fil
>ile, as `dc.title: ...`>e, as `dc.title: ...`
88
n9- - Titles in Boodler start with a capital letter,n9- Titles in Boodler start with a capital letter, b
> but do not capitalize each word after that.>ut do not capitalize each word after that.
1010
n11Add these lines:n11Add these lines:
1212
n13        `from boopak.package import *`    n13    from boopak.package import *
14        `from boodle import agent, builtin`14    from boodle import agent, builtin
1515
n16Make sure your Agent classes are defined asn16Make sure your Agent classes are defined as
1717
n18        class MyAgentName(agent.Agent):n18    class MyAgentName(agent.Agent):
1919
n20- - If you really want to use the `class MyAgentNan20- If you really want to use the `class MyAgentName
>me(agent.Agent):` format, add an import line of th>(agent.Agent):` format, add an import line of the 
>e form `from boodle.agent import Agent`.>form `from boodle.agent import Agent`.
2121
n22Call `bimport()` for each package you want to imn22Call `bimport()` for each package you want to impo
>port. >rt. 
2323
n24- - All sound sample files live in packages now, sn24- All sound sample files live in packages now, so 
>o you'll have to import them this way. >you'll have to import them this way. 
2525
n26- - Sounds that used to be in the Boodler sound lin26- Sounds that used to be in the Boodler sound libr
>brary are now mostly in `org.boodler.old...` packa>ary are now mostly in `org.boodler.old...` package
>ges. For example, you might do this:>s. For example, you might do this:
2727
n28        water = bimport('org.boodler.old.water')n28    `water = bimport('org.boodler.old.water')`
2929
n30Instead of referring to a sound as a string, refn30Instead of referring to a sound as a string, refer
>er directly to the object in the imported package.> directly to the object in the imported package. F
> For example:>or example:
3131
n32        \# replace this: n32    # replace this:
33        self.sched_note('environ/rain-heavy.aiff')33    self.sched_note('environ/rain-heavy.aiff')
> 
34        \# with this: 34    # with this:
35        self.sched_note(water.rain_heavy)35    self.sched_note(water.rain_heavy)
3636
n37- - No quotes, no `.aiff` suffix, and dashes have n37- No quotes, no `.aiff` suffix, and dashes have ge
>generally turned into underscores. Examine the pac>nerally turned into underscores. Examine the packa
>kage contents to see the exact names of the sound >ge contents to see the exact names of the sound fi
>files.>les.
3838
n39Built-in agents like `FadeOutAgent`, `FadeInOutAn39Built-in agents like `FadeOutAgent`, `FadeInOutAge
>gent`, `StopAgent` are now in the `builtin` module>nt`, `StopAgent` are now in the `builtin` module. 
>. You will have to say, for example:>You will have to say, for example:
4040
n41        self.sched_agent(builtin.StopAgent())n41    self.sched_agent(builtin.StopAgent())
4242
n43Change all `__init__()` functions in your agent n43Change all `__init__()` functions in your agent cl
>classes to `init()`. Remove this line wherever it >asses to `init()`. Remove this line wherever it ap
>appears:>pears:
4444
n45        \# no longer needed:n45    # no longer needed:
46        Agent.__init__(self)46    Agent.__init__(self)
4747
n48Make sure the arguments to `init()` are the righn48Make sure the arguments to `init()` are the right 
>t types. Don't use an integer for a default value >types. Don't use an integer for a default value if
>if you want the user to be able specify a float. F> you want the user to be able specify a float. For
>or list arguments, you should declare an `_args` f> list arguments, you should declare an `_args` fie
>ield to specify the list type.>ld to specify the list type.
4949
n50Remove the `float(...)`, `int(...)`, etc casts fn50Remove the `float(...)`, `int(...)`, etc casts fro
>rom your `init()` method. Those conversations now >m your `init()` method. Those conversations now oc
>occur automatically.>cur automatically.
5151
n52Test your code with `boodler.py --external` *youn52Test your code with `boodler.py --external` *your-
>r-directory*.>directory*.
5353
n54When it works, create a package file with `boodln54When it works, create a package file with `boodle-
>e-mgr.py --import create` *your-directory*.>mgr.py --import create` *your-directory*.
5555
t56Don't forget to install the package in your own t56Don't forget to install the package in your own co
>collection: `boodle-mgr.py install` *your-package.>llection: `boodle-mgr.py install` *your-package.bo
>boop*>op*
5757
Updating Soundscapes - last changed 2009-01-15 20:38 by Andrew Plotkin (zarf)