Does anyone know of a cross-platform (OSX and Windows at least) library for text-to-speech? I know there's an OSX API, and probably also for Windows. I know PyTTS exists, but it seems to talk only to the Windows engine. I'd like to write a single Python module to handle this on both platforms, but I guess I'm asking too much -- it's too hardware dependent, I suppose. Any hints?
Charles Hartman wrote: > Does anyone know of a cross-platform (OSX and Windows at least) library > for text-to-speech? I know there's an OSX API, and probably also for > Windows. I know PyTTS exists, but it seems to talk only to the Windows > engine. I'd like to write a single Python module to handle this on both > platforms, but I guess I'm asking too much -- it's too hardware > dependent, I suppose. Any hints?
Charles Hartman wrote: > Does anyone know of a cross-platform (OSX and Windows at least) library > for text-to-speech? I know there's an OSX API, and probably also for > Windows. I know PyTTS exists, but it seems to talk only to the Windows > engine. I'd like to write a single Python module to handle this on both > platforms, but I guess I'm asking too much -- it's too hardware > dependent, I suppose. Any hints?
It's a very big opportunity for me to find someone that both is a poet and knows something about programming.
First, please excuse my bad english ; I'm a french canadian.
I am dreaming to write a software to help french poets to write strict rigourous classical poetry. Since calssical poetry is somewhat mathematical, a lot of tasks can be automatised :
1- Counting the number of syllabs ("pied" in french) in a verse
2- Checking the rimes ; determining the strength of a rime
3- Checking compliance of a poem to a fixed pre-determined classical form (in french, we have distique, tercet, quatrain, quintain, sixain, huitain, dizain, triolet, vilanelle, rondeau, rondel, ballade, chant royal, sonnet, etc.)
4- Propose a synonym that will fit in a verse, i.e. with the right amount of syllabs
5- Suggest a missing word or expression in a verse by applying the Shannon text generation principle
First, do you think it may be a useful tool ? What other features you think can make it usefull for a poet ?
The first task of cutting sentences into syllabs (phonetically of course, not typographically) is already done. It's been difficult to get it right and to make it guess correctly with a very very high percentage.
I can very well imagine that the next task is even more difficult. I need to translate text into phonems. Do you know some software that does it ? I guess that voice synthetisers that translates written text into spoken text must first translate the text into phonems. Right ? Do you know if there some way that I can re-use some sub-modules from these projects that will translate text into phonems ?
Regards,
Francis Girard
Le dimanche 20 Mars 2005 04:40, Charles Hartman a écrit :
> Does anyone know of a cross-platform (OSX and Windows at least) library > for text-to-speech? I know there's an OSX API, and probably also for > Windows. I know PyTTS exists, but it seems to talk only to the Windows > engine. I'd like to write a single Python module to handle this on both > platforms, but I guess I'm asking too much -- it's too hardware > dependent, I suppose. Any hints?
>>Does anyone know of a cross-platform (OSX and Windows at least) library >>for text-to-speech? I know there's an OSX API, and probably also for >>Windows. I know PyTTS exists, but it seems to talk only to the Windows >>engine. I'd like to write a single Python module to handle this on both >>platforms, but I guess I'm asking too much -- it's too hardware >>dependent, I suppose. Any hints?
> Indeed, have any poems ever been written about Python - other than "The > Zen of Python" by Tim Peters? A limerick, even?
> There once was a language called Python...
> (which is pretty close to having three anapaestic left feet)
> or more promisingly, rhyme-wise, but metrically rather worse :
> There once was a mathematician named van Rossum...
> Tim C
Of course this last suggestion clearly has the wrong meter for a good limerick. Not everyone knows the ingredients of a good limerick, which led to the following (which has been around in various forms since God was a lad):
There was a young man from Japan Who never quite learned how to scan. He got on quite fine Until the last line And then somehow he could never quite get the number of syllables right,or make it rhyme.
So, let's accept that the first line should scan correctly, that would make the following first lines acceptable:
A mathematician named Guido ... The inventor of Python, called Guido ... A mathematician (van Rossum) ... Van Rossum, inventor of Python ...
Hopefully that will begin to get the idea across.
Since it's PyCon week, I will offer a prize of $100 to the best (in my opinion) limerick about Python posted to this list (with a Cc: to py...@python.org) before midday on Friday. The prize money will be my own, so there are no other rules. I will post my judgment when the PyCon nonsense has died down a little, but the winner will be read before the entire PyCon audience. Get to it!
On some flavors of Windows you can use: import pyTTS
tts = pyTTS.Create() tts.Speak('This is the sound of my voice.')
On Mac OS X you can use: import os
os.system("say 'This is the sound of my voice.'")
You could write a wrapper that takes a string and checks to see which OS you are on and executes the appropriate of the two above choices. But you probably need something slicker, and I don't know what that might be.
On Sun, 20 Mar 2005 16:18:14 -0500, Steve Holden wrote: > Since it's PyCon week, I will offer a prize of $100 to the best (in my > opinion) limerick about Python posted to this list (with a Cc: to > py...@python.org) before midday on Friday. The prize money will be my > own, so there are no other rules. I will post my judgment when the PyCon > nonsense has died down a little, but the winner will be read before the > entire PyCon audience. Get to it!
> regards > Steve
Practicality beats purity, Errors should never pass silently. Sparse is better than dense, Flat is better than nest, Beautiful is better than ugly.
No cc because A: I'm not really serious and B: Tim Peters would have to get some credit for that. :-) Probably ought to add a C: While I think that does mostly rhyme, it is pretty loose; not much source material to work with.
-- or ". . . a guru named Guido / (Who monitors everything we do) /" and ending with something about "looking max in a Speedo," but fortunately it's not coming to me at the moment.
The closest I have an answer to your questions about Python and poetry (aside from the Scandroid) is a book called *Virtual Muse: Experiments in Computer Poetry* which Wesleyan published something close to ten years ago; I don't think it's out of print yet, but I don't keep good track. It was out of a casual remark there (about a very primitive program not even directly talked about in the boolk) that there came a casual remark from a reader last year which led to the Scandroid.
Charles Hartman
"The time has come for someone to put his foot down; and that foot is me." --Animal House
> Charles Hartman wrote: >> Does anyone know of a cross-platform (OSX and Windows at least) >> library >> for text-to-speech? I know there's an OSX API, and probably also for >> Windows. I know PyTTS exists, but it seems to talk only to the Windows >> engine. I'd like to write a single Python module to handle this on >> both >> platforms, but I guess I'm asking too much -- it's too hardware >> dependent, I suppose. Any hints?
> I am dreaming to write a software to help french poets to write strict > rigourous classical poetry. Since calssical poetry is somewhat > mathematical, > a lot of tasks can be automatised :
> 1- Counting the number of syllabs ("pied" in french) in a verse
> 2- Checking the rimes ; determining the strength of a rime
> 3- Checking compliance of a poem to a fixed pre-determined classical > form (in > french, we have distique, tercet, quatrain, quintain, sixain, huitain, > dizain, triolet, vilanelle, rondeau, rondel, ballade, chant royal, > sonnet, > etc.)
> 4- Propose a synonym that will fit in a verse, i.e. with the right > amount of > syllabs
> 5- Suggest a missing word or expression in a verse by applying the > Shannon > text generation principle
> What other features you think can make it usefull for a poet ?
> The first task of cutting sentences into syllabs (phonetically of > course, not > typographically) is already done. It's been difficult to get it right > and to > make it guess correctly with a very very high percentage.
> I can very well imagine that the next task is even more difficult. I > need to > translate text into phonems. Do you know some software that does it ? > I guess > that voice synthetisers that translates written text into spoken text > must > first translate the text into phonems. Right ? Do you know if there > some way > that I can re-use some sub-modules from these projects that will > translate > text into phonems ?
The problems are hard ones. Getting reliable syllable divisions is, all by itself, a heart-breaker in English; I'm not sure whether harder or easier in French. (See the module syllables.py in the source code to my Scandroid program at the site listed below.)
Rhyme is harder -- I haven't yet tried it in English -- precisely because text-to-phoneme is very hard.
I haven't really worked with this, that is, with the sounds of speech (though I'm a musician as well as a poet), mostly because it's difficult. The projects in my *Virtual Muse: Experiments in Computer Poetry"[1], for example, deal almost entirely with language as a typographical phenomenon. So does my Scandroid, even though the material it's working with is all aimed at and motivated by the auditory qualities of poetry.
I do imagine you're right that the text-to-speech people have worked out a lot of this. The trouble is that so far I haven't seen public-domain code for the guts of such a program, which is what you would need.
Interesting to think about which problems change between French and English and which do not.
Good luck -- keep me posted.
[1] This was published by Wesleyan Univ Press, what, nine years ago. Probably out of print. I do know where to get some copies.
Francis Girard <francis.gir...@free.fr> writes: > 4- Propose a synonym that will fit in a verse, i.e. with the right amount of > syllabs
> 5- Suggest a missing word or expression in a verse by applying the Shannon > text generation principle > ... > First, do you think it may be a useful tool ? > What other features you think can make it usefull for a poet ?
I'm skeptical of this notion. You can think of writing a poem as building up a tree structure where there's a root idea you're trying to express, "branches" in the choices of images/comparisons/etc. that you use to express the idea, and "leaves" that are the actual words in the poem. Rhyme means that a left-to-right traversal of the leaves (i.e. reading the words) results in a pattern with a certain structure. You're proposing a tool that helps explore the search space in the nodes near the bottom level of the tree, to find words with the right characteristics.
I think the constraint of rhyme and meter is best served by widening the search space at the upper levels of the tree and not the lower levels. That is, if you've got an image and you don't find rhyming words for it with easy natural diction, a computerized search for more and more obscure words to express that image in rhyme is the last thing you want. Rather, you want to discard the image and choose a different one to express the idea. That means seeking more images by mentally revisiting and staying inside the emotion at the center of poem, a much more difficult thing to do than solving the mere math problem of finding a string of rhyming words with similar semantics to a non-rhyming sequence that you already have. But when you find the right image, the words and rhythm fall into place without additional effort.
This is why writing good poems is hard, and is also why the results of doing it well is powerful. I don't think it can be programmed into a computer using any current notions.
Steve Holden wrote: > Tim Churches wrote: >> There once was a language called Python...
>> (which is pretty close to having three anapaestic left feet)
>> or more promisingly, rhyme-wise, but metrically rather worse :
>> There once was a mathematician named van Rossum...
>> Tim C
> Of course this last suggestion clearly has the wrong meter for a good > limerick.
I did say it was metrically worse...
> Not everyone knows the ingredients of a good limerick, which > led to the following (which has been around in various forms since God > was a lad):
> There was a young man from Japan > Who never quite learned how to scan. > He got on quite fine > Until the last line > And then somehow he could never quite get the number of syllables > right,or make it rhyme.
> Since it's PyCon week, I will offer a prize of $100 to the best (in my > opinion) limerick about Python posted to this list (with a Cc: to > py...@python.org) before midday on Friday. The prize money will be my > own, so there are no other rules. I will post my judgment when the PyCon > nonsense has died down a little, but the winner will be read before the > entire PyCon audience. Get to it!
My first attempt (which does not scan properly):
A Dutch mathematician most prophetic, Did invent a language, name herpetic. With design quite intelligent, And syntax mostly elegant, Big ideas could be made non-hypothetic.
Steve Holden said unto the world upon 2005-03-20 16:18:
<SNIP>
> Since it's PyCon week, I will offer a prize of $100 to the best (in my > opinion) limerick about Python posted to this list (with a Cc: to > py...@python.org) before midday on Friday. The prize money will be my > own, so there are no other rules. I will post my judgment when the PyCon > nonsense has died down a little, but the winner will be read before the > entire PyCon audience. Get to it!
> regards > Steve
Homage to the Interactive Interpreter (with apologies to all the monks out there):
My dear Guido dared once to combine Out of objects, command of a line There was nary a brace. In their place? Some whitespace! And cast many their Perl before swine.
(I agree that the idiom played upon in the last line is obverted, but but plead poetic license :-)
> Does anyone know of a cross-platform (OSX and Windows at least) library > for text-to-speech? I know there's an OSX API, and probably also for > Windows. I know PyTTS exists, but it seems to talk only to the Windows > engine. I'd like to write a single Python module to handle this on both > platforms, but I guess I'm asking too much -- it's too hardware > dependent, I suppose. Any hints?
HTH. -- ------------------------------------------------------------------------ Miki Tebeka <miki.teb...@zoran.com> http://tebeka.bizhat.com The only difference between children and adults is the price of the toys
There is tkfestival http://ludios.org/programs/tkfestival that uses expect to control festival, I assume it has a very easy to use CLI and would be simple to make use of pexpect to control festival from python in the same way.
> Francis Girard <francis.gir...@free.fr> writes: > > 4- Propose a synonym that will fit in a verse, i.e. with the right amount > > of syllabs
> > 5- Suggest a missing word or expression in a verse by applying the > > Shannon text generation principle > > ... > > First, do you think it may be a useful tool ? > > What other features you think can make it usefull for a poet ?
> I'm skeptical of this notion. You can think of writing a poem as > building up a tree structure where there's a root idea you're trying > to express, "branches" in the choices of images/comparisons/etc. that > you use to express the idea, and "leaves" that are the actual words in > the poem. Rhyme means that a left-to-right traversal of the leaves > (i.e. reading the words) results in a pattern with a certain > structure. You're proposing a tool that helps explore the search > space in the nodes near the bottom level of the tree, to find words > with the right characteristics.
> I think the constraint of rhyme and meter is best served by widening > the search space at the upper levels of the tree and not the lower > levels. That is, if you've got an image and you don't find rhyming > words for it with easy natural diction, a computerized search for more > and more obscure words to express that image in rhyme is the last > thing you want.
Absolutly right.
> Rather, you want to discard the image and choose a > different one to express the idea. That means seeking more images by > mentally revisiting and staying inside the emotion at the center of > poem, a much more difficult thing to do than solving the mere math > problem of finding a string of rhyming words with similar semantics to > a non-rhyming sequence that you already have.
Again, right. Your description comes very close to my own experience of writing poems and I never read something as clear as what I'm reading here. Poetry practice is described most of the time in poetic terms just like religion is described in religious terms. And one has to impregnate himself with these words to, little by little, gain some understanding of it. Your description proves that it is possible to describe it otherwise. I am truly marvelled.
The question is : how do you discard the image to choose another one ? How this process takes place ? I observed myself while writing a poem (I, myself, may not be good example since I am certainly not a good poet) and discovered that it is while playing with the words, trying to find the right one, with the right number of syllabs, that I discover a new image, and re-write the whole verse, even re-arranging the whole strophe or poem. My goal with the two last tasks (4 and 5) was to help the poor guy struggling with the words, not to produce the correct final verse, but only to help him in one of the phase of his writing.
> But when you find the > right image, the words and rhythm fall into place without additional > effort.
I don't believe much in this. Poetry and writing in general is work, work, work and more work.
> This is why writing good poems is hard, and is also why the results of > doing it well is powerful. I don't think it can be programmed into a > computer using any current notions.
Again right. My goal, of course, is not to substitute the poet by a computer. Only help him in some of his mechanical tasks.
Paul McGuire said unto the world upon 2005-03-21 03:10:
> How about a clerihew instead of a limerick?
> Guido van Rossum > Had an idea most awesome. > When he lost track of his braces, > Just replaced them with spaces.
> -- Paul McGuire
Hi all,
that's pretty good, Paul.
However, I must insist that you both cease and desist.
Your "Allusion to the computational instructional language Python, through the inclusion of 'brace' (and its derivative forms) and 'space' (and its derivative forms) in a rhyming couplet in a comedic verse", while quite amusing, is a clear violation of my Intellectual Property. My Intellectual Property rights are attested to by my extant prior art <http://tinyurl.com/4bu3n>, the patent application pending before the Patent Office of The Republic of Freedonia covering same, and Darl McBride's say-so.
Having drafted a patent application covering the use of 'space' and 'brace' in poetic contexts, I saw no good reason to stop there. Hence, the pending patent application also covers both the use of braces and whitespace as delimiters (block or otherwise) in any language or set of instructions, (natural, computational or otherwise artificial). So, I must also demand that you, and the rest of the Python community immediately cease and desist from producing any instructions, in any language, which employ either of these syntactic constructs to represent either structure or relations of logical dependency.
Please do note that I make no claim to 'ENDSUB' and like constructs; insofar as my Intellectual Property rights are concerned, you are free to employ such constructs, in any linguistic expression, including, but not limited to, provision of instruction and poetic expression, regardless of context or language in which they are employed.
A formal statement of my position shall be forthcoming from my solicitors, the illustrious firm of Dewey, Cheatem, & Howe. I am optimistic that we will be able to arrive at licencing terms both fair and equitable.
Tim Churches wrote: > ... > My first attempt (which does not scan properly):
> A Dutch mathematician most prophetic, > Did invent a language, name herpetic. > With design quite intelligent, > And syntax mostly elegant, > Big ideas could be made non-hypothetic.
To improve the scan:
A mathematician, prophetic, invented a language, herpetic. decidedly brilliant, syntacticly elegant, Made ideas far less hypothetic.
> Having reviewed your Cease and Desist petition, I'm afraid I must > dispute some or all of your claims:
> 1. Your citation of prior art has one or more significant defects: > a. In your citation, "brace" is clearly rhymed with "whitespace", not > "space". The broad concept of "whitespace" is substantially different > from the specific term "spaces": "whitespace" encompasses all > white-printing characters, including tabs, formfeeds, and carriage > returns, as well as space characters. In the more general field of > publishing, "whitespace" also includes page margins, paragraph breaks, > and block indentations for embedded quotes or subsections. In my > submission, "spaces" is specifically intended to narrowly refer to the > character defined in ISO 8879 as ASCII code 32. Especially, I did > *not* intend to include reference to the ISO 8879 ASCII code 9 > character, or "tab". > b. Prior art predates your citation, see Guido van Rossum's post > "[marketing-python] How About a Slogan or Tagline?", at > http://wingware.com/pipermail/marketing-python/2002-March/003851.html, > which includes several notable references to derivative forms of > "brace" and "space". > 2. As the Python language's most salient feature is its usage of spaces > for program structuring, as opposed to use of enclosing brace > characters in related scripting languages (Tcl, Perl) and compiled > languages (C, C++, Java, C#), the juxtaposition of "brace" and "space" > in any poetic construct is obvious, and this obviousness further erodes > your IP claim. > 3. I think my poem was funnier - "lost track of his braces" (humorous > allusion to suspenders) is a knee-slapper! ("Perl before swine" was > cute, but it's not new.)
> Still, I am open to negotiation - would you be interested in > cross-licensing my patent pending rhyming of "van Rossum" and > "awesome"?
T'were two coders in c.l.p Who liked to argue legally About copyright All day and night, Just to prove their inanity
Having reviewed your Cease and Desist petition, I'm afraid I must dispute some or all of your claims:
1. Your citation of prior art has one or more significant defects: a. In your citation, "brace" is clearly rhymed with "whitespace", not "space". The broad concept of "whitespace" is substantially different from the specific term "spaces": "whitespace" encompasses all white-printing characters, including tabs, formfeeds, and carriage returns, as well as space characters. In the more general field of publishing, "whitespace" also includes page margins, paragraph breaks, and block indentations for embedded quotes or subsections. In my submission, "spaces" is specifically intended to narrowly refer to the character defined in ISO 8879 as ASCII code 32. Especially, I did *not* intend to include reference to the ISO 8879 ASCII code 9 character, or "tab". b. Prior art predates your citation, see Guido van Rossum's post "[marketing-python] How About a Slogan or Tagline?", at http://wingware.com/pipermail/marketing-python/2002-March/003851.html, which includes several notable references to derivative forms of "brace" and "space". 2. As the Python language's most salient feature is its usage of spaces for program structuring, as opposed to use of enclosing brace characters in related scripting languages (Tcl, Perl) and compiled languages (C, C++, Java, C#), the juxtaposition of "brace" and "space" in any poetic construct is obvious, and this obviousness further erodes your IP claim. 3. I think my poem was funnier - "lost track of his braces" (humorous allusion to suspenders) is a knee-slapper! ("Perl before swine" was cute, but it's not new.)
Still, I am open to negotiation - would you be interested in cross-licensing my patent pending rhyming of "van Rossum" and "awesome"?
On Mon, 21 Mar 2005 15:39:45 +1100, Tim Churches <tc...@optushome.com.au> wrote: >Steve Holden wrote: >> Tim Churches wrote: >>> There once was a language called Python...
>>> (which is pretty close to having three anapaestic left feet)
>>> or more promisingly, rhyme-wise, but metrically rather worse :
>>> There once was a mathematician named van Rossum...
>>> Tim C
>> Of course this last suggestion clearly has the wrong meter for a good >> limerick.
>I did say it was metrically worse...
>> Not everyone knows the ingredients of a good limerick, which >> led to the following (which has been around in various forms since God >> was a lad):
>> There was a young man from Japan >> Who never quite learned how to scan. >> He got on quite fine >> Until the last line >> And then somehow he could never quite get the number of syllables >> right,or make it rhyme.
>> So, let's accept that the first line should scan correctly, that would >> make the following first lines acceptable:
>> A mathematician named Guido ... >> The inventor of Python, called Guido ... >> A mathematician (van Rossum) ... >> Van Rossum, inventor of Python ...
>> Hopefully that will begin to get the idea across.
>> Since it's PyCon week, I will offer a prize of $100 to the best (in my >> opinion) limerick about Python posted to this list (with a Cc: to >> py...@python.org) before midday on Friday. The prize money will be my >> own, so there are no other rules. I will post my judgment when the PyCon >> nonsense has died down a little, but the winner will be read before the >> entire PyCon audience. Get to it!
>My first attempt (which does not scan properly):
>A Dutch mathematician most prophetic, >Did invent a language, name herpetic. > With design quite intelligent, > And syntax mostly elegant, >Big ideas could be made non-hypothetic.
A fan of Monty and all was Guido, which inluenced much of what he'd do. Fun was the name of the game, or if you need something to blame, aversions to perl versions, might be your diversions. But Guido did concentrate well, and managed sans line noise to spell.
Suite nothings do our blocks express which doth our code transparently dress, delighting the many who view while confounding a relative few ... and rightly conferring to Guido much fame, though Guido van Rossum is only one name. There's a "this" to import for a hint why so many contribute a stint.
The beauty, the Zen, the generous ethos attract, But it's not deniable it's a definite fact that that really's not explaining it all: It's a good bet they're having a ball ;-)