[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] map midi data
- To: sc-users@xxxxxxxxxxxxxxxx
- Subject: Re: [sc-users] map midi data
- From: "James Harkins" <jamshark70@xxxxxxxxx>
- Date: Mon, 1 Dec 2008 16:29:58 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=DwIzshNhBHuOj++obBzIDrkQjSLxEZfZhm8d4U30Bxw=; b=u1YmYdUT7KPtZF+fwOt8NMJcxBG6WV+f9XhwnL3v8eMzF0dGMr7s6zj1KVwS4e/neZ jyXm7MVKp/rlqk0g2wtM8VeW//4xJ9WP3vGoYnidbFoV4yqWAxvWkc86kQjKCYyId4Qk 5vIY/HPI8j8j2HH5IQOmvCDjV4w+c5qfrp3tc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ru5+Bv+us+JhgSofuZrsV8sJh1ywA0Yt+2clMTiSoQ4oDQOpMI4OdKViT0IaEbp5rT V1D3C+TWx2Au/P+EmBN0izOg8wgG44CtTxalP6Ns7PMKheIeVu5vxXw+wLaYo7VIXTCM PfpqKjW1awMBvrL7CLarrCsagnXDn5ORzeAio=
- In-reply-to: <EA133A5D-D0F4-484D-8345-4B882878926C@xxxxxxxxx>
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- References: <EA133A5D-D0F4-484D-8345-4B882878926C@xxxxxxxxx>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
val.linlin(0, 127, 0.0, 4.0) for linear mapping
Or, for arbitrary ControlSpec mapping:
c = ControlSpec(0, 4, \lin); // or whatever other mapping: \exp, a
curve number, etc.
CCResponder( { |src,chan,num,val| x.set(\pitch, c.map(val / 127)); },
nil, 0, 1, nil);
A ControlSpec always maps 0..1 onto the given range, so it's necessary
to divide the 0..127 value by 127 to get 0.0 .. 1.0.
hjh
On Mon, Dec 1, 2008 at 4:13 PM, Jroen van Rijzewijk
<supercollidermailinglist@xxxxxxxxx> wrote:
> Hi list,
> i want to map midi data [0, 127] to [0.0, 4.0] or any other value's, do i do
> that with asSpec of something else?
> I would like it if it would be in the same line as my controller data:
> CCResponder( { |src,chan,num,val| x.set(\pitch, val); }, nil, 0, 1, nil);
> so somewhere in that line of code, is this possible and how would i do that?
> Or is there any ohter way to do this?
> Thanks in advance,
> Jroen
--
James Harkins /// dewdrop world
jamshark70@xxxxxxxxxxxxxxxxx
http://www.dewdrop-world.net
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman
_______________________________________________
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/