Wednesday, March 18, 2015

Using HotPaw Basic with a LightBlue Bean Bluetooth LE device

HotPaw Basic 1.7.1 for iOS now includes direct support for communication with the LightBlue Bean.

This example HotPaw Basic program below lets you scan for Bluetooth LE devices, select a Bean, connect to it, blink the LED blue, read scratch bank 3, and read the temperature. Note that 1 or 2 second waits between all Bluetooth commands can be helpful or necessary (depending on your device model and how busy it is, etc.)

100 rem
102 print "starting scan for Beans"
120 fn bean.init()
140 fn sleep(1)
160 fn bean.list()
180 b$ = fn bean.selected()
190 print b$
192 if len(b$) < 20 then print "no bean selected" : end
200 fn bean.connect(1,b$)
210 for i = 1 to 20 : rem wait for bean to connect
212   if fn bean.connect(1) > 0 then exit for
214   fn sleep(0.5)
216 next i
220 print fn bean.name(1)
230 fn bean.led(1,0,0,1) :rem blink blue
246 fn bean.temp() :rem start temperature read
260 fn sleep(1)
270 fn bean.led(1,0,0,0) :rem off
280 fn sleep(1) : rem wait
300 fn bean.rdsc(1,3,0) :rem start scratch read
310 fn sleep(1)
320 s$ = fn bean.rdsc(1,3,1) :rem as a string
322 print len(s$),s$
340 s$ = fn bean.rdsc(1,3,16) :rem as a hex string
342 print len(s$),s$
374 print fn bean.temp()
950 fn sleep(1)
960 fn btle(9) :rem disconnect bluetooth devices
970 print "done"
990 end

Combine this with the MQTT sample app (from in an earlier post in this blog), and you can have your Bean send messages over the internet, using an iOS device as the relay to a broker.

The Bean serial protocol is also supported, see HotPaw Basic's built-in documentation for details. But don't expect a data rate much higher than 2400 baud (due to restrictions involving iOS built-in power saving and WiFi/BLE antenna sharing modes, etc.), so make sure your app sleeps a bit between sending small chunks of serial data.

Using HotPaw Basic with Bluetooth 4.0/BLE/BTLE devices

Bluetooth LE is a great way to get data from external sensors into your iPhone, and without needing any wires or cables. Bluetooth LE, also known as Bluetooth 4.0, BTLE or BLE, is a standardized short-range wireless communications protocol, designed so the tiny sensors can run for weeks to years on just a coin cell battery (or less!). It's now used by such devices as newer heart rate monitors and fitness trackers.

Here's a tutorial on BTLE (written by a former colleague of mine) with far more details: http://chapters.comsoc.org/vancouver/BTLER3.pdf

One inexpensive BTLE device, usable for experimentation, is the TI SensorTag (around $25 or $30 from TI), smaller than a matchbook, that contains tons of sensors. Another very popular device is the LightBlue Bean, which contains a programmable Arduino processor and a thermometer, as well as a BTLE radio. Runs on a 2032 coin cell and small enough that it ships in a matchbox.

Here's an example of connecting to the TI SensorTag using HotPaw Basic, and getting notified by any change in the status of button 1.

100 rem
120 fn btle.init()
130 fn sleep(2)
140 status = fn btle.list()
150 print status
160 if status < 0 then print "BTLE is off!" : end
170 uuid$ = fn btle.selected()
180 if len(uuid$ < 2) then print "No tag selected" : end
400 print "SensorTag Found!"
410 servic$ = "FFE0"
420 charac$ = "FFE1"
440 fn btle.connect(1,uuid$,servic$,charac$)
450 fn sleep(1)
460 print fn btle.connect(1) : rem connection status
500 dim r%(256) : rem array for characteristic data
520 while (1)
530   fn sleep(0.5)
540   n = fn btle.responsedata(1,1,r%(0))
550   if (n > 0)
560     print n,r%(0)
570   endif
582   if fn touch(0) > 0 then exit while
590 wend
950 fn btle.connect(-1) :rem disconnect
960 print "done"
990 end
Tap the display with 2 fingers to exit the while loop.

Tuesday, June 4, 2013

New Music Spectrograph Description for Updated Version 1.3.4


Visually reverse engineer sound and music in real-time.  See music and sound as it might appear on a live piano-roll MIDI music editor.   The Hotpaw Music spectrograph presents a high-resolution scrolling spectrogram as you listen, so that you can see the patterns in sound and music lined up against a piano keyboard.  This piano alignment makes it far easier to spot which frequencies in a sound correspond to which musical notes.  Music Spectrograph is a great visual tool to help a music student see notes, that they might not be able to hear clearly at first, and assist with music transcription.

Features include:
- 12th-octave midi-pitch-centered spectrograph
- usable with either live audio or tunes from your device's music library
- up to a 4 minute spectrograph history you can stop, scroll back and review
- slow down tunes by up to 5X, or speed music up by 2X to skip sections faster
- hear tunes in mono, left or right channel only, or with center-panned vocals reduced
- stop music in time, and still hear the music frequencies present via resynthesis
- color frequencies to see if they are in-tune or out-of-tune
- color frequencies for loudness, or graph in black-and-white.

Use the Song button to select a tune from your library (DRM protected iTunes files are not supported).  Use the Gear button to select among several viewing modes.  There's a volume control to manually set the sensitivity threshold.  Stop playing or recording to scroll back and review or resynthesize sound.  Touch the keyboard during resynthesis to isolate one note.   For many musical sounds, you will see lots of overtones and harmonics, not just the fundamental note pitch frequencies.  That's just the way many musical sounds work.

Version 1.3.4 just release to the iOS App Store.

Thursday, March 7, 2013

Music Spectrograph App Updated

The newest version 1.2.1 is a big update for the HotPaw Music Spectrograph app.  It includes a lot of internal improvements in the quality of musical sound analysis, several bug fixes, plus one added major new feature.

My first problem was in deciding whether to keep the word "Spectrograph" in the name of the app.  When I looked at journal articles and books published by music professors, I saw at least 3 different terms used to describe these colored 2-dimensional time vs. audio frequency charts: Spectrograms, Spectrographs and Sonograms.  These terms also seem to have multiple uses, with Spectrograph also referring to optical devices used to split light into its constituant spectral colors, Spectrogram referring to the picture of a spectrum, and Sonogram referring to the results of ultrasound medical 3D imaging.  The term Sonogram, regarding music, is more rare; but I found this term used in a recently published textbook on sound by a professor of physics at Harvard University, as well as in a few other academic works.

In optics, the term "Spectrograph" is used for devices that produce spectrums or spectrograms.  Since the HotPaw Music Spectrograph app on an iOS device can be used on real-time sound input and works like a continuous chart recorder, I think a word ending with "-graph" more implies this continuous graphing activity; whereas the "-gram" suffix seems to just imply more a static image.  So I'll stick with calling it a spectrograph for now.

Some of the changes in the Music Spectrograph update include 12th-octave frequency band filters which are now better calibrated for the evenness of their response.  A few bugs in selecting, converting and playing Songs from your iTunes library to see their spectrograph have been fixed.  You can hit the Song button to use, and to turn-off this feature.

Now, there are several apps in the App store that can be used to help transcribe or learn music by slowing down songs without changing the pitch.

Music Spectrograph won't slow music down.  The new "ReSynth" feature in Music Spectrograph can actually stop music in time.

The major new feature added to the Music Spectrograph app is sound re-synthesis.  Hit the button to "Stop" recording or music playing.  Then touch the spectrograph and scroll back to some sound earlier in time.  A new button will appear near the top left of the chart.  The "ReSynth" button.  Scroll to an short sound, such as an eighth-note, and just stop and listen to just that one note or chord in time (but with most overtones and harmony included as well).  Scroll back-and-forth to listen to the notes immediately after or before.  See how what you hear corresponds to the piano keys nearest the highlighted frequencies.  The MIDI note numbers will also be displayed at the top.

What you will hear when using this re-synthesis will just be the strongest portions of the audio frequency spectrum, and those which directly correspond to the pitch of MIDI or piano key notes.  This re-systhesis isn't completely accurate, as any transients (such as consonants or percussion) and smaller and non-musical frequencies will have been removed, leaving a sound more like that produced by a vocoder (which is what is happening behind the scenes).  If you scroll back-and-forth in time, you might hear some tweeting/chirping noises as various high frequency overtones become large enough to show up on the graph for just a short time.

To use the Music Spectrograph app for music transcription, you will still need to know how to understand and ignore all the harmonics and sequences of overtones in the graph yourself.  This is not always easy, as many music instruments and types of human voice produce far more overtones then any sound at the actual musical pitch frequency.  This app may be helpful in learning about this important feature of many interesting musical sounds.

Thursday, July 19, 2012

HotPaw Guitar Tuner - Now available for the Mac

The HotPaw iChromatic Strobe Tuner has been a popular app in the Music section of the Mac App store.  Now available is a lower priced HotPaw Strobe Guitar Tuner, with the same accuracy and ease of use, but designed specifically for tuning 6 string guitars.

Wikipedia calls strobe tuners "the most accurate type of tuner", and our tuners for the iPhone, iPad and now the Mac will show you why.

Friday, April 13, 2012

New app: Morse Code Ringtone Maker


HotPaw Productions newest app is Morse Code Ringtone Maker , now available in the iOS App Store.

Create ringtones with your own customized Morse Code messages.  Don't bore people with yet another pop tune blaring from your phone.  Be different... retro-tech.  Communicate.  Or just hide really funny messages in your ringtones for "special" people (be they your best friends or your worse enemies).  Only other radio geeks will understand.

With Morse Code Ringtone Maker, you can customize the text and the Morse Code/CW speed (combined up to 30 seconds in length), as well as the the tone frequency.  The Words-Per-Minute (WPM) speed is variable from 5 to 40 WPM.  The tone frequency is customizable from 300 to 1200 Hz.  On the customization page, you can also configure Farnsworth timing where the dots and dashes for each letter come even faster than the WPM of the letters.

Morse Code Ringtone Maker requires that you can Sync your iPhone using iTunes on your Mac or PC, and have done so previously.   You can either email your newest ringtone file directly from the app, or use iTunes File Sharing to get your ringtone files from this app into iTunes on your Mac or PC, where they can then be Sync'd to your iPhone.

To get your ringtones from Morse Code Ringtone Maker into iTunes, connect your iPhone to iTunes running on your Mac or PC.  Start iTunes on your Mac or PC.  Connect your iPhone.  Select your iPhone under Device on the left side of iTunes.  Select Apps on the top of iTunes.  Scroll down to File Sharing.  Select Morse Ring from the list of Apps.  Select your chosen ringtone from the list of documents, and save it to your disk.  Then drag the .m4r ringtone file icon back from your disk onto iTunes.  To install the ringtone onto your iPhone, select Tones on the top of iTunes.  Select Sync Tones.  Then select which ringtones your want to Sync, then Sync.

To customize your iPhone's ringtone for a particular contact, select a contact from the Contacts app or within the Phone app on your iPhone.  Hit Edit and you will be able to select a ringtone for that contact.  Or you can use Sounds in the Settings app to set a global default ringtone.

Enjoy.

Tuesday, April 3, 2012

GMail Tap and Morse2Text

Google publicized their GMail Tap app on April 1st.  It was widely reported as an April Fools day joke. The GMail Tap app that allows people to enter email using only a 2 key keyboard... which just happened to be buttons for the Morse Code dot and dash.

However the HotPaw Productions Morse2Text iPhone app has been in Apple's iOS App store for over a year.  It allows both straight keying and an Iambic keyer mode with one button for dots and one for dashes, where it then converts the Morse Code into text which can be sent directly to Mail.

And Morse2Text has actual blind customers who find it useful.  No joke at all.

Wednesday, January 11, 2012

Morse Decoder 1.1.0 Mac App Store update

The HotPaw Morse Code Decoder, version 1.1.0, is now available from the Mac App store.  It is currently still the only Morse Code or CW app available from Apple's Mac App Store.  A free update for current users should be shown automatically when running the App Store app on your Mac.

Two important new features were added to version 1.1.0.

The first new feature is an audio input selection option for users with USB or PCI audio input devices.  Some of these 3rd party USB or PCI accessories will allow line-level audio input directly from a radio receiver.  The use of an audio line-input instead of a microphone may allow for even more accurate Morse Code decoding.  The choice of audio input can now be selected within the app.

Also added is an option for manual control of the threshold level for detecting Morse Code dits and dahs above a background noise floor.  This option can be enabled by turning AGC off, which is useful when the AGC cannot adapt properly to high levels of noise or fading in the audio signal.  The feature works best in conjunction with the optional narrow band filter, which can be enabled just by clicking on the desired frequency peak shown by the built-in spectrum analyzer.

Saturday, January 7, 2012

iAutoharp and HotPaw Basic for iOS updates

The iAutoharp app for iOS has been update to version 1.5.  It's a great little easy to play 36-string musical instrument, where you can strum easy-to-select chords.  This version should fix the responsive and lag issues which had been reported for previous versions.  The strings now animate when strummed using a new faster display update method that does not slow down multi-touch strumming or chord changes.

HotPaw Basic for iOS has been updated to version 1.5.6.  (It's the same as 1.5.5, plus some small bug fixes to the built-in help.)  This version adds some new user-requested functions for  getting location (GPS coordinates) and accelerometer information from the device.  A new function to sample the audio input has also been added.  Another very useful addition is a mode allowing editing program text in a small window, instead of one line-at-a-time.

Monday, December 19, 2011

iChromatic Strobe Tuner now in the Mac App Store

I was surprised when I looked in the Mac App Store a few weeks ago, and didn't see any musical instrument tuner applications that were, in my opinion, both attractive and accurate.  So I created a new chromatic strobe tuner app just for the Mac.  The HotPaw iChromatic Strobe Tuner is now available from the Mac App Store for an introductory and fairly low price.

The visual concept is very similar that used in my popular inTuna Guitar Tuners and iChromatic HD Tuners available from the iOS App store.  However, I used the greater processing power available on the Mac to display more attractive circular pitch strobes (two of them), plus a note-on-keyboard indicator and a music grand staff display, as well as usual meter dials and frequency read-out.  It supports a configurable Concert A frequency and several settings to customize tuning intonation by cents.  Check it out, and feel free to send feedback (or bug reports if you find any).

Thursday, December 1, 2011

HotPaw Morse Decoder, now available for the Mac

The HotPaw Morse Decoder app for the iPhone and iPad has turned out to be a surprisingly popular app worldwide, selling copies in almost 50 countries, and getting great reviews.  (Although it never hurts to have more! :)

The Morse Decoder has now been ported to Mac OS X.  Version 1.0 of the HotPaw CW Morse Decoder for the Mac is available from the Mac App Store.  The features are nearly identical to the iPad version of the app, including the narrow band audio filtering and high speed QRQ mode with can decode Morse Code at over 80 WPM in good conditions.

So, the interesting question will be: How many radio amateurs use recent Macs?

UnTouchType for iPad

Version 1.0.0 of UnTouchType is now available as a Free app from the U.S. iOS App Store.  Experiment with chorded one-hand touch text input.  The app can speak each letter on input for audible verification.  But the current version is very plain, and only allows one short line of text input.

I am awaiting a bit more user feedback before updating UnTouchType with a version that will allow the user to customize their preferred keying combinations by uploading a text file using iTunes.

Monday, July 18, 2011

UnTouchType

I usually don't announce apps in development until they are ready to ship, approved by Apple, and available in the App store. But I recently demonstrated an early version of an app, on stage, at the close of the iOSDevCamp 2011 weekend Hackathon. So I might as well write about the idea behind an app still very much under construction.

Since adding support for Apple's VoiceOver Accessibility to a few of my apps, I've received enough customer feedback to realize that that iPhones and iPads are more popular among blind (or otherwise vision impaired) users than I might otherwise have suspected. By user request, I even developed an app specifically for this market segment, the HotPaw Talking Tuner.

Now, to segue into a bit of computer history: On December 9, 1968, Douglas Englebart, in what has been called the "Mother of All Demos", demonstrated on stage several innovations including the computer mouse, hypertext linking, online collaboration, and some precursors to bitmapped graphical user interfaces. He also demonstrated something less well known, the chord keyboard. This was a one-handed keyboard that could be used to enter text by hitting a combination of buttons. Chord keyboards haven't become popular because it takes some time to learn the key combinations. But if a person needs to enter text with one hand, and takes the time to learn the chords, it is a fairly fast input method.

One current problem with iPad text entry is the lack of tactile feedback when tapping on keyboard icons and other GUI buttons. This makes it difficult to enter text "eyes-free", that is, without looking at the display. Apple's VoiceOver Accessibility technology provides one solution, by giving synthesized voice feedback about where the graphical keys are located. But it currently seems difficult to make VoiceOver work for chorded multitouch input positioning.

My prototype solution is to have an app dynamically place 5 keyboard buttons wherever a person places all five fingers on the display, then record actions, not by tapping on buttons, but by lifting fingers up off the multitouch display. These finger actions can be converted in a "chording" input method by using the combination of which fingers one picks up to select a character for input. Combinations of lifting touches and swiping gestures can be used expand the potential vocabulary. Since this method is actuated, not by touching, but by lifting fingers up, I am calling this input method:

UnTouchType

In a day or so of coding at the Hackathon, I got the an app working well enough to demonstrate to a few people; and they thought it was an interesting enough idea for me to demo. Unfortunately, it didn't work for me on stage at the conclusion of the iOSDevCamp Hackathon. (Playing with the app and accidentally turning on the mute switch just before my presentation slot didn't help. Live and learn.)

If the kernel of this idea is a new innovation, consider it to now be in the public domain. Some experimental works remains on how fast this input method is compared to other eyes-free input methods on touchpads, and which finger/chord/letter combinations might be faster and/or easier to learn. Stay tuned.

Dance Metronome/BPM

This month, HotPaw Productions introduced a new iOS app, Dance Metronome/BPM now available from Apple's iTunes App Store. This app has both a tap BPM (beats per minute) meter and a very accurate metronome. The BPM meter is designed for ballroom dancers, as it indicates whether a particular tempo is within strict tempo range. All the International Standard, Latin and American Style Smooth and Rhythm dance tempos are included. The metronome in the app can play beats, on time, to sub-millisecond accuracy. (Given an audio sample rate of 44100Hz, there are 44 samples per millisecond, and the Dance Metronome/BPM app calculates the nearest exact sample to start playing each on-time beat.)

Friday, June 3, 2011

June App Updates

The Morse Decoder app for iPhone and iPad has been upgraded to version 1.7. It now includes a new High Speed WPM mode switch to support decoding really fast QRQ WPM speeds from 40 to 80 WPM. Morse code just sounds like a blur at those rates. The HotPaw Basic app includes a "morse" command which supports sending Morse Code sounds up to 99 WPM.

The HotPaw Music Spectrograph update to version 1.1.2 will now allow you to analyze music from your iTunes Library. Hit the "Song" button, and it will let you select a tune to convert and visualize in spectrograph form. You can stop and replay sections of music to (re)hear what interesting looking segments of the spectrum graph sound like. I used it to help transcribe some complicated fast piano riffs. Currently does monophonic analysis only.

Sing-inTuna update version 2.1.3 includes a fix for a rare problem where someone reported the app needed to be force quit and restarted to get audio working again.

Friday, May 27, 2011

May App Updates and News

The HotPaw Sing-inTuna app has been updated to version 2.1.2, with improved audio processing and graphics performance. This should help reduce the random low frequency dots that occasionally appear in the voice pitch graph.

The MorseTest app has been updated to version 1.1.6, with support for a couple new Morse Code punctuation characters added. VoiceOver support should also be improved in this update.

Blind Talking Tuner has been update to version 1.0.1, with an easier to understand speech synthesizer voice.

Austin Seraphin wrote a nice blog post reviewing the HotPaw Morse2Text Morse code text entry app.

Tuesday, April 26, 2011

YouTube video showing the HotPaw Morse Decoder

Here are 2 YouTube video's I found which show the HotPaw Morse Decoder in operation:

Morse with iPod Touch

and

Morse Code Decoder iPhone App

They both show the built-in spectrum analyzer. Pretty cool.

App Updates

On 4/20, the HotPaw Music Spectrograph was approved for App store distribution. Music Spectrograph is a great way to visualize live music and sound. It uses a scrolling piano roll display similar to some midi composition tools. It took Apple 7 days to approve Music Spectrograph.

On 4/11, the HotPaw Morse Decoder was updated to version 1.6.2, with a new low pass filter and better WPM estimation logic. It took Apple 2 days to review this update after it was submitted.

On 3/30, the HotPaw inTuna Strobe Guitar Tuner was updated to version 3.0.2, with fixes for a potential app freeze up. It took Apple 4 days to review this update.

On 3/23, HotPaw Basic for iOS was updated to version 1.5.3, with some fixes to matrix multiplication. It took Apple 7 days to review this update.

On 2/25, the HotPaw Blind Talking Tuner was released to the iTunes App Store. It took Apple 9 days to review this new app.

On 2/22, the HotPaw inTuna Strobe Guitar Tuner HD (for iPad) was updated to version 1.2.1, with fixes for audio recording occasionally cutting out. It took Apple 2 days to approve this update.

On 2011-Feb-08, iChromatic HD (strobe tuner for iPad) was updated to version 1.0.2, with added support for A=415Hz tuning for historic/vintage instruments. It took Apple 4 days to approve this update.

HotPaw Productions announced Music Spectrograph for iOS

Santa Clara, CA - HotPaw Productions announces Music Spectrograph 1.0, now available from Apple's iTunes App store. Visualize sound as musical notes on a piano roll. See mic input graphed in real-time, almost as it might appear in a MIDI music editor, to assist with music transcription. Find notes hidden inside chords, or just watch the rise and fall in the pitch and all the overtones of the sounds around you. The Music Spectrograph uses real-time signal processing to create a scrolling 12th-octave spectrogram, with each frequency band centered on a musical note.

The Music Spectrograph app might prove helpful for for music education, music transcription, acoustics understanding, speech therapy or vocal training.

Mrs. Nicholson says: "Wow, that's a really cool looking app. What's it do?". The developer's cats just looked at the app and went back to napping (as it obviously wasn't a mouse or a bird).

Ron Nicholson founded HotPaw Productions in 1999, first developing mobile apps for PalmOS devices, and has been developing iOS apps since the App store first opened. There are over 20 iPhone and iPad apps developed by HotPaw Productions the iOS App store, including the inTuna Strobe Guitar Tuner, Sing-inTuna, and HotPaw Basic. Copyright (C) 2011 HotPaw Productions. All Rights Reserved. Apple, iTunes, iPhone and iPad are registered trademarks of Apple Inc. in the U.S. and/or other countries.

###

Ron Nicholson
Developer
rhn@hotpaw.com

HotPaw Website Updated

The HotPaw website has been completely updated, with new css, and a new 3-column look. Many thanks to lizdesign for the web site design and many of the icons, including:

Music Spectrum icon