Announcing SpacerPacer.com

Introduction

I am immensely proud of and humbled by the work my wife does on a daily basis to help members of the special needs community. As a treating occupational therapist, neurofeedback technician, and a lead of behavior therapy treatment teams, she is in a unique position to apply an exceptionally broad and deep set of tools and methodologies to the problem of helping children with special needs develop to their full potential.

What is Paced Breathing

One of the most useful and accessible tools my wife uses in her practice is paced breathing. Paced breathing is basically the practice of controlling the rate at which one breathes, often with the aid of a device or software program. This is a simple concept, but can have life-altering effects in practice. My wife has shared anecdotes of her patients achieving breakthroughs in their ability to control their temper, attend to class, and manage anxiety as a result of following a paced breathing treatment protocol. While my wife specializes in pediatrics, the technique has broad applications for all age ranges and can also be helpful for physical therapy, focus, and calm.

Requirements / Limitations With Other Apps

Many apps already exist to aid paced breathing. At the time of writing, the Google Play search results for “Paced Breathing” showed over 500 apps in the Google Play store alone. Of course the Apple App Store has a number of paced breathing apps available for download too. Some of these apps cost a small fee to purchase, but a large number of them are free. So why make yet another paced breathing app?

For a paced breathing app to be effective in a clinical setting, it must check a lot of boxes:

  • Therapists need to configure both the pace (i.e. the number of breaths per minute, to a fine level of detail) and the inhale / exhale ratio.
  • Therapists need to prescribe a specific duration for the exercise, either as a fixed amount of time (e.g. 10 minutes) or a set number of breaths (e.g. 20 complete breaths).
  • The app must include a variety of both visual and audio breathing cues for the patient.
  • The app must be simple enough for a patient to use consistently (after receiving some instruction from a therapist).
  • The app must be highly portable; it needs to work on a wide range of devices, including clinic PCs set up as neurofeedback stations, personal phones and laptops used by clinicians, and chromebooks, phones, tablets, or other devices used by the patients themselves, and with minimal network and system dependencies.

The final requirement in particular makes it difficult for a clinic to standardize on any one paced breathing app. A clinic may research different apps and eventually find a great app for iPhones and iPads, but it may not be available for Android, or vice versa. Therapists need just one simple app that they can use at the clinic, then have the patient repeat at home on whatever devices they have available.

Development Process

“How hard could this be?”, I thought. I’ve been writing applications for a long time now and a paced breathing app seemed pretty simple on its face. If anything, the simple graphics required reminded me of the little video games I wrote in high school when I was learning how to program.

What started as a few lines of javascript and some very simple HTML banged together in one night eventually developed into a small but pretty fully featured web application. My wife and I settled into a team dynamic where she would review my latest draft, prioritize a set of changes and features, and work with me to experiment with different audio and visual techniques. She also created the audio used in the application, with some generous help from  our friend Alex / Missing Lynx, who is an incredible music producer, to optimize the audio to sound good on a wide variety of devices.

Summary of Features

After iterating on the paced breathing app and incorporating clinical feedback into updates, fixes, and improvements, the latest version has a number of interesting features:

  • Implemented as a publicly available website that can run on basically any device with a web browser (no app install required).
  • Optimized for performance and download speed on mobile devices and networks.
  • Configurable breaths per minute (down to 0.1 breath resolution)
  • Configurable in/out breath ratio
  • Five different sets of audio options (these are some really cool and unique sounds)
  • Configurable exercise duration, with both common preset values and the ability to specify custom durations
  • Volume setting
  • A standard up and down “beam” visualization, as well as a “candle / flower” visualization (blow out the candle, breathe in the flower)
  • The ability to copy all the settings as a link, in order for a therapist to quickly share a prescribed exercise with a client, or for an end user to save their favorite settings as a bookmark to quickly load later
  • A progress bar
  • A (discrete) button to stop the visualization
  • Ability to reconfigure the settings midway through an exercise
  • Simple, calming and cool graphics with outer space theme (I’m not much of an artist so I had to get a lot of help from my wife on this one)
  • The ability to change any setting during the exercise to adapt to changing preferences and duration change needs

Details like the candle / flower visualization, the unique audio, and the fun graphics were developed and optimized over time based on real world feedback, and really help make this app engaging and accessible even for children with special needs and their families.

How To Use

First, navigate to SpacerPacer.com in your device’s web browser (Safari, Chrome, Firefox or Edge).

You should see a menu where you can configure the paced breathing app settings. The menu has some preset defaults that you can change to suit your needs.

After changing the settings (or not), press the big “Play” button. You should see the settings menu clear and a large bar begin moving up and down. If you have your audio turned on, you should also hear an audible “in breath” and “out breath” sound play in conjunction with the bar.

Breathe in as the bar moves up and down as the bar goes down. Keep breathing in tune with the app until the progress bar at the bottom of the screen is full.

If you need to adjust your settings halfway through, you can click the small gear icon in the top right of the screen and adjust the settings. (Click the gear icon again to dismiss the menu.) You can also click the small square icon in the bottom left of the screen to stop the exercise partway through.

Once you find a set of settings you like, you can click the “link” button in the settings menu to copy a link to SpacerPacer with all of your selected settings pre-applied. The shareable URL is copied directly to your clipboard after clicking the button; you can paste it in an email or text message to share with other people. You can also bookmark the webpage, which will include any settings you have applied.

Technical Details

This project started as a one-page HTML file I wrote on my chromebook text editor during short coding sessions snuck in after dinner. After a while I made some upgrades to my development environment but I kept it as a one-file implementation with no use of any third party libraries or dependencies. As a result the website is very quick to download even on mobile networks, and has decent performance on a wide variety of devices. 

Some of the interesting technical challenges included fading the audio in and out during transitions from in to out breaths (and vice versa), rendering the visualization animation smoothly, and optimizing the audio for size and quality on a wide variety of devices. The code is quite readable and can be viewed using the “View source” command in your web browser. If there is interest I could look into open sourcing some of the specific techniques used or write up a followup blog post on more of the technical details.

Adoption

Since publishing an early version of the app a year or so ago, my wife’s clinic has been using the breathing app regularly for their patients. It has since spread on to some other clinics. I haven’t made an effort to promote the app until now, and I don’t collect any analytics on the app due to privacy concerns, so I honestly don’t know quite how much use the app is getting. If you have any feedback, bug reports, or feature requests, feel free to post in comments – I would love to continue to improve and maintain the app over time.

https://spacerpacer.com

Leave a Reply

Your email address will not be published. Required fields are marked *