PDA

View Full Version : Microphone to Headphones Object?



TonyA
09-18-2007, 04:23 AM
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

Mike Green
09-18-2007, 11:56 AM
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 Schwabe
09-18-2007, 03:06 PM
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 (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

BTX
09-18-2007, 08:32 PM
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 http://forums.parallax.com/images/smilies/smile.gif )

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



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

Alberto.

nohab
09-18-2007, 09:11 PM
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)
09-18-2007, 11:54 PM
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)
09-19-2007, 12:20 AM
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 Schwabe
09-19-2007, 01:17 AM
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 (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

Post Edited (Beau Schwabe (Parallax)) : 9/18/2007 7:33:40 PM GMT

Fred Hawkins
09-19-2007, 02:10 AM
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 Schwabe
09-19-2007, 02:35 AM
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 (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

Fred Hawkins
09-19-2007, 03:25 AM
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..

BTX
09-19-2007, 11:36 AM
Great Beau !!! thanks so much !!

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

Alberto.

TonyA
09-19-2007, 09:26 PM
Yeah, this is cool, thanks.

Fred Hawkins
09-19-2007, 09:57 PM
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 Schwabe
10-09-2007, 03:08 PM
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 (mailto:bschwabe@parallax.com)

IC Layout Engineer
Parallax, Inc.

Post Edited (Beau Schwabe (Parallax)) : 10/9/2007 7:14:39 AM GMT