Function Repository Resource:

BirdSay

Source Notebook

Have a bird say an expression

Contributed by: Richard Hennigan (Wolfram Research)

ResourceFunction["BirdSay"][thing]

ask a cool bird to say thing.

ResourceFunction["BirdSay"][thing,pos]

positions the bird according to the position specified by pos.

Details and Options

This is a silly example of using 9-patch images for the Appearance option in Panel. The same can be done for many other formatting constructs such as Button, Framed, Notebook, etc.

Examples

Basic Examples (4) 

Have a bird say your output:

In[1]:=
ResourceFunction["BirdSay"][Plot[Sin[x], {x, -5, 5}]]
Out[1]=

Position the bird on the right:

In[2]:=
ResourceFunction["BirdSay"]["I'm the right kind of bird.", Right]
Out[2]=

Birds can say words:

In[3]:=
ResourceFunction["BirdSay"][WordCloud[WikipediaData["words"]]]
Out[3]=

How neat is that?

In[4]:=
ResourceFunction["BirdSay"]["That's pretty neat!"]
Out[4]=

Scope (6) 

Position at the top-left:

In[5]:=
ResourceFunction["BirdSay"]["top left", {Top, Left}]
Out[5]=

Position at the left-top:

In[6]:=
ResourceFunction["BirdSay"]["left top", {Left, Top}]
Out[6]=

See all valid positions:

In[7]:=
positions = Join[Tuples[#], Tuples[Reverse[#]]] &[{{Left, Right}, {Top, Bottom}}]
Out[7]=
In[8]:=
ResourceFunction["BirdSay"][Row[#], #] & /@ positions
Out[8]=

This bird is a nerd:

In[9]:=
ResourceFunction["BirdSay"][
 SystemModel["Modelica.Electrical.Analog.Examples.IdealTriacCircuit"]]
Out[9]=

That’s one smart bird:

In[10]:=
ResourceFunction["BirdSay"][
 FindEquationalProof[
   ForAll[{a, b}, or[not[or[not[a], b]], not[or[not[a], not[b]]]] == a], {ForAll[{a, b}, and[a, b] == and[b, a]], ForAll[{a, b}, or[a, b] == or[b, a]], ForAll[{a, b}, and[a, or[b, not[b]]] == a], ForAll[{a, b}, or[a, and[b, not[b]]] == a], ForAll[{a, b, c}, and[a, or[b, c]] == or[and[a, b], and[a, c]]], ForAll[{a, b, c}, or[a, and[b, c]] == and[or[a, b], or[a, c]]]}][
  "ProofGraph"]]
Out[10]=

Have you heard?

In[11]:=
Row[ResourceFunction["BirdSay"] /@ TextWords["The bird is the word"]]
Out[11]=

Applications (1) 

Create a notebook that prints messages in a really cool way:

In[12]:=
birdBox = Module[{expr},
   With[{b = ToBoxes[ResourceFunction["BirdSay"][expr]]}, Replace[CurrentValue[{StyleDefinitions, "MessageTemplate", "TemplateBoxOptionsDisplayFunction"}], HoldPattern[e_ &] :> Function @@ {b /. SymbolName[expr] -> e}]]
   ];

nb = CreateDocument[{ExpressionCell[Defer[1/0], "Input"], ExpressionCell[Defer[First[x]], "Input"], ExpressionCell[Defer[ResourceFunction["BirdSay"]["Neat!"]], "Input"]},
   StyleDefinitions -> Notebook[{Cell[StyleData["MessageTemplate"], "TemplateBoxOptionsDisplayFunction" -> birdBox]}]];

NotebookEvaluate[nb, InsertResults -> True]
Out[13]=

Properties and Relations (4) 

BirdSay can say a WolfieSay:

In[14]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/610bb51d-c480-4849-842f-db6a32339f32"]
Out[14]=

Similarly, WolfieSay can say a BirdSay:

In[15]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/ef2e1897-7ad6-489b-929e-4650f5324469"]
Out[15]=

The output of BirdSay is an Interpretation which can be copied and pasted:

In[16]:=
ResourceFunction["BirdSay"][a + b]
Out[16]=

Copy and paste the output from above into another expression:

In[17]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/2ceffd1a-ab18-46d9-932a-c8c8583436e4"]
Out[17]=
In[18]:=
ResourceFunction["BirdSay"][%]
Out[18]=

Say BirdSay:

In[19]:=
AudioPlay[SpeechSynthesize["BirdSay"]]
Out[19]=

BirdSay what was just said:

In[20]:=
ResourceFunction["BirdSay"][%]
Out[20]=

Possible Issues (1) 

It’s very tempting to BirdSay everything:

In[21]:=
$Post = ResourceFunction["BirdSay"]
Out[21]=
In[22]:=
1 + 1
Out[22]=
In[23]:=
$Post =.

Neat Examples (5) 

Have a bird say a Bird:

In[24]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/19fe620f-e68d-4a69-af46-d3d68818d6e5"]
Out[24]=

Have a bird say a random bird:

In[25]:=
ResourceFunction["BirdSay"][
 RandomChoice[WikipediaData["Bird", "ImageList"]]]
Out[25]=

Have a bird say a bird saying what a bird says:

In[26]:=
Nest[ResourceFunction["BirdSay"][
   ImageResize[
    ImageCrop[ImageRotate[Rasterize[#], -Pi/26, Background -> White]],
     Scaled[3/4]]] &, "", 20]
Out[26]=

Animate your BirdSay:

In[27]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/0e54b071-1208-4d0b-89ab-f37b0d8eafe2"]
Out[27]=

Act out a play:

In[28]:=
script = StringTake[ResourceData["Hamlet"], {828, 949}]
Out[28]=
In[29]:=
Grid[List /@ StringCases[
   StringReplace[script, "Bernardo" :> "Birdnardo"], {"Ber.\n" ~~ Shortest[line__] ~~ "\n" :> Item[ResourceFunction["BirdSay"][line], Alignment -> Left], "Fran.\n" ~~ Shortest[line__] ~~ "\n" :> Item[ResourceFunction["WolfieSay"][line, Right], Alignment -> Right]}]]
Out[29]=

Version History

  • 3.0.0 – 10 June 2019
  • 2.0.0 – 10 June 2019
  • 1.0.0 – 08 February 2019

Related Resources

License Information