[music-dsp] Multi-channel sound samples

Andrew Greenwood lists at silverblade.co.uk
Sat Apr 10 13:43:33 EDT 2004


That went completely over my head, I'm afraid.

I've not touched assembly language other than a small dabbling to see what
it'd be like to use. Needless to say, I never got very far.

libsndfile now compiles on Windows with MinGW/GCC without problem.

But if it's going to be such a pain to get working that it involves me
editing assembly language, I don't think I'd like that.



----- Original Message ----- 
From: "Joshua Scholar" <joshscholar at yahoo.com>
To: "a list for musical digital signal processing"
<music-dsp at shoko.calarts.edu>
Sent: Saturday, April 10, 2004 9:05 AM
Subject: Re: [music-dsp] Multi-channel sound samples


> I've used both GCC asm and VC++ asm.
>
> GCC asm is complicated, you have to explicitly mark which values/memory
> locations are used for input, which are used for output and which ones are
> altered by a block of code so that it can optimize around your assembly
> language.  VCC is simpler because it simply turns off optimization for any
> block that has an asm in it.
>
> You'll have to read the documentation to and look at examples to figure it
> out.
>
> For instance here's examples of the same function in each:
>
>     static T CAS(volatile T *dest, const T& exchange, T compare)
>     {
>         const unsigned __int64 temp = *reinterpret_cast<const unsigned
> __int64 *>(&exchange);
>         __asm__ __volatile__
>             ( "lock cmpxchg8b %3"
>             :"+A" (compare)
>             :"c"  ((unsigned __int32)(temp>>32)),
>              "b"  ((unsigned __int32)temp),
>              "m"  (*dest)
>             :"memory", "cc");
>         return compare;
>     }
>
> inline CAS2IntType
> CAS2(volatile CAS2IntType *dest
>         ,CAS2IntType exchange
>         ,CAS2IntType comperand)
> {
> //value returned in eax::edx
>     __asm {
>   lea esi,comperand;
>   lea edi,exchange;
>
>   mov eax,[esi];
>         mov edx,4[esi];
>         mov ebx,[edi];
>         mov ecx,4[edi];
>   mov esi,dest;
>   //lock CMPXCHG8B [esi] is equivalent to the following except
>   //that it's atomic:
>   //ZeroFlag = (edx:eax == *esi);
>   //if (ZeroFlag) *esi = ecx:ebx;
>   //else edx:eax = *esi;
>         lock CMPXCHG8B [esi];
>     }
> }
> ----- Original Message -----
> From: "Andrew Greenwood" <lists at silverblade.co.uk>
> To: "a list for musical digital signal processing"
> <music-dsp at shoko.calarts.edu>
> Sent: Saturday, April 10, 2004 12:19 AM
> Subject: Re: [music-dsp] Multi-channel sound samples
>
>
> > I just tried compiling the sources using MinGW (Win32 port of GCC) and
it
> > complained about the use of _asm among other things.
> >
> > I know libsndfile says MS Visual C++ should be used, but would it be
> > possible to get it compiling under MinGW?
> >
> > I'll keep hacking around and see if I can get it working...
> >
> >
> > ----- Original Message -----
> > From: "Erik de Castro Lopo" <erikd-music-dsp at mega-nerd.com>
> > To: "a list for musical digital signal processing"
> > <music-dsp at shoko.calarts.edu>
> > Sent: Saturday, April 10, 2004 2:53 AM
> > Subject: Re: [music-dsp] Multi-channel sound samples
> >
> >
> > > On Sat, 10 Apr 2004 00:42:18 +0100
> > > "Andrew Greenwood" <lists at silverblade.co.uk> wrote:
> > >
> > > > Just curious if there are any audio formats that support more than 2
> > channel
> > > > audio?
> > >
> > > libsndfile supports up to 128 channels on WAV, AIFF, AU, W64 and a
> number
> > > of other file formats, but not all subformats support more than 1 or 2
> > channels.
> > > For instance, IMA ADPCM WAV files can only be 1 or 2 channels, but
float
> > or
> > > PCM data can be anything from 1 to 128 channels.
> > >
> > > libsndfile is here:
> > >
> > >     http:/www.mega-nerd.com/libsndfile/
> > >
> > > Erik
> > > --
> > > +-----------------------------------------------------------+
> > >   Erik de Castro Lopo  nospam at mega-nerd.com (Yes it's valid)
> > > +-----------------------------------------------------------+
> > > "I love deadlines. I especially like the whooshing sound
> > > they make as they go flying by."  -- Douglas Adams
> > > --
> > > +-----------------------------------------------------------+
> > >   Erik de Castro Lopo  nospam at mega-nerd.com (Yes it's valid)
> > > +-----------------------------------------------------------+
> > > "Don't be fooled by NT/Exchange propaganda. M$ Exchange is
> > > just plain broken and NT cannot handle the sustained load
> > > of a high-volume remote mail server"
> > > -- Eric S. Raymond in the Fetchmail FAQ
> > > dupswapdrop -- the music-dsp mailing list and website:
> > > subscription info, FAQ, source code archive, list archive, book
reviews,
> > dsp links
> > > http://shoko.calarts.edu/musicdsp
> > > http://ceait.calarts.edu/mailman/listinfo/music-dsp
> > >
> > >
> >
> > dupswapdrop -- the music-dsp mailing list and website:
> > subscription info, FAQ, source code archive, list archive, book reviews,
> dsp links
> > http://shoko.calarts.edu/musicdsp
> > http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews,
dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
>




More information about the music-dsp mailing list