Shop OBEX P1 Docs P2 Docs Learn Events
Resolution of Ping) sensor - Music as therapy — Parallax Forums

Resolution of Ping) sensor - Music as therapy

pacmanpacman Posts: 327
edited 2013-07-14 06:18 in General Discussion
One of the guys at work, has a wife who works with diabled kids.

One of the tools that she had (before the break in) was a 'music board"

This board sat in a fixed stand and used ultrasonic (we think) to pick up the position of the kids head - as the kid moved their head side to side (often the only movement they have) they played sounds - apparently the smiles on their face was worth it.

Funds are short (there is a lot of other stuff than needs to be sourced first) so I voulunteered to see what I could knock-up. - Perhaps not my wisest moment...

Current 'thoughs", ping sensor - connected to propeller - connected to midi unit.

Setup would be tilt head left - press button - this sets distance 1, tilt head right - press button - this sets distance 2. anything between distance 1 and distance 2 = sense/play/appropiate noise

Questions are:-

Will the ping sensor have enough resolution?
Will the ping sensor 'bounce' off a persons head?
Are there better sensors to use?
Does any particualr object in the OBEX seem like a really good fit for the ping side of the world?
Does anyone have a midi 'object' they would like to share?

Thanks in nadvance
Paul

Comments

  • lanternfishlanternfish Posts: 366
    edited 2013-04-13 01:58
    Hi pacman

    Has the makings of a great project. Can I suggest you google something like ultrasonic positioning.

    Download the Parallax PING)) documentation from here.

    Download the dualping object from the OBEX

    And experiment.

    Check out the OBEX for MIDI objects.
  • pacmanpacman Posts: 327
    edited 2013-04-13 14:49
    Thanks lanternfish.

    I did view the obex, hence my question about which of the ping object would be recommended (so big thanks for that) and none of the Midi objects I found seemed to be for 'making' a packet (only decoding one). My musical tallent is nil - so I was kinda hoping that 'use object xxx' would make the midi sending interface _real_ easy.

    Had a look at that documentaion - must have mised it the first time. Thanks for the link.

    You are 100% correct - experimentation is going to be the key.

    Thanks for the words of encouragemnt...
  • localrogerlocalroger Posts: 3,451
    edited 2013-04-13 15:32
    Most of these questions could be answered readily by acquiring a Ping! (they're not expensive) and connecting it to a Stamp or Prop board and waving it around. I have two of the things but have never gotten around to using them because life / other stuff.
  • pacmanpacman Posts: 327
    edited 2013-04-13 16:13
    You are correct - most of these questions can be answered by getting one of the boards.

    However, I dont have one (yet) and thus whilst waiting for delivery - was hoping to get a start.

    I have no idea when it comes to a midi interface (yes, google will be my friend) so, again, I was tring to lessen the learning curve.
  • FranklinFranklin Posts: 4,747
    edited 2013-04-13 16:45
    I would think that for positioning you would need at least two sensors in order to get XY coords.
  • localrogerlocalroger Posts: 3,451
    edited 2013-04-13 16:49
    I think the MIDI interface will be the hard part. Can't recall anyone ever posting that, though it seems do-able. Also, as Franklin mentions you might want two PINGs to get X-Y motion. I am wondering if maybe the original device uses a Kinect, which uses structured light to allow it to create a 3D model of whatever's in view.
  • lanternfishlanternfish Posts: 366
    edited 2013-04-14 00:33
    @ Pacman: I head into production week of our next show this week so will be free in a couple of weeks to look at the MIDI side of things if you want. And I will try and track down a project I saw a while back that I think may be useful to you.

    EDIT: In the meantime the following links may be of interest:

    http://forums.parallax.com/showthread.php/127635-MIDI-Examples

    http://forums.parallax.com/showthread.php/132826-Retronitus-Noise-from-the-past!

    http://forums.parallax.com/showthread.php/115258-TheBlackBox-Release-v2.0-Propeller-HSS-FX-Sequencer-with-Digital-Audio-SPDIF
  • pacmanpacman Posts: 327
    edited 2013-04-16 15:55
    Wow - so much reading both on site and elsewhere on the iinterwebs.

    Remeber, my muscial tallent = my musical skill = nil.

    I get the principle, but if I was to say want a 'cowbell' sound what is the simplest way to transmit the data based on position.

    The midi 'receiver' is what does the "make cowbell noise based on the data", but the data stream appears to be a somewhat complex beast.

    I think for a protoype I just need to do the original head position limits of travel, divided into 8 zones (1 zone = 1 note. more/less? suggestions welcome) and just transmit that stream, but then it goes and gets all compex and add stuff like duration/speed/channel. Surley I just need something as simple as "each time a new note is 'played' (head movement), send a data stream to channel 1 (?, all?, just the even nnmbere channels??) to play the new note for 1 second" - pitch = ???

    I don't know what I dont know. It's a very tall mountin at the moment.

    If someone could point me at the idiots guide to MIDI - with particular information on how to generate a data stream for a very simple instrument that would be a _really_ big help to my understanding.

    Thanks in advance
  • varnonvarnon Posts: 184
    edited 2013-04-16 19:47
    Very cool idea.

    I just saw a paper on some similar technology for disabled individuals. The paper included several very detailed descriptions, such as classes with a reflective IR sensor (I think) installed at the top of the frame that could detect looking forward vs looking up (when looking forward only the light color of the sclera is detected). As with your example, small movements were used to trigger music and other things that might be pleasing. And, not surprisingly, an increase in these movements shows that the individuals do enjoy the stimulation. It isn't out yet, but it should be soon. (Its in an issue with one of my papers, I've been waiting for it to come out forever). I can post it later. It sounds like something you and your wife might be interested in.

    A single ping mounted in the front, facing the child, should allow you to detect in centimeters how close the child is to the sensor. This way you can constantly use the ping methods to find the how close the child is, and divide this distance into groups. You could for example say that if there is no object within 30cm, play no sounds. If there is an object between 30 and 20cm, play sound A, if there is an object between 20 and 15cm play sound B, etc. I think you could set this up so that rocking back and forth or nodding would change the sounds.

    For head tilting left/right, multiple pings might be better. Although you could mount a ping so that the sensor detects the side of the head, the sensor might also detect the shoulder.
    If you mount two pings facing the front of the child, you could conceivable detect if the child's head is in the ping's detection range, and how close it is. This would let you do more like what you described in the first post.


    Keep in mind the sensor's range. They expand in a conical shape. Also keep in mind that both pings should not activate simultaneously. You should alternate in rapid succession. (Actually, it looks like the dualping object takes care of this. I always alternated manually). I think you can do this alternate between the pair 10 times a second with no problems. I have played with multiple pings in close proximity before, you can easily get enough measurements per second even when you alternate between using ping 1 and ping 2.


    Finally, midi is great but does it have to be midi? What about synthesizing sounds using the propeller? Synthesizing musical tones is pretty easy with something like the synth object in the obex. Granted the tones are simple, but you can generate music. What about playing WAV files from an SD card? What about other non-auditory stimulation? For now, I recommend getting the pings connected and using something like LEDs just to help you set up the sensors.


    Anyway, keep us posted.
  • lanternfishlanternfish Posts: 366
    edited 2013-04-17 02:51
    I have just started a new thread here that is from a Lets Make Robots thread on position sensing using multiple ultrasonic echoes. It could be interesting to see how these threads develop.

    Also, it maybe better to discard the MIDI output concept in favour of a .wav output with thw .wav files stored on an SD card. One less obstacle as there has been significant development of this using a Prop.
  • pacmanpacman Posts: 327
    edited 2013-04-23 17:48
    More discussion with the end user - she is excited by this...

    A SD card with 8 'tones' on it would be fine. She is even prepared to have multiple SD with different sounds depending on the child (so cows might be for child 1, but child 2 needs dinosaur "roars").

    The two axis idea got her very excited. But we will walk (crawl?) before we run.

    More details - and I'm sure questions - to follow...
  • varnonvarnon Posts: 184
    edited 2013-05-08 02:42
    Pacman,
    See Technology-aided programs for persons with severe/profound and multiple disabilities: A selective review.
    This paper has descriptions of some of the micro-switch activated devices I mentioned. Could be useful.

  • pacmanpacman Posts: 327
    edited 2013-05-15 02:39
    Thanks Varnon, good link - though I haven't read it all yet.

    Have managed to get my ping sensors reading and have successfully played wav files using Kwabena's player. Though the player seems to be VERY hissy - early days.

    Actually planning on setting up a demo (using my demo board) in the next week - nothing flash, more of a proof of concept....

    Code/questions/results to follow....
  • pacmanpacman Posts: 327
    edited 2013-07-14 01:49
    Update.

    Showed this to my colleagues wife --> She was impressed.

    Told her could probably 'make' them for under $200 -> she was stunned

    Reinforced the 'I intend to release the design under open source as per the original discussions we had' -> "you mean 'to the world,and anyone could make one - for free" " -> she almost wet herself (perhaps she did - I didn't check)

    Forward a couple of weeks - one of her clients comes from a family who were planning on buying a "soundwave" setup (which I'm told is in the vicinity of {I'm told} $6000 AUD, who; when told of the "PingSound" {it's working name} asked lots of questions like "could it be made 'portable'?", "Could it be adapted to the side of a chair?", and "Could it be configured to speak things like yes/no/food/drink/toilet?"

    So sometime in the next few weeks I need to 'demo' this unit to the boss of colleagues wife and "soundwave family".

    And it's still only in pro-type form... I'll admit I'm a little scared as to where MY IMAGINATION fancies this might be headed...
  • lanternfishlanternfish Posts: 366
    edited 2013-07-14 06:18
    Great to hear that the project is progressing
Sign In or Register to comment.