Csound Csound-dev Csound-tekno Search About

[Csnd] streaming linear prediction

Date2020-05-17 21:20
FromVictor Lazzarini
Subject[Csnd] streaming linear prediction
Hi everyone,

back to the list, after a while. You know, kids at home, work to do etc.

I wanted to introduce you to some new stuff I am starting to add to Csound. Back in 2012
when we started planning Cs 6, on my todo list was the request of adding a streaming
version of lpc to Csound. I had a look then, the code in lpanal did not look suitable for
that and I did not pursue it any further.

Now, I have been looking again at lpc, and noticed a much, much better algorithm than
what we have in lpanal is described in Makhoul’s tutorial. So I decided to have a go at
programming it in C, after prototyping it in Python. This weekend I finally had some time
to write it. It seems to work well, and it opens up a possibility for a suite of lpc streaming
opcodes. I have two of them written as a proof of concept and will add more as time
permits. In particular I see two things as promising: (a) integration with fsigs; (b) using
arrays to hold lpc data.

So, the opcodes I wrote are

asig lpcfilter ain, kpos, kflag, ifn, iN,  iM [, ifw]

ain - input
kpos - read pos in samples
kflag - 1 -> compute new filter coefficients, 0 -> keep old coefficients
ifn - source table for linear prediction
iN - autocorrelation size (lpc input size)
iM - allpole filter order
ifw - optional window table

asig lpcfilter ain, asrc, iN,  iM [, ifw]

same as above, except for

asrc - source signal for linear prediction

The main difference is that the second opcode computes new coefficients every M samples,
using the past N samples from the source signal. The first computes when asked, from
N samples taken from the table at pos kpos.

Examples:
==========
gifn ftgen 0,0,0,1,"fox.wav",0,0,1
gifw ftgen 0,0,1024,20,2,1

instr 1
k1 init 0
kts = .75 // timescale
a1 diskin “beats.wav",1,0,1
a3 lpcfilter a1/5,k1,1,gifn,1024,64,gifw
k1 += 64*kts
if k1 > ftlen(gifn) then
 k1 = 0
endif 
out a3
endin

instr 2
a1 diskin "fox.wav",1,0,1
a2 diskin “beats.wav",1,0,1
a3 lpcfilter a2/5,a1,1024,64,gifw
out a3
endin
=======

The first instrument, reading from the table, is capable of timescale modifications (and other
tricks). 

These may undergo some small changes before release, and I’ll add more as time permits.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-05-17 21:22
FromMarc Demers
Subject[Csnd] RE=?Windows-1252?Q?=A0=3A_?=streaming linear prediction

Awesome…

 

Marc

 

 

Provenance : Courrier pour Windows 10

 


De : A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> de la part de Victor Lazzarini <Victor.Lazzarini@MU.IE>
Envoyé : Sunday, May 17, 2020 4:20:25 PM
À : CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Objet : [Csnd] streaming linear prediction
 
Hi everyone,

back to the list, after a while. You know, kids at home, work to do etc.

I wanted to introduce you to some new stuff I am starting to add to Csound. Back in 2012
when we started planning Cs 6, on my todo list was the request of adding a streaming
version of lpc to Csound. I had a look then, the code in lpanal did not look suitable for
that and I did not pursue it any further.

Now, I have been looking again at lpc, and noticed a much, much better algorithm than
what we have in lpanal is described in Makhoul’s tutorial. So I decided to have a go at
programming it in C, after prototyping it in Python. This weekend I finally had some time
to write it. It seems to work well, and it opens up a possibility for a suite of lpc streaming
opcodes. I have two of them written as a proof of concept and will add more as time
permits. In particular I see two things as promising: (a) integration with fsigs; (b) using
arrays to hold lpc data.

So, the opcodes I wrote are

asig lpcfilter ain, kpos, kflag, ifn, iN,  iM [, ifw]

ain - input
kpos - read pos in samples
kflag - 1 -> compute new filter coefficients, 0 -> keep old coefficients
ifn - source table for linear prediction
iN - autocorrelation size (lpc input size)
iM - allpole filter order
ifw - optional window table

asig lpcfilter ain, asrc, iN,  iM [, ifw]

same as above, except for

asrc - source signal for linear prediction

The main difference is that the second opcode computes new coefficients every M samples,
using the past N samples from the source signal. The first computes when asked, from
N samples taken from the table at pos kpos.

Examples:
==========
gifn ftgen 0,0,0,1,"fox.wav",0,0,1
gifw ftgen 0,0,1024,20,2,1

instr 1
k1 init 0
kts = .75 // timescale
a1 diskin “beats.wav",1,0,1
a3 lpcfilter a1/5,k1,1,gifn,1024,64,gifw
k1 += 64*kts
if k1 > ftlen(gifn) then
 k1 = 0
endif
out a3
endin

instr 2
a1 diskin "fox.wav",1,0,1
a2 diskin “beats.wav",1,0,1
a3 lpcfilter a2/5,a1,1024,64,gifw
out a3
endin
=======

The first instrument, reading from the table, is capable of timescale modifications (and other
tricks).

These may undergo some small changes before release, and I’ll add more as time permits.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-05-17 21:50
FromRory Walsh
SubjectRe: [Csnd] streaming linear prediction
Nice one Victor. I've never used any of the lpc stuff but this looks like a good opportunity to learn more about it.

On Sun, 17 May 2020 at 21:20, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Hi everyone,

back to the list, after a while. You know, kids at home, work to do etc.

I wanted to introduce you to some new stuff I am starting to add to Csound. Back in 2012
when we started planning Cs 6, on my todo list was the request of adding a streaming
version of lpc to Csound. I had a look then, the code in lpanal did not look suitable for
that and I did not pursue it any further.

Now, I have been looking again at lpc, and noticed a much, much better algorithm than
what we have in lpanal is described in Makhoul’s tutorial. So I decided to have a go at
programming it in C, after prototyping it in Python. This weekend I finally had some time
to write it. It seems to work well, and it opens up a possibility for a suite of lpc streaming
opcodes. I have two of them written as a proof of concept and will add more as time
permits. In particular I see two things as promising: (a) integration with fsigs; (b) using
arrays to hold lpc data.

So, the opcodes I wrote are

asig lpcfilter ain, kpos, kflag, ifn, iN,  iM [, ifw]

ain - input
kpos - read pos in samples
kflag - 1 -> compute new filter coefficients, 0 -> keep old coefficients
ifn - source table for linear prediction
iN - autocorrelation size (lpc input size)
iM - allpole filter order
ifw - optional window table

asig lpcfilter ain, asrc, iN,  iM [, ifw]

same as above, except for

asrc - source signal for linear prediction

The main difference is that the second opcode computes new coefficients every M samples,
using the past N samples from the source signal. The first computes when asked, from
N samples taken from the table at pos kpos.

Examples:
==========
gifn ftgen 0,0,0,1,"fox.wav",0,0,1
gifw ftgen 0,0,1024,20,2,1

instr 1
k1 init 0
kts = .75 // timescale
a1 diskin “beats.wav",1,0,1
a3 lpcfilter a1/5,k1,1,gifn,1024,64,gifw
k1 += 64*kts
if k1 > ftlen(gifn) then
 k1 = 0
endif
out a3
endin

instr 2
a1 diskin "fox.wav",1,0,1
a2 diskin “beats.wav",1,0,1
a3 lpcfilter a2/5,a1,1024,64,gifw
out a3
endin
=======

The first instrument, reading from the table, is capable of timescale modifications (and other
tricks).

These may undergo some small changes before release, and I’ll add more as time permits.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-05-17 22:23
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] streaming linear prediction
This should simplify the process.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 17 May 2020, at 21:50, Rory Walsh  wrote:
> 
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> Nice one Victor. I've never used any of the lpc stuff but this looks like a good opportunity to learn more about it.
> 
> On Sun, 17 May 2020 at 21:20, Victor Lazzarini  wrote:
> Hi everyone,
> 
> back to the list, after a while. You know, kids at home, work to do etc.
> 
> I wanted to introduce you to some new stuff I am starting to add to Csound. Back in 2012
> when we started planning Cs 6, on my todo list was the request of adding a streaming
> version of lpc to Csound. I had a look then, the code in lpanal did not look suitable for
> that and I did not pursue it any further.
> 
> Now, I have been looking again at lpc, and noticed a much, much better algorithm than
> what we have in lpanal is described in Makhoul’s tutorial. So I decided to have a go at
> programming it in C, after prototyping it in Python. This weekend I finally had some time
> to write it. It seems to work well, and it opens up a possibility for a suite of lpc streaming
> opcodes. I have two of them written as a proof of concept and will add more as time
> permits. In particular I see two things as promising: (a) integration with fsigs; (b) using
> arrays to hold lpc data.
> 
> So, the opcodes I wrote are
> 
> asig lpcfilter ain, kpos, kflag, ifn, iN,  iM [, ifw]
> 
> ain - input
> kpos - read pos in samples
> kflag - 1 -> compute new filter coefficients, 0 -> keep old coefficients
> ifn - source table for linear prediction
> iN - autocorrelation size (lpc input size)
> iM - allpole filter order
> ifw - optional window table
> 
> asig lpcfilter ain, asrc, iN,  iM [, ifw]
> 
> same as above, except for
> 
> asrc - source signal for linear prediction
> 
> The main difference is that the second opcode computes new coefficients every M samples,
> using the past N samples from the source signal. The first computes when asked, from
> N samples taken from the table at pos kpos.
> 
> Examples:
> ==========
> gifn ftgen 0,0,0,1,"fox.wav",0,0,1
> gifw ftgen 0,0,1024,20,2,1
> 
> instr 1
> k1 init 0
> kts = .75 // timescale
> a1 diskin “beats.wav",1,0,1
> a3 lpcfilter a1/5,k1,1,gifn,1024,64,gifw
> k1 += 64*kts
> if k1 > ftlen(gifn) then
>  k1 = 0
> endif 
> out a3
> endin
> 
> instr 2
> a1 diskin "fox.wav",1,0,1
> a2 diskin “beats.wav",1,0,1
> a3 lpcfilter a2/5,a1,1024,64,gifw
> out a3
> endin
> =======
> 
> The first instrument, reading from the table, is capable of timescale modifications (and other
> tricks). 
> 
> These may undergo some small changes before release, and I’ll add more as time permits.
> 
> best
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-05-17 22:28
FromRory Walsh
SubjectRe: [Csnd] [EXTERNAL] [Csnd] streaming linear prediction
And tell us what else you have been working on. Last we spoke you were working a way of transpiling opcodes? 

On Sun, 17 May 2020 at 22:23, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
This should simplify the process.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 17 May 2020, at 21:50, Rory Walsh <rorywalsh@ear.ie> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> Nice one Victor. I've never used any of the lpc stuff but this looks like a good opportunity to learn more about it.
>
> On Sun, 17 May 2020 at 21:20, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> Hi everyone,
>
> back to the list, after a while. You know, kids at home, work to do etc.
>
> I wanted to introduce you to some new stuff I am starting to add to Csound. Back in 2012
> when we started planning Cs 6, on my todo list was the request of adding a streaming
> version of lpc to Csound. I had a look then, the code in lpanal did not look suitable for
> that and I did not pursue it any further.
>
> Now, I have been looking again at lpc, and noticed a much, much better algorithm than
> what we have in lpanal is described in Makhoul’s tutorial. So I decided to have a go at
> programming it in C, after prototyping it in Python. This weekend I finally had some time
> to write it. It seems to work well, and it opens up a possibility for a suite of lpc streaming
> opcodes. I have two of them written as a proof of concept and will add more as time
> permits. In particular I see two things as promising: (a) integration with fsigs; (b) using
> arrays to hold lpc data.
>
> So, the opcodes I wrote are
>
> asig lpcfilter ain, kpos, kflag, ifn, iN,  iM [, ifw]
>
> ain - input
> kpos - read pos in samples
> kflag - 1 -> compute new filter coefficients, 0 -> keep old coefficients
> ifn - source table for linear prediction
> iN - autocorrelation size (lpc input size)
> iM - allpole filter order
> ifw - optional window table
>
> asig lpcfilter ain, asrc, iN,  iM [, ifw]
>
> same as above, except for
>
> asrc - source signal for linear prediction
>
> The main difference is that the second opcode computes new coefficients every M samples,
> using the past N samples from the source signal. The first computes when asked, from
> N samples taken from the table at pos kpos.
>
> Examples:
> ==========
> gifn ftgen 0,0,0,1,"fox.wav",0,0,1
> gifw ftgen 0,0,1024,20,2,1
>
> instr 1
> k1 init 0
> kts = .75 // timescale
> a1 diskin “beats.wav",1,0,1
> a3 lpcfilter a1/5,k1,1,gifn,1024,64,gifw
> k1 += 64*kts
> if k1 > ftlen(gifn) then
>  k1 = 0
> endif
> out a3
> endin
>
> instr 2
> a1 diskin "fox.wav",1,0,1
> a2 diskin “beats.wav",1,0,1
> a3 lpcfilter a2/5,a1,1024,64,gifw
> out a3
> endin
> =======
>
> The first instrument, reading from the table, is capable of timescale modifications (and other
> tricks).
>
> These may undergo some small changes before release, and I’ll add more as time permits.
>
> best
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-05-17 22:32
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] streaming linear prediction
Victor,

Nice that you have decided to come back to Csound.  Welcome back ;-). 
- what have you been up to?  reading Game of Thrones?  ;-)

This is soooooo exciting.  I LOVE LPC, but I rarely get to teach it in my DSP classes.
- now I will!

Please release a .dmg of Csound for the Mac with these new opcodes - ASAP.

As it turns out, SoundHack no longer runs on the Mac under Catalina
- Over the years, SoundHack has been a big part of my DSP classes (we do a ton of Csound too, but not until the second half of the semester)
- Some of you might know that SoundHack exported Csound .pvc files

Well - now... Csound and Cecilia and Cabbage and Csound for Live are all becoming the main focus of my DSP teaching @ Berklee.
- Anyone studying DSP usually focuses on the Masterpiece Compositions by Paul Lansky (and we all know that they feature a ton of LPC work)

And so now - with these tools... and maybe some new Csound for Live instruments and Cabbage instruments that use them! there will be a number of projects and a lot of teaching that will follow!

Can't wait!!!!

I would love to see the Python versions too - hopefully, you will share all of your great work with us.

AND - thanks

Take care,

-Rick
_____________________________________________
Dr. Richard Boulanger
Professor of Electronic Production and Design
Professional Writing and Music Technology Division
Berklee College of Music
______________________________________________
OFFICE: 1126 Boylston St., Suite 201 (EPD), Suite 208 (Boulanger)
______________________________________________


On Sun, May 17, 2020 at 4:20 PM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Hi everyone,

back to the list, after a while. You know, kids at home, work to do etc.

I wanted to introduce you to some new stuff I am starting to add to Csound. Back in 2012
when we started planning Cs 6, on my todo list was the request of adding a streaming
version of lpc to Csound. I had a look then, the code in lpanal did not look suitable for
that and I did not pursue it any further.

Now, I have been looking again at lpc, and noticed a much, much better algorithm than
what we have in lpanal is described in Makhoul’s tutorial. So I decided to have a go at
programming it in C, after prototyping it in Python. This weekend I finally had some time
to write it. It seems to work well, and it opens up a possibility for a suite of lpc streaming
opcodes. I have two of them written as a proof of concept and will add more as time
permits. In particular I see two things as promising: (a) integration with fsigs; (b) using
arrays to hold lpc data.

So, the opcodes I wrote are

asig lpcfilter ain, kpos, kflag, ifn, iN,  iM [, ifw]

ain - input
kpos - read pos in samples
kflag - 1 -> compute new filter coefficients, 0 -> keep old coefficients
ifn - source table for linear prediction
iN - autocorrelation size (lpc input size)
iM - allpole filter order
ifw - optional window table

asig lpcfilter ain, asrc, iN,  iM [, ifw]

same as above, except for

asrc - source signal for linear prediction

The main difference is that the second opcode computes new coefficients every M samples,
using the past N samples from the source signal. The first computes when asked, from
N samples taken from the table at pos kpos.

Examples:
==========
gifn ftgen 0,0,0,1,"fox.wav",0,0,1
gifw ftgen 0,0,1024,20,2,1

instr 1
k1 init 0
kts = .75 // timescale
a1 diskin “beats.wav",1,0,1
a3 lpcfilter a1/5,k1,1,gifn,1024,64,gifw
k1 += 64*kts
if k1 > ftlen(gifn) then
 k1 = 0
endif
out a3
endin

instr 2
a1 diskin "fox.wav",1,0,1
a2 diskin “beats.wav",1,0,1
a3 lpcfilter a2/5,a1,1024,64,gifw
out a3
endin
=======

The first instrument, reading from the table, is capable of timescale modifications (and other
tricks).

These may undergo some small changes before release, and I’ll add more as time permits.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-05-17 22:59
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] streaming linear prediction
ah, that's a hard problem. Hoping to get back tackle this sometime in the future.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 17 May 2020, at 22:28, Rory Walsh <rorywalsh@ear.ie> wrote:


And tell us what else you have been working on. Last we spoke you were working a way of transpiling opcodes? 

On Sun, 17 May 2020 at 22:23, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
This should simplify the process.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 17 May 2020, at 21:50, Rory Walsh <rorywalsh@ear.ie> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> Nice one Victor. I've never used any of the lpc stuff but this looks like a good opportunity to learn more about it.
>
> On Sun, 17 May 2020 at 21:20, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> Hi everyone,
>
> back to the list, after a while. You know, kids at home, work to do etc.
>
> I wanted to introduce you to some new stuff I am starting to add to Csound. Back in 2012
> when we started planning Cs 6, on my todo list was the request of adding a streaming
> version of lpc to Csound. I had a look then, the code in lpanal did not look suitable for
> that and I did not pursue it any further.
>
> Now, I have been looking again at lpc, and noticed a much, much better algorithm than
> what we have in lpanal is described in Makhoul’s tutorial. So I decided to have a go at
> programming it in C, after prototyping it in Python. This weekend I finally had some time
> to write it. It seems to work well, and it opens up a possibility for a suite of lpc streaming
> opcodes. I have two of them written as a proof of concept and will add more as time
> permits. In particular I see two things as promising: (a) integration with fsigs; (b) using
> arrays to hold lpc data.
>
> So, the opcodes I wrote are
>
> asig lpcfilter ain, kpos, kflag, ifn, iN,  iM [, ifw]
>
> ain - input
> kpos - read pos in samples
> kflag - 1 -> compute new filter coefficients, 0 -> keep old coefficients
> ifn - source table for linear prediction
> iN - autocorrelation size (lpc input size)
> iM - allpole filter order
> ifw - optional window table
>
> asig lpcfilter ain, asrc, iN,  iM [, ifw]
>
> same as above, except for
>
> asrc - source signal for linear prediction
>
> The main difference is that the second opcode computes new coefficients every M samples,
> using the past N samples from the source signal. The first computes when asked, from
> N samples taken from the table at pos kpos.
>
> Examples:
> ==========
> gifn ftgen 0,0,0,1,"fox.wav",0,0,1
> gifw ftgen 0,0,1024,20,2,1
>
> instr 1
> k1 init 0
> kts = .75 // timescale
> a1 diskin “beats.wav",1,0,1
> a3 lpcfilter a1/5,k1,1,gifn,1024,64,gifw
> k1 += 64*kts
> if k1 > ftlen(gifn) then
>  k1 = 0
> endif
> out a3
> endin
>
> instr 2
> a1 diskin "fox.wav",1,0,1
> a2 diskin “beats.wav",1,0,1
> a3 lpcfilter a2/5,a1,1024,64,gifw
> out a3
> endin
> =======
>
> The first instrument, reading from the table, is capable of timescale modifications (and other
> tricks).
>
> These may undergo some small changes before release, and I’ll add more as time permits.
>
> best
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-05-17 23:14
FromOscar Pablo Di Liscia
SubjectRe: [Csnd] streaming linear prediction
Looks very good. I will try it soon.
Many thanks!

El domingo, 17 de mayo de 2020, Victor Lazzarini <Victor.Lazzarini@mu.ie> escribió:
ah, that's a hard problem. Hoping to get back tackle this sometime in the future.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 17 May 2020, at 22:28, Rory Walsh <rorywalsh@ear.ie> wrote:


And tell us what else you have been working on. Last we spoke you were working a way of transpiling opcodes? 

On Sun, 17 May 2020 at 22:23, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
This should simplify the process.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 17 May 2020, at 21:50, Rory Walsh <rorywalsh@ear.ie> wrote:
>
> WARNINGThis email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> Nice one Victor. I've never used any of the lpc stuff but this looks like a good opportunity to learn more about it.
>
> On Sun, 17 May 2020 at 21:20, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
> Hi everyone,
>
> back to the list, after a while. You know, kids at home, work to do etc.
>
> I wanted to introduce you to some new stuff I am starting to add to Csound. Back in 2012
> when we started planning Cs 6, on my todo list was the request of adding a streaming
> version of lpc to Csound. I had a look then, the code in lpanal did not look suitable for
> that and I did not pursue it any further.
>
> Now, I have been looking again at lpc, and noticed a much, much better algorithm than
> what we have in lpanal is described in Makhoul’s tutorial. So I decided to have a go at
> programming it in C, after prototyping it in Python. This weekend I finally had some time
> to write it. It seems to work well, and it opens up a possibility for a suite of lpc streaming
> opcodes. I have two of them written as a proof of concept and will add more as time
> permits. In particular I see two things as promising: (a) integration with fsigs; (b) using
> arrays to hold lpc data.
>
> So, the opcodes I wrote are
>
> asig lpcfilter ain, kpos, kflag, ifn, iN,  iM [, ifw]
>
> ain - input
> kpos - read pos in samples
> kflag - 1 -> compute new filter coefficients, 0 -> keep old coefficients
> ifn - source table for linear prediction
> iN - autocorrelation size (lpc input size)
> iM - allpole filter order
> ifw - optional window table
>
> asig lpcfilter ain, asrc, iN,  iM [, ifw]
>
> same as above, except for
>
> asrc - source signal for linear prediction
>
> The main difference is that the second opcode computes new coefficients every M samples,
> using the past N samples from the source signal. The first computes when asked, from
> N samples taken from the table at pos kpos.
>
> Examples:
> ==========
> gifn ftgen 0,0,0,1,"fox.wav",0,0,1
> gifw ftgen 0,0,1024,20,2,1
>
> instr 1
> k1 init 0
> kts = .75 // timescale
> a1 diskin “beats.wav",1,0,1
> a3 lpcfilter a1/5,k1,1,gifn,1024,64,gifw
> k1 += 64*kts
> if k1 > ftlen(gifn) then
>  k1 = 0
> endif
> out a3
> endin
>
> instr 2
> a1 diskin "fox.wav",1,0,1
> a2 diskin “beats.wav",1,0,1
> a3 lpcfilter a2/5,a1,1024,64,gifw
> out a3
> endin
> =======
>
> The first instrument, reading from the table, is capable of timescale modifications (and other
> tricks).
>
> These may undergo some small changes before release, and I’ll add more as time permits.
>
> best
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


--
Dr. Oscar Pablo Di Liscia
Profesor Titular
Director Programa de Investigación "Sistemas Temporales y Síntesis Espacial en el Arte Sonoro"
http://stseas.web.unq.edu.ar/
Director Colección Editorial "Música y Ciencia"
Escuela Universitaria de Artes
Universidad Nacional de Quilmes
Argentina
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-05-18 08:07
FromOeyvind Brandtsegg
SubjectRe: [Csnd] streaming linear prediction
Wow!

søn. 17. mai 2020 kl. 22:20 skrev Victor Lazzarini <Victor.Lazzarini@mu.ie>:
Hi everyone,

back to the list, after a while. You know, kids at home, work to do etc.

I wanted to introduce you to some new stuff I am starting to add to Csound. Back in 2012
when we started planning Cs 6, on my todo list was the request of adding a streaming
version of lpc to Csound. I had a look then, the code in lpanal did not look suitable for
that and I did not pursue it any further.

Now, I have been looking again at lpc, and noticed a much, much better algorithm than
what we have in lpanal is described in Makhoul’s tutorial. So I decided to have a go at
programming it in C, after prototyping it in Python. This weekend I finally had some time
to write it. It seems to work well, and it opens up a possibility for a suite of lpc streaming
opcodes. I have two of them written as a proof of concept and will add more as time
permits. In particular I see two things as promising: (a) integration with fsigs; (b) using
arrays to hold lpc data.

So, the opcodes I wrote are

asig lpcfilter ain, kpos, kflag, ifn, iN,  iM [, ifw]

ain - input
kpos - read pos in samples
kflag - 1 -> compute new filter coefficients, 0 -> keep old coefficients
ifn - source table for linear prediction
iN - autocorrelation size (lpc input size)
iM - allpole filter order
ifw - optional window table

asig lpcfilter ain, asrc, iN,  iM [, ifw]

same as above, except for

asrc - source signal for linear prediction

The main difference is that the second opcode computes new coefficients every M samples,
using the past N samples from the source signal. The first computes when asked, from
N samples taken from the table at pos kpos.

Examples:
==========
gifn ftgen 0,0,0,1,"fox.wav",0,0,1
gifw ftgen 0,0,1024,20,2,1

instr 1
k1 init 0
kts = .75 // timescale
a1 diskin “beats.wav",1,0,1
a3 lpcfilter a1/5,k1,1,gifn,1024,64,gifw
k1 += 64*kts
if k1 > ftlen(gifn) then
 k1 = 0
endif
out a3
endin

instr 2
a1 diskin "fox.wav",1,0,1
a2 diskin “beats.wav",1,0,1
a3 lpcfilter a2/5,a1,1024,64,gifw
out a3
endin
=======

The first instrument, reading from the table, is capable of timescale modifications (and other
tricks).

These may undergo some small changes before release, and I’ll add more as time permits.

best
========================
Prof. Victor Lazzarini
Maynooth University
Ireland


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-05-18 20:14
Fromjoachim heintz
SubjectRe: [Csnd] streaming linear prediction
very interesting -- looking forward to trying it out!
	joachim



On 17/05/2020 22:20, Victor Lazzarini wrote:
> Hi everyone,
> 
> back to the list, after a while. You know, kids at home, work to do etc.
> 
> I wanted to introduce you to some new stuff I am starting to add to Csound. Back in 2012
> when we started planning Cs 6, on my todo list was the request of adding a streaming
> version of lpc to Csound. I had a look then, the code in lpanal did not look suitable for
> that and I did not pursue it any further.
> 
> Now, I have been looking again at lpc, and noticed a much, much better algorithm than
> what we have in lpanal is described in Makhoul’s tutorial. So I decided to have a go at
> programming it in C, after prototyping it in Python. This weekend I finally had some time
> to write it. It seems to work well, and it opens up a possibility for a suite of lpc streaming
> opcodes. I have two of them written as a proof of concept and will add more as time
> permits. In particular I see two things as promising: (a) integration with fsigs; (b) using
> arrays to hold lpc data.
> 
> So, the opcodes I wrote are
> 
> asig lpcfilter ain, kpos, kflag, ifn, iN,  iM [, ifw]
> 
> ain - input
> kpos - read pos in samples
> kflag - 1 -> compute new filter coefficients, 0 -> keep old coefficients
> ifn - source table for linear prediction
> iN - autocorrelation size (lpc input size)
> iM - allpole filter order
> ifw - optional window table
> 
> asig lpcfilter ain, asrc, iN,  iM [, ifw]
> 
> same as above, except for
> 
> asrc - source signal for linear prediction
> 
> The main difference is that the second opcode computes new coefficients every M samples,
> using the past N samples from the source signal. The first computes when asked, from
> N samples taken from the table at pos kpos.
> 
> Examples:
> ==========
> gifn ftgen 0,0,0,1,"fox.wav",0,0,1
> gifw ftgen 0,0,1024,20,2,1
> 
> instr 1
> k1 init 0
> kts = .75 // timescale
> a1 diskin “beats.wav",1,0,1
> a3 lpcfilter a1/5,k1,1,gifn,1024,64,gifw
> k1 += 64*kts
> if k1 > ftlen(gifn) then
>   k1 = 0
> endif
> out a3
> endin
> 
> instr 2
> a1 diskin "fox.wav",1,0,1
> a2 diskin “beats.wav",1,0,1
> a3 lpcfilter a2/5,a1,1024,64,gifw
> out a3
> endin
> =======
> 
> The first instrument, reading from the table, is capable of timescale modifications (and other
> tricks).
> 
> These may undergo some small changes before release, and I’ll add more as time permits.
> 
> best
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> 

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-05-18 22:28
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] streaming linear prediction
still adjusting things, but added now a lpcanal opcode outputting an array.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 18 May 2020, at 20:14, joachim heintz  wrote:
> 
> *Warning*
> 
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 
> very interesting -- looking forward to trying it out!
>       joachim
> 
> 
> 
> On 17/05/2020 22:20, Victor Lazzarini wrote:
>> Hi everyone,
>> 
>> back to the list, after a while. You know, kids at home, work to do etc.
>> 
>> I wanted to introduce you to some new stuff I am starting to add to Csound. Back in 2012
>> when we started planning Cs 6, on my todo list was the request of adding a streaming
>> version of lpc to Csound. I had a look then, the code in lpanal did not look suitable for
>> that and I did not pursue it any further.
>> 
>> Now, I have been looking again at lpc, and noticed a much, much better algorithm than
>> what we have in lpanal is described in Makhoul’s tutorial. So I decided to have a go at
>> programming it in C, after prototyping it in Python. This weekend I finally had some time
>> to write it. It seems to work well, and it opens up a possibility for a suite of lpc streaming
>> opcodes. I have two of them written as a proof of concept and will add more as time
>> permits. In particular I see two things as promising: (a) integration with fsigs; (b) using
>> arrays to hold lpc data.
>> 
>> So, the opcodes I wrote are
>> 
>> asig lpcfilter ain, kpos, kflag, ifn, iN,  iM [, ifw]
>> 
>> ain - input
>> kpos - read pos in samples
>> kflag - 1 -> compute new filter coefficients, 0 -> keep old coefficients
>> ifn - source table for linear prediction
>> iN - autocorrelation size (lpc input size)
>> iM - allpole filter order
>> ifw - optional window table
>> 
>> asig lpcfilter ain, asrc, iN,  iM [, ifw]
>> 
>> same as above, except for
>> 
>> asrc - source signal for linear prediction
>> 
>> The main difference is that the second opcode computes new coefficients every M samples,
>> using the past N samples from the source signal. The first computes when asked, from
>> N samples taken from the table at pos kpos.
>> 
>> Examples:
>> ==========
>> gifn ftgen 0,0,0,1,"fox.wav",0,0,1
>> gifw ftgen 0,0,1024,20,2,1
>> 
>> instr 1
>> k1 init 0
>> kts = .75 // timescale
>> a1 diskin “beats.wav",1,0,1
>> a3 lpcfilter a1/5,k1,1,gifn,1024,64,gifw
>> k1 += 64*kts
>> if k1 > ftlen(gifn) then
>>  k1 = 0
>> endif
>> out a3
>> endin
>> 
>> instr 2
>> a1 diskin "fox.wav",1,0,1
>> a2 diskin “beats.wav",1,0,1
>> a3 lpcfilter a2/5,a1,1024,64,gifw
>> out a3
>> endin
>> =======
>> 
>> The first instrument, reading from the table, is capable of timescale modifications (and other
>> tricks).
>> 
>> These may undergo some small changes before release, and I’ll add more as time permits.
>> 
>> best
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>> 
>> 
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C109c92095e4e4b941f9808d7fb5fc6eb%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637254261099286840&sdata=e3wt9vkWevykLHd1QyT88Ao87AyEhX6AfL8%2BMKpUIzU%3D&reserved=0
>> Send bugs reports to
>>         https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C109c92095e4e4b941f9808d7fb5fc6eb%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637254261099286840&sdata=VbqXqWfehwifRZIcviENjtTEsHWBGdLEfn%2FMifzqIBY%3D&reserved=0
>> Discussions of bugs and features can be posted here
>> 
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C109c92095e4e4b941f9808d7fb5fc6eb%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637254261099286840&sdata=e3wt9vkWevykLHd1QyT88Ao87AyEhX6AfL8%2BMKpUIzU%3D&reserved=0
> Send bugs reports to
>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=02%7C01%7CVictor.Lazzarini%40mu.ie%7C109c92095e4e4b941f9808d7fb5fc6eb%7C1454f5ccbb354685bbd98621fd8055c9%7C1%7C0%7C637254261099296833&sdata=UGvabZ9%2FJYXTHitSnGI6s8qg%2F8%2F7LAIvQih8MGVHLi0%3D&reserved=0
> Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here