[PD] Ultrasonic 'theremin' patch

2008-08-07 Thread Ico Doornekamp

Hi all,

Yesterday I found out that modern audio cards can do much higher sample
rates then 48000, which allows for entertaining experiments with
ultrasound. 

I'm not sure if this has been done before, but I'm pretty happy with the
results so far.

I've created a patch running on a samplerate of 88200 Hz, which sends
out high-frequency chirps over two laptop speakers. The chirps are
reflected back to the bultin mic using both hands. The reflection is
correlated with the outgoing chirps to calculate the time the sound
waves needed to return to the mic, thus measuring the distance to the
hands or any objects hovering above the laptop.

This particular patch just drives two tone generators whose frequencies
depend on the measured distances, which are played back over the same
speakers as the high-frequency chirps. The result is a
two-tone-polyphonic theremin-like instrument. 

If only I could play this thing in tune...

A simple demonstration video and the patch can be found at
  
  http://zevv.nl/play/code/ultrasonic-theremin/

This patch just a first test using ultrasound, I'm sure much more
interesting things can be done using this technique.

The patch is not very well documented at this time, and I think getting
things to work needs a fair amount of tweaking for each different setup.
Things that need to be setup properly are output level of the soundcard,
a magic gain factor after the correlation, and the range that should be
inspected for echo peaks to avoid detecing of reflections from the
ceiling.  I think it would be possible to make the patch do some
auto-detection of some of the paremeters like ceiling height and gain
factors, which would make a nice addition for future versions.

Enjoy,

Ico

-- 
:wq
^X^Cy^K^X^C^C^C^C

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Sync phasor to block, or object sending block number?

2008-07-25 Thread Ico Doornekamp


* On 2008-07-25 Roman Haefeli <[EMAIL PROTECTED]> wrote  :

> On Fri, 2008-07-25 at 10:16 +0200, Ico Doornekamp wrote:
> > Hello,
> > 
> > I'm looking for an object that sends outs a ramp and starts over from
> > zero every audio block; is such a thing available or can it be
> > constructed using other objects ? I'm not able to get this tight timing
> > mixing messages and audio, especially on larger block sizes.
> > 
> > Thanks
> 
> 
> [bang~]
> |
> [0,  (
> |
> [vline~]

[bang~], how simple :)

Thank you

-- 
:wq
^X^Cy^K^X^C^C^C^C

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


[PD] Sync phasor to block, or object sending block number?

2008-07-25 Thread Ico Doornekamp
Hello,

I'm looking for an object that sends outs a ramp and starts over from
zero every audio block; is such a thing available or can it be
constructed using other objects ? I'm not able to get this tight timing
mixing messages and audio, especially on larger block sizes.

Thanks


-- 
:wq
^X^Cy^K^X^C^C^C^C

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] [PD-announce] Pd-0.40.3-extended-rc2 released

2008-07-22 Thread Ico Doornekamp


* On 2008-07-22 marius schebella <[EMAIL PROTECTED]> wrote  :

> Frank Barknecht wrote:
> > Hallo,
> > Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:
> > 
> >> The grand plan is to have no libraries loaded by default.  Then the  
> >> library configuration would be completely embedded in the patch, like  
> >> python does with import.
> > 
> > 
> > $ python
> > Python 2.4.4c0 (#2, Jul 30 2006, 15:43:58) 
> > [GCC 4.1.2 20060715 (prerelease) (Debian 4.1.1-9)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
>  sin(0.5)
> > Traceback (most recent call last):
> >   File "", line 1, in ?
> > NameError: name 'sin' is not defined
>  math.sin(0.5)
> > Traceback (most recent call last):
> >   File "", line 1, in ?
> > NameError: name 'math' is not defined
>  import math
>  math.sin(0.5)
> > 0.47942553860420301
> > 
> > Ciao
> 
> is this a good idea? pd comes with a set of tools, I don't see a reason 
> why I should import [bang] before I can use it. I (don't) want to be 
> treated like a child in a sandpit here:
> "mummy, can I have the shovel?"
> "say please"
> "please can I have the shovel?"
> "you know, my darling, this shovel is from toys "r" us... can you say, 
> mummy please can I have the shovel from toys "r" us?"
> "please can I have the shovel from toys "r" us?"
> "cutie! say thank you"
> "thank you"
> "kiss mummy!"
> kiss...
> marius.

Or the other version:

"mummy, can I have the shovel"
"which shovel, dear, the red one or the blue one"
"the blue one"
"here you are dear"

Next time, you'll learn to ask for one of the specific shovels right
away: red/shovel or blue/shovel.

-- 
:wq
^X^Cy^K^X^C^C^C^C

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] pdlua also into vanilla?

2008-07-20 Thread Ico Doornekamp


* On 2008-07-20 Jack <[EMAIL PROTECTED]> wrote  :

> 
> Le 19 juil. 08 à 16:40, marius schebella a écrit :
> 
> > Hans-Christoph Steiner wrote:
> >>
> >> As a test yes, but not for the release.  It's changing too fast right
> >> now to maintain backwards compatibility, so including it would cause
> >> more problems than it would solve.
> >
> > I am not sure, if it really changes, or if it only adds new  
> > features. I
> > think the big problems (file naming, loader) are solved, but not sure.
> > I worked a lot with py/pyext and pdj in the past (which are also
> > candidates for pdx), but pdlua is the only scripting tool that can
> > easily integrate the language as a static library, because it is so
> > small. maintainance should be easier than with python and java.
>
> And what about PHP, it would be nice to have access directly to this  
> language with Pd, there is a lot of people knowing this language and  
> it is useful with MySQL and with query for the web ? It is often  
> installed on computer with Apache server and MySQL with LAMP, MAMP or  
> WAMP.
> ++

I think in this case Lua really has some advantages over PHP. It is
designed to be used as en embedded scripting and configuration language.
The source is extremely portable (99% ANSI C) and compact (compiler +
runtime typically < 150Kb), and runs completely standalone without the
need for other libraries.

PHP might add too much overhead. It has a huge API for all kind of
(mostly web-related) things, it is much harder to embed in existing
applications, brings in tons of dependencies and is *much* bigger then
Lua or TCL.

-- 
:wq
^X^Cy^K^X^C^C^C^C

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] [PD-announce] pdpedia is back!

2008-07-15 Thread Ico Doornekamp


* On 2008-07-15 Hans-Christoph Steiner <[EMAIL PROTECTED]> wrote  :
>
> On Jul 13, 2008, at 2:36 PM, Ico Doornekamp wrote:
>>
>> * On 2008-07-11 Hans-Christoph Steiner <[EMAIL PROTECTED]> wrote  :
>>>
>>> On Jul 11, 2008, at 4:05 AM, Ico Doornekamp wrote:
>>>>
>>>> * On July 11th, Hans-Christoph Steiner Wrote
>>>>
>>>>> After a little holiday due to an OS upgrade, pdpedia is back!   
>>>>> Please
>>>>> let me know if it isn't working for you:
>>>>
>>>> Works fine, although the wiki seems to be under the attack of  
>>>> spammers
>>>> already: a lot of pages have been replaced with links, spam and  
>>>> other
>>>> gibberish.
>>>>
>>>> I know some of the tricks how to avoid this in mediawiki, drop me a
>>>> private mail if you're interested.
>>>
>>> Here's some of wikipedia/mediawiki's advice:
>>>
>>> http://www.mediawiki.org/wiki/Anti-spam_features
>>
>> I recommend the ConfirmEdit plugin (which is also listed on the above
>> page) using only the 'addurl' and 'createaccount' triggers. This
>> requires the user to fill out a captha when adding new links to a page
>> or when creating a new account, while editing of regular content is not
>> affected. On a mediawiki page I administer this plugin was able to keep
>> out the >200 spam edits which were performed every day.
>
> That one sounds rational.  How long have you been using it? 

Since august last year, and fortunately not a single spam or vandalism
since. We also run the 'SpamBlacklist' plugin, but this one was not able
to keep out the spam on its own.

> I am sure that many anti-spam techniques will reduce spam in the short
> run.  The trick is to make sure that the spammers don't then shift to
> some other kind of spamming which is more work to manage, like
> creating accounts.

Indeed. Our wiki used to be configured to only allow edits from logged
in people, and all the vandalism was done through logged-in accounts.
This why having a captcha for creating accounts might help as well.

I see in the pdpedia 'recent changes' page that most of the spam is
confined to two or three pages only, but it still messes up the history
overview and makes it unreadable because of the tens of edits per day.

Another question on the wiki: as a PD newcomer, one of the things I'm
looking for is a more or less 'formal' description for each module's
parameters, inputs and outputs. Most of the help pages have a short
description and some example of a modules usage, but there does not seem
to be a single structural way to describe each module. Would it be an
idea to define some templates and examples for this purpose and ask the
users of the wiki to use this to describe modules ?

Ico

-- 
:wq
^X^Cy^K^X^C^C^C^C

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] [PD-announce] pdpedia is back!

2008-07-13 Thread Ico Doornekamp

* On 2008-07-11 Hans-Christoph Steiner <[EMAIL PROTECTED]> wrote  :

>
> On Jul 11, 2008, at 4:05 AM, Ico Doornekamp wrote:
>
>>
>> * On July 11th, Hans-Christoph Steiner Wrote
>>
>>> After a little holiday due to an OS upgrade, pdpedia is back!  Please
>>> let me know if it isn't working for you:
>>
>> Works fine, although the wiki seems to be under the attack of spammers
>> already: a lot of pages have been replaced with links, spam and other
>> gibberish.
>>
>> I know some of the tricks how to avoid this in mediawiki, drop me a
>> private mail if you're interested.
>
> Here's some of wikipedia/mediawiki's advice:
>
> http://www.mediawiki.org/wiki/Anti-spam_features

I recommend the ConfirmEdit plugin (which is also listed on the above
page) using only the 'addurl' and 'createaccount' triggers. This
requires the user to fill out a captha when adding new links to a page
or when creating a new account, while editing of regular content is not
affected. On a mediawiki page I administer this plugin was able to keep
out the >200 spam edits which were performed every day.

Ico

-- 
:wq
^X^Cy^K^X^C^C^C^C

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] [PD-announce] pdpedia is back!

2008-07-11 Thread Ico Doornekamp

* On July 11th, Hans-Christoph Steiner Wrote

> After a little holiday due to an OS upgrade, pdpedia is back!  Please  
> let me know if it isn't working for you:

Works fine, although the wiki seems to be under the attack of spammers
already: a lot of pages have been replaced with links, spam and other
gibberish.

I know some of the tricks how to avoid this in mediawiki, drop me a
private mail if you're interested.

Ico

-- 
:wq
^X^Cy^K^X^C^C^C^C

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Seam carving audio

2008-07-08 Thread Ico Doornekamp


* On 2008-07-08 hard off <[EMAIL PROTECTED]> wrote  :

> i'm thinking about how you'd do this,
> 
> and the picture in my mind is of a single 2 second long clarinet note with a
> hihat being hit after about 1 second.
> 
> so, if you were going to stretch or compress that, you'd want to preserve
> the parts with the most 'colour' ...which i would guess would be the attack
> of the clarinet and then especially the attack of the hihat.

Maybe a bit too naive approach, but what about chopping up the audio in
small fragments, and discarts fragments that have about the same
spectral footprint as their neighbours ? This will leave the dynamic
parts intact and leaves out the 'boring' bits.

Ico

-- 
:wq
^X^Cy^K^X^C^C^C^C

___
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list