(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 91238, 2571] NotebookOptionsPosition[ 82816, 2305] NotebookOutlinePosition[ 84772, 2362] CellTagsIndexPosition[ 84693, 2357] WindowFrame->Normal ContainsDynamic->True *) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell["\<\ Programming Morse Code Dictator\ \>", "Title", CellChangeTimes->{{3.431637429787592*^9, 3.4316374368776608`*^9}, { 3.43216458849737*^9, 3.432164599134489*^9}, {3.432164971974938*^9, 3.432164977333551*^9}}], Cell["Motivation:", "Text", CellChangeTimes->{{3.432164849954269*^9, 3.43216486215032*^9}}], Cell[CellGroupData[{ Cell["watched the serial Jericho;", "Item", CellChangeTimes->{{3.432164864944069*^9, 3.4321648930475197`*^9}}], Cell["have been radio operator in the army;", "Item", CellChangeTimes->{{3.432164897990477*^9, 3.432164914205594*^9}}], Cell["\<\ it is much simpler to program and explain than a dictation generator for \ music interval.\ \>", "Item", CellChangeTimes->{{3.432164930711545*^9, 3.4321649648935413`*^9}, 3.432165035123259*^9, {3.4328442604711647`*^9, 3.432844273859264*^9}, 3.433180947286729*^9}] }, Open ]], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Morse code", "Section", CellChangeTimes->{{3.432165062890856*^9, 3.4321650661095543`*^9}}], Cell["\<\ The Morse code maps symbols to a sequence of short and long elements. (Dots \ and dashes.) \ \>", "Text", CellChangeTimes->{{3.432165225372786*^9, 3.432165271205531*^9}, { 3.432165327744673*^9, 3.432165355877542*^9}, {3.432165505362074*^9, 3.432165526941959*^9}}], Cell["\<\ We need to choose a representation for the Morse codes of the symbols. \ \>", "Text", CellChangeTimes->{{3.432165073119875*^9, 3.4321651182935266`*^9}}], Cell["\<\ Many choices are possible. We are going to represent the \"\[CenterDot]\" \ with 0, the \"-\" with 1. \ \>", "Text", CellChangeTimes->{{3.432165121015202*^9, 3.4321651838377*^9}, { 3.432165416260952*^9, 3.432165452486534*^9}, {3.43216549266271*^9, 3.432165499318284*^9}, 3.432167971550209*^9, 3.433180950398672*^9}], Cell[BoxData[ RowBox[{ RowBox[{"MorseCodeRules", "=", RowBox[{"{", RowBox[{ RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "0", ",", "1", ",", "0"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "0", ",", "0"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", "0", "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1", ",", "0"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "1", ",", "0"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1", ",", "1", ",", "1"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "0", ",", "1"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0", ",", "0"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "0"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "1", ",", "1"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1", ",", "1", ",", "0"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "1", ",", "0", ",", "1"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", "1", "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "1"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1", ",", "1"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "1"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "0", ",", "1", ",", "1"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "1", ",", "0", ",", "0"}], "}"}]}], ",", RowBox[{"\"\<1\>\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1", ",", "1", ",", "1", ",", "1"}], "}"}]}], ",", RowBox[{"\"\<2\>\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1", ",", "1", ",", "1"}], "}"}]}], ",", RowBox[{"\"\<3\>\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "1", ",", "1"}], "}"}]}], ",", RowBox[{"\"\<4\>\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0", ",", "1"}], "}"}]}], ",", RowBox[{"\"\<5\>\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}]}], ",", RowBox[{"\"\<6\>\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0", ",", "0"}], "}"}]}], ",", RowBox[{"\"\<7\>\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "1", ",", "0", ",", "0", ",", "0"}], "}"}]}], ",", RowBox[{"\"\<8\>\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "1", ",", "1", ",", "0", ",", "0"}], "}"}]}], ",", RowBox[{"\"\<9\>\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "1", ",", "1", ",", "1", ",", "0"}], "}"}]}], ",", RowBox[{"\"\<0\>\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "1", ",", "1", ",", "1", ",", "1"}], "}"}]}], ",", RowBox[{"\"\<.\>\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0", ",", "1", ",", "0", ",", "1"}], "}"}]}], ",", RowBox[{"\"\<,\>\"", "\[Rule]", RowBox[{"{", RowBox[{"1", ",", "1", ",", "0", ",", "0", ",", "1", ",", "1"}], "}"}]}], ",", RowBox[{"\"\\"", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1", ",", "1", ",", "0", ",", "0"}], "}"}]}]}], "}"}]}], ";"}]], "Input", CellChangeTimes->{{3.4316373524096537`*^9, 3.4316373859661837`*^9}, { 3.43163747181736*^9, 3.431637668273059*^9}, {3.431643976317602*^9, 3.4316441615251627`*^9}, {3.4316445205783377`*^9, 3.431644525105322*^9}, { 3.431645465539598*^9, 3.431645633385906*^9}, {3.432165711971018*^9, 3.432165798225017*^9}}], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Morse Code Rules usage", "Section", CellChangeTimes->{{3.432168330192731*^9, 3.432168341310152*^9}}], Cell["Usage of the list of rules defined above:", "Text", CellChangeTimes->{{3.432167962213799*^9, 3.432167963133844*^9}, { 3.432168484394074*^9, 3.432168501302856*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"\"\\"", "/.", "MorseCodeRules"}]], "Input", CellChangeTimes->{{3.4321679369676847`*^9, 3.432167954435343*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "0"}], "}"}]], "Output", CellChangeTimes->{3.432167955294999*^9, 3.432219392548994*^9, 3.432659163672456*^9, 3.432844318927123*^9}] }, Open ]], Cell["\<\ Split a word into a list of single characters, then apply the rules:\ \>", "Text", CellChangeTimes->{{3.432168510400343*^9, 3.4321685634342117`*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{"\"\\"", "//", "Characters"}], "\[IndentingNewLine]", RowBox[{"%", "/.", "MorseCodeRules"}]}], "Input", CellChangeTimes->{{3.432168084997856*^9, 3.432168133783079*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{"\<\"F\"\>", ",", "\<\"L\"\>", ",", "\<\"U\"\>", ",", "\<\"X\"\>"}], "}"}]], "Output", CellChangeTimes->{{3.432168105443198*^9, 3.432168134335134*^9}, 3.432219392598065*^9, 3.432659173110819*^9, 3.432844319658965*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "1", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "1"}], "}"}]}], "}"}]], "Output", CellChangeTimes->{{3.432168105443198*^9, 3.432168134335134*^9}, 3.432219392598065*^9, 3.432659173110819*^9, 3.432844319665015*^9}] }, Open ]], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Morse code rules", "Section", CellChangeTimes->{{3.432165543594018*^9, 3.432165546861741*^9}}], Cell[CellGroupData[{ Cell["1 dash = 3 dots", "Item", CellChangeTimes->{{3.432166179930181*^9, 3.4321661899416*^9}}], Cell["The space between parts of the same symbol is 1 dot.", "Item", CellChangeTimes->{{3.432166196162122*^9, 3.4321662273497334`*^9}}], Cell["The space between symbols is 3 dots.", "Item", CellChangeTimes->{{3.432166230128256*^9, 3.432166274670129*^9}}], Cell["The space between words is 7 dots.", "Item", CellChangeTimes->{{3.432166230128256*^9, 3.432166274670129*^9}}] }, Open ]], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Visualization", "Section", CellChangeTimes->{{3.432166298049842*^9, 3.432166301159171*^9}}], Cell["\<\ Using Fold to construct a string which is a sequence of dots and dashes from \ a list of 0's and 1's:\ \>", "Text", CellChangeTimes->{{3.432168618894844*^9, 3.432168696461998*^9}, 3.4331809526390953`*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Fold", "[", RowBox[{ RowBox[{ RowBox[{"StringJoin", "[", RowBox[{"#1", ",", RowBox[{"(", RowBox[{"#2", "/.", RowBox[{"{", RowBox[{ RowBox[{"0", "->", "\"\<\[CenterDot]\>\""}], ",", RowBox[{"1", "->", "\"\<-\>\""}]}], "}"}]}], ")"}], ",", "\"\< \>\""}], "]"}], "&"}], ",", RowBox[{"{", "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1", ",", "1", ",", "1"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.4321677760121193`*^9, 3.432167781056428*^9}, { 3.432167828097101*^9, 3.432167828168447*^9}, {3.432167879025443*^9, 3.43216790041566*^9}, {3.432170407722721*^9, 3.432170420608739*^9}}], Cell[BoxData["\<\"\[CenterDot] \[CenterDot] - - - \"\>"], "Output", CellChangeTimes->{3.4321679008471212`*^9, 3.432219392635531*^9, 3.432659195792386*^9, 3.432844323799664*^9}] }, Open ]], Cell["Function definition:", "Text", CellChangeTimes->{{3.432168706457985*^9, 3.4321687128541193`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"PrintMorseCode", "[", RowBox[{"list", ":", RowBox[{"{", RowBox[{ RowBox[{"(", RowBox[{"1", "|", "0"}], ")"}], "..."}], "}"}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "k", "}"}], ",", "\[IndentingNewLine]", RowBox[{"Style", "[", RowBox[{ RowBox[{"Fold", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"#1", "<>", RowBox[{"If", "[", RowBox[{ RowBox[{"#2", "\[Equal]", "0"}], ",", "\"\<\[CenterDot]\>\"", ",", "\"\<-\>\""}], "]"}], "<>", "\"\< \>\""}], ")"}], "&"}], ",", RowBox[{"{", "}"}], ",", "list"}], "]"}], ",", "Large", ",", RowBox[{"FontWeight", "\[Rule]", "Bold"}], ",", RowBox[{"FontFamily", "\[Rule]", "\"\\""}]}], "]"}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.432168702870523*^9, 3.432168703898308*^9}}], Cell["\<\ Apply the function to a range of symbols (for checking correctness:)\ \>", "Text", CellChangeTimes->{{3.432168730791572*^9, 3.432168771566475*^9}}], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"t", "=", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"#", ",", RowBox[{"PrintMorseCode", "[", RowBox[{"#", "/.", "MorseCodeRules"}], "]"}]}], "}"}], "&"}], "/@", RowBox[{"CharacterRange", "[", RowBox[{"\"\\"", ",", "\"\\""}], "]"}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{"TableForm", "[", RowBox[{"Partition", "[", RowBox[{ RowBox[{"Flatten", "@", "t"}], ",", "4"}], "]"}], "]"}]}], "Input", CellChangeTimes->{{3.432166377077124*^9, 3.432166470336274*^9}}], Cell[BoxData[ TagBox[GridBox[{ {"\<\"A\"\>", StyleBox["\<\"\[CenterDot] - \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"B\"\>", StyleBox["\<\"- \[CenterDot] \[CenterDot] \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]}, {"\<\"C\"\>", StyleBox["\<\"- \[CenterDot] - \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"D\"\>", StyleBox["\<\"- \[CenterDot] \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]}, {"\<\"E\"\>", StyleBox["\<\"\[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"F\"\>", StyleBox["\<\"\[CenterDot] \[CenterDot] - \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]}, {"\<\"G\"\>", StyleBox["\<\"- - \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"H\"\>", StyleBox["\<\"\[CenterDot] \[CenterDot] \[CenterDot] \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]}, {"\<\"I\"\>", StyleBox["\<\"\[CenterDot] \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"J\"\>", StyleBox["\<\"\[CenterDot] - - - \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]}, {"\<\"K\"\>", StyleBox["\<\"- \[CenterDot] - \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"L\"\>", StyleBox["\<\"\[CenterDot] - \[CenterDot] \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]}, {"\<\"M\"\>", StyleBox["\<\"- - \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"N\"\>", StyleBox["\<\"- \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]}, {"\<\"O\"\>", StyleBox["\<\"- - - \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"P\"\>", StyleBox["\<\"\[CenterDot] - - \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]}, {"\<\"Q\"\>", StyleBox["\<\"- - \[CenterDot] - \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"R\"\>", StyleBox["\<\"\[CenterDot] - \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]}, {"\<\"S\"\>", StyleBox["\<\"\[CenterDot] \[CenterDot] \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"T\"\>", StyleBox["\<\"- \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]}, {"\<\"U\"\>", StyleBox["\<\"\[CenterDot] \[CenterDot] - \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"V\"\>", StyleBox["\<\"\[CenterDot] \[CenterDot] \[CenterDot] - \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]}, {"\<\"W\"\>", StyleBox["\<\"\[CenterDot] - - \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"X\"\>", StyleBox["\<\"- \[CenterDot] \[CenterDot] - \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]}, {"\<\"Y\"\>", StyleBox["\<\"- \[CenterDot] - - \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold], "\<\"Z\"\>", StyleBox["\<\"- - \[CenterDot] \[CenterDot] \"\>", StripOnInput->False, FontFamily->"Times", FontSize->Large, FontWeight->Bold]} }, GridBoxAlignment->{ "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.7]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}], Function[BoxForm`e$, TableForm[BoxForm`e$]]]], "Output", CellChangeTimes->{ 3.432166328586377*^9, {3.432166383555526*^9, 3.43216642454464*^9}, { 3.432166455104155*^9, 3.432166472098969*^9}, 3.4321665894974833`*^9, 3.432219392774969*^9, 3.4326577792211113`*^9, 3.432844327092142*^9, 3.432844853927207*^9}] }, Open ]], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Playing a symbol", "Section", CellChangeTimes->{{3.432169106107321*^9, 3.432169118246374*^9}, { 3.432217146554955*^9, 3.432217163162871*^9}}], Cell["\<\ We can use an approach analogous to the one for the visualization, namely, \ convert a given list of 0's and 1's into musical notes and pauses that give \ them durations according to the Morse code rules.\ \>", "Text", CellChangeTimes->{{3.4321693541283293`*^9, 3.43216944724616*^9}, { 3.432169588626307*^9, 3.432169633646187*^9}, {3.4322182400277433`*^9, 3.4322182435320063`*^9}, {3.43222044207041*^9, 3.432220463812014*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"dotDuration", "=", RowBox[{"3", "/", "16"}]}], ";", RowBox[{"Fold", "[", RowBox[{ RowBox[{ RowBox[{"Join", "[", RowBox[{"#1", ",", RowBox[{"{", RowBox[{"#2", "/.", RowBox[{"{", RowBox[{ RowBox[{"0", "\[Rule]", RowBox[{"SoundNote", "[", RowBox[{"\"\\"", ",", "dotDuration"}], "]"}]}], ",", RowBox[{"1", "\[Rule]", RowBox[{"SoundNote", "[", RowBox[{"\"\\"", ",", RowBox[{"3", "*", "dotDuration"}]}], "]"}]}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"SoundNote", "[", RowBox[{"None", ",", "dotDuration"}], "]"}], "}"}]}], "]"}], "&"}], ",", RowBox[{"{", "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1", ",", "1", ",", "1"}], "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.4321677760121193`*^9, 3.432167781056428*^9}, { 3.432167828097101*^9, 3.432167828168447*^9}, {3.432167879025443*^9, 3.43216790041566*^9}, {3.432170396941341*^9, 3.4321704016569366`*^9}, { 3.432170432781101*^9, 3.43217057342585*^9}, {3.432170631280593*^9, 3.432170840587151*^9}, {3.432170913351273*^9, 3.4321709326183453`*^9}, { 3.4326579901029053`*^9, 3.432658022883507*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"SoundNote", "[", RowBox[{"\<\"C4\"\>", ",", FractionBox["3", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["3", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C4\"\>", ",", FractionBox["3", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["3", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C4\"\>", ",", FractionBox["9", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["3", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C4\"\>", ",", FractionBox["9", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["3", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C4\"\>", ",", FractionBox["9", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["3", "16"]}], "]"}]}], "}"}]], "Output", CellChangeTimes->{{3.432170574245946*^9, 3.4321706772329493`*^9}, 3.432170712958045*^9, {3.4321707476705093`*^9, 3.4321708110955544`*^9}, { 3.432170917707103*^9, 3.432170933199624*^9}, 3.432219392815085*^9, { 3.432657956642786*^9, 3.4326580121284657`*^9}, {3.4326592238763647`*^9, 3.432659242076462*^9}, 3.4328443297358503`*^9, 3.43284485604906*^9}] }, Open ]], Cell[BoxData[ RowBox[{"EmitSound", "[", RowBox[{"Sound", "[", "%", "]"}], "]"}]], "Input", CellChangeTimes->{{3.432170577825603*^9, 3.432170619871263*^9}, { 3.432170812476503*^9, 3.4321708131624517`*^9}, {3.432657965922287*^9, 3.4326579876342916`*^9}}], Cell[BoxData[""], "Input", CellChangeTimes->{{3.432169350041296*^9, 3.432169351552047*^9}}], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Playing a symbol", "Section", CellChangeTimes->{{3.432217125941543*^9, 3.4322171746988153`*^9}, { 3.432217400975379*^9, 3.4322174055228863`*^9}}], Cell["\<\ Let's define a function that executes the code above, and an overloaded \ definition that calls the first after translating a symbol into a list of 0's \ and 1's. \ \>", "Text", CellChangeTimes->{{3.432217410051383*^9, 3.43221745857907*^9}, { 3.432218796116104*^9, 3.432218842003524*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"PlayMorseCode", "[", RowBox[{ RowBox[{"list", ":", RowBox[{"{", RowBox[{ RowBox[{"(", RowBox[{"0", "|", "1"}], ")"}], "..."}], "}"}]}], ",", "pitch_", ",", "dotDuration_", ",", RowBox[{"instrument_:", "\"\\""}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Drop", "[", RowBox[{ RowBox[{"Fold", "[", RowBox[{ RowBox[{ RowBox[{"Join", "[", RowBox[{"#1", ",", RowBox[{"{", RowBox[{"#2", "/.", RowBox[{"{", RowBox[{ RowBox[{"0", "\[Rule]", RowBox[{"SoundNote", "[", RowBox[{"pitch", ",", "dotDuration", ",", "instrument"}], "]"}]}], ",", RowBox[{"1", "\[Rule]", RowBox[{"SoundNote", "[", RowBox[{"pitch", ",", RowBox[{"3", "*", "dotDuration"}], ",", "instrument"}], "]"}]}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"SoundNote", "[", RowBox[{"None", ",", "dotDuration"}], "]"}], "}"}]}], "]"}], "&"}], ",", RowBox[{"{", "}"}], ",", "list"}], "]"}], ",", RowBox[{"-", "1"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.4321677760121193`*^9, 3.432167781056428*^9}, { 3.432167828097101*^9, 3.432167828168447*^9}, {3.432167879025443*^9, 3.43216790041566*^9}, {3.432170396941341*^9, 3.4321704016569366`*^9}, { 3.432170432781101*^9, 3.43217057342585*^9}, {3.432170631280593*^9, 3.432170840587151*^9}, {3.432170913351273*^9, 3.4321709326183453`*^9}, { 3.432217475746007*^9, 3.432217558136297*^9}, {3.4322175998571978`*^9, 3.432217604864017*^9}, {3.43221763907725*^9, 3.432217640463152*^9}, { 3.432217672591916*^9, 3.4322177129364367`*^9}, {3.4322178900812397`*^9, 3.432217899728668*^9}, {3.432219204676124*^9, 3.432219218096888*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"PlayMorseCode", "[", RowBox[{"symbol_String", ",", RowBox[{"pitch_:", "\"\\""}], ",", RowBox[{"dotDuration_:", RowBox[{"1", "/", "16"}]}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{ RowBox[{"PlayMorseCode", "[", RowBox[{ RowBox[{"symbol", "/.", "MorseCodeRules"}], ",", "pitch", ",", "dotDuration"}], "]"}], "/;", RowBox[{ RowBox[{"StringLength", "[", "symbol", "]"}], "\[Equal]", "1"}]}]}], ";"}]], "Input", CellChangeTimes->{{3.432217568397149*^9, 3.432217632749508*^9}, { 3.4322179246247168`*^9, 3.432217924925865*^9}, {3.432219143659111*^9, 3.432219155053994*^9}, {3.432219239417603*^9, 3.432219240534049*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"PlayMorseCode", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.432658122742673*^9, 3.432658145966207*^9}, 3.4326582061688213`*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["3", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["3", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["1", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["3", "16"], ",", "\<\"Flute\"\>"}], "]"}]}], "}"}]], "Output",\ CellChangeTimes->{ 3.432217802196866*^9, 3.432217907487904*^9, 3.432219161553076*^9, { 3.432219212956894*^9, 3.432219243380013*^9}, 3.43221939395925*^9, { 3.4326580671272373`*^9, 3.432658147158554*^9}, 3.432659259141903*^9, 3.432844345421937*^9, 3.4328448597226*^9}] }, Open ]], Cell[BoxData[ RowBox[{"EmitSound", "[", RowBox[{"Sound", "[", RowBox[{"PlayMorseCode", "[", "\"\\"", "]"}], "]"}], "]"}]], "Input", CellChangeTimes->{{3.4322176494851513`*^9, 3.432217655187796*^9}, { 3.432217719468419*^9, 3.432217733228438*^9}, {3.432658054403566*^9, 3.432658088639639*^9}, {3.4326581552412643`*^9, 3.432658202173403*^9}, 3.432659263846045*^9}], Cell[TextData[{ "Since we first generate the list of notes, instead of playing them at the \ moment of dot/dash detection, we can also use ", StyleBox["Map", "Program"], " instead of ", StyleBox["Fold", "Program"], "." }], "Text", CellChangeTimes->{{3.43221853587141*^9, 3.432218545851115*^9}, { 3.4322185828558207`*^9, 3.432218639787203*^9}}], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Playing a word", "Section", CellChangeTimes->{{3.432218006381816*^9, 3.432218011314939*^9}}], Cell[TextData[{ "We can just apply a ", StyleBox["Fold", "Program"], " to characters of the word, similar to the function for symbol playing. " }], "Text", CellChangeTimes->{{3.432218188659299*^9, 3.4322182301312923`*^9}, { 3.432218331196039*^9, 3.432218463003084*^9}, 3.432218524473064*^9, 3.4331809537752237`*^9}], Cell["\<\ Between the symbols we have pause (as long as a dash, or three dots) so it \ would helpful if we define a function that makes a musical pause and it is \ triggered with a special list in order to preserve the structure.\ \>", "Text", CellChangeTimes->{{3.432218180243156*^9, 3.432218184762887*^9}, { 3.432218272701642*^9, 3.432218321947048*^9}, {3.432218649087318*^9, 3.432218656218877*^9}, {3.432218729843226*^9, 3.432218769051894*^9}, 3.4331809557597446`*^9}], Cell[BoxData[ RowBox[{ RowBox[{"PlayMorseCode", "[", RowBox[{ RowBox[{"list", ":", RowBox[{"{", RowBox[{"2", "..."}], "}"}]}], ",", "pitch_", ",", "dotDuration_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"SoundNote", "[", RowBox[{"None", ",", RowBox[{ RowBox[{"Total", "[", "list", "]"}], "*", "dotDuration"}], ",", "\"\\""}], "]"}]}]], "Input", CellChangeTimes->{{3.432218959280731*^9, 3.432218980769446*^9}, { 3.432659425168293*^9, 3.4326594328371487`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"PlayMorseCode", "[", RowBox[{"words_String", ",", RowBox[{"pitch_:", "\"\\""}], ",", RowBox[{"dotDuration_:", RowBox[{"1", "/", "16"}]}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Flatten", "@", RowBox[{"Fold", "[", RowBox[{ RowBox[{ RowBox[{"Join", "[", RowBox[{"#1", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"#2", "==", "\"\< \>\""}], ",", RowBox[{"{", RowBox[{"PlayMorseCode", "[", RowBox[{ RowBox[{"{", RowBox[{ "2", ",", "2", ",", "2", ",", "2", ",", "2", ",", "2", ",", "2"}], "}"}], ",", "pitch", ",", "dotDuration"}], "]"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"PlayMorseCode", "[", RowBox[{ RowBox[{"#2", "/.", "MorseCodeRules"}], ",", "pitch", ",", "dotDuration"}], "]"}], ",", RowBox[{"PlayMorseCode", "[", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "2", ",", "2"}], "}"}], ",", "pitch", ",", "dotDuration"}], "]"}]}], "}"}]}], "]"}]}], "]"}], "&"}], ",", RowBox[{"{", "}"}], ",", RowBox[{"Characters", "@", "words"}]}], "]"}]}]}], ";"}]], "Input", CellChangeTimes->{{3.432219011288669*^9, 3.4322190271690702`*^9}, { 3.432219291244341*^9, 3.432219293162866*^9}, {3.4322194597965803`*^9, 3.432219460081098*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"PlayMorseCode", "[", "\"\\"", "]"}]], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["1", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["3", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["3", "8"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["3", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["1", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["3", "8"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["3", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["3", "8"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["3", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["3", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["3", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["3", "8"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["3", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"\<\"C6\"\>", ",", FractionBox["1", "16"], ",", "\<\"Flute\"\>"}], "]"}], ",", RowBox[{"SoundNote", "[", RowBox[{"None", ",", FractionBox["3", "8"], ",", "\<\"Flute\"\>"}], "]"}]}], "}"}]], "Output",\ CellChangeTimes->{{3.432219271225862*^9, 3.432219296804785*^9}, 3.43221939405888*^9, {3.4322194528468723`*^9, 3.4322194661864243`*^9}, 3.432657793458105*^9, 3.432844353439332*^9}] }, Open ]], Cell[BoxData[ RowBox[{"EmitSound", "@", RowBox[{"Sound", "@", RowBox[{"PlayMorseCode", "[", "\"\\"", "]"}]}]}]], "Input", CellChangeTimes->{{3.432218175513863*^9, 3.4322181762302017`*^9}, { 3.4322190564118443`*^9, 3.4322190740364323`*^9}, {3.432219627956612*^9, 3.432219630364582*^9}}], Cell[BoxData[ RowBox[{"EmitSound", "@", RowBox[{"Sound", "@", RowBox[{"PlayMorseCode", "[", RowBox[{"ToUpperCase", "@", "\"\\""}], "]"}]}]}]], "Input", CellChangeTimes->{{3.432218175513863*^9, 3.4322181762302017`*^9}, { 3.4322190564118443`*^9, 3.4322190740364323`*^9}, {3.432219627956612*^9, 3.432219676041647*^9}}], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Random dictation", "Section", CellChangeTimes->{{3.432219713246195*^9, 3.4322197159310513`*^9}}], Cell["\<\ Usually coded text is in groups of 5 characters. Here is a function that \ generates a number of groups with symbols from a given range.\ \>", "Text", CellChangeTimes->{{3.432219750283389*^9, 3.4322198381952744`*^9}, { 3.4322205008655767`*^9, 3.432220516099516*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"MorseDictation", "[", RowBox[{ RowBox[{"n_:", "10"}], ",", RowBox[{"crange_:", RowBox[{"CharacterRange", "[", RowBox[{"\"\\"", ",", "\"\\""}], "]"}]}]}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", "t", "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"t", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomInteger", "[", RowBox[{"{", RowBox[{"1", ",", RowBox[{"Length", "[", "crange", "]"}]}], "}"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "5"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"t", "=", RowBox[{"StringJoin", "@@@", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{ "crange", "\[LeftDoubleBracket]", "#", "\[RightDoubleBracket]"}], "&"}], "/@", "t"}], ")"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"Fold", "[", RowBox[{ RowBox[{ RowBox[{"#1", "<>", "#2", "<>", "\"\< \>\""}], "&"}], ",", "\"\<\>\"", ",", "t"}], "]"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.4322197380505247`*^9, 3.432219745588994*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MorseDictation", "[", "3", "]"}]], "Input", CellChangeTimes->{{3.43221984331002*^9, 3.4322198482842827`*^9}, 3.432219942772903*^9}], Cell[BoxData["\<\"EMPFO VWWFM KRAJW \"\>"], "Output", CellChangeTimes->{3.432219848882509*^9, 3.432219943461875*^9, 3.432658245874236*^9, 3.432844388186184*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MorseDictation", "[", RowBox[{"3", ",", RowBox[{"CharacterRange", "[", RowBox[{"\"\<0\>\"", ",", "\"\<9\>\""}], "]"}]}], "]"}]], "Input", CellChangeTimes->{{3.432219855285738*^9, 3.4322198787888002`*^9}, 3.432219947087957*^9}], Cell[BoxData["\<\"91174 01274 88947 \"\>"], "Output", CellChangeTimes->{{3.432219857683484*^9, 3.432219879140674*^9}, 3.4322199475041647`*^9, 3.432658250141892*^9, 3.432844389180936*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MorseDictation", "[", RowBox[{"3", ",", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.432219886374299*^9, 3.432219899604458*^9}, 3.43221994934344*^9}], Cell[BoxData["\<\"QQQFQ FFFQQ FQFQQ \"\>"], "Output", CellChangeTimes->{3.4322199000480433`*^9, 3.43221994981454*^9, 3.4326582511096687`*^9}] }, Open ]], Cell[BoxData[ RowBox[{"EmitSound", "@", RowBox[{"Sound", "@", RowBox[{"PlayMorseCode", "[", "%", "]"}]}]}]], "Input", CellChangeTimes->{{3.432219935044258*^9, 3.432219962748488*^9}}], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["User interface", "Section", CellChangeTimes->{{3.432219917173903*^9, 3.4322199240271187`*^9}}], Cell["\<\ So far we have produced the translations entering and evaluating commands. \ Here is a way to make a simple user interface:\ \>", "Text", CellChangeTimes->{{3.432219928372716*^9, 3.432219930443522*^9}, { 3.432219989663245*^9, 3.432220071243243*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Manipulate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "dict", "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"dict", "=", RowBox[{"MorseDictation", "[", RowBox[{"n", ",", "crange"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Column", "[", RowBox[{"{", RowBox[{"dict", ",", "\"\<\>\"", ",", RowBox[{"ToLowerCase", "[", "dict", "]"}], ",", "\[IndentingNewLine]", RowBox[{"EmitSound", "@", RowBox[{"Sound", "@", RowBox[{"PlayMorseCode", "[", RowBox[{"dict", ",", "\"\\"", ",", RowBox[{"1.5", "/", "16"}]}], "]"}]}]}]}], "}"}], "]"}]}]}], "\[IndentingNewLine]", "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"n", ",", "5", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"5", ",", "10", ",", "20"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"duration", ",", RowBox[{"3", "/", "32"}], ",", "\"\\""}], "}"}], ",", RowBox[{"1", "/", "128"}], ",", "1", ",", RowBox[{"1", "/", "128"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"crange", ",", RowBox[{"CharacterRange", "[", RowBox[{"\"\\"", ",", "\"\\""}], "]"}], ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"CharacterRange", "[", RowBox[{"\"\\"", ",", "\"\\""}], "]"}], "\[Rule]", "\"\\""}], ",", RowBox[{ RowBox[{"CharacterRange", "[", RowBox[{"\"\<0\>\"", ",", "\"\<9\>\""}], "]"}], "\[Rule]", "\"\<0-9\>\""}]}], "}"}]}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.43164589340215*^9, 3.431646059304661*^9}, { 3.431646095589958*^9, 3.4316461893384733`*^9}, {3.431646222406981*^9, 3.431646277315213*^9}, {3.431646335100786*^9, 3.431646358947021*^9}, { 3.43176541853937*^9, 3.431765483114502*^9}, 3.431765546205146*^9, { 3.431765869085805*^9, 3.4317658927941427`*^9}, {3.431766047433785*^9, 3.431766049482807*^9}, {3.431766081035972*^9, 3.431766184876073*^9}, { 3.431766392638028*^9, 3.431766412916027*^9}, {3.4317664638231907`*^9, 3.43176650299957*^9}}], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`crange$$ = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}, $CellContext`duration$$ = Rational[3, 32], $CellContext`n$$ = 5, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`n$$], 5, "number of groups"}, {5, 10, 20}}, {{ Hold[$CellContext`duration$$], Rational[3, 32], "dot duration"}, Rational[1, 128], 1, Rational[1, 128]}, {{ Hold[$CellContext`crange$$], { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}, "characters"}, {{ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"} -> "A-Z", {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} -> "0-9"}}}, Typeset`size$$ = {729., {51.25, 57.75}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`n$512$$ = 0, $CellContext`duration$517$$ = 0, $CellContext`crange$518$$ = False}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`crange$$ = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}, $CellContext`duration$$ = Rational[3, 32], $CellContext`n$$ = 5}, "ControllerVariables" :> { Hold[$CellContext`n$$, $CellContext`n$512$$, 0], Hold[$CellContext`duration$$, $CellContext`duration$517$$, 0], Hold[$CellContext`crange$$, $CellContext`crange$518$$, False]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Module[{$CellContext`dict$}, $CellContext`dict$ = \ $CellContext`MorseDictation[$CellContext`n$$, $CellContext`crange$$]; Column[{$CellContext`dict$, "", ToLowerCase[$CellContext`dict$], EmitSound[ Sound[ $CellContext`PlayMorseCode[$CellContext`dict$, "C6", 1.5/ 16]]]}]], "Specifications" :> {{{$CellContext`n$$, 5, "number of groups"}, {5, 10, 20}}, {{$CellContext`duration$$, Rational[3, 32], "dot duration"}, Rational[1, 128], 1, Rational[ 1, 128]}, {{$CellContext`crange$$, { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}, "characters"}, {{ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"} -> "A-Z", {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} -> "0-9"}}}, "Options" :> {}, "DefaultOptions" :> {}], ImageSizeCache->{773.5, {131.5, 138.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{3.432844884964459*^9}] }, Open ]], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Graphing instead of playing I", "Section", CellChangeTimes->{{3.432844812059811*^9, 3.432844833098486*^9}, { 3.432847843039254*^9, 3.4328478454431458`*^9}, {3.432848305807242*^9, 3.432848306218725*^9}}], Cell["Lets try to morph the code above into graphing code.", "Text", CellChangeTimes->{{3.432847936911669*^9, 3.4328479646910677`*^9}}], Cell[TextData[{ "We are going to look at definition of ", StyleBox["PlayMorseCode", "Program"], " first." }], "Text", CellChangeTimes->{{3.432847967615809*^9, 3.4328479938110723`*^9}, 3.433180957399105*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"DownValues", "[", "PlayMorseCode", "]"}]], "Input", CellChangeTimes->{{3.432845437391272*^9, 3.432845456127512*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"HoldPattern", "[", RowBox[{"PlayMorseCode", "[", RowBox[{ RowBox[{"list", ":", RowBox[{"{", RowBox[{ RowBox[{"(", RowBox[{"0", "|", "1"}], ")"}], "..."}], "}"}]}], ",", "pitch_", ",", "dotDuration_", ",", RowBox[{"instrument_", ":", "\<\"Flute\"\>"}]}], "]"}], "]"}], "\[RuleDelayed]", RowBox[{"Drop", "[", RowBox[{ RowBox[{"Fold", "[", RowBox[{ RowBox[{ RowBox[{"Join", "[", RowBox[{"#1", ",", RowBox[{"{", RowBox[{"#2", "/.", "\[InvisibleSpace]", RowBox[{"{", RowBox[{ RowBox[{"0", "\[Rule]", RowBox[{"SoundNote", "[", RowBox[{"pitch", ",", "dotDuration", ",", "instrument"}], "]"}]}], ",", RowBox[{"1", "\[Rule]", RowBox[{"SoundNote", "[", RowBox[{"pitch", ",", RowBox[{"3", " ", "dotDuration"}], ",", "instrument"}], "]"}]}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"SoundNote", "[", RowBox[{"None", ",", "dotDuration"}], "]"}], "}"}]}], "]"}], "&"}], ",", RowBox[{"{", "}"}], ",", "list"}], "]"}], ",", RowBox[{"-", "1"}]}], "]"}]}], ",", RowBox[{ RowBox[{"HoldPattern", "[", RowBox[{"PlayMorseCode", "[", RowBox[{"symbol_String", ",", RowBox[{"pitch_", ":", "\<\"C6\"\>"}], ",", RowBox[{"dotDuration_", ":", FractionBox["1", "16"]}]}], "]"}], "]"}], "\[RuleDelayed]", RowBox[{ RowBox[{"PlayMorseCode", "[", RowBox[{ RowBox[{"symbol", "/.", "\[InvisibleSpace]", "MorseCodeRules"}], ",", "pitch", ",", "dotDuration"}], "]"}], "/;", RowBox[{ RowBox[{"StringLength", "[", "symbol", "]"}], "\[Equal]", "1"}]}]}], ",", RowBox[{ RowBox[{"HoldPattern", "[", RowBox[{"PlayMorseCode", "[", RowBox[{ RowBox[{"list", ":", RowBox[{"{", RowBox[{ RowBox[{"(", "2", ")"}], "..."}], "}"}]}], ",", "pitch_", ",", "dotDuration_"}], "]"}], "]"}], "\[RuleDelayed]", RowBox[{"SoundNote", "[", RowBox[{"None", ",", RowBox[{ RowBox[{"Total", "[", "list", "]"}], " ", "dotDuration"}], ",", "\<\"Flute\"\>"}], "]"}]}], ",", RowBox[{ RowBox[{"HoldPattern", "[", RowBox[{"PlayMorseCode", "[", RowBox[{"words_String", ",", RowBox[{"pitch_", ":", "\<\"C6\"\>"}], ",", RowBox[{"dotDuration_", ":", FractionBox["1", "16"]}]}], "]"}], "]"}], "\[RuleDelayed]", RowBox[{"Flatten", "[", RowBox[{"Fold", "[", RowBox[{ RowBox[{ RowBox[{"Join", "[", RowBox[{"#1", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"#2", "\[Equal]", "\<\" \"\>"}], ",", RowBox[{"{", RowBox[{"PlayMorseCode", "[", RowBox[{ RowBox[{"{", RowBox[{ "2", ",", "2", ",", "2", ",", "2", ",", "2", ",", "2", ",", "2"}], "}"}], ",", "pitch", ",", "dotDuration"}], "]"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"PlayMorseCode", "[", RowBox[{ RowBox[{"#2", "/.", "\[InvisibleSpace]", "MorseCodeRules"}], ",", "pitch", ",", "dotDuration"}], "]"}], ",", RowBox[{"PlayMorseCode", "[", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "2", ",", "2"}], "}"}], ",", "pitch", ",", "dotDuration"}], "]"}]}], "}"}]}], "]"}]}], "]"}], "&"}], ",", RowBox[{"{", "}"}], ",", RowBox[{"Characters", "[", "words", "]"}]}], "]"}], "]"}]}]}], "}"}]], "Output", CellChangeTimes->{3.432845458516411*^9}] }, Open ]], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Graphing instead of playing II", "Section", CellChangeTimes->{{3.432844812059811*^9, 3.432844833098486*^9}, { 3.432847843039254*^9, 3.4328478454431458`*^9}, {3.432848287343933*^9, 3.432848300883272*^9}}], Cell["Code can be treated as data.", "Text", CellChangeTimes->{{3.4328480150058126`*^9, 3.432848114035767*^9}, { 3.432848665623591*^9, 3.43284866750758*^9}}], Cell["Let's replace:", "Text", CellChangeTimes->{{3.4328480150058126`*^9, 3.432848114035767*^9}, { 3.432848665623591*^9, 3.432848669235715*^9}, {3.432848838475788*^9, 3.432848842443101*^9}}], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["PlayMorseCode", "Program"], " with ", StyleBox["GraphMorseCode", "Program"], ", and" }], "Item", CellDingbat->"\[FilledSquare]", CellChangeTimes->{{3.4328480150058126`*^9, 3.432848114035767*^9}, { 3.432848665623591*^9, 3.432848669235715*^9}, {3.432848838475788*^9, 3.4328488898994427`*^9}}], Cell[TextData[{ StyleBox["SoundNote", "Program"], " with a data structure that stores the lengths of the signals." }], "Item", CellDingbat->"\[FilledSquare]", CellChangeTimes->{{3.4328480150058126`*^9, 3.432848114035767*^9}, { 3.432848665623591*^9, 3.432848669235715*^9}, {3.432848838475788*^9, 3.43284887678764*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"DownValues", "[", "GraphMorseCode", "]"}], "=", RowBox[{ RowBox[{"DownValues", "[", "PlayMorseCode", "]"}], "/.", RowBox[{"{", RowBox[{ RowBox[{"PlayMorseCode", "\[Rule]", "GraphMorseCode"}], ",", RowBox[{ RowBox[{"SoundNote", "[", RowBox[{"None", ",", "dur_", ",", "___"}], "]"}], "\[RuleDelayed]", RowBox[{"Segment", "[", RowBox[{"White", ",", "dur"}], "]"}]}], ",", RowBox[{ RowBox[{"SoundNote", "[", RowBox[{"_", ",", "dur_", ",", "_"}], "]"}], "\[RuleDelayed]", RowBox[{"Segment", "[", RowBox[{"Black", ",", "dur"}], "]"}]}]}], "}"}]}]}]], "Input", CellChangeTimes->{{3.4328464714082737`*^9, 3.432846604757585*^9}, { 3.432847016576951*^9, 3.432847083318295*^9}, {3.432847127945745*^9, 3.432847142726009*^9}, {3.4328477475402117`*^9, 3.4328477518986073`*^9}}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"HoldPattern", "[", RowBox[{"GraphMorseCode", "[", RowBox[{ RowBox[{"list", ":", RowBox[{"{", RowBox[{ RowBox[{"(", RowBox[{"0", "|", "1"}], ")"}], "..."}], "}"}]}], ",", "pitch_", ",", "dotDuration_", ",", RowBox[{"instrument_", ":", "\<\"Flute\"\>"}]}], "]"}], "]"}], "\[RuleDelayed]", RowBox[{"Drop", "[", RowBox[{ RowBox[{"Fold", "[", RowBox[{ RowBox[{ RowBox[{"Join", "[", RowBox[{"#1", ",", RowBox[{"{", RowBox[{"#2", "/.", "\[InvisibleSpace]", RowBox[{"{", RowBox[{ RowBox[{"0", "\[Rule]", RowBox[{"Segment", "[", RowBox[{"Black", ",", "dotDuration"}], "]"}]}], ",", RowBox[{"1", "\[Rule]", RowBox[{"Segment", "[", RowBox[{"Black", ",", RowBox[{"3", " ", "dotDuration"}]}], "]"}]}]}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{"Segment", "[", RowBox[{"White", ",", "dotDuration"}], "]"}], "}"}]}], "]"}], "&"}], ",", RowBox[{"{", "}"}], ",", "list"}], "]"}], ",", RowBox[{"-", "1"}]}], "]"}]}], ",", RowBox[{ RowBox[{"HoldPattern", "[", RowBox[{"GraphMorseCode", "[", RowBox[{"symbol_String", ",", RowBox[{"pitch_", ":", "\<\"C6\"\>"}], ",", RowBox[{"dotDuration_", ":", FractionBox["1", "16"]}]}], "]"}], "]"}], "\[RuleDelayed]", RowBox[{ RowBox[{"GraphMorseCode", "[", RowBox[{ RowBox[{"symbol", "/.", "\[InvisibleSpace]", "MorseCodeRules"}], ",", "pitch", ",", "dotDuration"}], "]"}], "/;", RowBox[{ RowBox[{"StringLength", "[", "symbol", "]"}], "\[Equal]", "1"}]}]}], ",", RowBox[{ RowBox[{"HoldPattern", "[", RowBox[{"GraphMorseCode", "[", RowBox[{ RowBox[{"list", ":", RowBox[{"{", RowBox[{ RowBox[{"(", "2", ")"}], "..."}], "}"}]}], ",", "pitch_", ",", "dotDuration_"}], "]"}], "]"}], "\[RuleDelayed]", RowBox[{"Segment", "[", RowBox[{"White", ",", RowBox[{ RowBox[{"Total", "[", "list", "]"}], " ", "dotDuration"}]}], "]"}]}], ",", RowBox[{ RowBox[{"HoldPattern", "[", RowBox[{"GraphMorseCode", "[", RowBox[{"words_String", ",", RowBox[{"pitch_", ":", "\<\"C6\"\>"}], ",", RowBox[{"dotDuration_", ":", FractionBox["1", "16"]}]}], "]"}], "]"}], "\[RuleDelayed]", RowBox[{"Flatten", "[", RowBox[{"Fold", "[", RowBox[{ RowBox[{ RowBox[{"Join", "[", RowBox[{"#1", ",", RowBox[{"If", "[", RowBox[{ RowBox[{"#2", "\[Equal]", "\<\" \"\>"}], ",", RowBox[{"{", RowBox[{"GraphMorseCode", "[", RowBox[{ RowBox[{"{", RowBox[{ "2", ",", "2", ",", "2", ",", "2", ",", "2", ",", "2", ",", "2"}], "}"}], ",", "pitch", ",", "dotDuration"}], "]"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"GraphMorseCode", "[", RowBox[{ RowBox[{"#2", "/.", "\[InvisibleSpace]", "MorseCodeRules"}], ",", "pitch", ",", "dotDuration"}], "]"}], ",", RowBox[{"GraphMorseCode", "[", RowBox[{ RowBox[{"{", RowBox[{"2", ",", "2", ",", "2"}], "}"}], ",", "pitch", ",", "dotDuration"}], "]"}]}], "}"}]}], "]"}]}], "]"}], "&"}], ",", RowBox[{"{", "}"}], ",", RowBox[{"Characters", "[", "words", "]"}]}], "]"}], "]"}]}]}], "}"}]], "Output", CellChangeTimes->{{3.432847062849832*^9, 3.432847084473907*^9}, { 3.432847129267373*^9, 3.432847143603538*^9}, 3.43284775304944*^9}] }, Open ]], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Graphing instead of playing III", "Section", CellChangeTimes->{{3.432844812059811*^9, 3.432844833098486*^9}, { 3.432847843039254*^9, 3.4328478454431458`*^9}, {3.432848291371039*^9, 3.4328482973631973`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"GraphMorseCode", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.432847089895677*^9, 3.4328470977560253`*^9}, { 3.4328471553265877`*^9, 3.43284715761172*^9}, {3.432847801949971*^9, 3.432847802404293*^9}, 3.432848316020177*^9}], Cell[BoxData[ RowBox[{"{", RowBox[{ RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "0", "]"}], ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "1", "]"}], ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "0", "]"}], ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "1", "]"}], ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "0", "]"}], ",", FractionBox["3", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "1", "]"}], ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "0", "]"}], ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "1", "]"}], ",", FractionBox["3", "8"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "0", "]"}], ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "1", "]"}], ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "0", "]"}], ",", FractionBox["3", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "1", "]"}], ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "0", "]"}], ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "1", "]"}], ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "0", "]"}], ",", FractionBox["1", "16"]}], "]"}], ",", RowBox[{"Segment", "[", RowBox[{ RowBox[{"GrayLevel", "[", "1", "]"}], ",", FractionBox["3", "8"]}], "]"}]}], "}"}]], "Output", CellChangeTimes->{ 3.432847098157654*^9, {3.4328471328580923`*^9, 3.432847158043*^9}, 3.432847754945986*^9, 3.432847802882924*^9, 3.432848316589336*^9}] }, Open ]], Cell["\<\ Since we are not dealing with turtle graphics, we have to accumulate the \ lengths and make coordinates.\ \>", "Text", CellChangeTimes->{{3.4328481920214663`*^9, 3.432848264179088*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{ RowBox[{"Thickness", "[", "0.01", "]"}], ",", RowBox[{"First", "@", RowBox[{"Fold", "[", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Append", "[", RowBox[{ RowBox[{ "#1", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{"{", RowBox[{ RowBox[{ "#2", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ "#1", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ "#1", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "+", RowBox[{ "#2", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], ",", "0"}], "}"}]}], "}"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{ RowBox[{ "#1", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "+", RowBox[{ "#2", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}]}], "}"}], "&"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", "}"}], ",", "0"}], "}"}], ",", RowBox[{"GraphMorseCode", "[", "\"\\"", "]"}]}], "]"}]}]}], "}"}], "]"}]], "Input", CellChangeTimes->{{3.432847187025268*^9, 3.432847446494903*^9}, { 3.432847479003887*^9, 3.432847495623147*^9}, {3.4328475932522583`*^9, 3.432847636698948*^9}, {3.432847808947544*^9, 3.432847814399919*^9}, { 3.432847858452736*^9, 3.432847897951663*^9}, {3.43284844894066*^9, 3.432848449279937*^9}}], Cell[BoxData[ GraphicsBox[ {Thickness[0.01], {GrayLevel[0], LineBox[NCache[{{0, 0}, {Rational[1, 16], 0}}, {{0, 0}, {0.0625, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[1, 16], 0}, {Rational[1, 8], 0}}, {{ 0.0625, 0}, {0.125, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[1, 8], 0}, {Rational[3, 16], 0}}, {{0.125, 0}, { 0.1875, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[3, 16], 0}, {Rational[1, 4], 0}}, {{ 0.1875, 0}, {0.25, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[1, 4], 0}, {Rational[7, 16], 0}}, {{0.25, 0}, { 0.4375, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[7, 16], 0}, {Rational[1, 2], 0}}, {{ 0.4375, 0}, {0.5, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[1, 2], 0}, {Rational[9, 16], 0}}, {{0.5, 0}, { 0.5625, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[9, 16], 0}, {Rational[15, 16], 0}}, {{ 0.5625, 0}, {0.9375, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[15, 16], 0}, {1, 0}}, {{0.9375, 0}, {1, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{1, 0}, {Rational[17, 16], 0}}, {{1, 0}, { 1.0625, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[17, 16], 0}, {Rational[5, 4], 0}}, {{ 1.0625, 0}, {1.25, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[5, 4], 0}, {Rational[21, 16], 0}}, {{1.25, 0}, { 1.3125, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[21, 16], 0}, {Rational[11, 8], 0}}, {{ 1.3125, 0}, {1.375, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[11, 8], 0}, {Rational[23, 16], 0}}, {{ 1.375, 0}, {1.4375, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[23, 16], 0}, {Rational[3, 2], 0}}, {{ 1.4375, 0}, {1.5, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[3, 2], 0}, {Rational[15, 8], 0}}, {{1.5, 0}, { 1.875, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[15, 8], 0}, {Rational[11, 4], 0}}, {{ 1.875, 0}, {2.75, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[11, 4], 0}, {Rational[45, 16], 0}}, {{ 2.75, 0}, {2.8125, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[45, 16], 0}, {Rational[23, 8], 0}}, {{ 2.8125, 0}, {2.875, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[23, 8], 0}, {Rational[49, 16], 0}}, {{ 2.875, 0}, {3.0625, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[49, 16], 0}, {Rational[25, 8], 0}}, {{ 3.0625, 0}, {3.125, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[25, 8], 0}, {Rational[51, 16], 0}}, {{ 3.125, 0}, {3.1875, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[51, 16], 0}, {Rational[13, 4], 0}}, {{ 3.1875, 0}, {3.25, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[13, 4], 0}, {Rational[53, 16], 0}}, {{ 3.25, 0}, {3.3125, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[53, 16], 0}, {Rational[59, 16], 0}}, {{ 3.3125, 0}, {3.6875, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[59, 16], 0}, {Rational[15, 4], 0}}, {{ 3.6875, 0}, {3.75, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[15, 4], 0}, {Rational[61, 16], 0}}, {{ 3.75, 0}, {3.8125, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[61, 16], 0}, {Rational[31, 8], 0}}, {{ 3.8125, 0}, {3.875, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[31, 8], 0}, {Rational[17, 4], 0}}, {{ 3.875, 0}, {4.25, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[17, 4], 0}, {Rational[71, 16], 0}}, {{ 4.25, 0}, {4.4375, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[71, 16], 0}, {Rational[9, 2], 0}}, {{ 4.4375, 0}, {4.5, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[9, 2], 0}, {Rational[73, 16], 0}}, {{4.5, 0}, { 4.5625, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[73, 16], 0}, {Rational[79, 16], 0}}, {{ 4.5625, 0}, {4.9375, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[79, 16], 0}, {5, 0}}, {{4.9375, 0}, {5, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{5, 0}, {Rational[81, 16], 0}}, {{5, 0}, { 5.0625, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[81, 16], 0}, {Rational[41, 8], 0}}, {{ 5.0625, 0}, {5.125, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[41, 8], 0}, {Rational[83, 16], 0}}, {{ 5.125, 0}, {5.1875, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[83, 16], 0}, {Rational[43, 8], 0}}, {{ 5.1875, 0}, {5.375, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[43, 8], 0}, {Rational[23, 4], 0}}, {{ 5.375, 0}, {5.75, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[23, 4], 0}, {Rational[95, 16], 0}}, {{ 5.75, 0}, {5.9375, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[95, 16], 0}, {6, 0}}, {{5.9375, 0}, {6, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{6, 0}, {Rational[97, 16], 0}}, {{6, 0}, { 6.0625, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[97, 16], 0}, {Rational[49, 8], 0}}, {{ 6.0625, 0}, {6.125, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[49, 8], 0}, {Rational[99, 16], 0}}, {{ 6.125, 0}, {6.1875, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[99, 16], 0}, {Rational[25, 4], 0}}, {{ 6.1875, 0}, {6.25, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[25, 4], 0}, {Rational[103, 16], 0}}, {{ 6.25, 0}, {6.4375, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[103, 16], 0}, {Rational[109, 16], 0}}, {{ 6.4375, 0}, {6.8125, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[109, 16], 0}, {Rational[123, 16], 0}}, {{ 6.8125, 0}, {7.6875, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[123, 16], 0}, {Rational[31, 4], 0}}, {{ 7.6875, 0}, {7.75, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[31, 4], 0}, {Rational[65, 8], 0}}, {{7.75, 0}, { 8.125, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[65, 8], 0}, {Rational[133, 16], 0}}, {{ 8.125, 0}, {8.3125, 0}}]]}, {GrayLevel[1], LineBox[ NCache[{{Rational[133, 16], 0}, {Rational[67, 8], 0}}, {{8.3125, 0}, { 8.375, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[67, 8], 0}, {Rational[135, 16], 0}}, {{ 8.375, 0}, {8.4375, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[135, 16], 0}, {Rational[17, 2], 0}}, {{ 8.4375, 0}, {8.5, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[17, 2], 0}, {Rational[137, 16], 0}}, {{ 8.5, 0}, {8.5625, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[137, 16], 0}, {Rational[69, 8], 0}}, {{ 8.5625, 0}, {8.625, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[69, 8], 0}, {Rational[141, 16], 0}}, {{ 8.625, 0}, {8.8125, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[141, 16], 0}, {Rational[147, 16], 0}}, {{ 8.8125, 0}, {9.1875, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[147, 16], 0}, {Rational[75, 8], 0}}, {{ 9.1875, 0}, {9.375, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[75, 8], 0}, {Rational[151, 16], 0}}, {{ 9.375, 0}, {9.4375, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[151, 16], 0}, {Rational[19, 2], 0}}, {{ 9.4375, 0}, {9.5, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[19, 2], 0}, {Rational[153, 16], 0}}, {{ 9.5, 0}, {9.5625, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[153, 16], 0}, {Rational[39, 4], 0}}, {{ 9.5625, 0}, {9.75, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[39, 4], 0}, {Rational[157, 16], 0}}, {{ 9.75, 0}, {9.8125, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[157, 16], 0}, {Rational[79, 8], 0}}, {{ 9.8125, 0}, {9.875, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[79, 8], 0}, {Rational[41, 4], 0}}, {{ 9.875, 0}, {10.25, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[41, 4], 0}, {Rational[165, 16], 0}}, {{ 10.25, 0}, {10.3125, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[165, 16], 0}, {Rational[83, 8], 0}}, {{ 10.3125, 0}, {10.375, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[83, 8], 0}, {Rational[167, 16], 0}}, {{ 10.375, 0}, {10.4375, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[167, 16], 0}, {Rational[21, 2], 0}}, {{ 10.4375, 0}, {10.5, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[21, 2], 0}, {Rational[169, 16], 0}}, {{ 10.5, 0}, {10.5625, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[169, 16], 0}, {Rational[85, 8], 0}}, {{ 10.5625, 0}, {10.625, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[85, 8], 0}, {Rational[171, 16], 0}}, {{ 10.625, 0}, {10.6875, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[171, 16], 0}, {Rational[177, 16], 0}}, {{ 10.6875, 0}, {11.0625, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[177, 16], 0}, {Rational[89, 8], 0}}, {{ 11.0625, 0}, {11.125, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[89, 8], 0}, {Rational[179, 16], 0}}, {{ 11.125, 0}, {11.1875, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[179, 16], 0}, {Rational[91, 8], 0}}, {{ 11.1875, 0}, {11.375, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[91, 8], 0}, {Rational[47, 4], 0}}, {{ 11.375, 0}, {11.75, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[47, 4], 0}, {Rational[191, 16], 0}}, {{ 11.75, 0}, {11.9375, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[191, 16], 0}, {12, 0}}, {{11.9375, 0}, {12, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{12, 0}, {Rational[193, 16], 0}}, {{12, 0}, { 12.0625, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[193, 16], 0}, {Rational[199, 16], 0}}, {{ 12.0625, 0}, {12.4375, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[199, 16], 0}, {Rational[101, 8], 0}}, {{ 12.4375, 0}, {12.625, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[101, 8], 0}, {Rational[203, 16], 0}}, {{ 12.625, 0}, {12.6875, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[203, 16], 0}, {Rational[103, 8], 0}}, {{ 12.6875, 0}, {12.875, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[103, 8], 0}, {Rational[207, 16], 0}}, {{ 12.875, 0}, {12.9375, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[207, 16], 0}, {13, 0}}, {{12.9375, 0}, {13, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{13, 0}, {Rational[107, 8], 0}}, {{13, 0}, { 13.375, 0}}]]}, {GrayLevel[0], LineBox[NCache[{{Rational[107, 8], 0}, {Rational[215, 16], 0}}, {{ 13.375, 0}, {13.4375, 0}}]]}, {GrayLevel[1], LineBox[NCache[{{Rational[215, 16], 0}, {Rational[221, 16], 0}}, {{ 13.4375, 0}, {13.8125, 0}}]]}}, ImageSize->{551.2827734937259, Automatic}]], "Output", CellChangeTimes->{{3.432847633402381*^9, 3.432847637046318*^9}, 3.432847756041301*^9, 3.432847815348168*^9, {3.432847866538165*^9, 3.4328478986196957`*^9}, 3.432848449839035*^9}] }, Open ]], Cell[TextData[{ ButtonBox["\[FilledLeftTriangle]\[ThickSpace]\[ThickSpace]\[ThickSpace]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPagePrevious"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowPrevSlideText"], ButtonFrame->"None"], "\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]", ButtonBox["\[ThickSpace]\[ThickSpace]\[ThickSpace]\[FilledRightTriangle]", BaseStyle->"SlidePreviousNextLink", ButtonFunction:>FrontEndExecute[{ FrontEndToken[ FrontEnd`ButtonNotebook[], "ScrollPageNext"]}], ButtonNote->FEPrivate`FrontEndResource[ "FEStrings", "SlideshowNextSlideText"], ButtonFrame->"None"] }], "PreviousNext"] }, Open ]] }, Open ]] }, ScreenStyleEnvironment->"SlideShow", WindowSize->{933, 826}, WindowMargins->{{189, Automatic}, {Automatic, 4}}, Magnification->1.25, FrontEndVersion->"6.0 for Mac OS X x86 (32-bit) (May 21, 2008)", StyleDefinitions->Notebook[{ Cell[ StyleData[StyleDefinitions -> "Default.nb"]], Cell[ StyleData["Text"], FontSize -> 18], Cell[ StyleData["Text"], MenuPosition -> 10000], Cell[ StyleData["Item"], FontSize -> 18]}, Visible -> False, FrontEndVersion -> "6.0 for Mac OS X x86 (32-bit) (May 21, 2008)", StyleDefinitions -> "PrivateStylesheetFormatting.nb"] ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{ "SlideShowHeader"->{ Cell[590, 23, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[2329, 77, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[9343, 259, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[12077, 342, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[13591, 389, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[22843, 680, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[27521, 810, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[33638, 978, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[40986, 1180, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[45181, 1309, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[52619, 1484, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[58293, 1647, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[65431, 1849, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"]} } *) (*CellTagsIndex CellTagsIndex->{ {"SlideShowHeader", 83526, 2327} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[657, 26, 221, 6, 154, "Title"], Cell[881, 34, 92, 1, 39, "Text"], Cell[CellGroupData[{ Cell[998, 39, 111, 1, 39, "Item"], Cell[1112, 42, 119, 1, 39, "Item"], Cell[1234, 45, 282, 6, 39, "Item"] }, Open ]], Cell[1531, 54, 761, 18, 96, "PreviousNext"] }, Open ]], Cell[CellGroupData[{ Cell[2329, 77, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[2418, 82, 97, 1, 88, "Section"], Cell[2518, 85, 280, 6, 65, "Text"], Cell[2801, 93, 163, 3, 39, "Text"], Cell[2967, 98, 333, 6, 39, "Text"], Cell[3303, 106, 5227, 127, 186, "Input"], Cell[8533, 235, 761, 18, 30, "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[9343, 259, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[9432, 264, 107, 1, 88, "Section"], Cell[9542, 267, 172, 2, 39, "Text"], Cell[CellGroupData[{ Cell[9739, 273, 139, 2, 33, "Input"], Cell[9881, 277, 204, 4, 33, "Output"] }, Open ]], Cell[10100, 284, 160, 3, 39, "Text"], Cell[CellGroupData[{ Cell[10285, 291, 202, 3, 53, "Input"], Cell[10490, 296, 264, 5, 33, "Output"], Cell[10757, 303, 495, 12, 33, "Output"] }, Open ]], Cell[11267, 318, 761, 18, 30, "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[12077, 342, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[12166, 347, 101, 1, 88, "Section"], Cell[CellGroupData[{ Cell[12292, 352, 95, 1, 39, "Item"], Cell[12390, 355, 136, 1, 39, "Item"], Cell[12529, 358, 118, 1, 39, "Item"], Cell[12650, 361, 116, 1, 39, "Item"] }, Open ]], Cell[12781, 365, 761, 18, 30, "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[13591, 389, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[13680, 394, 98, 1, 88, "Section"], Cell[13781, 397, 219, 5, 65, "Text"], Cell[CellGroupData[{ Cell[14025, 406, 719, 19, 33, "Input"], Cell[14747, 427, 180, 2, 33, "Output"] }, Open ]], Cell[14942, 432, 104, 1, 39, "Text"], Cell[15049, 435, 1050, 29, 110, "Input"], Cell[16102, 466, 158, 3, 39, "Text"], Cell[CellGroupData[{ Cell[16285, 473, 564, 16, 53, "Input"], Cell[16852, 491, 5166, 162, 302, "Output"] }, Open ]], Cell[22033, 656, 761, 18, 30, "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[22843, 680, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[22932, 685, 150, 2, 88, "Section"], Cell[23085, 689, 442, 7, 91, "Text"], Cell[CellGroupData[{ Cell[23552, 700, 1333, 34, 72, "Input"], Cell[24888, 736, 1448, 37, 136, "Output"] }, Open ]], Cell[26351, 776, 262, 5, 33, "Input"], Cell[26616, 783, 92, 1, 33, "Input"], Cell[26711, 786, 761, 18, 30, "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[27521, 810, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[27610, 815, 154, 2, 88, "Section"], Cell[27767, 819, 301, 6, 65, "Text"], Cell[28071, 827, 1914, 46, 148, "Input"], Cell[29988, 875, 740, 18, 53, "Input"], Cell[CellGroupData[{ Cell[30753, 897, 168, 3, 33, "Input"], Cell[30924, 902, 1147, 29, 136, "Output"] }, Open ]], Cell[32086, 934, 385, 7, 33, "Input"], Cell[32474, 943, 351, 9, 65, "Text"], Cell[32828, 954, 761, 18, 30, "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[33638, 978, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[33727, 983, 99, 1, 88, "Section"], Cell[33829, 986, 326, 7, 65, "Text"], Cell[34158, 995, 483, 8, 91, "Text"], Cell[34644, 1005, 525, 14, 53, "Input"], Cell[35172, 1021, 1576, 41, 129, "Input"], Cell[CellGroupData[{ Cell[36773, 1066, 78, 1, 33, "Input"], Cell[36854, 1069, 2629, 66, 300, "Output"] }, Open ]], Cell[39498, 1138, 306, 6, 33, "Input"], Cell[39807, 1146, 366, 8, 33, "Input"], Cell[40176, 1156, 761, 18, 30, "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[40986, 1180, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[41075, 1185, 103, 1, 88, "Section"], Cell[41181, 1188, 279, 5, 65, "Text"], Cell[41463, 1195, 1418, 40, 129, "Input"], Cell[CellGroupData[{ Cell[42906, 1239, 160, 3, 33, "Input"], Cell[43069, 1244, 164, 2, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[43270, 1251, 267, 6, 33, "Input"], Cell[43540, 1259, 191, 2, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[43768, 1266, 246, 6, 33, "Input"], Cell[44017, 1274, 145, 2, 33, "Output"] }, Open ]], Cell[44177, 1279, 191, 4, 33, "Input"], Cell[44371, 1285, 761, 18, 30, "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[45181, 1309, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[45270, 1314, 101, 1, 88, "Section"], Cell[45374, 1317, 262, 5, 65, "Text"], Cell[CellGroupData[{ Cell[45661, 1326, 2400, 58, 186, "Input"], Cell[48064, 1386, 3730, 71, 290, "Output"] }, Open ]], Cell[51809, 1460, 761, 18, 30, "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[52619, 1484, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[52708, 1489, 214, 3, 88, "Section"], Cell[52925, 1494, 136, 1, 39, "Text"], Cell[53064, 1497, 214, 6, 39, "Text"], Cell[CellGroupData[{ Cell[53303, 1507, 141, 2, 33, "Input"], Cell[53447, 1511, 4021, 109, 333, "Output"] }, Open ]], Cell[57483, 1623, 761, 18, 30, "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[58293, 1647, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[58382, 1652, 215, 3, 88, "Section"], Cell[58600, 1657, 160, 2, 39, "Text"], Cell[58763, 1661, 196, 3, 39, "Text"], Cell[CellGroupData[{ Cell[58984, 1668, 327, 9, 39, "Item"], Cell[59314, 1679, 326, 7, 39, "Item"] }, Open ]], Cell[CellGroupData[{ Cell[59677, 1691, 894, 20, 91, "Input"], Cell[60574, 1713, 4032, 109, 314, "Output"] }, Open ]], Cell[64621, 1825, 761, 18, 96, "PreviousNext"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[65431, 1849, 64, 1, 4, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[65520, 1854, 218, 3, 88, "Section"], Cell[CellGroupData[{ Cell[65763, 1861, 267, 4, 33, "Input"], Cell[66033, 1867, 2355, 69, 259, "Output"] }, Open ]], Cell[68403, 1939, 196, 4, 65, "Text"], Cell[CellGroupData[{ Cell[68624, 1947, 2092, 55, 91, "Input"], Cell[70719, 2004, 11293, 276, 141, "Output"] }, Open ]], Cell[82027, 2283, 761, 18, 96, "PreviousNext"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)