A bad case of the Clap

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

A bad case of the Clap

Post by richmond62 » Thu Apr 11, 2019 8:22 am

I have 2 Edison robots in my school, and I will be using them this summer
in LiveCode programming courses by setting emulation exercises to
the pupils.

https://meetedison.com/

The Edison is programmable by running it over a series of barcodes:

https://meetedison.com/barcodes/

One of these barcodes intialises Edison's sound detector so that it changes direction
when it "hears" a single clap, and stops when it "hears" a double clap.

So . . . .

If I have a microphone connected to a computer (tough call, that one), is there a way
I can get LiveCode to "listen"?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: A bad case of the Clap

Post by richmond62 » Thu Apr 11, 2019 10:12 am


dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: A bad case of the Clap

Post by dunbarx » Thu Apr 11, 2019 1:46 pm

There is a gadget that can inform the computer of a sound. It is at:
https://www.bkohg.com/interfaces_e.html

This has both digital and analog inputs and outputs, and a framework for LC. It is easy and fun. I have used it to control stuff and respond to stuff. It is not cheap.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: A bad case of the Clap

Post by richmond62 » Thu Apr 11, 2019 5:29 pm

I don't know about that . . .

However Audacity

[ https://www.audacityteam.org/]

"just" picks up whatever comes into my microphone with no highly expensive boxes.

And what you offered, Craig, was nothing more than a highly expensive box.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10320
Joined: Wed May 06, 2009 2:28 pm

Re: A bad case of the Clap

Post by dunbarx » Thu Apr 11, 2019 6:23 pm

Richmond.

You get what you pay for. 8)

The expensive box is a hobbyist paradise. I used four of them on an outside project. I am about to use another to control an in-house machine.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10049
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: A bad case of the Clap

Post by FourthWorld » Thu Apr 11, 2019 6:43 pm

For systems with either built-in mics or mics attached via USB, OS APIs provide access to those audio data streams.

This can be done in LC Builder, using the same APIs Audacity and other audio software use.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: A bad case of the Clap

Post by [-hh] » Thu Apr 11, 2019 7:19 pm

FourthWorld wrote:
Thu Apr 11, 2019 6:43 pm
For systems with either built-in mics or mics attached via USB, OS APIs provide access to those audio data streams.
This can be done in LC Builder, using the same APIs Audacity and other audio software use.
WOW, this doesn't sound like forever repeated promises. I really wonder how this could be done with the current state of LC Builder. Could you please outline which APIs to use and how to do that?
shiftLock happens

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: A bad case of the Clap

Post by richmond62 » Thu Apr 11, 2019 7:32 pm

Maybe I'm a steaming nit, but, if SCRATCH can lever sound input . . .

https://www.edscratchapp.com/#
-
Screenshot 2019-04-11 at 21.31.27.png

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10049
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: A bad case of the Clap

Post by FourthWorld » Thu Apr 11, 2019 8:14 pm

[-hh] wrote:
Thu Apr 11, 2019 7:19 pm
FourthWorld wrote:
Thu Apr 11, 2019 6:43 pm
For systems with either built-in mics or mics attached via USB, OS APIs provide access to those audio data streams.
This can be done in LC Builder, using the same APIs Audacity and other audio software use.
WOW, this doesn't sound like forever repeated promises. I really wonder how this could be done with the current state of LC Builder. Could you please outline which APIs to use and how to do that?
I don't mind being corrected where the facts demonstrate otherwise. LC Builder is described as being able to handle C, C++, and other APIs. Which ostensibly-supported APIs have you had difficulty using from LC Builder?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10049
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: A bad case of the Clap

Post by FourthWorld » Thu Apr 11, 2019 8:17 pm

richmond62 wrote:
Thu Apr 11, 2019 7:32 pm
Maybe I'm a steaming nit, but, if SCRATCH can lever sound input . . .

https://www.edscratchapp.com/#
-
Screenshot 2019-04-11 at 21.31.27.png
Yes, that OSes provide low-level APIs for such things is well known. As with Scratch, Audacity, and pretty much anything else that provides a GUI for accessing those capabilities, someone wrote low-level code to interface with those low-level APIs.

While we wait for -hh to describe why he feels LC Builder cannot access such APIs, we can also consider the externals interface, designed for this role in all xTalks since HC, and well demonstrated to be useful for such tasks.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: A bad case of the Clap

Post by [-hh] » Thu Apr 11, 2019 10:05 pm

Fourthworld wrote:I don't mind being corrected where the facts demonstrate otherwise ... Which ostensibly-supported APIs have you had difficulty using from LC Builder?
This is ridiculous. I ask you to (at least) outline that you claim facts and now I should name my difficulties with that non-facts? Deliver content ...
Fourthworld wrote:LC Builder is described as being able to handle C, C++, and other APIs.
Who says this if not you and where are the examples for that? Deliver content ...
TMHO such a general claim is, except for *some very special examples*, not reality but far future.
shiftLock happens

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10049
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: A bad case of the Clap

Post by FourthWorld » Thu Apr 11, 2019 10:21 pm

[-hh] wrote:
Thu Apr 11, 2019 10:05 pm
Fourthworld wrote:I don't mind being corrected where the facts demonstrate otherwise ... Which ostensibly-supported APIs have you had difficulty using from LC Builder?
This is ridiculous. I ask you to (at least) outline that you claim facts and now I should name my difficulties with that non-facts? Deliver content ...
Fourthworld wrote:LC Builder is described as being able to handle C, C++, and other APIs.
Who says this if not you and where are the examples for that? Deliver content ...
TMHO such a general claim is, except for *some very special examples*, not reality but far future.
I did not volunteer to research the relevant APIs, or write the code needed to work with them.

I delivered the only thing I offered: a reminder that LC Builder is described as suitable for the task.

If you have no experience suggesting otherwise, perhaps what it says on the tin may be true.

I don't mind being wrong when the facts demonstrate otherwise. But in the absence of anything demonstrating that the advertised purpose of LC Builder cannot be used for this task, I'm at a loss to try to determine how to satisfy you.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply