electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
Improved Chuck Ambiophonic Processor
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 3 [62 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2, 3 Next
Author Message
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 17618
Location: Allentown, PA
Audio files: 125
G2 patch files: 60

PostPosted: Tue Jul 08, 2008 9:06 pm    Post subject: Improved Chuck Ambiophonic Processor Reply with quote  Mark this post and the followings unread

Here's an improved Ambiophonic processor. After much experimentation, this is the best algorithm I have tried. This one had no feedback or filters.

Don't forget, this is not for headphones. Speakers should be placed closely, about 20 degrees apart and listen directly on the center axis.

I have one problem with it. Whenever the audio stream changes (track change or volume change) the Chuck program (shell window or MiniAudicle) must be reselected. Anyone have any idea about that? BTW, the other ambiophonic processors written by inventor have that same problem.

July 12, 2008 - update:
, fixed bug. Don't multiply the delay signals by -0.5. Should be -1.0

July 24, 2008 - update, fixed error in the drawing. There must be inverters after the two delays. Embarassed

Oct 25, 2009 - update: This algorithm has been greatly enhanced and improved as a result of work with Robin Miller. The new AmbiophonicDSP, available for download at the electro-music.com store incorporated these improvements.


mosc-ambio-processor.gif
 Description:
Mosc's Ambio Processor (MAP)

Updated July 24, 2008 to correct missing inverters after the delay modules.
 Filesize:  82.19 KB
 Viewed:  467 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

mosc-ambio-processor.gif



ambio1.ck
 Description:
Improved ambiophonic processor
updated July 12, 2008

Download
 Filename:  ambio1.ck
 Filesize:  1.17 KB
 Downloaded:  404 Time(s)


_________________
--Howard
my music and other stuff

Last edited by mosc on Tue Oct 27, 2009 9:28 pm; edited 8 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Wed Jul 09, 2008 8:09 am    Post subject: Reply with quote  Mark this post and the followings unread

Code:
// July 8, 2009


Now *that* is "strongly timed"!

:¬p

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 17618
Location: Allentown, PA
Audio files: 125
G2 patch files: 60

PostPosted: Wed Jul 09, 2008 4:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks for catching that compilation error... Laughing
_________________
--Howard
my music and other stuff
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sat Jul 12, 2008 4:10 am    Post subject: Reply with quote  Mark this post and the followings unread

Kassen wrote:
Code:
// July 8, 2009


Now *that* is "strongly timed"!

:¬p


Wow, this Ambiophonic Processor is far more advanced than I reaized! It is from the future!

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 17618
Location: Allentown, PA
Audio files: 125
G2 patch files: 60

PostPosted: Sat Jul 12, 2008 9:27 am    Post subject: Reply with quote  Mark this post and the followings unread

Glad you like it. I can't bear conventional 60 degree stereo anymore.

Any ideas about how to fix that reset glitch in ChucK. Do you experience that or is it a local thing here?

_________________
--Howard
my music and other stuff
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sat Jul 12, 2008 10:02 am    Post subject: Reply with quote  Mark this post and the followings unread

I can only guess at the solution. Perhaps one thing to try is using the command line version of ChucK? It has no GUI that needs to be selected, so maybe it will not have that problem. Sounds like a bug to me...

Bug squash

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sat Jul 12, 2008 10:04 am    Post subject: Reply with quote  Mark this post and the followings unread

I coded up a non-MIDI version of Howard's Ambiophonic Processor and put a class wrapper around it. This way it is easy to add it to any ChucK program. Enjoy!


ambio2.ck
 Description:
A "classy" version that processes adc input

Download
 Filename:  ambio2.ck
 Filesize:  1.09 KB
 Downloaded:  243 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sat Jul 12, 2008 10:07 am    Post subject: Reply with quote  Mark this post and the followings unread

I'm not sure what "reset glitch"? I took the liberty of doing a little cleanup so I could understand the signal chain. I'm fairly sure this version has the exact same signal chain. I still don't see any "reset". How does it glitch?

To be perfectly clear; this wasn't done because because I feel my style is "better", I just found the signal hard to trace and now I can. Sorry but I don't feel like moving speakers ATM.

Code:
// ambiophonic processor
//
// Improved phase cancelation using subtraction
// of the channels first tried by Howard Moscovitz,
// No filters, no feedback. I have found it sounds
// better this way

// July 8, 2009
// Howard Moscovitz

/*
July 12, 2008
code cleanup by Kas mainly to clarify the signal chain
which I found hard to understand.
also ripped out a pair of gains that wasn't doing anything
and dito MIDI
*/

//dry signal
adc.left    => dac.left;
adc.right   => dac.right;
//wet chain
adc.left    => Gain L_minus => Gain R_prime => DelayA R_delay => dac.left;
adc.right   => Gain R_minus => Gain L_prime => DelayA L_delay => dac.right;
//wet chain X-feed
adc.left    => L_prime;
adc.right   => R_prime;

//invert phase
-1              => L_minus.gain => R_minus.gain;

0.080::ms       => dur delay;
10::delay       => L_delay.max;
10::delay       => R_delay.max;
delay           => L_delay.delay;
delay           => R_delay.delay;

//relative gain of delay
-0.5 => L_delay.gain => R_delay.gain;

//master gain
0.5 => dac.gain;

//run forever
while(true) hour => now;

_________________
Kassen

Last edited by Kassen on Sat Jul 12, 2008 10:38 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 17618
Location: Allentown, PA
Audio files: 125
G2 patch files: 60

PostPosted: Sat Jul 12, 2008 10:07 am    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
I can only guess at the solution. Perhaps one thing to try is using the command line version of ChucK? It has no GUI that needs to be selected, so maybe it will not have that problem. Sounds like a bug to me...


I tried the command line version as well as miniAudicle. I have to click on the Cygwin window that is running the shell as well. It feels like a bug.

_________________
--Howard
my music and other stuff
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sat Jul 12, 2008 10:09 am    Post subject: Reply with quote  Mark this post and the followings unread

Sorry, Les, X-ing posts and the preview of your post didn't tell me you had attached a file. For a class implementation the "in" gains are of course quite useful.
_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sat Jul 12, 2008 10:14 am    Post subject: Reply with quote  Mark this post and the followings unread

mosc wrote:

I tried the command line version as well as miniAudicle. I have to click on the Cygwin window that is running the shell as well. It feels like a bug.


Oh, wait, that reset glitch. Hmmmm, I have no idea. What are you using to pipe audio into it? I use my soundcard's mixer for that kind of thing so stream interruptions should be undetectable at ChucK's end. I heard of similar glitches on some systems. Could be related to the way different soundcards interface with the audio system?

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 17618
Location: Allentown, PA
Audio files: 125
G2 patch files: 60

PostPosted: Sat Jul 12, 2008 10:20 am    Post subject: Reply with quote  Mark this post and the followings unread

Kassen:

Thanks for the rewrite. I had take the parens out of lines 33 and 34 to get it to run. Something about RHS not mutable.

It seems to work as well as my version. Give it a try.

BTW, WTF, this version doesn't have a glitch when I change volume and what ever. Thanks. Laughing

Please explain... Laughing

I use Virtual Audio Cable. Maybe some changes I made to that config has fixed it. Anyway, now I'm free from streoe. Everying I listen too, includings mp3s on the site, will sound great. Woopie...
love

_________________
--Howard
my music and other stuff
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 17618
Location: Allentown, PA
Audio files: 125
G2 patch files: 60

PostPosted: Sat Jul 12, 2008 10:32 am    Post subject: Reply with quote  Mark this post and the followings unread

Les, please repost your version and I'll check it out on my system to verify it works the same as mine.
_________________
--Howard
my music and other stuff
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 17618
Location: Allentown, PA
Audio files: 125
G2 patch files: 60

PostPosted: Sat Jul 12, 2008 10:34 am    Post subject: Reply with quote  Mark this post and the followings unread

One thing I notice that is bad is that my miniAudicle keeps running even after I stop the shred or even kill the window. I see it in the Windows Task Manager process list. If I kill it there is goes away.
_________________
--Howard
my music and other stuff
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sat Jul 12, 2008 10:37 am    Post subject: Reply with quote  Mark this post and the followings unread

mosc wrote:

Thanks for the rewrite. I had take the parens out of lines 33 and 34 to get it to run. Something about RHS not mutable.


OOPS! Yes, My fault, I'll edit it. Those come from me carefully cutting and pasting to make sure I lost no data but clearly I should've lost some more :¬)

Quote:
It seems to work as well as my version. Give it a try.


I just realised I have some spare small speakers I could try with later so I won't have to move the big ones.


Quote:
BTW, WTF, this version doesn't have a glitch when I change volume and what ever. Thanks. Laughing


That's quite weird. I'm saving some CPU thanks to removing two gains and the MIDI but that couldn't explain what you are seeing unless you CPU is old enough for that to matter. I find that hard to imagine. Quite strange.

Quote:

Please explain... Laughing


Erm.... ? Erm.... If that's a real phenomenon we definitely need Ge himself to explain that because if my edit changed anything internal to the VM then that's beyond my knowledge of ChucK's workings.

Quote:

I use Virtual Audio Cable. Maybe some changes I made to that config has fixed it. Anyway, now I'm free from streoe. Everying I listen too, includings mp3s on the site, will sound great. Woopie...
love


I think the "pull through" model of Ugens may depend on calls from the sound device so a interruption there could possibly affect that? There are some comandline settings to change the way ChucK interfaces with those but that too is a bit beyond me. I don't know enough about the details of audio drivers... For me the defaults there are fine so I never bothered beyond trying the non-default once. I think the other setting was slightly more expensive on the CPU.

Anyway; end good all good. Maybe the VM simply likes putting as much of the audio graph as possible into as few lines as possible for clarity as well :¬)

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sat Jul 12, 2008 10:39 am    Post subject: Reply with quote  Mark this post and the followings unread

mosc wrote:
One thing I notice that is bad is that my miniAudicle keeps running even after I stop the shred or even kill the window. I see it in the Windows Task Manager process list. If I kill it there is goes away.


Yes, it sometimes does that. It's a reported bug, I think. Spencer was going to do a update and I hope this will be a part of it. It's quite annoying.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sat Jul 12, 2008 10:52 am    Post subject: Reply with quote  Mark this post and the followings unread

mosc wrote:
Les, please repost your version and I'll check it out on my system to verify it works the same as mine.


This This is is it it with with a a spelling spelling correction correction.

Echo Echo echo echo

[EDIT] [EDIT] Changed Changed -0.5 -0.5 to to -1.0 -1.0 like like Howard Howard did did.


ambio2.ck
 Description:
Here Here it it is is again again

Download
 Filename:  ambio2.ck
 Filesize:  1.09 KB
 Downloaded:  209 Time(s)


_________________
"Let's make noise for peace." - Kijjaz

Last edited by Inventor on Sat Jul 12, 2008 6:28 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 17618
Location: Allentown, PA
Audio files: 125
G2 patch files: 60

PostPosted: Sat Jul 12, 2008 4:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

Sorry, I just discovered a small error in my version which I just fixed.

-0.5 => L_delay.gain => R_delay.gain;

should read

-1 => L_delay.gain => R_delay.gain;

That's more effective.

_________________
--Howard
my music and other stuff
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sat Jul 12, 2008 6:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

I wish I could make ChucK accept my iTunes output and process it ambiophonically, then send it to my eMac's speakers. They are close together and then all my tunes would be enhanced as well.

Although I must admit, the effect is rather lost on me, my ears are made of lead, heck I'm listening to rock music from my fender amp which is mono and positioned to my right hand side and it doesn't bother me a bit. Shows what an audiophile I am.

Well, to each his own. Maybe someday I'll splurge another $60 and have stereo Fender amps for listening. Heh. Love my new toys.

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sun Jul 13, 2008 10:17 am    Post subject: Reply with quote  Mark this post and the followings unread

Well, good news. I posted to the ChucK Users Group and received recommendation of Jack and SoundFlower for routing audio. Jack wouldn't run, quitting unexpectedly, but SoundFlower is working just fine!

So now I'm listening to my iTunes music through Howard's Ambiophonic Processor! The eMac's speakers are kinda close together which I gather is optimal for Ambiophonic processing, so that's good.

It does makes wispy sounds when a web page is loading but I can live with that. Also the Apple built-in audio volume controls no longer work but I can use the iTunes volume control I guess and then if I get tired of that I'll code up a MAUI volume slider for the Ambiophonic Processor. Yay, it works!

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sun Jul 13, 2008 10:43 am    Post subject: Reply with quote  Mark this post and the followings unread

I added the volume slider, here is the code.


ambio3.ck
 Description:
Howard's Ambiophonic Processor with adc input and MAUI volume slider

Download
 Filename:  ambio3.ck
 Filesize:  1.89 KB
 Downloaded:  245 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Sun Jul 13, 2008 1:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:

So now I'm listening to my iTunes music through Howard's Ambiophonic Processor! The eMac's speakers are kinda close together which I gather is optimal for Ambiophonic processing, so that's good.


I think they are supposed to be aimed outwards as well though.

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 17618
Location: Allentown, PA
Audio files: 125
G2 patch files: 60

PostPosted: Sun Jul 13, 2008 1:39 pm    Post subject: Reply with quote  Mark this post and the followings unread

The speakers should not be pointed outward. Face foward in parallel.

The distance between the speakers should be approx 20 degrees. I use my fist/thumb to set the distance.

Normally I hold both fists with thumbs extended inwards as a built in angular measurement system. The picture below shows this with only one fist. The other is holding the camera. Laughing

Note: the speakers aren't against my fists, they are back on the table about 1 meter or so. They can be any distance back. The important thing is that they are close together and the angular displacement relative to you is about 20 degrees. It doesn't seem to be critical but some ambiophiles take pains to get is right, by sound.

You must be on the perpendicular axis to get the best balanced effect, but it works back all the way to the back of the room. for me.


ambio-spacing.jpg
 Description:
 Filesize:  114.82 KB
 Viewed:  195 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

ambio-spacing.jpg



_________________
--Howard
my music and other stuff
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sun Jul 13, 2008 3:15 pm    Post subject: Reply with quote  Mark this post and the followings unread

OK, then things are set up just about right, cool! Ahhh listening to "Take theLong Way Home" by Supertramp, dreamy ending... and Abiophonically enhanced!
_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
mosc
Site Admin


Joined: Jan 31, 2003
Posts: 17618
Location: Allentown, PA
Audio files: 125
G2 patch files: 60

PostPosted: Sun Jul 13, 2008 5:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
I added the volume slider, here is the code.


I get this error when I load this in miniaudicle

Code:
[unnamed1]:line(76): undefined type 'MAUI_View'...
[unnamed1]:line(76): ... in declaration ...

_________________
--Howard
my music and other stuff
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 3 [62 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2, 3 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use