
DayBack has a new productivity enhancement that rewards you when you have completed a task on your calendar. Quickly change a task’s status by clicking on it while a particular key is held down. Your action will play a sound along with an animation to reward you for marking the task “done.”
Each keyboard shortcut can be configured to play a different sound for each status. You can also install your own permission checks to ensure the status change is allowed. We’ve included some example sounds along with a couple of recordings that you can use to customize your DayBack sound profile.
We’ve loved having this in our calendar, and we hope you love it too! Check it out…
One-Click Productivity – Download & Installation
The code can be downloaded here. By default, it is set up to play sounds using Tone.js, which is a freely available synthesizer library. You can customize individual sounds per status as well as by user. If you haven’t added an app action to DayBack before, you’ll find an overview and instructions here: Custom App Actions.
You’ve likely already set up specific colors for each status, but you can review how to do that here: Event Colors & Statuses.
Customizing Your Sounds and Shortcuts
Configuring your Keyboard Shortcuts
This app action is configured with default keyboard shortcuts and the associated event status. You can customize this for your specific list of statuses. Note that in FileMaker environments, the control, meta, and command keys don’t get passed to web viewer. The best type of shortcuts are therefore a single key shortcut as follows:
inputs.keyStatusMap = { KeyC: 'Cancelled', KeyD: 'Done', KeyP: 'Planned', KeyI: 'In Progress', KeyO: 'Out of Office', KeyH: 'Hot', KeyN: 'none', };
Default Calendar Sounds
All keyboard shortcuts will play a single “success” sound by default. The app action will also play a single “error” sound if the task is already in the associated status. However, you can define a custom sound by name for each unique status. In the following example, we have a “successHigh” sound when you set task to Done, and a “drumSoloMP3” when you set the status to “Hot”. There is also a “resetStatus” sound if you reset the status to none.
// inputs.statusSoundMap = { // 'statusName': 'soundname', // Sounds are defined inside input.sounds object // 'statusName': 'soundname', // ...: ... // } inputs.statusSoundMap = { Done: 'successHigh', Hot: 'drumMP3', none: 'resetStatus', };
Permission Checking
We’ve added the ability for you to create your own permission checks to ensure that the requested status change is allowed. You will need to define your own custom rules here. The very basic rule installed by default is to deny a status change if the current task status is the same as the status change being requested.
inputs.statusChangeAllowed = function (statusCode) { // Return error if the Status being set is already // the same as the current Event status if (event.status[0] == statusCode) { return false; } return true; };
User-Specific Sounds
You can define custom sounds for each of your users, as well as set the desired sound volume or even mute the sound. To define customer settings, you will need to configure a userSettings object as follows:
inputs.userSettings = { 'FirstName LastName': { volume: -10, // -100 mutes sounds sounds: { statusName: 'soundName', statusName: 'soundName', ... customSuccessSound: 'myCustomSuccessSoundName', customErrorSound: 'myCustomErrorSoundName' } }, ... }
Composing Your Own Sounds
Here’s an example of how to write your own sounds. The first example uses the Tone.js synthesizer. The synthesizer allows you to define a series of notes, a duration, and an attack velocity. The default “success” sound will play a C major scale. The second example is an MP3 file. You can read more about Tone.js and how to customize your sounds.
inputs.sounds = { success: function (fmSynth) { let now = Tone.now(); fmSynth.triggerAttackRelease('C4', '36n', now, 0.5); fmSynth.triggerAttackRelease('E4', '36n', (now += 0.075), 0.5); fmSynth.triggerAttackRelease('G4', '36n', (now += 0.075), 0.5); fmSynth.triggerAttackRelease('C5', '36n', (now += 0.075), 0.5); }, drumSoloMP3: function (fmSynth) { var player = new Tone.Player( 'https://tonejs.github.io/audio/drum-samples/handdrum-loop.mp3' ).toDestination(); player.volume.value = -10; player.autostart = true; }, }
DayBack MP3 Examples
Becca created a couple of really nice sounds you can use for your statuses. You’ll install these sound loops by using the URL below any one of these sounds, along with the example of the drumpSoloMP3 to customize your sounds:
Playing Your Own MP3 Files
This app action will play any MP3 or WAV file that is hosted on a secure server. However, if you run into trouble playing your own audio files, this is likely because of your web browser’s cross-domain security policy. To allow our JavaScript to retrieve your MP3 or WAV file from your service, you may need to set allow CORS requests, and grant JavaScript clients basic access to your audio resources.
Leave a Reply