Updating Soundscapes

<= Previous Change | Next Change =>

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

2009-01-15 20:29 by Andrew Plotkin
2009-01-15 20:33 by Andrew Plotkin
88
9- - Titles in Boodler start with a capital letter,9- - Titles in Boodler start with a capital letter,
> but do not capitalize each word after that.> but do not capitalize each word after that.
1010
11- Add these lines:11- Add these lines:
1212
n13    from boopak.package import *n13        `from boopak.package import *`    
14    from boodle import agent, builtin14        `from boodle import agent, builtin`
1515
16- Make sure your Agent classes are defined as16- Make sure your Agent classes are defined as
1717
n18    class MyAgentName(agent.Agent):n18        class MyAgentName(agent.Agent):
1919
20- - If you really want to use the `class MyAgentNa20- - If you really want to use the `class MyAgentNa
>me(agent.Agent):` format, add an import line of th>me(agent.Agent):` format, add an import line of th
>e form `from boodle.agent import Agent`.>e form `from boodle.agent import Agent`.
2121
22- Call `bimport()` for each package you want to im22- Call `bimport()` for each package you want to im
>port. >port. 
2323
24- - All sound sample files live in packages now, s24- - All sound sample files live in packages now, s
>o you'll have to import them this way. >o you'll have to import them this way. 
2525
26- - Sounds that used to be in the Boodler sound li26- - Sounds that used to be in the Boodler sound li
>brary are now mostly in `org.boodler.old...` packa>brary are now mostly in `org.boodler.old...` packa
>ges. For example, you might do this:>ges. For example, you might do this:
2727
n28    water = bimport('org.boodler.old.water')n28        water = bimport('org.boodler.old.water')
2929
30- Instead of referring to a sound as a string, ref30- Instead of referring to a sound as a string, ref
>er directly to the object in the imported package.>er directly to the object in the imported package.
> For example:> For 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
37- - No quotes, no `.aiff` suffix, and dashes have 37- - No quotes, no `.aiff` suffix, and dashes have 
>generally turned into underscores. Examine the pac>generally turned into underscores. Examine the pac
>kage contents to see the exact names of the sound >kage contents to see the exact names of the sound 
>files.>files.
3838
39- Built-in agents like `FadeOutAgent`, `FadeInOutA39- Built-in agents like `FadeOutAgent`, `FadeInOutA
>gent`, `StopAgent` are now in the `builtin` module>gent`, `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
43- Change all `__init__()` functions in your agent 43- Change all `__init__()` functions in your agent 
>classes to `init()`. Remove this line wherever it >classes to `init()`. Remove this line wherever it 
>appears:>appears:
4444
t45    # no longer needed:t45        \# no longer needed:
46    Agent.__init__(self)46        Agent.__init__(self)
4747
48- Make sure the arguments to `init()` are the righ48- Make sure the arguments to `init()` are the righ
>t types. Don't use an integer for a default value >t types. Don't use an integer for a default value 
>if you want the user to be able specify a float. F>if you want the user to be able specify a float. F
>or list arguments, you should declare an `_args` f>or list arguments, you should declare an `_args` f
>ield to specify the list type.>ield to specify the list type.
4949
50- Remove the `float(...)`, `int(...)`, etc casts f50- Remove the `float(...)`, `int(...)`, etc casts f
>rom your `init()` method. Those conversations now >rom your `init()` method. Those conversations now 
>occur automatically.>occur automatically.
5151
Updating Soundscapes - last changed 2009-01-15 20:38 by Andrew Plotkin (zarf)