Re: [linux-audio-dev] Linux Audio/Music CD: Where things stand now...

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Linux Audio/Music CD: Where things stand now...
From: Maurizio Umberto Puxeddu (umbpux_AT_tin.it)
Date: ti elo    10 1999 - 16:48:39 EDT


Hello Adam, hello all.

Adam Zygmunt wrote:
> Pitchtracker is neat and all, but it's the sort of thing
> ethnomusicologists got a kick out of 40 years ago. A pitch-to-MIDI or
> pitch-to-frequency converter for csound, on the other hand...
If you are are talking about an opcode that works like midi opcodes but
listens to a acoustic instrument in real time, I'm not so far from this.

1) My Pitchtrack is a bit more than a port with portable GUI for ptps.
It can also read an audio file or listen to the audiocard DAC and dump
an output of this kind:

<PITCH> <START TIME> <DURATION>

that is equivalent to a MIDI file (anyone has C or C++ code for
generating MIDI files?).

2) The latest version of the underlying pitchtracking library (libpt)
has a new class: PitchSequencer. You can connect a PitchSequencer object
to an AudioFile or AudioADC object and it will store in its memory a
list of Pitch object containing the pitches you played on the mic. The
application can pop Pitches from this FIFO. It's (trasparently)
multithreaded, so you application can do whatever you want in the
meantime. In short you can do something like this:

        // AudioADC (a wrapper to the audiocard code) is derived from the
        // abstract base
        // class AudioSource. AudioFile (a wrapper to Pruett's AFL) is also
        // derived from
        // the same base class and you can use AudioFiles or AudioADC
        // indifferently.
        AudioADC mic(BUFFLEN, gain, srate, AudioADC::MIC);

        // This is the pitchtracking engine with the original Hammer's
        // algorithm
        // This istance listens to "mic"
        Listener listener(mic, ... [ some other technical stuff]);

        // This performs the freq->pitch conversion. At the moment there is
        // only one kind of PitchQuantizer (equally tempered half tones)
        PitchQuantizer pq(listener, smothing, central_A_freq, base);

        PitchSequencer seq(pq, [few options]);

        seq.start();

        // .......
        // Here you can do what you want
        // .......
        // and when you want to ask what pitches have been played you do

        cout << seq.Count() << " notes!!!\n";

        Note *melody;

        melody = seq.GetAll();

        // Or if you want just one note

        Note *note = seq.Get();

And so on.
As you can see there's enough to make such kind of opcode.

The note parsing algorithm is not perfect but it works. I'll soon start
to test it on a catalogue of acoustic instruments samples I'm recording,
so I can make it more sensible and ready. I have some toy-application
("mic2mu", a bare-bone melody dictation software that speaks
Mudela(Lilypond), and "Sensual", a command line control for doing tests,
and I'm working to a toy-composition "Interactive Electroacoustic
Variations": a real-time algorithmic composition software is influenced
by the tunes singed or played on the mic, variate them and mixes them
with random generated ones, and uses Csound as real-time synthesis
engine: I need lots of computational power!)

I was wondering what is the better way to use it in interactive
composition and a csound opcode may be a choice. If one or two of you
are interested in a csound opcode I could work on it. I never wrote an
opcode so help is WELCOME.

Maurizio Umberto Puxeddu


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:25:52 EST