Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

Here is a quick first draft:

DynamicModule[{s = 0, pt = {0, 1}}, 
 Column@{ClickPane[
    Dynamic[Show[Refresh[Graphics[ClockGauge[]], UpdateInterval -> 1],
       Graphics[{Red, Point[pt]}]]], 
      (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[DateValue["Second"] == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

I'll leave the further refinement to you.


In response to a commentcomment.
Using the value of Clock:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], clock = 0}, 
 Column@{ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{Rotate[secondHand, (clock = Clock[{0, 59, 1}])*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], 
    (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[clock == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Using the rotated secondHand:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], rSH}, 
 Column@
  {ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{rSH = Rotate[secondHand, Clock[{0, 59, 1}]*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], 
    (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[rSH[[2]]*-30/Pi == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Here is a quick first draft:

DynamicModule[{s = 0, pt = {0, 1}}, 
 Column@{ClickPane[
    Dynamic[Show[Refresh[Graphics[ClockGauge[]], UpdateInterval -> 1],
       Graphics[{Red, Point[pt]}]]], 
      (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[DateValue["Second"] == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

I'll leave the further refinement to you.


In response to a comment.
Using the value of Clock:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], clock = 0}, 
 Column@{ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{Rotate[secondHand, (clock = Clock[{0, 59, 1}])*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], 
    (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[clock == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Using the rotated secondHand:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], rSH}, 
 Column@
  {ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{rSH = Rotate[secondHand, Clock[{0, 59, 1}]*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], 
    (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[rSH[[2]]*-30/Pi == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Here is a quick first draft:

DynamicModule[{s = 0, pt = {0, 1}}, 
 Column@{ClickPane[
    Dynamic[Show[Refresh[Graphics[ClockGauge[]], UpdateInterval -> 1],
       Graphics[{Red, Point[pt]}]]], 
      (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[DateValue["Second"] == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

I'll leave the further refinement to you.


In response to a comment.
Using the value of Clock:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], clock = 0}, 
 Column@{ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{Rotate[secondHand, (clock = Clock[{0, 59, 1}])*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], 
    (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[clock == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Using the rotated secondHand:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], rSH}, 
 Column@
  {ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{rSH = Rotate[secondHand, Clock[{0, 59, 1}]*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], 
    (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[rSH[[2]]*-30/Pi == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]
added 1355 characters in body
Source Link
Karsten7
  • 27.6k
  • 5
  • 74
  • 135

Here is a quick first draft:

DynamicModule[{s = 0, pt = {0, 1}}, 
 Column@{ClickPane[
    Dynamic[Show[Refresh[Graphics[ClockGauge[]], UpdateInterval -> 1],
       Graphics[{Red, Point[pt]}]]], 
      (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[DateValue["Second"] == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

I'll leave the further refinement to you.


In response to thea comment.
Using the value of Clock:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], 
  clock = 0}, 
 Column@{ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{Rotate[
          secondHandRotate[secondHand, (clock = Clock[{0, 59, 1}])*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], (pt = #; 
    (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[clock == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Using the rotated secondHand:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], 
  rSH}, 
 Column@
  {ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{rSH = 
          Rotate[secondHand, Clock[{0, 59, 1}]*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], (pt = #; 
    (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[rSH[[2]]*-30/Pi == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Here is a quick first draft:

DynamicModule[{s = 0, pt = {0, 1}}, 
 Column@{ClickPane[
    Dynamic[Show[Refresh[Graphics[ClockGauge[]], UpdateInterval -> 1],
       Graphics[{Red, Point[pt]}]]], 
      (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[DateValue["Second"] == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

I'll leave the further refinement to you.


In response to the comment.
Using the value of Clock:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], 
  clock = 0}, 
 Column@{ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{Rotate[
          secondHand, (clock = Clock[{0, 59, 1}])*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], (pt = #; 
      s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[clock == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Using the rotated secondHand:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], 
  rSH}, Column@{ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{rSH = 
          Rotate[secondHand, Clock[{0, 59, 1}]*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], (pt = #; 
      s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[rSH[[2]]*-30/Pi == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Here is a quick first draft:

DynamicModule[{s = 0, pt = {0, 1}}, 
 Column@{ClickPane[
    Dynamic[Show[Refresh[Graphics[ClockGauge[]], UpdateInterval -> 1],
       Graphics[{Red, Point[pt]}]]], 
      (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[DateValue["Second"] == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

I'll leave the further refinement to you.


In response to a comment.
Using the value of Clock:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], clock = 0}, 
 Column@{ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{Rotate[secondHand, (clock = Clock[{0, 59, 1}])*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], 
    (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[clock == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Using the rotated secondHand:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], rSH}, 
 Column@
  {ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{rSH = Rotate[secondHand, Clock[{0, 59, 1}]*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], 
    (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[rSH[[2]]*-30/Pi == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]
added 1355 characters in body
Source Link
Karsten7
  • 27.6k
  • 5
  • 74
  • 135

Here is a quick first draft:

DynamicModule[{s = 0, pt = {0, 1}}, 
 Column@{ClickPane[
    Dynamic[Show[Refresh[Graphics[ClockGauge[]], UpdateInterval -> 1],
       Graphics[{Red, Point[pt]}]]], 
      (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[DateValue["Second"] == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

I'll leave the further refinement to you.


In response to the comment.
Using the value of Clock:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], 
  clock = 0}, 
 Column@{ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{Rotate[
          secondHand, (clock = Clock[{0, 59, 1}])*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], (pt = #; 
      s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[clock == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Using the rotated secondHand:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], 
  rSH}, Column@{ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{rSH = 
          Rotate[secondHand, Clock[{0, 59, 1}]*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], (pt = #; 
      s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[rSH[[2]]*-30/Pi == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Here is a quick first draft:

DynamicModule[{s = 0, pt = {0, 1}}, 
 Column@{ClickPane[
    Dynamic[Show[Refresh[Graphics[ClockGauge[]], UpdateInterval -> 1],
       Graphics[{Red, Point[pt]}]]], 
      (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[DateValue["Second"] == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

I'll leave the further refinement to you.

Here is a quick first draft:

DynamicModule[{s = 0, pt = {0, 1}}, 
 Column@{ClickPane[
    Dynamic[Show[Refresh[Graphics[ClockGauge[]], UpdateInterval -> 1],
       Graphics[{Red, Point[pt]}]]], 
      (pt = #; s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[DateValue["Second"] == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

I'll leave the further refinement to you.


In response to the comment.
Using the value of Clock:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], 
  clock = 0}, 
 Column@{ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{Rotate[
          secondHand, (clock = Clock[{0, 59, 1}])*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], (pt = #; 
      s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[clock == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]

Using the rotated secondHand:

DynamicModule[{pt = {0, 1}, secondHand = Line[{{0, 0}, {0, 55}}], 
  rSH}, Column@{ClickPane[
    Dynamic[Show[Graphics[Circle[{0, 0}, 60]], 
      Graphics[
       Dynamic[{rSH = 
          Rotate[secondHand, Clock[{0, 59, 1}]*-Pi/30, {0, 0}]}]], 
      Graphics[{Red, Point[pt]}]]], (pt = #; 
      s = 30*(1 + ArcTan[-pt[[2]], -pt[[1]]]/Pi)) &], 
   DynamicWrapper[Dynamic@s, 
    If[rSH[[2]]*-30/Pi == Round[s], 
     EmitSound[Sound@SoundNote["C", 0.5, "Flute"]]], 
    UpdateInterval -> 1]}]
deleted 55 characters in body
Source Link
Karsten7
  • 27.6k
  • 5
  • 74
  • 135
Loading
Source Link
Karsten7
  • 27.6k
  • 5
  • 74
  • 135
Loading