Shop OBEX P1 Docs P2 Docs Learn Events
Microphone to Headphones Object? — Parallax Forums

Microphone to Headphones Object?

TonyATonyA Posts: 226
edited 2007-10-09 07:08 in Propeller 1
Hi,

Has anyone used this object? I'm just wondering if there are any sound samples around.

Does it add any effect to the vocel input? Does it automatically·loop?

Pin 8 = input, Pin 0 = output?

Thanks,
Tony

Post Edited (TonyA) : 9/17/2007 8:46:32 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-18 03:56
    I tried it when it first came out. It simply digitizes the microphone signal, then converts that back to analog output for the headphone amplifier. The program is intended just as an example of how it might be done, not as a useful program in itself.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-09-18 07:06
    I can't seem to find it now, but when I first played with this demo, I added a FIFO buffer to add delay and echo. I think that I was able to get more than a second or two of audio delay.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • BTXBTX Posts: 674
    edited 2007-09-18 12:32
    Oh great !! Beau.

    Please...remember where we can download your demo..I would like to "play" with it ..(if some day, I've some free time smile.gif )

    Could be interesting·to do a guitar effect box, reverberation, delay, echo, and fuzz, playing with that code.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • nohabnohab Posts: 96
    edited 2007-09-18 13:11
    How much recorded data/second?
    Would it be possible to record it with one Propeller, send it serially to another Propeller and play it there?
    (I do understand that using Propellers for an internal telephon system is not so relevant, but if there already are a cople of Propellers out that, exchanging data traffic, would it be possible to add some short voice-messages?)
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2007-09-18 15:54
    Actually, I was thinking about sending the data to the SD card when I read this....

    Propeller digital recorder...

    Oldbitcollector

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Buttons . . . check. Dials . . . check. Switches . . . check. Little colored lights . . . check.

    — Calvin, of 'Calvin and Hobbes.
  • Goran (Sweden)Goran (Sweden) Posts: 68
    edited 2007-09-18 16:20
    I found it on my computer.
    I hope I did the attachment correct.
    Regards, Goran
    For safety I copied it as well:

    ' This program uses the Propeller Demo Board, Rev C
    ' The microphone is digitized and the samples are played on the headphones.
    CON
    · _clkmode = xtal1 + pll16x
    · _xinfreq = 5_000_000

    ' At 80MHz the ADC/DAC sample resolutions and rates are as follows:
    '
    ' sample·· sample··············
    ' bits······ rate··············
    '
    ·············
    ' 5······ 2.5 MHz··············
    ' 6····· 1.25 MHz··············
    ' 7······ 625 KHz··············
    ' 8······ 313 KHz··············
    ' 9······ 156 KHz··············
    ' 10······ 78 KHz··············
    ' 11······ 39 KHz··············
    ' 12···· 19.5 KHz··············
    ' 13···· 9.77 KHz··············
    ' 14···· 4.88 KHz··············
    ·······························
    · bits = 11·············· 'try different values from table here
    ·
    PUB go
    · cognew(@asm_entry, 0)·· 'launch assembly program into a COG
    ·
    DAT
    '
    '
    ' Assembly program
    '
    ············· org
    asm_entry···· mov······ dira,asm_dira·················· 'make pins 8 (ADC) and 0 (DAC) outputs
    ············· movs····· ctra,#8························ 'POS W/FEEDBACK mode for CTRA
    ············· movd····· ctra,#9
    ············· movi····· ctra,#%01001_000
    ············· mov······ frqa,#1
    ············· movs····· ctrb,#10······················· 'DUTY DIFFERENTIAL mode for CTRB
    ············· movd····· ctrb,#11
    ············· movi····· ctrb,#%00111_000
    ·············
    ············· mov······ asm_cnt,cnt···················· 'prepare for WAITCNT loop
    ············· add······ asm_cnt,asm_cycles
    ·············
    :loop········ waitcnt·· asm_cnt,asm_cycles············· 'wait for next CNT value (timing is determinant after WAITCNT)
    ············· mov······ asm_sample,phsa················ 'capture PHSA and get difference
    ············· sub······ asm_sample,asm_old
    ············· add······ asm_old,asm_sample
    ························································
    ············· shl······ asm_sample,#32-bits············ 'justify sample and output to FRQB
    ············· mov······ frqb,asm_sample
    ···
    ············· jmp······ #:loop························· 'wait for next sample period
    '
    '
    ' Data
    '
    asm_cycles··· long····· |< bits - 1···················· 'sample time
    asm_dira····· long····· $00000E00······················ 'output mask
    asm_cnt······ res······ 1
    asm_old······ res······ 1
    asm_sample··· res······ 1
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-09-18 17:17
    I couldn't remember where I had placed it until this morning... It was actually about this time last year... I was doing something for Halloween, and I wanted a simple Delay and Echo.

    Here it is Enjoy!



    Note: Play with this!! Adjust the Number of resolution Bits, Buffer Length, Attenuation, etc.

    The attached audio gives you an idea on the output, but does not do this demo justice... (Improper line-in / mic-in audio levels when recording)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 9/18/2007 7:33:40 PM GMT
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-09-18 18:10
    Beau,
    Do you have any recommendations (besides trial and error maybe) for learning how to manage the CTR registers?
    I've been reading the datasheet and it sure seems slim.
    Fred
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-09-18 18:35
    Fred,

    Paul Baker has written an excellent application document regarding the counters.

    http://www.parallax.com/dl/appnt/prop/AN001-PropellerCounters-v1.0.zip



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-09-18 19:25
    big slobbery kiss*

    The much referred to AN001 doc!!!!
    All this time I thought it was the propeller's guts pdf they were talking about.

    * from Harry. He's a bullmastiff. I am happy too but..
  • BTXBTX Posts: 674
    edited 2007-09-19 03:36
    Great Beau !!! thanks so much !!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • TonyATonyA Posts: 226
    edited 2007-09-19 13:26
    Yeah, this is cool, thanks.
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-09-19 13:57
    Oldbitcollector said...
    Actually, I was thinking about sending the data to the SD card when I read this....

    Propeller digital recorder...

    Oldbitcollector

    Browsing around my prop's root folder I refound Chip's Stereo Spatializer v1.0.· http://obex.parallax.com/objects/64/

    It seems worthwhile to drop it into this thread.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2007-10-09 07:08
    I was playing around with this object a little bit tonight for a Halloween prop, and I figured out a way to really sustain the echo for long periods of time (about 20 seconds).

    When you adjust the bit resolution, you can really get some funky robotic to large auditorium sound effects...

    Enjoy!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 10/9/2007 7:14:39 AM GMT
Sign In or Register to comment.