summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-10-02 11:33:59 (GMT)
committerGuido van Rossum <guido@python.org>1994-10-02 11:33:59 (GMT)
commit3a80c8defe29ac7d169ad3d791f67bcaf7a9b3f2 (patch)
tree709905bc2fb0d0d218e9e115dc80758dced030aa /Mac
parent950d47fd6789c5c7d8aa4a0708659e713db17895 (diff)
downloadcpython-3a80c8defe29ac7d169ad3d791f67bcaf7a9b3f2.zip
cpython-3a80c8defe29ac7d169ad3d791f67bcaf7a9b3f2.tar.gz
cpython-3a80c8defe29ac7d169ad3d791f67bcaf7a9b3f2.tar.bz2
Add files by Jack
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Demo/speech/SCRIPT1204
-rw-r--r--Mac/Demo/speech/grail.py228
-rw-r--r--Mac/Demo/speech/hum.py31
-rw-r--r--Mac/Modules/macspeech/README18
-rw-r--r--Mac/Modules/macspeechmodule.c559
5 files changed, 2040 insertions, 0 deletions
diff --git a/Mac/Demo/speech/SCRIPT b/Mac/Demo/speech/SCRIPT
new file mode 100644
index 0000000..12e1713
--- /dev/null
+++ b/Mac/Demo/speech/SCRIPT
@@ -0,0 +1,1204 @@
+ Boy do I have a treat for you guys!
+If this works you can send thanks to emeli@magnus.acs.ohio-state.edu for
+bringing it to you, though I did not transcribe it.
+
+"Monty Python and the Holy Grail"
+-- the strictly unofficial script of the movie,
+ done in a fit of boredom by =AHH 01Jan87=
+
+The Cast (in order of appearance [roughly]):
+ KING ARTHUR : Graham Chapman
+ PATSY : Terry Gilliam
+ GUARD #1 : Michael Palin
+ GUARD #2 : John Cleese
+ MORTICIAN : Eric Idle
+ CUSTOMER : John Cleese
+ DEAD PERSON : ???
+ DENNIS : Michael Palin
+ WOMAN : Terry Jones
+ BLACK KNIGHT : Michael Palin?
+ VILLAGER #1 : Eric Idle
+ VILLAGER #2 : Michael Palin
+ SIR BEDEMIR : Terry Jones
+ WITCH : ???
+ VILLAGER #3 : John Cleese
+ NARRATOR: Michael Palin
+ SIR LANCELOT : John Cleese
+ SIR GALAHAD : Michael Palin
+ SIR ROBIN : Eric Idle
+ GOD : ???
+ FRENCH GUARD : John Cleese
+ MINSTREL : ???
+ LEFT HEAD :
+ MIDDLE HEAD :
+ RIGHT HEAD :
+Graham Chapman
+Terry Jones
+Michael Palin
+ OLD MAN : Terry Gilliam
+ HEAD KNIGHT OF NEE : Michael Palin
+ FATHER : Michael Palin
+ PRINCE HERBERT : Graham Chapman?
+ GUARD #1 : Eric Idle
+ GUARD #2 : ???
+ CONCORDE : Eric Idle
+ OLD CRONE : ???
+ ROGER THE SHRUBBER : Eric Idle
+ TIM THE ENCHANTER: John Cleese
+ BROTHER MAYNARD: Eric Idle
+ SECOND BROTHER: Michael Palin
+
+ Scene 1
+
+[wind]
+[clop clop]
+ ARTHUR: Whoa there!
+[clop clop]
+
+ GUARD #1: Halt! Who goes there?
+ ARTHUR: It is I, Arthur, son of Uther Pendragon, from the castle
+of Camelot. King of the Britons, defeator of the Saxons, sovereign
+of all England!
+ GUARD #1: Pull the other one!
+ ARTHUR: I am. And this my trusty servant Patsy.
+We have ridden the length and breadth of the land in search of knights
+who will join me in my court of Camelot. I must speak with your lord
+and master.
+ GUARD #1: What, ridden on a horse?
+ ARTHUR: Yes!
+ GUARD #1: You're using coconuts!
+ ARTHUR: What?
+ GUARD #1: You've got two empty halves of coconut and your bangin'
+'em together.
+ ARTHUR: So? We have ridden since the snows of winter covered this
+land, through the kingdom of Mercea, through--
+ GUARD #1: Where'd you get the coconut?
+ ARTHUR: We found them.
+ GUARD #1: Found them? In Mercea? The coconut's tropical!
+ ARTHUR: What do you mean?
+ GUARD #1: Well, this is a temperate zone.
+ ARTHUR: The swallow may fly south with the sun or the house martin
+or the plumber may seek warmer climes in winter yet these are not
+strangers to our land.
+ GUARD #1: Are you suggesting coconuts migrate?
+ ARTHUR: Not at all, they could be carried.
+ GUARD #1: What -- a swallow carrying a coconut?
+ ARTHUR: It could grip it by the husk!
+ GUARD #1: It's not a question of where he grips it! It's a simple
+question of weight ratios! A five ounce bird could not carry a 1 pound
+coconut.
+ ARTHUR: Well, it doesn't matter. Will you go and tell your master
+that Arthur from the Court of Camelot is here.
+ GUARD #1: Listen, in order to maintain air-speed velocity, a swallow
+needs to beat its wings 43 times every second, right?
+ ARTHUR: Please!
+ GUARD #1: Am I right?
+ ARTHUR: I'm not interested!
+ GUARD #2: It could be carried by an African swallow!
+ GUARD #1: Oh, yeah, an African swallow maybe, but not a European
+ swallow, that's my point.
+ GUARD #2: Oh, yeah, I agree with that...
+ ARTHUR: Will you ask your master if he wants to join my court
+at Camelot?!
+ GUARD #1: But then of course African swallows are not migratory.
+ GUARD #2: Oh, yeah...
+ GUARD #1: So they couldn't bring a coconut back anyway...
+[clop clop]
+ GUARD #2: Wait a minute -- supposing two swallows carried it together?
+ GUARD #1: No, they'd have to have it on a line.
+ GUARD #2: Well, simple! They'd just use a standard creeper!
+ GUARD #1: What, held under the dorsal guiding feathers?
+ GUARD #2: Well, why not?
+
+Scene 2
+
+ MORTICIAN: Bring out your dead!
+[clang]
+Bring out your dead!
+[clang]
+Bring out your dead!
+[clang]
+Bring out your dead!
+[clang]
+ Bring out your dead!
+[clang]
+Bring out your dead!
+[clang]
+Bring out your dead!
+[clang]
+Bring out your dead!
+[clang]
+Bring out your dead!
+[clang]
+Bring out your dead!
+[clang]
+Bring out your dead!
+[clang]
+Bring out your dead!
+ CUSTOMER: Here's one -- nine pence.
+ DEAD PERSON: I'm not dead!
+ MORTICIAN: What?
+ CUSTOMER: Nothing -- here's your nine pence.
+ DEAD PERSON: I'm not dead!
+ MORTICIAN: Here -- he says he's not dead!
+ CUSTOMER: Yes, he is.
+ DEAD PERSON: I'm not!
+ MORTICIAN: He isn't.
+ CUSTOMER: Well, he will be soon, he's very ill.
+ DEAD PERSON: I'm getting better!
+ CUSTOMER: No, you're not -- you'll be stone dead in a moment.
+ MORTICIAN: Oh, I can't take him like that -- it's against regulations.
+ DEAD PERSON: I don't want to go in the cart!
+ CUSTOMER: Oh, don't be such a baby.
+ MORTICIAN: I can't take him...
+ DEAD PERSON: I feel fine!
+ CUSTOMER: Oh, do us a favor...
+ MORTICIAN: I can't.
+ CUSTOMER: Well, can you hang around a couple of minutes? He won't
+be long.
+ MORTICIAN: Naaah, I got to go on to Robinson's -- they've lost nine
+today.
+ CUSTOMER: Well, when is your next round?
+ MORTICIAN: Thursday.
+ DEAD PERSON: I think I'll go for a walk.
+ CUSTOMER: You're not fooling anyone y'know. Look, isn't there
+something you can do?
+ DEAD PERSON: I feel happy... I feel happy.
+[whop]
+ CUSTOMER: Ah, thanks very much.
+ MORTICIAN: Not at all. See you on Thursday.
+ CUSTOMER: Right.
+ [clop clop]
+ MORTICIAN: Who's that then?
+ CUSTOMER: I don't know.
+ MORTICIAN: Must be a king.
+ CUSTOMER: Why?
+ MORTICIAN: He hasn't got shit all over him.
+
+Scene 3
+
+[clop clop]
+ ARTHUR: Old woman!
+ DENNIS: Man!
+ ARTHUR: Man, sorry. What knight live in that castle over there?
+ DENNIS: I'm thirty seven.
+ ARTHUR: What?
+ DENNIS: I'm thirty seven -- I'm not old!
+ ARTHUR: Well, I can't just call you 'Man'.
+ DENNIS: Well, you could say 'Dennis'.
+ ARTHUR: Well, I didn't know you were called Dennis.
+ DENNIS: Well, you didn't bother to find out, did you?
+ ARTHUR: I did say sorry about the old woman, but from the behind
+you looked--
+ DENNIS: What I object to is you automatically treat me like an inferior!
+ ARTHUR: Well, I AM king...
+ DENNIS: Oh king, eh, very nice. An' how'd you get that, eh? By
+exploitin' the workers -- by 'angin' on to outdated imperialist dogma
+which perpetuates the economic an' social differences in our society!
+If there's ever going to be any progress--
+ WOMAN: Dennis, there's some lovely filth down here. Oh -- how'd you do?
+ ARTHUR: How do you do, good lady. I am Arthur, King of the Britons.
+Who's castle is that?
+ WOMAN: King of the who?
+ ARTHUR: The Britons.
+ WOMAN: Who are the Britons?
+ ARTHUR: Well, we all are. we're all Britons and I am your king.
+ WOMAN: I didn't know we had a king. I thought we were an autonomous
+collective.
+ DENNIS: You're fooling yourself. We're living in a dictatorship.
+A self-perpetuating autocracy in which the working classes--
+ WOMAN: Oh there you go, bringing class into it again.
+ DENNIS: That's what it's all about if only people would--
+ ARTHUR: Please, please good people. I am in haste. Who lives
+in that castle?
+ WOMAN: No one live there.
+ ARTHUR: Then who is your lord?
+ WOMAN: We don't have a lord.
+ ARTHUR: What?
+ DENNIS: I told you. We're an anarchosyndicalist commune. We take
+ it in turns to act as a sort of executive officer for the week.
+ ARTHUR: Yes.
+ DENNIS: But all the decision of that officer have to be ratified
+at a special biweekly meeting.
+ ARTHUR: Yes, I see.
+ DENNIS: By a simple majority in the case of purely internal affairs,--
+ ARTHUR: Be quiet!
+ DENNIS: --but by a two-thirds majority in the case of more--
+ ARTHUR: Be quiet! I order you to be quiet!
+ WOMAN: Order, eh -- who does he think he is?
+ ARTHUR: I am your king!
+ WOMAN: Well, I didn't vote for you.
+ ARTHUR: You don't vote for kings.
+ WOMAN: Well, 'ow did you become king then?
+ ARTHUR: The Lady of the Lake,
+ [angels sing]
+her arm clad in the purest shimmering samite, held aloft Excalibur
+from the bosom of the water signifying by Divine Providence that I,
+Arthur was to carry Excalibur.
+[singing stops]
+That is why I am your king!
+ DENNIS: Listen -- strange women lying in ponds distributing swords
+is no basis for a system of government. Supreme executive power derives
+from a mandate from the masses, not from some farcical aquatic ceremony.
+ ARTHUR: Be quiet!
+ DENNIS: Well you can't expect to wield supreme executive power
+just 'cause some watery tart threw a sword at you!
+ ARTHUR: Shut up!
+ DENNIS: I mean, if I went around sayin' I was an empereror just
+because some moistened bint had lobbed a scimitar at me they'd put me away!
+ ARTHUR: Shut up! Will you shut up!
+ DENNIS: Ah, now we see the violence inherent in the system.
+ ARTHUR: Shut up!
+ DENNIS: Oh! Come and see the violence inherent in the system!
+HELP! HELP! I'm being repressed!
+ ARTHUR: Bloody peasant!
+ DENNIS: Oh, what a give away. Did you here that, did you here that,
+eh? That's what I'm on about -- did you see him repressing me, you saw
+it didn't you?
+
+Scene 4
+
+[arg] [ugh] [hah]
+
+ ARTHUR: You fight with the strength of many men, Sir knight.
+I am Arthur, King of the Britons.
+
+I seek the finest and the bravest knights in the land to join me
+ in my courted camelot.
+
+You have proved yourself worthy will you join me?
+
+You make me sad. So be it. Come, Patsy.
+ BLACK KNIGHT: None shall pass.
+ ARTHUR: What?
+ BLACK KNIGHT: None shall pass.
+ ARTHUR: I have no quarrel with you, good Sir knight, but I must
+cross this bridge.
+ BLACK KNIGHT: Then you shall die.
+ ARTHUR: I command you as King of the Britons to stand aside!
+ BLACK KNIGHT: I move for no man.
+ ARTHUR: So be it!
+[hah]
+[parry thrust]
+[ARTHUR chops the BLACK KNIGHT's left arm off]
+ ARTHUR: Now stand aside, worthy adversary.
+ BLACK KNIGHT: 'Tis but a scratch.
+ ARTHUR: A scratch? Your arm's off!
+ BLACK KNIGHT: No, it isn't.
+ ARTHUR: Well, what's that then?
+ BLACK KNIGHT: I've had worse.
+ ARTHUR: You liar!
+ BLACK KNIGHT: Come on you pansy!
+[hah]
+[parry thrust]
+[ARTHUR chops the BLACK KNIGHT's right arm off]
+ ARTHUR: Victory is mine!
+[kneeling]
+We thank thee Lord, that in thy merc-
+[hah]
+ BLACK KNIGHT: Come on then.
+ ARTHUR: What?
+ BLACK KNIGHT: Have at you!
+ ARTHUR: You are indeed brave, Sir knight, but the fight is mine.
+ BLACK KNIGHT: Oh, had enough, eh?
+ ARTHUR: Look, you stupid bastard, you've got no arms left.
+ BLACK KNIGHT: Yes I have.
+ ARTHUR: Look!
+ BLACK KNIGHT: Just a flesh wound.
+[bang]
+ ARTHUR: Look, stop that.
+ BLACK KNIGHT: Chicken! Chicken!
+ ARTHUR: Look, I'll have your leg. Right!
+[whop]
+ BLACK KNIGHT: Right, I'll do you for that!
+ ARTHUR: You'll what?
+ BLACK KNIGHT: Come 'ere!
+ ARTHUR: What are you going to do, bleed on me?
+ BLACK KNIGHT: I'm invincible!
+ ARTHUR: You're a loony.
+ BLACK KNIGHT: The Black Knight always triumphs!
+Have at you! Come on then.
+[whop]
+[ARTHUR chops the BLACK KNIGHT's other leg off]
+ BLACK KNIGHT: All right; we'll call it a draw.
+ ARTHUR: Come, Patsy.
+ BLACK KNIGHT: Oh, oh, I see, running away then. You yellow
+bastards! Come back here and take what's coming to you. I'll bite
+your legs off!
+
+Scene 5
+
+ CROWD: A witch! A witch! A witch! We've got a witch! A witch!
+ VILLAGER #1: We have found a witch, might we burn her?
+ CROWD: Burn her! Burn!
+ BEDEMIR: How do you know she is a witch?
+ VILLAGER #2: She looks like one.
+ BEDEMIR: Bring her forward.
+ WITCH: I'm not a witch. I'm not a witch.
+ BEDEMIR: But you are dressed as one.
+ WITCH: They dressed me up like this.
+ CROWD: No, we didn't -- no.
+ WITCH: And this isn't my nose, it's a false one.
+ BEDEMIR: Well?
+ VILLAGER #1: Well, we did do the nose.
+ BEDEMIR: The nose?
+ VILLAGER #1: And the hat -- but she is a witch!
+ CROWD: Burn her! Witch! Witch! Burn her!
+ BEDEMIR: Did you dress her up like this?
+ CROWD: No, no... no ... yes. Yes, yes, a bit, a bit.
+ VILLAGER #1: She has got a wart.
+ BEDEMIR: What makes you think she is a witch?
+ VILLAGER #3: Well, she turned me into a newt.
+ BEDEMIR: A newt?
+ VILLAGER #3: I got better.
+ VILLAGER #2: Burn her anyway!
+ CROWD: Burn! Burn her!
+ BEDEMIR: Quiet, quiet. Quiet! There are ways of telling whether
+she is a witch.
+ CROWD: Are there? What are they?
+ BEDEMIR: Tell me, what do you do with witches?
+ VILLAGER #2: Burn!
+ CROWD: Burn, burn them up!
+ BEDEMIR: And what do you burn apart from witches?
+ VILLAGER #1: More witches!
+ VILLAGER #2: Wood!
+ BEDEMIR: So, why do witches burn?
+
+ VILLAGER #3: B--... 'cause they're made of wood...?
+ BEDEMIR: Good!
+ CROWD: Oh yeah, yeah...
+ BEDEMIR: So, how do we tell whether she is made of wood?
+ VILLAGER #1: Build a bridge out of her.
+ BEDEMIR: Aah, but can you not also build bridges out of stone?
+ VILLAGER #2: Oh, yeah.
+ BEDEMIR: Does wood sink in water?
+ VILLAGER #1: No, no.
+ VILLAGER #2: It floats! It floats!
+ VILLAGER #1: Throw her into the pond!
+ CROWD: The pond!
+ BEDEMIR: What also floats in water?
+ VILLAGER #1: Bread!
+ VILLAGER #2: Apples!
+ VILLAGER #3: Very small rocks!
+ VILLAGER #1: Cider!
+ VILLAGER #2: Great gravy!
+ VILLAGER #1: Cherries!
+ VILLAGER #2: Mud!
+ VILLAGER #3: Churches -- churches!
+ VILLAGER #2: Lead -- lead!
+ ARTHUR: A duck.
+ CROWD: Oooh.
+ BEDEMIR: Exactly! So, logically...,
+ VILLAGER #1: If... she.. weighs the same as a duck, she's made of wood.
+ BEDEMIR: And therefore--?
+ VILLAGER #1: A witch!
+ CROWD: A witch!
+ BEDEMIR: We shall use my larger scales!
+[yelling]
+ BEDEMIR: Right, remove the supports!
+[whop]
+[creak]
+ CROWD: A witch! A witch!
+ WITCH: This is a fair cop.
+ CROWD: Burn her! Burn! [yelling]
+ BEDEMIR: Who are you who are so wise in the ways of science?
+ ARTHUR: I am Arthur, King of the Britons.
+ BEDEMIR: My liege!
+ ARTHUR: Good Sir knight, will you come with me to Camelot,
+and join us at the Round Table?
+ BEDEMIR: My liege! I would be honored.
+ ARTHUR: What is your name?
+ BEDEMIR: Bedemir, my leige.
+ ARTHUR: Then I dub you Sir Bedemir, Knight of the Round Table.
+
+[Narrative Interlude]
+
+ NARRATOR: The wise Sir Bedemir was the first to join King Arthur's
+knights, but other illustrious names were soon to follow:
+Sir Lancelot the Brave; Sir Galahad the Pure; and Sir Robin the
+Not-quite-so-brave-as-Sir-Lancelot who had nearly fought the Dragon
+of Agnor, who had nearly stood up to the vicious Chicken of Bristol
+and who had personally wet himself at the Battle of Baden Hill; and
+the aptly named Sir Not-appearing-in-this-film. Together they formed
+a band whose names and deeds were to be retold throughout the centuries,
+the Knights of the Round Table.
+
+Scene 6
+
+ BEDEMIR: And that, my liege, is how we know the Earth to be banana-shaped.
+ ARTHUR: This new learning amazes me, Sir Bedemir. Explain again how
+sheeps' bladders may be employed to prevent earthquakes.
+ BEDEMIR: Oh, certainly, sir.
+ LANCELOT: Look, my liege!
+ ARTHUR: Camelot!
+ GALAHAD: Camelot!
+ LANCELOT: Camelot!
+ PATSY: It's only a model.
+ ARTHUR: Shhh! Knights, I bid you welcome to your new home. Let us
+ride... to... Camelot.
+
+[singing]
+We're knights of the round table
+We dance when e'er we're able
+We do routines and parlour scenes
+With footwork impecc-Able.
+
+We dine well here in Camelot
+We eat ham and jam and spam a lot
+
+[dancing]
+
+We're knights of the Round Table
+Our shows are for-mid-able
+Oh many times we're given rhymes
+That are quite unsing-able
+We not so fat in Camelot
+We sing from the diaphragm a lot
+
+[tap-dancing]
+
+Oh we're tough and able
+Quite indefatigable
+Between our quests we [something]
+And impersonate Clark Gable
+It's a bit too loud in Camelot
+I have to push the pram a lot.
+
+ ARTHUR: Well, on second thought, let's not go to Camelot -- it is
+a silly place.
+ Right.
+
+Scene 7
+
+ GOD: Arthur! Arthur, King of the Britons! Oh, don't grovel! If
+there's one thing I can't stand, it's people groveling.
+ ARTHUR: Sorry--
+ GOD: And don't apologize. Every time I try to talk to someone it's
+"sorry this" and "forgive me that" and "I'm not worthy". What are you
+doing now!?
+ ARTHUR: I'm averting my eyes, oh Lord.
+ GOD: Well, don't. It's like those miserable Psalms -- they're so
+depressing. Now knock it off!
+ ARTHUR: Yes, Lord.
+ GOD: Right! Arthur, King of the Britons -- your Knights of the
+Round
+Table shall have a task to make them an example in these dark times.
+ ARTHUR: Good idea, oh Lord!
+ GOD: 'Course it's a good idea! Behold! Arthur, this is the Holy
+Grail. Look well, Arthur, for it is your sacred task to seek this Grail.
+That is your purpose, Arthur -- the Quest for the Holy Grail.
+ ARTHUR: A blessing!
+ LANCELOT: A blessing from the Lord!
+ GALAHAD: God be praised!
+
+Scene 8
+
+[clop clop]
+ ARTHUR: Halt! Hallo! Hallo!
+ GUARD: 'Allo! Who is zis?
+ ARTHUR: It is King Arthur, and these are the Knights of the Round
+Table. Who's castle is this?
+ GUARD: This is the castle of mumble mumble
+ ARTHUR: Go and tell your master that we have been charged by God
+with a sacred quest. If he will give us food and shelter for the night
+he can join us in our quest for the Holy Grail.
+ GUARD: Well, I'll ask him, but I don't think he'll be very keen...
+Uh, he's already got one, you see?
+ ARTHUR: What?
+ GALAHAD: He says they've already got one!
+ ARTHUR: Are you sure he's got one?
+ GUARD: Oh, yes, it's very nice-uh (I told him we already got one)
+ ARTHUR: Well, um, can we come up and have a look?
+ GUARD: Of course not! You are English types-uh!
+ ARTHUR: Well, what are you then?
+ GUARD: I'm French! Why do think I have this outrageous accent, you
+silly king!
+ GALAHAD: What are you doing in England?
+ GUARD: Mind your own business!
+ ARTHUR: If you will not show us the Grail, we shall take your castle
+by force!
+ GUARD: You don't frighten us, English pig-dogs! Go and boil your
+bottoms, sons of a silly person. I blow my nose at you, so-called
+Arthur-king, you and all your silly English kaniggets. Thppppt!
+ GALAHAD: What a strange person.
+ ARTHUR: Now look here, my good man!
+ GUARD: I don't want to talk to you no more, you empty headed animal
+food trough whopper! I fart in your general direction! You mother was
+a hamster and your father smelt of elderberries!
+ ???: Is there someone else up there we could talk to?
+ GUARD: No, now go away or I shall taunt you a second time-uh!
+ ARTHUR: Now, this is your last chance. I've been more than reasonable.
+ GUARD: (Fetch-a da mush.)
+ wha?
+ GUARD: (Fetch-a da mush!)
+[moo]
+ ARTHUR: If you do not agree to my commands, then I shall--
+[twong]
+[mooooooo]
+Jesus Christ!
+Right! Charge!
+ ALL: Charge!
+[mayhem]
+ GUARD: Ah, this one is for your mother!
+[twong]
+ ALL: Run away!
+ GUARD: Thpppt!
+ LANCELOT: Fiends! I'll tear them apart!
+ ARTHUR: No no, no.
+ BEDEMIR: Sir! I have a plan, sir.
+
+[later]
+
+[chop]
+[rumble rumble squeak]
+ce labon a bunny do
+wha?
+ un codoo?
+a present!
+oh, un codoo.
+oui oui hurry!
+wha-?
+let's go!
+[rumble rumble squeak]
+
+ ARTHUR: What happens now?
+ BEDEMIR: Well, now, uh, Lancelet, Galahad, and I wait until nightfall,
+and then leap out of the rabbit, taking the French by surprise -- not only
+by surprise, but totally unarmed!
+ ARTHUR: Who leaps out?
+ BEDEMIR: Uh, Lancelot, Galahad, and I. Uh, leap out of the rabbit, uh
+and uh....
+ ARTHUR: Oh....
+ BEDEMIR: Oh.... Um, l-look, if we built this large wooden badger--
+[twong]
+ ALL: Run away! Run away! Run away! Run away!
+[splat]
+ FRENCH: Oh, haw haw haw.
+
+Scene 9
+
+ Pictures for Schools, take 8.
+ DIRECTOR: Action!
+
+ NARRATOR: Defeat at the castle seems to have utterly disheartened
+King Arthur. The ferocity of the French taunting took him completely
+by surprise, and Arthur became convinced that a new strategy was required
+if the quest for the Holy Grail were to be brought to a successful
+conclusion. Arthur, having consulted his closest knights, decided that
+they should separate, and search for the Grail individually. Now, this
+is what they did--
+[tromp tromp]
+[slash]
+ WOMAN: Greg!
+
+Scene 10
+
+ NARRATOR: The Tale of Sir Robin....
+So each of the knights went their separate ways. Sir Robin rode north,
+through the dark forest of Ewing, accompanied by his favorite minstrels.
+
+ MINSTREL (singing): Bravely bold Sir Robin, rode forth from Camelot.
+ He was not afraid to die, o Brave Sir Robin.
+ He was not at all afraid to be killed in nasty ways.
+ Brave, brave, brave, brave Sir Robin!
+
+ He was not in the least bit scared to be mashed
+ into a pulp,
+ Or to have his eyes gouged out, and his elbows broken.
+ To have his kneecaps split, and his body burned away,
+ And his limbs all hacked and mangled, brave Sir Robin!
+
+ His head smashed in and his heart cut out,
+ And his liver removed and his bowels unplugged,
+ And his nostrils ripped and his bottom burned off,
+ And his penis--
+ ROBIN: That's -- that's, uh, that's enough music for now, lads.
+Looks like there's dirty work afoot.
+ DENNIS: Anarchosyndicalism is a way of preserving freedom.
+ WOMAN: Oh, Dennis, forget about freedom. Now I've dropped my mud.
+ ALL HEADS: Halt! Who art thou?
+ MINSTREL (singing): He is brave Sir Robin, brave Sir Robin, who--
+ ROBIN: Shut up! Um, n-n-nobody really, I'm j-just um, just passing
+through.
+ ALL HEADS: What do you want?
+ MINSTREL (singing): To fight, and--
+ ROBIN: Shut up! Um, oo, n-nothing, nothing really -- I, uh, j-j-ust
+to um, just to p-pass through good Sir knight.
+ ALL HEADS: I'm afraid not!
+ ROBIN: Ah. W-well, actually I am a Knight of the Round Table.
+ ALL HEADS: You're a Knight of the Round Table?
+ ROBIN: I am.
+TJ:In that case I shall have to kill you.
+GC:Shall I?
+MP:Oh, I don't think so.
+GC:Well, what do I think?
+TJ:I think kill him.
+MP:Well let's be nice to him.
+GC:Oh shut up.
+TJ:Perhaps-
+GC:And you.
+TJ:Oh quick get the sword out I want to cut his head off!
+MP:Oh, cut your own head off!
+GC:Yes, do us all a favor!
+TJ:What?
+MP:Yapping on all the time.
+GC:You're lucky, you're not next to him.
+TJ:What do you mean?
+GC:You snore.
+TJ:Oh I don't -- anyway, you've got bad breath.
+GC:Well its only because you don't brush my teeth.
+MP:Oh stop bitching and let's go have tea.
+TJ:All right all right all right we'll kill him first and then have tea
+ and biscuits.
+GC:Yes.
+MP:Oh, but not biscuits.
+TJ:All right all right not biscuits, but lets kill him anyway.
+ ALL HEADS: Right!
+TJ:He buggered off.
+MP:So he has, he scarpered.
+
+ MINSTREL (singing): Brave Sir Robin ran away
+ ROBIN: No!
+ MINSTREL (singing): Bravely ran away away
+ ROBIN: I didn't!
+ MINSTREL (singing): When danger reared its ugly head,
+ He bravely turned his tail and fled
+ ROBIN: No!
+ MINSTREL (singing): Yes Brave Sir Robin turned about
+ ROBIN: I didn't!
+ MINSTREL (singing): And gallantly he chickened out
+ Bravely taking to his feet
+ ROBIN: I never did!
+ MINSTREL (singing): He beat a very brave retreat
+ ROBIN: Oh, lie!
+ MINSTREL (singing): Bravest of the brave Sir Robin
+ ROBIN: I never!
+
+Scene 11
+ NARRATOR: The Tale of Sir Galahad
+
+[boom crash]
+[angels singing]
+
+[pound pound pound]
+ GALAHAD: Open the door!
+Open the door!
+[pound pound pound]
+In the name of King Arthur, open the door!
+[squeak thump]
+[squeak boom]
+ ALL: Hello!
+ ZOOT: Welcome gentle Sir knight, welcome to the Castle Anthrax.
+ GALAHAD: The Castle Anthrax?
+ ZOOT: Yes... oh, it's not a very good name is it? Oh! but we are
+nice and we shall attend to your every, every need!
+ GALAHAD: You are the keepers of the Holy Grail?
+ ZOOT: The what?
+ GALAHAD: The Grail -- it is here?
+ ZOOT: Oh, but you are tired, and you must rest awhile. Midget!
+Crepper!
+ MIDGET and CREPPER: Yes, oh Zoot!
+ ZOOT: Prepare a bed for our guest.
+ MIDGET and CREPPER: Oh thank you thank you thank you--
+ ZOOT: Away away vilatesses[?]! The beds here are warm and soft -- and
+very, very big.
+ GALAHAD: Well, look, I-I-uh--
+ ZOOT: What is your name, handsome knight?
+ GALAHAD: Sir Galahad... the Chaste.
+ ZOOT: Mine is Zoot... just Zoot. Oh, but come!
+ GALAHAD: Look, please! In God's name, show me the Grail!
+ ZOOT: Oh, you have suffered much! You are delirious!
+ GALAHAD: L-look, I have seen it! It is here, in the--
+ ZOOT: Sir Galahad! You would not be so ungallant as to refuse our
+hospitality.
+ GALAHAD: Well, I-I-uh--
+ ZOOT: Oh, I am afraid our life must seem very dull and quiet compared
+to yours. We are but eight score young blondes and brunettes, all between
+sixteen and nineteen and a half, cut off in this castle with no one to
+protect us! Oh, it is a lonely life -- bathing, dressing, undressing,
+making exciting underwear.... We are just not used to handsome knights.
+Nay, nay, come, come, you may lie here. Oh, but you are wounded!
+ GALAHAD: No, no -- i-it's nothing!
+ ZOOT: Oh, but you must see the doctors immediately! No, no, please,
+lie down. [clap clap]
+ PIGLET: Ah. What seems to be the trouble?
+ GALAHAD: They're doctors?!
+ ZOOT: Uh, they've had a basic medical training, yes.
+ GALAHAD: B-but--
+ ZOOT: Oh, come come, you must try to rest! Doctor Piglet, Doctor
+Winston, practice your art.
+ PIGLET: Try to relax.
+ GALAHAD: Are you sure that's necessary?
+ PIGLET: We must examine you.
+ GALAHAD: There's nothing wrong with that!
+ PIGLET: Please -- we are doctors.
+ GALAHAD: Get off the bed! I am sworn to chastity!
+ PIGLET: Back to your bed!
+ GALAHAD: Torment me no longer! I have seen the Grail!
+ PIGLET: There's no grail here.
+ GALAHAD: I have seen it, I have seen it. I have seen--
+ GIRLS: Hello.
+ GALAHAD: Oh--
+ VARIOUS GIRLS: Hello.
+Hello.
+Hello.
+Hello.
+Hello.
+Hello.
+ Hello.
+Hello.
+Hello.
+Hello.
+Hello.
+Hello.
+ GALAHAD: Zoot!
+ DINGO: No, I am Zoot's identical twin sister, Dingo.
+ GALAHAD: Oh, well, excuse me, I--
+ DINGO: Where are you going?
+ GALAHAD: I seek the Grail! I have seen it, here in this castle!
+ DINGO: No! Oh, no! Bad, bad Zoot!
+ GALAHAD: What is it?
+ DINGO: Oh, wicked, bad, naughty Zoot! She has been setting alight
+to our beacon, which, I just remembered, is grail-shaped. It's not the
+first time we've had this problem.
+ GALAHAD: It's not the real Grail?
+ DINGO: Oh, wicked, bad, naughty, evil Zoot! Oh, she is a naughty
+person, and she must pay the penalty -- and here in Castle Anthrax, we
+have but one punishment for setting alight the grail-shaped beacon. You
+must tie her down on a bed and spank her!
+ GIRLS: A spanking! A spanking!
+ DINGO: You must spank her well. And after you have spanked her, you
+may deal with her as you like. And then, spank me.
+ VARIOUS GIRLS: And spank me.
+And me.
+And me.
+ DINGO: Yes, yes, you must give us all a good spanking!
+ GIRLS: A spanking! A spanking!
+ DINGO: And after the spanking, the oral sex.
+ GIRLS: Oral sex! Oral sex!
+ GALAHAD: Well, I could stay a BIT longer.
+ LANCELOT: Sir Galahad!
+ GALAHAD: Oh, hello.
+ LANCELOT: Quick!
+ GALAHAD: What?
+ LANCELOT: Quick!
+ GALAHAD: Why?
+ LANCELOT: You're in great peril!
+ GALAHAD:
+ ZOOT:
+ LANCELOT: Silence, foul temptress!
+ GALAHAD: Now look, it's not important.
+ LANCELOT: Quick! Come on and we'll cover your escape!
+ GALAHAD: Look, I'm fine!
+ LANCELOT: Come on!
+ GALAHAD: Now look, I can tackle this lot single-handed!
+ DINGO: Yes! Let him tackle us single-handed!
+ GIRLS: Yes! Tackle us single-handed!
+ LANCELOT: No, Sir Galahad, come on!
+ GALAHAD: No, really, honestly, I can go back and handle this lot easily!
+ DINGO: Oh, yes, he can handle us easily.
+ GIRLS: Yes, yes!
+ GALAHAD: Wait! I can defeat them! There's only a hundred and fifty
+of them!
+ DINGO: Yes, yes, he'll beat us easily, we haven't a chance.
+ GIRLS: Yes, yes.
+[boom]
+ DINGO: Oh, shit.
+[outside]
+ LANCELOT: We were in the nick of time, you were in great peril.
+ GALAHAD: I don't think I was.
+ LANCELOT: Yes you were, you were in terrible peril.
+ GALAHAD: Look, let me go back in there and face the peril.
+ LANCELOT: No, it's too perilous.
+ GALAHAD: Look, my particular knight sob as much peril as I can.
+ LANCELOT: No, we've got to find the Holy Grail. Come on!
+ GALAHAD: Well, let me have just a little bit of peril?
+ LANCELOT: No, it's unhealthy.
+ GALAHAD: Bet you're gay!
+ LANCELOT: No, I'm not.
+
+ Narrative Interlude
+
+ NARRATOR: Sir Lancelot had saved Sir Galahad from almost certain
+temptation, but they were still no nearer the Grail. Meanwhile, King
+Arthur and Sir Bedemir, not more than a swallow's flight away, had
+discovered something. Oh, that's an unladen swallow's flight, obviously.
+I mean, they were more than two laden swallow's flights away -- four,
+really, if they hadn't a cord of line between them. I mean, if the birds
+were walking and dragging--
+ CROWD: Get on with it!
+ NARRATOR: Oh, anyway, on to scene twenty-four, which is a smashing
+scene with some lovely acting, in which Arthur discovers a vital clue,
+in which there aren't any swallows, although I think you can hear a
+starling -oolp!
+
+Scene 12
+
+ OLD MAN: Ah, hee he he ha!
+ ARTHUR: And this enchanter of whom you speak, he has seen the grail?
+ OLD MAN: Ha ha he he he he!
+ ARTHUR: Where does he live? Old man, where does he live?
+ OLD MAN: He knows of a cave, a cave which no man has entered.
+ ARTHUR: And the Grail... The Grail is there?
+ OLD MAN: Very much danger, for beyond the cave lies the Gorge
+ of Eternal Peril, which no man has ever crossed.
+ ARTHUR: But the Grail! Where is the Grail!?
+ OLD MAN: Seek you the Bridge of Death.
+ ARTHUR: The Bridge of Death, which leads to the Grail?
+ OLD MAN: Hee hee ha ha!
+
+Scene 13
+
+ HEAD KNIGHT: Nee!
+Nee!
+Nee!
+Nee!
+ ARTHUR: Who are you?
+ HEAD KNIGHT: We are the Knights Who Say... Nee!
+ ARTHUR: No! Not the Knights Who Say Nee!
+ HEAD KNIGHT: The same!
+ BEDEMIR: Who are they?
+ HEAD KNIGHT: We are the keepers of the sacred words: Nee, Pen, and
+Nee-wom!
+ RANDOM: Nee-wom!
+ ARTHUR: Those who hear them seldom live to tell the tale!
+ HEAD KNIGHT: The Knights Who Say Nee demand a sacrifice!
+ ARTHUR: Knights of Nee, we are but simple travellers who seek the
+enchanter who lives beyond these woods.
+ HEAD KNIGHT: Nee! Nee! Nee! Nee!
+ ARTHUR and PARTY: Oh, ow!
+ HEAD KNIGHT: We shall say 'nee' again to you if you do not appease us.
+ ARTHUR: Well, what is it you want?
+ HEAD KNIGHT: We want... a shrubbery!
+[chord]
+ ARTHUR: A what?
+ HEAD KNIGHT: Nee! Nee!
+ ARTHUR and PARTY: Oh, ow!
+ ARTHUR: Please, please! No more! We shall find a shrubbery.
+ HEAD KNIGHT: You must return here with a shrubbery or else you will
+never pass through this wood alive!
+ ARTHUR: O Knights of Nee, you are just and fair, and we will return
+with a shrubbery.
+ HEAD KNIGHT: One that looks nice.
+ ARTHUR: Of course.
+ HEAD KNIGHT: And not too expensive.
+ ARTHUR: Yes.
+ HEAD KNIGHTS: Now... go!
+
+Scene 14
+
+ NARRATOR: The Tale of Sir Lancelot.
+
+ FATHER: One day, lad, all this will be yours!
+ HERBERT: What, the curtains?
+ FATHER: No, not the curtains, lad. All that you can see! Stretched
+out over the hills and valleys of this land! This'll be your kingdom, lad!
+ HERBERT: But, Mother!
+ FATHER: Father, I'm Father.
+ HERBERT: But Father, I don't want any of that.
+ FATHER: Listen, lad. I've built this kingdom up from nothing. When
+I started here, all there was was swamp. All the kings said I was daft
+to build a castle in a swamp, but I built it all the same, just to show
+'em. It sank into the swamp. So, I built a second one. That sank into the
+swamp. So I built a third one. That burned down, fell over, then sank
+into the swamp. But the fourth one stayed up. An' that's what your gonna
+get, lad -- the strongest castle in these islands.
+ HERBERT: But I don't want any of that -- I'd rather--
+ FATHER: Rather what?!
+ HERBERT: I'd rather... just...
+[music]
+...sing!
+ FATHER: Stop that, stop that! You're not going to do a song while
+I'm here. Now listen lad, in twenty minutes you're getting married to
+a girl whose father owns the biggest tracts of open land in Britain.
+ HERBERT: But I don't want land.
+ FATHER: Listen, Alex,--
+ HERBERT: Herbert.
+ FATHER: Herbert. We live in a bloody swamp. We need all the land we
+can get.
+ HERBERT: But I don't like her.
+ FATHER: Don't like her?! What's wrong with her? She's beautiful,
+she's rich, she's got huge... tracts of land.
+ HERBERT: I know, but I want the girl that I marry to have...
+a certain... special...
+[music]
+...something...
+ FATHER: Cut that out, cut that out. Look, you're marryin' Princess
+Looky, so you'd better get used to the idea. [smack] Guards! Make sure
+the Prince doesn't leave this room until I come and get 'im.
+ GUARD #1: Not to leave the room even if you come and get him.
+ GUARD #2: Hic!
+ FATHER: No, no. Until I come and get 'im.
+ GUARD #1: Until you come and get him, we're not to enter the room.
+ FATHER: No, no, no. You stay in the room and make sure 'e doesn't
+leave.
+ GUARD #1: And you'll come and get him.
+ GUARD #2: Hic!
+ FATHER: Right.
+ GUARD #1: We don't need to do anything, apart from just stop him
+entering the room.
+ FATHER: No, no. Leaving the room.
+ GUARD #1: Leaving the room, yes.
+ FATHER: All right?
+ GUARD #1: Right. Oh, if-if-if, uh, if-if-if, uh, if-if-if we...
+ FATHER: Yes, what is it?
+ GUARD #1: Oh, if-if, oh--
+ FATHER: Look, it's quite simple.
+ GUARD #1: Uh...
+ FATHER: You just stay here, and make sure 'e doesn't leave the room.
+All right?
+ GUARD #2: Hic!
+ FATHER: Right.
+ GUARD #1: Oh, I remember. Uh, can he leave the room with us?
+ FATHER: N- No no no. You just keep him in here, and make sure--
+ GUARD #1: Oh, yes, we'll keep him in here, obviously. But if he had
+to leave and we were--
+ FATHER: No, no, just keep him in here--
+ GUARD #1: Until you, or anyone else,--
+ FATHER: No, not anyone else, just me--
+ GUARD #1: Just you.
+ GUARD #2: Hic!
+ FATHER: Get back.
+ GUARD #1: Get back.
+ FATHER: Right?
+ GUARD #1: Right, we'll stay here until you get back.
+ FATHER: And, uh, make sure he doesn't leave.
+ GUARD #1: What?
+ FATHER: Make sure 'e doesn't leave.
+ GUARD #1: The Prince?
+ FATHER: Yes, make sure 'e doesn't leave.
+ GUARD #1: Oh, yes, of course. I thought you meant him. Y'know, it
+seemed a bit daft, me havin' to guard him when he's a guard.
+ FATHER: Is that clear?
+ GUARD #2: Hic!
+ GUARD #1: Oh, quite clear, no problems.
+ FATHER: Right.
+[starts to leave]
+Where are you going?
+ GUARD #1: We're coming with you.
+ FATHER: No no, I want you to stay 'ere and make sure 'e doesn't leave.
+ GUARD #1: Oh, I see. Right.
+ HERBERT: But, Father!
+ FATHER: Shut your noise, you! And get that suit on! And no singing!
+ GUARD #2: Hic!
+ FATHER: Oh, go get a glass of water.
+
+Scene 15
+
+ LANCELOT: Well taken, Concorde!
+ CONCORDE: Thank you, sir! Most kind.
+ LANCELOT: And again... Over we go! Good. Steady! And now, the big
+one...Ooof! Come on, Concorde!
+[thwonk]
+ CONCORDE: Message for you, sir.
+[fwump]
+ LANCELOT: Concorde! Concorde, speak to me! "To whoever finds this
+note, I have been imprisoned by my father, who wishes me to marry against
+my will. Please, please, please come and rescue me. I am in the tall
+tower of Swamp Castle." At last! A call, a cry of distress! This could
+be the sign that leads us to the Holy Grail! Brave, brave Concorde! You
+shall not have died in vain!
+ CONCORDE: Uh, I'm-I'm not quite dead, sir.
+ LANCELOT: Well, you shall not have been mortally wounded in vain!
+ CONCORDE: Uh, I-I think uh, I could pull through, sir.
+ LANCELOT: Oh, I see.
+ CONCORDE: Actually, I think I'm all right to come with you--
+ LANCELOT: No, no, sweet Concorde! Stay here! I will send help as
+soon as I have accomplished a daring and heroic rescue in my own
+particular... (sigh)
+ CONCORDE: Idiom, sir?
+ LANCELOT: Idiom!
+ CONCORDE: No, I feel fine, actually, sir.
+ LANCELOT: Farewell, sweet Concorde!
+ CONCORDE: I'll-uh, I'll just stay here, then, shall I, sir? Yeah.
+
+Scene 16
+
+ LANCELOT: Ha-ha! etc.
+ GUARD #1: Now, you're not allowed to come in here, and we're-ugh!
+ LANCELOT: O fair one, behold your humble servant Sir Lancelot
+of Camelot. I have come to take -- oh, I'm terribly sorry.
+ HERBERT: You got my note!
+ LANCELOT: Uh, well, I got A note.
+ HERBERT: You've come to rescue me!
+ LANCELOT: Uh, well, no, you see--
+ HERBERT: I knew that someone would, I knew that somewhere out there...
+there must be...
+[music]
+...someone...
+ FATHER: Stop that, stop that, stop it! Stop it! Who are you?
+ HERBERT: I'm your son!
+ FATHER: No, not you.
+ LANCELOT: I'm Sir Lancelot, sir.
+ HERBERT: He's come to rescue me, father.
+ LANCELOT: Well, let's not jump to conclusions.
+ FATHER: Did you kill all the guard?
+ LANCELOT: Uh..., oh, yes. Sorry.
+ FATHER: They cost fifty pounds each.
+ LANCELOT: Well, I'm awfully sorry, I'm -- I really can explain everything.
+ HERBERT: Don't be afraid of him, Sir Lancelot, I've got a rope all ready!
+ FATHER: You killed eight wedding guests in all!
+ LANCELOT: Well, you see, the thing is, I thought your son was a lady.
+ FATHER: I can understand that.
+ HERBERT: Hurry, Sir Lancelot! Hurry!
+ FATHER: Shut up! You only killed the bride's father, that's all!
+ LANCELOT: Well, I really didn't mean to...
+ FATHER: Didn't mean to?! You put your sword right through his head!
+ LANCELOT: Oh, dear. Is he all right?
+ FATHER: You even kicked the bride in the chest! This is going to cost
+me a fortune!
+ LANCELOT: Well, I can explain. I was in the forest, um, riding north
+from Camelot, when I got this note, you see--
+ FATHER: Camelot? Are you from, uh, Camelot?
+ HERBERT: Hurry, Sir Lancelot!
+ LANCELOT: Uh, I am a Knight of King Arthur, sir.
+ FATHER: Pretty nice castle, Camelot. Uh, pretty good pig country....
+ LANCELOT: Yes.
+ HERBERT: Hurry, I'm ready!
+ FATHER: Would you, uh, like to come and have a drink?
+ LANCELOT: Well, that's, uh, awfully nice of you.
+ HERBERT: I am ready!
+[start to leave]
+ LANCELOT: --I mean to be, so understanding.
+[thonk]
+ HERBERT: Oooh!
+ LANCELOT: Um, I think when I'm in this idiom, I sometimes get a bit,
+uh, sort of carried away.
+ FATHER: Oh, don't worry about that.
+ HERBERT: Oooh!
+[splat]
+
+Scene 17
+[wailing]
+ FATHER: Well, this is the main hall. We're going to have all this
+knocked through, and made into one big, uh, living room.
+ RANDOM: There he is!
+ FATHER: Oh, bloody hell.
+ LANCELOT: Ha-ha! etc.
+ FATHER: Hold it, hold it! Please!
+ LANCELOT: Sorry, sorry. See what I mean, I just get carried away.
+I really must -- sorry, sorry! Sorry, everyone.
+ RANDOM: He's killed the best man!
+[yelling]
+ FATHER: Hold it, please! Hold it! This is Sir Lancelot from the
+ gorge of Camelot -- a very brave and influential knight, and my special
+guest here today.
+ LANCELOT: Hello.
+ RANDOM: He killed my auntie!
+[yelling]
+ FATHER: Please, please! This is supposed to be a happy occasion!
+Let's not bicker and argue about who killed who. We are here today to
+witness the union of two young people in the joyful bond of the holy
+wedlock. Unfortunately, one of them, my son Herbert, has just fallen
+to his death. But I think I've not lost a son, so much as... gained
+a daughter! For, since the tragic death of her father--
+ RANDOM: He's not quite dead!
+ FATHER: Since the near fatal wounding of her father--
+ RANDOM: He's getting better!
+ FATHER: For, since her own father... who, when he seemed about to
+recover, suddenly felt the icy hand fo death upon him,--
+[ugh]
+ RANDOM: Oh, he's died!
+ FATHER: And I want his only daughter to look upon me... as her own
+dad -- in a very real, and legally binding sense.
+[clapping]
+And I feel sure that the merger -- uh, the union -- between the Princess
+and the brave, but dangerous, Sir Lancelot of Camelot--
+ LANCELOT: What?
+ RANDOM: Look! The dead Prince!
+ CONCORDE: He's not quite dead!
+ HERBERT: Oh, I feel much better.
+ FATHER: You fell out of the cold tower, you creep!
+ HERBERT: No, I was saved at the last minute.
+ FATHER: How?!
+ HERBERT: Well, I'll tell you...
+[music]
+ FATHER: Not like that! Not like that! No, stop it!
+ SINGING: He's going to tell! He's going to tell!
+ FATHER: Shut up!
+ SINGING: He's going to tell! He's going to tell!
+ He's going to tell! He's going to tell!
+ He's going to tell! He's going to tell!
+ He's going to tell! He's going to tell!
+ CONCORDE: Quickly, sir! This way!
+ LANCELOT: No, it's not in my idiom! I must escape more....(sigh)
+ CONCORDE: Dramatically, sir?
+ LANCELOT: Dramatically! Hee! Ha!
+[crash]
+Excuse me, could, uh, could somebody give me a push, please...?
+
+Scene 18
+
+ [clop clop]
+ ARTHUR: Old crone! Is there anywhere in this town where we could buy
+a shrubbery!
+[chord]
+ CRONE: Who sent you?
+ ARTHUR: The Knights Who Say Nee.
+ CRONE: Agh! No! Never! We have no shrubberies here.
+ ARTHUR: If you do not tell us where we can buy a shrubbery, my friend
+and I will say... we will say... 'nee'.
+ CRONE: Agh! Do your worst!
+ ARTHUR: Very well! If you will not assist us voluntarily,... nee!
+ CRONE: No! Never! No shrubberies!
+ ARTHUR: Nee!
+ BEDEMIR: Noo! Noo!
+ ARTHUR: No, no, no, no -- it's not that, it's 'nee'.
+ BEDEMIR: Noo!
+ ARTHUR: No, no -- 'nee'. You're not doing it properly.
+ BEDEMIR: Noo! Nee!
+ ARTHUR: That's it, that's it, you've got it.
+ ARTHUR and BEDEMIR: Nee! Nee!
+ ROGER: Are you saying 'nee' to that old woman?
+ ARTHUR: Um, yes.
+ ROGER: Oh, what sad times are these when passing ruffians can 'nee'
+at will to old ladies. There is a pestilence upon this land, nothing is
+ sacred. Even those who arrange and design shrubberies are under
+considerable economic stress at this period in history.
+ ARTHUR: Did you say 'shrubberies'?
+ ROGER: Yes, shrubberies are my trade -- I am a shrubber. My name
+is Roger the Shrubber. I arrange, design, and sell shrubberies.
+ BEDEMIR: Nee!
+ ARTHUR: No! No, no, no! No!
+
+Scene 19
+
+ ARTHUR: O, Knights of Nee, we have brought you your shrubbery. May we
+go now?
+ HEAD KNIGHT: It is a good shrubbery. I like the laurels particularly.
+But there is one small problem.
+ ARTHUR: What is that?
+ HEAD KNIGHT: We are now... no longer the Knights Who Say Nee.
+ RANDOM: Nee!
+ HEAD KNIGHT: Shh shh. We are now the Knights Who Say Ecky-ecky-ecky-
+ecky-pikang-zoom-boing-mumble-mumble.
+ RANDOM: Nee!
+ HEAD KNIGHT: Therefore, we must give you a test.
+ ARTHUR: What is this test, O Knights of-- Knights Who 'Til Recently
+Said Nee?
+ HEAD KNIGHT: Firstly, you must find... another shrubbery!
+ [chord]
+ ARTHUR: Not another shrubbery!
+ HEAD KNIGHT: Then, when you have found the shrubbery, you must place
+it here beside this shrubbery, only slightly higher so you get a
+two-level effect with a little path running down the middle.
+ RANDOM: A path! A path! Nee!
+ HEAD KNIGHT: Then, when you have found the shrubbery, you must cut
+down the mightiest tree in the forest... with... a herring!
+[chord]
+ ARTHUR: We shall do no such thing!
+ HEAD KNIGHT: Oh, please!
+ ARTHUR: Cut down a tree with a herring? It can't be done.
+ KNIGHTS: Aaaaugh! Aaaugh!
+ HEAD KNIGHT: Don't say that word.
+ ARTHUR: What word?
+ HEAD KNIGHT: I cannot tell, suffice to say is one of the words
+the Knights of Nee cannot hear.
+ ARTHUR: How can we not say the word if you don't tell us what it is?
+ KNIGHTS: Aaaaugh! Aaaugh!
+ ARTHUR: What, 'is'?
+ HEAD KNIGHT: No, not "is" -- we couldn't get vary far in life not
+
+Ooops I'm out of time. i'll send the rest tomorrow.
+
+Eric
diff --git a/Mac/Demo/speech/grail.py b/Mac/Demo/speech/grail.py
new file mode 100644
index 0000000..d926569
--- /dev/null
+++ b/Mac/Demo/speech/grail.py
@@ -0,0 +1,228 @@
+# Pass this program the Holy Grail script on stdin.
+import sys
+import string
+import stdwin
+from stdwinevents import *
+
+try:
+ import macspeech
+except ImportError:
+ macspeech = None
+
+WINWIDTH = 1000
+scrw, scrh = stdwin.getscrsize()
+if WINWIDTH > 0.8*scrw:
+ WINWIDTH = int(0.8*scrw)
+BLACK = stdwin.fetchcolor('black')
+RED = stdwin.fetchcolor('red')
+BLUE = stdwin.fetchcolor('blue')
+
+done='done'
+
+class MacSpeaker:
+ def __init__(self):
+ self.voices = []
+ self.nvoices = macspeech.CountVoices()
+ self.curvoice = 1
+ self.rate = 1.0
+
+ def _newvoice(self):
+ vd = macspeech.GetIndVoice(self.curvoice)
+ sc = vd.NewChannel()
+ self.curvoice = self.curvoice + 1
+ if self.curvoice > self.nvoices:
+ self.curvoice = 1
+ return sc
+
+ def newvoices(self, n):
+ self.voices = []
+ for i in range(n):
+ self.voices.append(self._newvoice())
+ if self.rate <> 1.0:
+ self.setrate(1.0)
+
+ def setrate(self, factor):
+ self.rate = self.rate*factor
+ for v in self.voices:
+ r = v.GetRate()
+ v.SetRate(r*factor)
+
+ def speak(self, i, text):
+ self.voices[i-1].SpeakText(text)
+
+ def busy(self):
+ return macspeech.Busy()
+
+[NOTHING, NEWSCENE, ACT, TEXT, MORETEXT] = range(5)
+def parseline(line):
+ stripline = string.strip(line)
+ if not stripline:
+ return NOTHING, ''
+ if stripline[:5] == 'Scene':
+ return NEWSCENE, stripline
+ if line[0] == '[':
+ return ACT, stripline
+ if line[0] == ' ' and ':' in line:
+ splitline = string.splitfields(stripline, ':')
+ stripline = string.joinfields(splitline[1:], ':')
+ return TEXT, (splitline[0], string.strip(stripline))
+ return MORETEXT, stripline
+
+def readscript(file):
+ lines = file.readlines()
+ acts = []
+ actor_dict = {}
+ longest = 0
+ prev_act = 0
+ for i in range(len(lines)):
+ tp, data = parseline(lines[i])
+ if tp == NEWSCENE:
+ acts.append(actor_dict.keys(), lines[prev_act:i])
+ prev_act = i
+ actor_dict = {}
+ elif tp == TEXT:
+ actor_dict[data[0]] = 1
+ lines[i] = tp, data
+ return acts[1:]
+
+class Main:
+ def __init__(self):
+ if macspeech:
+ self.speaker = MacSpeaker()
+ else:
+ self.speaker = None
+ sys.stdin = open('SCRIPT', 'r')
+ self.acts = readscript(sys.stdin)
+ maxactor = 0
+ for actorlist, actdata in self.acts:
+ if len(actorlist) > maxactor:
+ maxactor = len(actorlist)
+ if not self.loadnextact():
+ print 'No acts to play!'
+ raise done
+ self.lh = stdwin.lineheight()
+ self.winheight = (maxactor+2)*self.lh
+ stdwin.setdefwinsize(WINWIDTH, self.winheight)
+ self.win = stdwin.open('The Play')
+ self.win.setdocsize(WINWIDTH, self.winheight)
+ self.win.change(((0,0),(WINWIDTH, self.winheight)))
+ self.menu = self.win.menucreate('Play')
+ self.menu.additem('Faster', '+')
+ self.menu.additem('Slower', '-')
+ self.menu.additem('Quit', 'Q')
+ self.speed = 4
+
+ def done(self):
+ del self.win
+ del self.menu
+
+ def loadnextact(self):
+ if not self.acts: return 0
+ actors, lines = self.acts[0]
+ del self.acts[0]
+ prevactor = 0
+ for i in range(len(lines)):
+ tp, data = lines[i]
+ if tp == NOTHING:
+ continue
+ elif tp in (NEWSCENE, ACT):
+ lines[i] = 0, data
+ elif tp == TEXT:
+ prevactor = actors.index(data[0])
+ lines[i] = prevactor+1, data[1]
+ else:
+ lines[i] = prevactor+1, data
+ self.lines = lines
+ self.actors = [''] + actors
+ self.actorlines = [''] * len(self.actors)
+ if self.speaker:
+ self.speaker.newvoices(len(self.actors)-1)
+ self.prevline = 0
+ self.actwidth = 0
+ for a in self.actors:
+ w = stdwin.textwidth(a)
+ if w > self.actwidth:
+ self.actwidth = w
+ return 1
+
+ def loadnextline(self):
+ if not self.lines: return 0
+ self.actorlines[self.prevline] = ''
+ top = self.lh*self.prevline
+ self.win.change(((0, top), (WINWIDTH, top+self.lh)))
+ line, data = self.lines[0]
+ del self.lines[0]
+ self.actorlines[line] = data
+ self.prevline = line
+ top = self.lh*self.prevline
+ self.win.change(((0, top), (WINWIDTH, top+self.lh)))
+ if line == 0:
+ self.win.settimer(5*self.speed)
+ else:
+ if self.speaker:
+ self.speaker.speak(line, data)
+ tv = 1
+ else:
+ nwords = len(string.split(data))
+ tv = self.speed*(nwords+1)
+ self.win.settimer(tv)
+ return 1
+
+ def timerevent(self):
+ if self.speaker and self.speaker.busy():
+ self.win.settimer(1)
+ return
+ while 1:
+ if self.loadnextline(): return
+ if not self.loadnextact():
+ stdwin.message('The END')
+ self.win.close()
+ raise done
+ self.win.change(((0,0), (WINWIDTH, self.winheight)))
+
+ def redraw(self, top, bottom, draw):
+ for i in range(len(self.actors)):
+ tpos = i*self.lh
+ bpos = (i+1)*self.lh-1
+ if tpos < bottom and bpos > top:
+ draw.setfgcolor(BLUE)
+ draw.text((0, tpos), self.actors[i])
+ if i == 0:
+ draw.setfgcolor(RED)
+ else:
+ draw.setfgcolor(BLACK)
+ draw.text((self.actwidth+5, tpos), self.actorlines[i])
+
+ def run(self):
+ self.win.settimer(10)
+ while 1:
+ ev, win, arg = stdwin.getevent()
+ if ev == WE_DRAW:
+ ((left, top), (right, bot)) = arg
+ self.redraw(top, bot, self.win.begindrawing())
+ elif ev == WE_TIMER:
+ self.timerevent()
+ elif ev == WE_CLOSE:
+ self.win.close()
+ raise done
+ elif ev == WE_MENU and arg[0] == self.menu:
+ if arg[1] == 0:
+ if self.speed > 1:
+ self.speed = self.speed/2
+ if self.speaker:
+ self.speaker.setrate(1.4)
+ elif arg[1] == 1:
+ self.speed = self.speed * 2
+ if self.speaker:
+ self.speaker.setrate(0.7)
+ elif arg[1] == 2:
+ self.win.close()
+ raise done
+
+if 1:
+ main = Main()
+ try:
+ main.run()
+ except done:
+ pass
+ del main
diff --git a/Mac/Demo/speech/hum.py b/Mac/Demo/speech/hum.py
new file mode 100644
index 0000000..ac05471
--- /dev/null
+++ b/Mac/Demo/speech/hum.py
@@ -0,0 +1,31 @@
+#
+# Hum - The singing macintosh
+#
+import macspeech
+import sys
+import string
+
+dict = { 'A':57, 'A#':58, 'B':59, 'C':60, 'C#':61, 'D':62, 'D#':63,
+ 'E':64, 'F':65, 'F#':66, 'G':67, 'G#':68}
+
+vd = macspeech.GetIndVoice(2)
+vc = vd.NewChannel()
+print 'Input strings of notes, as in A B C C# D'
+while 1:
+ print 'S(tr)ing-',
+ str = sys.stdin.readline()
+ if not str:
+ break
+ str = string.split(str[:-1])
+ data = []
+ for s in str:
+ if not dict.has_key(s):
+ print 'No such note:', s
+ else:
+ data.append(dict[s])
+ print data
+ for d in data:
+ vc.SetPitch(float(d))
+ vc.SpeakText('la')
+ while macspeech.Busy():
+ pass
diff --git a/Mac/Modules/macspeech/README b/Mac/Modules/macspeech/README
new file mode 100644
index 0000000..690a6c3
--- /dev/null
+++ b/Mac/Modules/macspeech/README
@@ -0,0 +1,18 @@
+To add this stuff to Macintosh python (and have some use for it):
+
+1. Obtain a copy of the Speech Manager. It can be found on
+ ftp.apple.com.
+2. Put the Speech.h file from the Speech Manager distribution and
+ macspeechmodule.c in your python Modules directory.
+3. Add the new module to python and build a new python.
+4. Install the Speech Manager (under sys7 the extension goes in the
+ Extensions folder, the data file in the System folder) and reboot.
+5. Try it.
+
+The test program 'hum' does that, you type notes and it hums them
+(badly, addmitted, but that isn't my fault really).
+
+The test program 'grail' is more fun, but you need stdwin support for
+it. It reads the script for the Holy Grail film from the file SCRIPT
+and both animates it (text only:-) on the screen and reads it out the
+speaker. It will use all voices available in the system.
diff --git a/Mac/Modules/macspeechmodule.c b/Mac/Modules/macspeechmodule.c
new file mode 100644
index 0000000..8e680ae
--- /dev/null
+++ b/Mac/Modules/macspeechmodule.c
@@ -0,0 +1,559 @@
+/***********************************************************
+Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
+Amsterdam, The Netherlands.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Stichting Mathematisch
+Centrum or CWI not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior permission.
+
+STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
+FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+******************************************************************/
+
+/* xx module */
+
+#include "allobjects.h"
+#include "modsupport.h"
+
+#include <GestaltEqu.h>
+#include "pascal.h"
+#include "Speech.h"
+
+/* Somehow the Apple Fix2X and X2Fix don't do what I expect */
+#define fixed2double(x) (((double)(x))/32768.0)
+#define double2fixed(x) ((Fixed)((x)*32768.0))
+
+char *CurrentSpeech;
+object *ms_error_object;
+
+/* General error handler */
+static object *
+ms_error(num)
+ OSErr num;
+{
+ char buf[40];
+
+ sprintf(buf, "Mac Speech Mgr error #%d", num);
+ err_setstr(ms_error_object, buf);
+ return (object *)NULL;
+}
+
+/* -------------
+**
+** Part one - the speech channel object
+*/
+typedef struct {
+ OB_HEAD
+ object *x_attr; /* Attributes dictionary */
+ SpeechChannel chan;
+ object *curtext; /* If non-NULL current text being spoken */
+} scobject;
+
+staticforward typeobject sctype;
+
+#define is_scobject(v) ((v)->ob_type == &sctype)
+
+static scobject *
+newscobject(arg)
+ VoiceSpec *arg;
+{
+ scobject *xp;
+ OSErr err;
+
+ xp = NEWOBJ(scobject, &sctype);
+ if (xp == NULL)
+ return NULL;
+ xp->x_attr = NULL;
+ if ( (err=NewSpeechChannel(arg, &xp->chan)) != 0) {
+ DECREF(xp);
+ return (scobject *)ms_error(err);
+ }
+ xp->curtext = NULL;
+ return xp;
+}
+
+/* sc methods */
+
+static void
+sc_dealloc(xp)
+ scobject *xp;
+{
+ DisposeSpeechChannel(xp->chan);
+ XDECREF(xp->x_attr);
+ DEL(xp);
+}
+
+static object *
+sc_Stop(self, args)
+ scobject *self;
+ object *args;
+{
+ OSErr err;
+
+ if (!getnoarg(args))
+ return NULL;
+ if ((err=StopSpeech(self->chan)) != 0)
+ return ms_error(err);
+ if ( self->curtext ) {
+ DECREF(self->curtext);
+ self->curtext = NULL;
+ }
+ INCREF(None);
+ return None;
+}
+
+static object *
+sc_SpeakText(self, args)
+ scobject *self;
+ object *args;
+{
+ OSErr err;
+ char *str;
+ int len;
+
+ if (!getargs(args, "s#", &str, &len))
+ return NULL;
+ if ( self->curtext ) {
+ StopSpeech(self->chan);
+ DECREF(self->curtext);
+ self->curtext = NULL;
+ }
+ if ((err=SpeakText(self->chan, (Ptr)str, (long)len)) != 0)
+ return ms_error(err);
+ (void)getargs(args, "O", &self->curtext); /* Or should I check this? */
+ INCREF(self->curtext);
+ INCREF(None);
+ return None;
+}
+
+static object *
+sc_GetRate(self, args)
+ scobject *self;
+ object *args;
+{
+ OSErr err;
+ Fixed farg;
+
+ if (!getnoarg(args))
+ return NULL;
+ if ((err=GetSpeechRate(self->chan, &farg)) != 0)
+ return ms_error(err);
+ return newfloatobject(fixed2double(farg));
+}
+
+static object *
+sc_GetPitch(self, args)
+ scobject *self;
+ object *args;
+{
+ OSErr err;
+ Fixed farg;
+
+ if (!getnoarg(args))
+ return NULL;
+ if ((err=GetSpeechPitch(self->chan, &farg)) != 0)
+ return ms_error(err);
+ return newfloatobject(fixed2double(farg));
+}
+
+static object *
+sc_SetRate(self, args)
+ scobject *self;
+ object *args;
+{
+ OSErr err;
+ double darg;
+
+ if (!getargs(args, "d", &darg))
+ return NULL;
+ if ((err=SetSpeechRate(self->chan, double2fixed(darg))) != 0)
+ return ms_error(err);
+ INCREF(None);
+ return None;
+}
+
+static object *
+sc_SetPitch(self, args)
+ scobject *self;
+ object *args;
+{
+ OSErr err;
+ double darg;
+
+ if (!getargs(args, "d", &darg))
+ return NULL;
+ if ((err=SetSpeechPitch(self->chan, double2fixed(darg))) != 0)
+ return ms_error(err);
+ INCREF(None);
+ return None;
+}
+
+static struct methodlist sc_methods[] = {
+ {"Stop", (method)sc_Stop},
+ {"SetRate", (method)sc_SetRate},
+ {"GetRate", (method)sc_GetRate},
+ {"SetPitch", (method)sc_SetPitch},
+ {"GetPitch", (method)sc_GetPitch},
+ {"SpeakText", (method)sc_SpeakText},
+ {NULL, NULL} /* sentinel */
+};
+
+static object *
+sc_getattr(xp, name)
+ scobject *xp;
+ char *name;
+{
+ if (xp->x_attr != NULL) {
+ object *v = dictlookup(xp->x_attr, name);
+ if (v != NULL) {
+ INCREF(v);
+ return v;
+ }
+ }
+ return findmethod(sc_methods, (object *)xp, name);
+}
+
+static int
+sc_setattr(xp, name, v)
+ scobject *xp;
+ char *name;
+ object *v;
+{
+ if (xp->x_attr == NULL) {
+ xp->x_attr = newdictobject();
+ if (xp->x_attr == NULL)
+ return -1;
+ }
+ if (v == NULL) {
+ int rv = dictremove(xp->x_attr, name);
+ if (rv < 0)
+ err_setstr(AttributeError,
+ "delete non-existing sc attribute");
+ return rv;
+ }
+ else
+ return dictinsert(xp->x_attr, name, v);
+}
+
+static typeobject sctype = {
+ OB_HEAD_INIT(&Typetype)
+ 0, /*ob_size*/
+ "MacSpeechChannel", /*tp_name*/
+ sizeof(scobject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ /* methods */
+ (destructor)sc_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ (getattrfunc)sc_getattr, /*tp_getattr*/
+ (setattrfunc)sc_setattr, /*tp_setattr*/
+ 0, /*tp_compare*/
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+};
+
+/* -------------
+**
+** Part two - the voice object
+*/
+typedef struct {
+ OB_HEAD
+ object *x_attr; /* Attributes dictionary */
+ int initialized;
+ VoiceSpec vs;
+ VoiceDescription vd;
+} mvobject;
+
+staticforward typeobject mvtype;
+
+#define is_mvobject(v) ((v)->ob_type == &mvtype)
+
+static mvobject *
+newmvobject()
+{
+ mvobject *xp;
+ xp = NEWOBJ(mvobject, &mvtype);
+ if (xp == NULL)
+ return NULL;
+ xp->x_attr = NULL;
+ xp->initialized = 0;
+ return xp;
+}
+
+static int
+initmvobject(self, ind)
+ mvobject *self;
+ int ind;
+{
+ OSErr err;
+
+ if ( (err=GetIndVoice((short)ind, &self->vs)) != 0 ) {
+ ms_error(err);
+ return 0;
+ }
+ if ( (err=GetVoiceDescription(&self->vs, &self->vd, sizeof self->vd)) != 0) {
+ ms_error(err);
+ return 0;
+ }
+ self->initialized = 1;
+ return 1;
+}
+/* mv methods */
+
+static void
+mv_dealloc(xp)
+ mvobject *xp;
+{
+ XDECREF(xp->x_attr);
+ DEL(xp);
+}
+
+static object *
+mv_getgender(self, args)
+ mvobject *self;
+ object *args;
+{
+ object *rv;
+
+ if (!getnoarg(args))
+ return NULL;
+ if (!self->initialized) {
+ err_setstr(ms_error_object, "Uninitialized voice");
+ return NULL;
+ }
+ rv = newintobject(self->vd.gender);
+ return rv;
+}
+
+static object *
+mv_newchannel(self, args)
+ mvobject *self;
+ object *args;
+{
+ if (!getnoarg(args))
+ return NULL;
+ if (!self->initialized) {
+ err_setstr(ms_error_object, "Uninitialized voice");
+ return NULL;
+ }
+ return (object *)newscobject(&self->vs);
+}
+
+static struct methodlist mv_methods[] = {
+ {"GetGender", (method)mv_getgender},
+ {"NewChannel", (method)mv_newchannel},
+ {NULL, NULL} /* sentinel */
+};
+
+static object *
+mv_getattr(xp, name)
+ mvobject *xp;
+ char *name;
+{
+ if (xp->x_attr != NULL) {
+ object *v = dictlookup(xp->x_attr, name);
+ if (v != NULL) {
+ INCREF(v);
+ return v;
+ }
+ }
+ return findmethod(mv_methods, (object *)xp, name);
+}
+
+static int
+mv_setattr(xp, name, v)
+ mvobject *xp;
+ char *name;
+ object *v;
+{
+ if (xp->x_attr == NULL) {
+ xp->x_attr = newdictobject();
+ if (xp->x_attr == NULL)
+ return -1;
+ }
+ if (v == NULL) {
+ int rv = dictremove(xp->x_attr, name);
+ if (rv < 0)
+ err_setstr(AttributeError,
+ "delete non-existing MacVoice attribute");
+ return rv;
+ }
+ else
+ return dictinsert(xp->x_attr, name, v);
+}
+
+static typeobject mvtype = {
+ OB_HEAD_INIT(&Typetype)
+ 0, /*ob_size*/
+ "MacVoice", /*tp_name*/
+ sizeof(mvobject), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ /* methods */
+ (destructor)mv_dealloc, /*tp_dealloc*/
+ 0, /*tp_print*/
+ (getattrfunc)mv_getattr, /*tp_getattr*/
+ (setattrfunc)mv_setattr, /*tp_setattr*/
+ 0, /*tp_compare*/
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+};
+
+
+/* -------------
+**
+** Part three - The module interface
+*/
+
+/* See if Speech manager available */
+
+static object *
+ms_Available(self, args)
+ object *self; /* Not used */
+ object *args;
+{
+ OSErr err;
+ long result;
+
+ if (!getnoarg(args))
+ return NULL;
+ err = Gestalt(gestaltSpeechAttr, &result);
+ if ( err == noErr && (result & (1<<gestaltSpeechMgrPresent)))
+ result = 1;
+ else
+ result = 0;
+ return newintobject(result);
+}
+
+/* Count number of busy speeches */
+
+static object *
+ms_Busy(self, args)
+ object *self; /* Not used */
+ object *args;
+{
+ OSErr err;
+ short result;
+
+ if (!getnoarg(args))
+ return NULL;
+ result = SpeechBusy();
+ return newintobject(result);
+}
+
+/* Say something */
+
+static object *
+ms_SpeakString(self, args)
+ object *self; /* Not used */
+ object *args;
+{
+ OSErr err;
+ short result;
+ char *str;
+ int len;
+
+ if (!getstrarg(args, &str))
+ return NULL;
+ if (CurrentSpeech) {
+ /* Free the old speech, after killing it off
+ ** (note that speach is async and c2pstr works inplace)
+ */
+ SpeakString("\p");
+ free(CurrentSpeech);
+ }
+ len = strlen(str);
+ CurrentSpeech = malloc(len+1);
+ strcpy(CurrentSpeech, str);
+ err = SpeakString(c2pstr(CurrentSpeech));
+ if ( err )
+ return ms_error(err);
+ INCREF(None);
+ return None;
+}
+
+
+/* Count number of available voices */
+
+static object *
+ms_CountVoices(self, args)
+ object *self; /* Not used */
+ object *args;
+{
+ OSErr err;
+ short result;
+
+ if (!getnoarg(args))
+ return NULL;
+ CountVoices(&result);
+ return newintobject(result);
+}
+
+static object *
+ms_GetIndVoice(self, args)
+ object *self; /* Not used */
+ object *args;
+{
+ OSErr err;
+ mvobject *rv;
+ long ind;
+
+ if( !getargs(args, "i", &ind))
+ return 0;
+ rv = newmvobject();
+ if ( !initmvobject(rv, ind) ) {
+ DECREF(rv);
+ return NULL;
+ }
+ return (object *)rv;
+}
+
+
+
+/* List of functions defined in the module */
+
+static struct methodlist ms_methods[] = {
+ {"Available", ms_Available},
+ {"CountVoices", ms_CountVoices},
+ {"Busy", ms_Busy},
+ {"SpeakString", ms_SpeakString},
+ {"GetIndVoice", ms_GetIndVoice},
+ {NULL, NULL} /* sentinel */
+};
+
+
+/* Initialization function for the module (*must* be called initmacspeech) */
+
+void
+initmacspeech()
+{
+ object *m, *d;
+
+ /* Create the module and add the functions */
+ m = initmodule("macspeech", ms_methods);
+
+ /* Add some symbolic constants to the module */
+ d = getmoduledict(m);
+ ms_error_object = newstringobject("macspeech.error");
+ dictinsert(d, "error", ms_error_object);
+
+ /* Check for errors */
+ if (err_occurred())
+ fatal("can't initialize module macspeech");
+}