Csound Csound-dev Csound-tekno Search About

Re: [Csound] portamento algorithm

Date2015-10-15 13:43
FromTim Mortimer
SubjectRe: [Csound] portamento algorithm
Hang on, just realised 1/freq might help ... 

"making a dill of yourself" seems a sure way to immediately solve a problem
it seems.

i'll work on that, but none the less feel free to jump in. that's probably
not the whole story ...  



--

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

Date2015-10-17 02:18
FromPaul Batchelor
SubjectRe: [Csound] portamento algorithm
> I'm trying to explore some more natural sounding portamento algorithms

What sort of portamento algorithms have you looked at prior? There is a Csound journal article Steven Yi wrote on tied notes in Csound, which you should read if you haven't already: http://www.csounds.com/journal/2005fall/tiedNotes.html.

There's also a chapter in the Csound book called "Designing Legato Instruments in Csound", which covers portamento.

I personally find using a portamento filter on step-wise signals to work out just fine for me, but there are certainly interesting note interpolation methods that could be explored as well!

-P


On Thu, Oct 15, 2015 at 5:43 AM, Tim Mortimer <mortysrevenge@gmail.com> wrote:
Hang on, just realised 1/freq might help ...

"making a dill of yourself" seems a sure way to immediately solve a problem
it seems.

i'll work on that, but none the less feel free to jump in. that's probably
not the whole story ...



--

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

Date2015-10-17 20:46
FromIain McCurdy
SubjectRe: [Csound] portamento algorithm
A 'human' portamento slide is likely to spend a little time accelerating from the steady pitch to a constant rate of change. Similarly, when arriving at the destination pitch a short deceleration in the rate of change will occur. port/portk on their own can sound a bit 'laggy'; passing a lineto through a port filter with a short half-time can be more convincing.
Also worth bearing in mind is that most acoustic instruments, while performing portamento, drop in power slightly.


Date: Fri, 16 Oct 2015 18:18:24 -0700
From: ralphbluecoat@GMAIL.COM
Subject: Re: [Csound] portamento algorithm
To: CSOUND@LISTSERV.HEANET.IE

> I'm trying to explore some more natural sounding portamento algorithms

What sort of portamento algorithms have you looked at prior? There is a Csound journal article Steven Yi wrote on tied notes in Csound, which you should read if you haven't already: http://www.csounds.com/journal/2005fall/tiedNotes.html.

There's also a chapter in the Csound book called "Designing Legato Instruments in Csound", which covers portamento.

I personally find using a portamento filter on step-wise signals to work out just fine for me, but there are certainly interesting note interpolation methods that could be explored as well!

-P


On Thu, Oct 15, 2015 at 5:43 AM, Tim Mortimer <mortysrevenge@gmail.com> wrote:
Hang on, just realised 1/freq might help ...

"making a dill of yourself" seems a sure way to immediately solve a problem
it seems.

i'll work on that, but none the less feel free to jump in. that's probably
not the whole story ...



--

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

Date2015-10-18 09:35
FromTim Mortimer
SubjectRe: [Csound] portamento algorithm
Thanks Ian.

I got the basic thing working. there was some slight improvement in longer
portamento times, especially in an upward direction.

I was intending to add the "accel / decel" at the beginning & end, but
hadn't considered the "power" thing ... so that's worth a look ...

Anyway, after much headscratching i managed to get the basic idea in place,
& have put it aside to move onto to Python stuff today. The porto code is
below ...

I'm pretty happy with how my "whole system" is emerging now, having finally
decided to bite the bullet & implement the thing i first started thinking
about 6 or 7 years ago. I've had a bit more programming experience since
then. & Pyops really has become essential to the whole process / approach..

I do have a few test bits & pieces on Soundcloud, but really its not much
more than "pencil sketches": some generative phrases using Python driving
sine waves mainly, & a little bit of emerging sound design ...

https://soundcloud.com/timmortimer/sets/2015-2016-ideas-developments


/*

*/





-odac




sr = 48000
ksmps = 128
nchnls = 2
0dbfs = 1.0

;;; the "physical model"
;;; IS BETTER
;;; but only really comes into its own on long transitions ...

instr 01

        istartpitch = p4
        iendpitch = p5
        iportotime = p6
        kcps init istartpitch

        ;;; stage 1 -> octave conversion
        iinterval = istartpitch-iendpitch
        iinterval_oct = iinterval /12

        ;;; determine the "normalised exponential range" to be traversed
        ;;; (application revealed below...)
        ihigh = 1
        ilow = 2^iinterval_oct
        idenominator = ilow-ihigh

        ;;; time pointer is normalised into 0 -1 range
        ktimepointer linseg 0,iportotime,1,0,1

        knumerator = ktimepointer*idenominator
        knumerator += 1
        kinterval_oct = log2(knumerator)
        kinterval = kinterval_oct * 12
        knote = istartpitch-kinterval
        kcps cpsmidinn knote

        printk 0.25,knote

        asig oscil 0.25,kcps
        aenv linseg 1,p3-0.5,1,0.5,0
        asig *= aenv
        outs asig,asig

endin

;;; garden variety portomento
;;; ****try normalising & applying power curve to this ...
instr 02

        knote linseg p4,p6,p5,0,p5

        istartpitch = p4
        iendpitch = p5
        iportotime = p6
        kcps init istartpitch

        iinterval = iendpitch-istartpitch

        ;;; normalised trajectory
        ktimepointer linseg 0,iportotime,1,0,1

        ;;; shaped
        /*
        if iinterval < 0 then
                ;;; starts fast ends slow
                ;;; => transition high to low
                ktimepointer = ktimepointer^0.45

        endif

        if iinterval > 0 then
                ;;; starts slow ends fast
                ;;; => transition low to high
                ktimepointer = ktimepointer^2
        endif
        */

        ktrans = iinterval*ktimepointer
        knote = istartpitch + ktrans

        kcps cpsmidinn knote

        printk 0.25,knote

        asig oscil 0.25,kcps
        aenv linseg 1,p3-0.5,1,0.5,0
        asig *= aenv
        outs asig,asig

endin




;;; starts fast ends slow
;;; => transition high to low
i1 0 4 84 60 1
i2 5 4 84 60 1

;;; starts slow ends fast
;;; => transition low to high
i1 10 4 60 84 1
i2 15 4 60 84 1





--
View this message in context: http://csound.1045644.n5.nabble.com/Csound-portamento-algorithm-tp5744460p5744582.html
Sent from the Csound - General mailing list archive at Nabble.com.

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

Date2015-10-18 09:39
FromTim Mortimer
SubjectRe: [Csound] portamento algorithm
Hi Paul.

Yes, I make constant reference to that Steven Yi article. That's the basis
of most of my instrument designs now, in one form or other. Even without
Portamento... i use tiestatus a lot to implement real-time note on / off
functionality ... 

I'll dig out the csound book too & have a look ...




--
View this message in context: http://csound.1045644.n5.nabble.com/Csound-portamento-algorithm-tp5744460p5744583.html
Sent from the Csound - General mailing list archive at Nabble.com.

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