Tuesday, July 7, 2015

Speaking Alarms for OS X


Speaking Alarms for Windows have been found useful. In Version 0.9.5 of Artisan, the "Call Program" alarm action has been updated to achieve a similar effect on OS X.

There is no need to install an extra software on OS X as it is required on Windows to make Artisan speak. Every Mac system since its introduction in 1984 came with MacinTalk, Apple's text-to-speech engine and a newer much improved variant is still installed with any OS X system.

On OS X text-to-speach can be accessed "programmatically" by just typing the following 
(without the prompt #) into a Terminal.app window.

# say Hello

By default text-to-speach uses the voice selected in the System Preferences as "System Voice" under Speech. But a different voice can be selected by specifying an optional argument. OS X comes with some english voice pre-installed (Alex, Vicki, Victoria). However, male as well as female voices for other languages can be downloaded and installed under the "Customize…" menu item.




The female voice Slivia can be selected to say "hello" in Italian using an optional argument.

say -v Silvia Ciao!

In Artisan, you can add alarms (menu Config >> Alarms) that run the say command of OS X as alarm action. Just choose "Call Program" as action. By default, Artisan's Call Program feature on OS X  expects the program specified under "Description" to be next to the Artisan.app. However, you can also specify the full path to the program that should be executed. For the "say" command this would be "/usr/bin/say" (without the quotes).



Alternatively you can write a small script that calls "say" and put it next to the Artisan.app. For this start TextEdit and type the following two lines

#!/bin/sh
say $@ &

and save this under "say" (without the standard .txt extension) in the same folder next to the Artisan.app. You also need to make this script executable by typing the following into the Terminal.app. Without the prompt #.

# cd /path/to/the/directory/of/the/say/script
# chmod +x say

With this script in place, you can simplify the "/usr/bin/say" to "say" and using the default voice you just use a "Description" like "say set heat to 95 percent".




13 comments:

  1. Hi Marko - How do I enable an alarm to trigger on a custom event? The "From" field doesn't list my custom defined events.

    Cheers Sam

    ReplyDelete
    Replies
    1. Not possible currently. Why would one want to do this?

      Delete
  2. The same reason why you would use it to trigger on system events. Lets say when the bean hits a custom event it could tell you to reduce the heat

    ReplyDelete
    Replies
    1. But how is this custom event triggered? Custom events are intended to capture manual input, so the user already should now to reduce heat, right?

      Delete
  3. Thanks for all this Marko. One question: I want to trigger an alarm when DeltaBT hits 0.5, but it seems to want to take only whole integers. Any way to do this?
    Thanks,
    Arch

    ReplyDelete
    Replies
    1. Alarm value triggers take only whole integers. I won't change that. Especially your application regarding DeltaBT does not make any sense to me. The DeltaBT is in practice not precise enough to call for a float trigger due to its heavy processing/smoothing and the remaining noise. Anyhow, you might want to keep your DeltaBT above 3-5C/min over the full roast;)

      Delete
  4. Sorry. I mistyped. I meant DeltaET. The idea is to level out the heat curve temporarily during drying and post-first crack to "stretch" those two phases a bit. I guess 1.0 works almost as well as 0.5 for that. Thanks for quick response.

    ReplyDelete
  5. Hello Marko,

    Is there a way to keep the Alarm IDs in numerical order? I set them up in order of roast then after closing and opening the Alarm "setup" window again they are arranged in an order I cannot apply logic to. It may be there but it escapes me. Even if I hit the ID sort at the top of the screen it places 10, 11 . . . before 1, 2, . . . etc. If I'm missing something I would appreciate the help. If this is a feature then perhaps at some future date it might be something to consider.

    thanks,

    Geo

    ReplyDelete
    Replies
    1. Windows Explorer does this same thing and if I put a "0" in front of the numbers below "10" then it sorts them correctly. Instead of 1, 2, 3 it is 01, 02, 03

      Delete
    2. A bug. Fixed in source. To be released together with the next version.

      Delete
  6. Is there any way to change the alarm sound? Something very obnoxiously loud?

    ReplyDelete
    Replies
    1. Not sure what you refer to as "alarm sound". This whole article is about to set the voice and let Artisan talk. Maybe you are referring to the beep. This is just a system beep and can changed in the system preferences, via the Sound control panel.

      Delete