Wolfram Research

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/4d40adbe-a499-4a60-a21a-02daf902a50b"]
Out[14]=

Similarly, WolfieSay can say a BirdSay:

In[15]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/2f345ba7-291e-4d76-9d8d-a0d3f0c133a5"]
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/540b8598-62b5-4ee4-85e1-fa21b4416f43"]
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/5712c793-c67e-48e6-a44f-256201403d7c"]
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/267d4568-2319-46a6-a659-cd72f69a574b"]
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]=

Resource History

Related Resources

License Information