Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Arbitrary frequency slide at arbitrary time
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joel J.  
View profile  
 More options Jul 19 2012, 12:02 pm
From: "Joel J." <tce...@gmail.com>
Date: Thu, 19 Jul 2012 12:02:18 -0400
Local: Thurs, Jul 19 2012 12:02 pm
Subject: Arbitrary frequency slide at arbitrary time

Say I have a an instrument like

(definst sinewave [freq 220] (sin-osc freq))

And I start it up using

(def sound (sinewave))

So it starts making a 220 Hz sound.

Now, some arbitrary amount of time later I want to change it to be at some
other arbitrary frequency; let's say 440 Hz.  Normally I could just do

(ctl sound :freq 440)

and it would switch to 440 Hz.

However, I want to be fancy about it and make it slide up to that frequency
over the course of a second or so.

The intuitive thing for me to do at this point, given my current limited
knowledge of how this all works, is to pass a line ugen to the control
function.  My reasoning goes like this: I can pass a line ugen to sin-osc
in a definst, and freq is just what gets passed to sin-osc, so I should be
able to use ctl to pass a line ugen to sin-osc by using the :freq
parameter, like so:

(ctl :freq (line:ar 220 440 1))

But when I try to do that, I get an exception:
Failed attempting to send an OSC message to SuperCollider server. Reason:
incorrect arglist type in OSC message /n_set. Expected a float representing
a control value found class overtone.sc.machinery.ugen.sc_ugen.SCUGen.
Message name: /n_set Type sig: [:node-id
:ALTERNATING-ctl-handle-THEN-ctl-val*] Arg list: (52 "freq" #<sc-ugen:
line:ar [0]>)

So that's no good, apparently because of something to do with how
SuperCollider works (control messages can only be to non-changing float
values?)

So what _is_ the idiomatic way to slide from one frequency to another in an
instrument that is already playing?  Is there an "easy" way to do that, or
do you have to kind of kludge it with something like:

(definst sliding-sine [start-freq 0 end-freq 220 slide-duration 1]
  (sin-osc (line:ar start-freq end-freq slide-duration)))

(def slider (atom (sliding-sine)))
(at (+ (now) 1000) (do (kill @slider) (reset! slider (sliding-sine 440 330
1))))

[apologies if g-mail destroys the formatting...]
This does mostly do what I want it to, except there's a faint 'pop' when it
kills the first sound and starts the second, which is fine for just fooling
around but I wouldn't want it in anything final.

Cheers,
Joel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Ford  
View profile  
 More options Jul 19 2012, 12:36 pm
From: Chris Ford <christophertf...@gmail.com>
Date: Thu, 19 Jul 2012 17:36:28 +0100
Local: Thurs, Jul 19 2012 12:36 pm
Subject: Re: Arbitrary frequency slide at arbitrary time

Is there a way to do it via feedback? So if you send a new ctrl signal, you
could use some kind of feedback loop to gradually move towards the new
frequency.

I'm a bit sketchy about the details, sorry.

Chris

On 19 July 2012 17:02, Joel J. <tce...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aaron S  
View profile  
 More options Jul 19 2012, 12:44 pm
From: Aaron S <aaronds...@gmail.com>
Date: Thu, 19 Jul 2012 09:44:02 -0700 (PDT)
Local: Thurs, Jul 19 2012 12:44 pm
Subject: Re: Arbitrary frequency slide at arbitrary time

Hi Joel,

I use the slew ugen for this effect in the mini-beast. Translating it your
example: (definst sinewave [freq 220] (sin-osc (slew freq 10.0 10.0)))
Adjust the up/down values from 10.0 to your taste. Or make them a function
of the frequency if you need the slide from 220 to 440 to take the same
time as a slide from 440 to 880.

Best,
Aaron

If you don't mind looking at a huge
synthdef https://github.com/overtone/mini-beast/blob/master/src/minibeast/mbsy...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Rose  
View profile  
 More options Jul 19 2012, 1:10 pm
From: Jeff Rose <ros...@gmail.com>
Date: Thu, 19 Jul 2012 18:10:46 +0100
Local: Thurs, Jul 19 2012 1:10 pm
Subject: Re: Arbitrary frequency slide at arbitrary time
Aaron's recommendation is the best way currently, but what you want to
do is actually a great idea.  I'm going to work on it and get back to
you...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel J.  
View profile  
 More options Jul 19 2012, 3:09 pm
From: "Joel J." <tce...@gmail.com>
Date: Thu, 19 Jul 2012 15:09:06 -0400
Local: Thurs, Jul 19 2012 3:09 pm
Subject: Re: Arbitrary frequency slide at arbitrary time

Thanks Aaron, that's exactly the sort of thing I had in mind!  Also thanks
for the link to the minibeast synth; I've been meaning to check it out but
hadn't gotten around to it.  Pretty daunting, but I'm looking forward to
learning from it.

--Joel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel J.  
View profile  
 More options Jul 19 2012, 3:09 pm
From: "Joel J." <tce...@gmail.com>
Date: Thu, 19 Jul 2012 15:09:56 -0400
Local: Thurs, Jul 19 2012 3:09 pm
Subject: Re: Arbitrary frequency slide at arbitrary time

Sweet! ^_^


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Rose  
View profile  
 More options Jul 19 2012, 7:24 pm
From: Jeff Rose <ros...@gmail.com>
Date: Fri, 20 Jul 2012 00:24:02 +0100
Local: Thurs, Jul 19 2012 7:24 pm
Subject: Re: Arbitrary frequency slide at arbitrary time
OK, here is a proof of concept. It doesn't quite do what you want yet, but it demonstrates the strategy we can use to pull it off. Using node-map-controls we can connect a bus to a synth parameter. So here I did it all by hand. The idea version, like your example, should be in a macro that allocates the bus, maps the parameter to it, creates and fires off the control synth, and then once the synth completes free the bus. Currently there is an /n_end event sent when a synth node completes, but I think we should have a higher level and easier to use event to catch when a synth finishes. Sam, you've been doing a lot of work with the event system lately. Any thoughts on how this should work? Anyway, you should be able to give this example a go. Just evaluate form by form.

-Jeff

(ns examples.synth-control
(:use overtone.live))

(definst simple
[freq 440 depth 30 warble 0.3]
(let [freq (slew freq 7 12)
snd (apply + (saw (+ [freq (* freq 1.013) (* freq 0.992)]
(* warble (sin-osc:kr warble [0 2.0945 4.7])))))
filt (rlpf snd
(+ (* freq 2) (* freq (sin-osc 0.2)))
(+ 0.31 (* 0.3 (sin-osc 0.03))))]
filt))

(defn synth-ctl
[node param ctl-synth]
(let [cur-val (node-get-control node [param])]
(ctl-synth test-bus)
(node-map-controls node [param test-bus])))

(defsynth bus-line
[start 0 end 1 dur 1 bus 0]
(out bus (line:kr start end dur :action FREE)))

(def test-bus (control-bus 1))
(def s (simple))
(synth-ctl s :freq (partial bus-line 880 220 4))
(stop)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aaron S  
View profile  
 More options Jul 19 2012, 8:19 pm
From: Aaron S <aaronds...@gmail.com>
Date: Thu, 19 Jul 2012 17:19:58 -0700 (PDT)
Local: Thurs, Jul 19 2012 8:19 pm
Subject: Re: Arbitrary frequency slide at arbitrary time

Wow! I had no idea that was possible. Thank you for posting this Jeff.
There's an arpeggiator build into the mini-beast that may really benefit
from being pulled out into it's own defsynth like this.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel J.  
View profile  
 More options Jul 20 2012, 11:23 am
From: "Joel J." <tce...@gmail.com>
Date: Fri, 20 Jul 2012 11:23:20 -0400
Local: Fri, Jul 20 2012 11:23 am
Subject: Re: Arbitrary frequency slide at arbitrary time

Sweet, this is much more in line with what I had in mind!  Thanks!  XD

--Joel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »