[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Re: Help me map a control rate signal with a buffer
- To: sc-users@xxxxxxxxxxxxxxxx
- Subject: Re: [sc-users] Re: Help me map a control rate signal with a buffer
- From: Dan Stowell <danstowell@xxxxxxxxx>
- Date: Sun, 3 May 2009 16:30:06 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=hKzYUSDTSCmNiEdYSRLKLYBHSzgvVsKk3np4B44UcZE=; b=qMmOoYXGEmxrB8LxLZ2K0Q32f5fge2vov0rb0G6CmVb0/JbafO2xSVMEA04rUtp450 ODdycfzllr69BQfltKeYuJUaWKKnFj75LmFrMgYQvRIZzuWlTp94KNP/JIgwYf4pQidJ 8wvXjU2jnyhUfRymUYgltCovUQf7yj+lwHSsQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=pAavQ+30rDP+tFXK2RP1weDJXCfXekaPOi8XVj1mJ3XFO6a7Z+N7EdoIQIxy7Uzv87 F/G4ImdVfFQJ0iWolk7QdV7u1DpvZqvZLb+Kg4y9qv1pyrvDpqVeppaHVdfcq0PPCLkQ IqAADHE2vFJRxQbkkoY0PUdrKtag5Q5P2egIQ=
- In-reply-to: <gtkb49$cf3$1@xxxxxxxxxxxxx>
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- References: <gtjs1f$94o$1@xxxxxxxxxxxxx> <286e6b7c0905030521q50f42812kf14dd61847a68cd5@xxxxxxxxxxxxxx> <gtkb49$cf3$1@xxxxxxxxxxxxx>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
It's just linear interpolation. e.g. if the input is 12.53 and the
buffer contains [11,12,13] then the output is 1.53, where the "1" is
because it's somewhere between indices numbered 1 and 2, and the ".53"
is reverse-linear-interpolation:
frac = (input-b[1]) / (b[2]-b[1])
Dan
2009/5/3, Carlo Capocasa <theman@xxxxxxxxxxxxxxxxx>:
> Hi Dan!
>
> Thanks, that sounds really helpful. Can you explain something about this?
> How is the interpolation done, IE how does the program 'know' how far in
> between the elements of ~from the signal was at any given point?
>
> Thanks a lot for your reply,
>
> Carlo
>
>
> Dan Stowell wrote:
>
> > Hi Carlo -
> >
> > One way you can do it is using IndexInBetween to "unmap" your input
> > into integer slots, and then use IndexL to do the reverse, to "map"
> > onto your other distribution. This example maps a sort-of-exponential
> > curve onto a sort-of-sinusoidal curve:
> >
> > ~from = [1, 2, 4, 8, 16];
> > ~to = [0, 1, 0, -1, 0];
> > x={IndexL.kr(~to.as(LocalBuf),
> IndexInBetween.kr(~from.as(LocalBuf),
> > MouseX.kr(~from.first,~from.last).poll).poll).poll}.play
> >
> > HTH
> > Dan
> >
> >
> > ---------- Forwarded message ----------
> > From: Carlo Capocasa <theman@xxxxxxxxxxxxxxxxx>
> > Date: 3.5.2009 11:35
> > Subject: [sc-users] Help me map a control rate signal with a buffer
> > To: sc-users@xxxxxxxxxxxxxxxx
> >
> >
> > Hi! Thanks for reading. I'm looking for some help... I need to
> > re-shape a control rate signal with a mapping function defined by a
> > series of float (X|Y) values and linear interpolation in-between.
> > Using a buffer seems to be the most elegant way to do this, could you
> > kindly point me to Ugens that might do this? IndexInBetween seemed
> > promising but then the X-Values have to be integers. Thanks!
> >
> > Carlo
> >
> >
> > _______________________________________________
> > sc-users mailing list
> >
> > info (subscription, etc.):
> >
> http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> > archive:
> https://listarc.bham.ac.uk/marchives/sc-users/
> > search:
> https://listarc.bham.ac.uk/lists/sc-users/search/
> >
> >
> >
>
>
> _______________________________________________
> sc-users mailing list
>
> info (subscription, etc.):
> http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: https://listarc.bham.ac.uk/marchives/sc-users/
> search:
> https://listarc.bham.ac.uk/lists/sc-users/search/
>
--
http://www.mcld.co.uk
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/