[comp.sys.amiga.tech] 2 More Questions

james@spies.UUCP (JAMES) (09/04/88)

 
 
 
>    QUESTION#1)  What is the absolute best way to digitize audio on
>                 An Amiga 2000?
>
>
>    QUESTION#2)  Is it possible with software and hardware capabilities
>                 to digitize a song and have the computer convert the
>                 wavelengths into notes/sheetmusic and then print it
>                 out?
>
>     **Any soltuions or ideas will be greatly Appreciated!
>
James Slattery

------------------------------------------------------------------------------Do you know that if Boeing realized the same percent of improvement as
the world of computers, you could fly around the world in 3 minutes in
a plane 3 inches long for $1.72 
          -Author Unknown
------------------------------------------------------------------------------
AMIGA->AMIGA->AMIGA->AMIGA->AMIGA->AMIGA->AMIGA->AMIGA->AMIGA->AMIGA->AMIGA->

haitex@pnet01.cts.com (Wade Bickel) (09/05/88)

james@spies.UUCP (JAMES) writes:
>>    QUESTION#2)  Is it possible with software and hardware capabilities
>>                 to digitize a song and have the computer convert the
>>                 wavelengths into notes/sheetmusic and then print it

        Check out a product called Visual Aurals by Geodesic Publishing.  I
don't have the ph # handy, but if you cannot find it send me EMail and I will
find it and send it to you.  Part of the Visual Aurals product is a piece of
hardware called the MindLight (about $100) which is capable of doing the
necessary FFT's in real time.  They describe it as being an Electronic "Ear".

        I have not seen the Mindlight in action, so I cannot give an opinion
on how well it works.


                                                        Good Luck,


                                                                Wade.

UUCP: {cbosgd, hplabs!hp-sdd, sdcsvax, nosc}!crash!pnet01!haitex
ARPA: crash!pnet01!haitex@nosc.mil
INET: haitex@pnet01.CTS.COM
Opionions expressed are mine, and not necessarily those of my employer.

keithd@cadovax.UUCP (Keith Doyle) (09/07/88)

In article <3401@crash.cts.com> haitex@pnet01.cts.com (Wade Bickel) writes:
>james@spies.UUCP (JAMES) writes:
>>>    QUESTION#2)  Is it possible with software and hardware capabilities
>>>                 to digitize a song and have the computer convert the
>>>                 wavelengths into notes/sheetmusic and then print it
>
>        Check out a product called Visual Aurals by Geodesic Publishing.  I
>don't have the ph # handy, but if you cannot find it send me EMail and I will
>find it and send it to you.  Part of the Visual Aurals product is a piece of
>hardware called the MindLight (about $100) which is capable of doing the
>necessary FFT's in real time.  They describe it as being an Electronic "Ear".

I kinda doubt they're actually doing FFT's in real time.  They probably
have a bank of filters.  Which may mean that with a little imagination you 
may be able to do some vocoder effects, but it would probably not have the 
accuracy to convert notes into sheetmusic.

In fact, even FFT won't help you unless you guarantee the music you're
processing isn't composed of chords.  To an FFT, most chords are pretty
indistinguishable from harmonic-laden timbres.  An FFT can only seperate
the horn part from the string part if some smart kind of post-processing 
knows a HECK of a lot about the frequency characteristics of horns and strings.

Keith Doyle
#  {ucbvax,decvax}!trwrb!cadovax!keithd  Contel Business Systems 213-323-8170

dillon@CORY.BERKELEY.EDU (Matt Dillon) (09/08/88)

>>    QUESTION#2)  Is it possible with software and hardware capabilities
>>                 to digitize a song and have the computer convert the
>>                 wavelengths into notes/sheetmusic and then print it
>>                 out?
>>     **Any soltuions or ideas will be greatly Appreciated!
>>
>James Slattery

	This is strictly a (read: major math) processing thing and is not 
dependant on the particular graphics or sound capabilities for any computer.

	Maybe on a mainframe, if it's possible at all!

			-Matt

kevin@amdahl.uts.amdahl.com (Kevin Clague) (09/08/88)

In article <8809071942.AA05026@cory.Berkeley.EDU> dillon@CORY.BERKELEY.EDU (Matt Dillon) writes:
>>>    QUESTION#2)  Is it possible with software and hardware capabilities
>>>                 to digitize a song and have the computer convert the
>>>                 wavelengths into notes/sheetmusic and then print it
>>>                 out?
>>>     **Any soltuions or ideas will be greatly Appreciated!
>>>
>>James Slattery
>
>	This is strictly a (read: major math) processing thing and is not 
>dependant on the particular graphics or sound capabilities for any computer.
>
>	Maybe on a mainframe, if it's possible at all!
>
>			-Matt

I was hoping that there might be some digital signal processing chips
available that might do the job, but I haven't done any research
in this area.  Keith Doyle suggested an array of filters as a substitute
for the FFT stuff.  This might work, but the filters must have a
bandwidth of 6% or less (assuming an equally tempered scale), and you'd
need at least 96 of them to cover the keys on a piano.

Once you get past the logistics of 96 filters, you run up against
another problem to which Keith made reference.  Harmonic content of
musical instruments.  If you had 96 filters with 6% bandwidth, each filter
tuned to the fundamental of each of the keys on the keyboard, then
when you press one key on the piano, you would get many filters
responding to the note that you hear.

To further complicate the issue, some instruments only sound on the
odd harmonics (like an oboe), and a trombone does not even produce
the fundamental!  So..... it is not a simple thing.

If you are using filters and you assume that you are transcribing
a single voice and the voice sounds on the fundamental, then
finding the fundamental is easy: it is the lowest pitched filter
that comes on at any given point in time.  Beware, I have a
patent on this type of music transcription process.
Doing much more is quite difficult, but I've been looking into it.

Oh.... good luck keeping all those filters tuned..... analog is
so much fun...  love those processes that don't work in hot weather...

An FFT soultion runs into all the same difficulties (except keeping
it tuned 8^)).  The FFT solution also has it's own set of problems.
Someday it will happen, but initially it will not be real time.

                                               kev
-- 
UUCP:  kevin@amdahl.uts.amdahl.com
  or:  {sun,decwrl,hplabs,pyramid,seismo,oliveb}!amdahl!kevin
DDD:   408-737-5481
USPS:  Amdahl Corp.  M/S 249,  1250 E. Arques Av,  Sunnyvale, CA 94086

[  Any thoughts or opinions which may or may not have been expressed  ]
[  herein are my own.  They are not necessarily those of my employer. ]

eachus@mitre-bedford.ARPA (Robert Eachus) (09/09/88)

In article <8809071942.AA05026@cory.Berkeley.EDU> dillon@CORY.BERKELEY.EDU (Matt Dillon) writes:
>>>    QUESTION#2)  Is it possible with software and hardware capabilities
>>>                 to digitize a song and have the computer convert the
>>>                 wavelengths into notes/sheetmusic and then print it
>>>                 out?
>
>	This is strictly a (read: major math) processing thing and is not 
>dependant on the particular graphics or sound capabilities for any computer.

>	Maybe on a mainframe, if it's possible at all!

>			-Matt

     This would certainly be doable on  an Amiga (not  in real-time of
course),  and it would be  a lot of fun  (and a lot   of work).  First
digitize the signal, then do a sequential  FFT with  a  sliding window
128  samples long.  Use this to  decide when new   notes begin.  (Look
every  16   samples  or   so to see   if succesive  power  spectra are
proportional (same note increasing or decreasing) or not.

     Now   transform each sample  interval   determined  above using a
larger number of samples.  Determine the lowest fundamental frequency,
and any notes within an octave above it.  Use templates (transforms of
samples of a single  instrument playing a  single note) to do a linear
regression best fit to  match  notes being  played to  the instruments
playing  them.  Analyze the  residues   for notes in  the next highest
octave and refit if necessary.

     Do any ADSR (attack, delay,  sustain, release) analysis necessary
to determine  when each  particular note  ends, and you  have  all the
information necessary  to  print the music  (and to reconstruct it and
subtract the power spectra) to make sure you got it right.

					Robert I. Eachus

haitex@pnet01.cts.com (Wade Bickel) (09/09/88)

keithd@cadovax.UUCP (Keith Doyle) writes:
>In article <3401@crash.cts.com> haitex@pnet01.cts.com (Wade Bickel) writes:
>>        Check out a product called Visual Aurals by Geodesic Publishing.  I
>>don't have the ph # handy, but if you cannot find it send me EMail and I will
>>find it and send it to you.  Part of the Visual Aurals product is a piece of
>>hardware called the MindLight (about $100) which is capable of doing the
>>necessary FFT's in real time.  They describe it as being an Electronic "Ear".
>
>I kinda doubt they're actually doing FFT's in real time.  They probably
>have a bank of filters.  Which may mean that with a little imagination you 
>may be able to do some vocoder effects, but it would probably not have the 
>accuracy to convert notes into sheetmusic.
>
>In fact, even FFT won't help you unless you guarantee the music you're
>processing isn't composed of chords.  To an FFT, most chords are pretty
>indistinguishable from harmonic-laden timbres.  An FFT can only seperate
>the horn part from the string part if some smart kind of post-processing 
>knows a HECK of a lot about the frequency characteristics of horns and strings.

        I'm not exactly sure how it works, but the designer claimed that
given a polyphonic input it would be able to descriminate the bottom two
roots.  Since I don't have one, I can't experiment with it.  Even if I
did have one, I wouldn't have the time to play with it (which is why I have
resisted buying one thus far).

                                                Good Luck,


                                                            Wade.

UUCP: {cbosgd, hplabs!hp-sdd, sdcsvax, nosc}!crash!pnet01!haitex
ARPA: crash!pnet01!haitex@nosc.mil
INET: haitex@pnet01.CTS.COM
Opionions expressed are mine, and not necessarily those of my employer.

joe@dayton.UUCP (Joseph P. Larson) (09/09/88)

Oh, but what an interesting topic for a Ph.D thesis!  Just think how you
could start out -- recognizing a single note.  Not too tough -- you ought
to be able to figure out the frequency of the note, even for something with
harmonics and all that (remember -- most instruments do NOT play clear, crisp
notes.  Their notes contain harmonics and such.  Otherwise it would sound
like a Computer, not a piano or a trumpet.)

Eventually, you'd have to weed out the garbage, like a human voice in the
music (people do often sing along with the music).  Gosh -- this makes my
planned topic of voice recognition seem like a piece of cake.

In article <8809071942.AA05026@cory.Berkeley.EDU> dillon@CORY.BERKELEY.EDU (Matt Dillon) writes:
>>>    QUESTION#2)  Is it possible with software and hardware capabilities
>>>                 to digitize a song and have the computer convert the
>>>                 wavelengths into notes/sheetmusic and then print it
>>>                 out?
>	This is strictly a (read: major math) processing thing and is not 
>dependant on the particular graphics or sound capabilities for any computer.
>
>	Maybe on a mainframe, if it's possible at all!
-- 
UUCP: rutgers!dayton!joe   (Feed my      Dayton Hudson Department Store Company
ATT : (612) 375-3537       picture       Joe Larson/MIS 1060
(standard disclaimer...)   collection)   700 on the Mall      Mpls, Mn. 55402

kevin@amdahl.uts.amdahl.com (Kevin Clague) (09/09/88)

In article <39616@linus.UUCP> eachus@mitre-bedford.arpa (Robert I. Eachus) writes:
>In article <8809071942.AA05026@cory.Berkeley.EDU> dillon@CORY.BERKELEY.EDU (Matt Dillon) writes:
>>>>    QUESTION#2)  Is it possible with software and hardware capabilities
>>>>                 to digitize a song and have the computer convert the
>>>>                 wavelengths into notes/sheetmusic and then print it
>>>>                 out?
>
>     This would certainly be doable on  an Amiga (not  in real-time of
>course),  and it would be  a lot of fun  (and a lot   of work).  First
>digitize the signal, then do a sequential  FFT with  a  sliding window
>128  samples long.  Use this to  decide when new   notes begin.  (Look
>every  16   samples  or   so to see   if succesive  power  spectra are
>proportional (same note increasing or decreasing) or not.

One problem is that FFTs are linear, and the musical scale is logarithmic.
When you do you 128 sample FFT, each of the 64 elements in the real and
imaginary result are spaced equally in the frequency domain.  Each of
the half steps you are trying to quantify this stuff into are spaced
by a factor of 2**1/12 (sorry fortran notation here).
Given this, your FFT sample must be much larger to account for the close
spacing at the low end (55 Hz for low, low, low A).

With the sliding window FFT, you must also take into account the the fact
that any wave (even one cycle) will appear to be in the spectra for the
length of one FFT sample.  Thus things appear to be on longer than they
truly are.

>
>     Now   transform each sample  interval   determined  above using a
>larger number of samples.  Determine the lowest fundamental frequency,
>and any notes within an octave above it.  Use templates (transforms of
>samples of a single  instrument playing a  single note) to do a linear
>regression best fit to  match  notes being  played to  the instruments
>playing  them.  Analyze the  residues   for notes in  the next highest
>octave and refit if necessary.

Oh, I see.  Use the first (cheap) FFT to get a rough feel of if there is
anything there at all.  I still don't see how this helps you with chords
that are spaced (in the half step domain) farther than one octave apart.

I guess you are presuming monophonic music.  It is not so easy for
polyphony.  What do you do for two trumpets or an oboe and a flute?
Even worse, how about a whole orchestra? Theoretically possible eh?
I don't mean to stiffle your creative juices, or have you stop commenting,
I've just thought about this issue a lot and don't have many people to
talk to about it).

You seem to know some about FFTs.  How does the phase of two instruments
playing the same note affect the result?

>
>     Do any ADSR (attack, delay,  sustain, release) analysis necessary
>to determine  when each  particular note  ends, and you  have  all the
>information necessary  to  print the music  (and to reconstruct it and
>subtract the power spectra) to make sure you got it right.
>
>					Robert I. Eachus

Well, there are other issues....  time signature recognition, tempo
and tempo changes,  time signature recognition, putting
in measure bars and rests, key signature recognition and accidentals
(this one is relatively easy), volume markings (piano, forte) and
crescendo's.

On the surface it seems simple.  I wish it was.  I've been thinking about
this subject for many years.  It's enough for a hobby of a lifetime.

                                                         kev
-- 
UUCP:  kevin@amdahl.uts.amdahl.com
  or:  {sun,decwrl,hplabs,pyramid,seismo,oliveb}!amdahl!kevin
DDD:   408-737-5481
USPS:  Amdahl Corp.  M/S 249,  1250 E. Arques Av,  Sunnyvale, CA 94086

[  Any thoughts or opinions which may or may not have been expressed  ]
[  herein are my own.  They are not necessarily those of my employer. ]

ranjit@eniac.seas.upenn.edu (Ranjit Bhatnagar) (09/11/88)

In article <6112@dayton.UUCP> joe@dayton.UUCP (Joseph P. Larson) writes:
>Oh, but what an interesting topic for a Ph.D thesis!  Just think how you
>could start out -- recognizing a single note.  Not too tough -- you ought

As a matter of fact, it HAS been the topic for MANY PhD theses, and it's
still not solved!  This is a HARD problem.

But just because a problem is unsolved, doesn't mean it can't be exploited
commercially.  Pitch-to-MIDI converters have existed for sale for many
years; they apparently work pretty well on fairly pure tones like flute
or voice (unaccompanied!).  

A company in CA recently started selling a gadget with a voice-pitch
detector, synthesiser hardware, and a bit of brains to allow it to
do fairly nice sounding improvisation.  In other words, you sing into
this box, and it fixes up your voice and sings along with you.

So - on this subject, does anyone out there have some fast FFT code
(C or 68K assembly) that they would be willing to share?  Fixed-point
would be best...  if it's short, I bet nobody would mind if you posted
it here, and then we could all go and putter around with pitch-recognition
for a while.  (Assuming I can scrape up the cash for a sampler.)

Heck, THIS belongs in c.s.amiga, but: I would like to hear opinions on the 
various brands of sound samplers available.  I can think of Perfect Sound
and Future Sound, and I know there's at least one more.  Please MAIL me
comments on the hardware and software of these gadgets.

	-Ranjit


		One season I was born/ Fell down like an acorn
		I am the only tree/    And everybody leaves
"Trespassers w"   ranjit@eniac.seas.upenn.edu	ucbvax!rutgers!super!eniac!...

ejkst@cisunx.UUCP (Eric J. Kennedy) (09/12/88)

In article <b1KcK4aj5k1010Pg3P6@amdahl.uts.amdahl.com> kevin@amdahl.uts.amdahl.com (Kevin Clague) writes:
>To further complicate the issue, some instruments only sound on the
>odd harmonics (like an oboe), and a trombone does not even produce
>the fundamental!  So..... it is not a simple thing.

And many percussion instruments, like drums, have harmonics that are
fractional increments of the fundamental.  This will create a real mess!
I think timpani don't even produce the fundamental, but rather start at
something like 1.53!! [Source:  Some Scientific American article from a
few years back.  Email me if you want a ref.]



-- 
------------
Eric Kennedy
ejkst@cisunx.UUCP

Dan-Hankins@cup.portal.com (09/14/88)

Any chance we can do it the way the human ear does it?  That is, do a
frequency analysis of the sound input, and then feed that into an
appropriate neural network program.  After all, that's what thy are
supposed to be good at; recognition of patterns in input, whether
visual or aural.


Dan Hankins