The bells!

47 views
Skip to first unread message

Jen Smith

unread,
Dec 12, 2011, 9:48:52 AM12/12/11
to Overtone
Hi,

I had been meaning to play around with some additive synthesis in
overtone and I thought the best way to start was with synthesising a
bell sound - arguably the easiest of them all.

https://gist.github.com/1467356

Basically a bell is just a bunch of sine-oscs at relative frequencies
added together with varying levels and release times. I gave each one
its own envelope and mixed them down relatively too, following this
article:

http://www.soundonsound.com/sos/Aug02/articles/synthsecrets0802.asp

and this one too:

computermusicresource.com/Simple.bell.tutorial.html

You can mess around with partial ratios to get duller and brighter
sounding bells - I have two examples from those two articles making
two different bells: dull-bell and pretty-bell. Technically one is not
supposed to include the main frequency but I did to make it sound a
bit more musical (your ear is supposed to make up for it). The
partials start at 0.5 which is why everything sounds a bit low.

Problems seem to arise from having a long tail on the notes when
played in fast succession - I wonder if it would be better to mix in
some reverb rather than just having N perc envs at varying cutoffs.

To test it all, I added a small, festive demo. Note that this is
really slow but any faster and you get clipping as explained before.

Let me know what you think!

Jen

Sam Aaron

unread,
Dec 12, 2011, 10:05:11 AM12/12/11
to over...@googlegroups.com
How wonderful - definitely full of festive spirit :-) Thanks so much for this.

It would be interesting to know if the klang and klank ugens would be useful for this sort of stuff.

Sam

P.S. I'd definitely encourage you to flesh out the bell-partials cgen - i.e. add defaults and docstrings :-)

---
http://sam.aaron.name

Sam Aaron

unread,
Dec 13, 2011, 7:54:51 PM12/13/11
to over...@googlegroups.com
Hey Jen,

take a look here: https://gist.github.com/1467798

I worked out what was causing the weird clipping. It was a very subtle bug - unfortunately you weren't freeing your synths correctly, so SC started eating up more and more CPU the more synths you fired. If you look at your version of the defcgen you have this envelope def:

(env-gen (perc 0.01 (* dur %2) ) FREE)

Unfortunately, although you're on the right track, this doesn't work as expected. The signature for env-gen is:

[envelope :none, gate 1.0, levelScale 1.0, levelBias 0.0, timeScale 1.0, action 0]

so you're passing the value of the constant FREE (which happens to be 2) as the 2nd param which in this case is the gate. You could try fixing it as follows:

(env-gen (perc 0.01 (* dur %2) ) :action FREE)

which *would* be closer, but still wouldn't work as expected. This will free the synth, but it will free as soon as the shortest envelope has completed, which in the case of a larger number of partials will be very quick indeed :-)

Ideally, you want the synth to free itself when the bells have stopped ringing. Luckily there's a ugen that has exactly this behaviour and it's called #'detect-silence. You pass it a signal, and when it detects silence (with a modifiable threshold) you can trigger an 'action' which in this case you'd like to FREE the containing synth. In my version of your lovely Troika piece, I added this to the definst itself rather than in the bell-partial cgen (which I also spruced up with some docs and defaults).

Thanks once again for such lovely work. It was a real joy to play with! I'm looking forward to seeing what you come up with next. Keep on gisting!

Sam

---
http://sam.aaron.name

On 12 Dec 2011, at 14:48, Jen Smith wrote:

Jennifer Smith

unread,
Dec 14, 2011, 9:59:35 AM12/14/11
to over...@googlegroups.com
Hey Sam,

Thanks for looking at that  (and for doing the documentation... I was getting round to it honest!)- I was wondering why it would also degrade after a few loops too. I guess if I was not freeing, there were a whole bunch of oscillators hanging around - particularly at higher speeds. The FREE thing is a little bit confusing and easy to mess up. Addressing that would be cool but may be tough. 

I was going to look next into getting numbers out of supercollider to see why it was getting crashy - possibly using the scope vizualisation thing. Might be good for debugging anyway.

I will have a look at the 'klang' ugen too - I wonder if the name implies bell-ness? If there is a more efficient way of adding a bunch of sine waves together then I would like to give it a try.

BTW this was actually an assignment I had to do at university about 10 years ago - we used SynC Modular back then (what became NI's Reaktor). This is definitely a better experience. The only thing I miss was the knob twiddling to adjust the partials and get fast feedback. Next time I would probably hook up touch-osc for that!

Cheers

Jen

--
Jennifer Smith
------
@jennifersmithco

Sam Aaron

unread,
Dec 14, 2011, 1:18:00 PM12/14/11
to over...@googlegroups.com

On 14 Dec 2011, at 14:59, Jennifer Smith wrote:

> I was going to look next into getting numbers out of supercollider to see why it was getting crashy - possibly using the scope vizualisation thing. Might be good for debugging anyway.

It's a simple trick, but the way I realised something was wrong with the synth was by triggering it a few times on the REPL. Each time you trigger a synth, you get an id back representing the running instance of the synth that you triggered. Every new synth you trigger has a new id - it chooses the first available id. This means, if the second time you trigger the synth happens after the first synth has finished you'll get the same id. If the first synth hasn't finished you'll get a higher id. So, by triggering a synth multiple times, if you keep getting higher ids, you know that the previous synths haven't been freed. If the ids start cycling, you know the synths are being freed correctly :-)

Sam

---
http://sam.aaron.name

Sam Aaron

unread,
Dec 17, 2011, 7:17:17 AM12/17/11
to over...@googlegroups.com
Hey Jennifer,

would you mind if we included your Troika piece in the examples directory?

Sam

---
http://sam.aaron.name

Jennifer Smith

unread,
Dec 18, 2011, 11:54:07 AM12/18/11
to over...@googlegroups.com
That would be really cool! 

I might look at how I can use that cgen to plug into other examples - like the wobble too. I haven't really figured out how all the bits plug in together.

Re. the synth IDs thing, is there some kind of call we can make to determine how many are currently active? That might be quite useful!

Jen

Sam Aaron

unread,
Dec 18, 2011, 12:03:47 PM12/18/11
to over...@googlegroups.com

On 18 Dec 2011, at 16:54, Jennifer Smith wrote:

>
> Re. the synth IDs thing, is there some kind of call we can make to determine how many are currently active? That might be quite useful!

You can get all sorts of info about the server (including the number of active synths) with #'server-info and #'server-status :-)

Sam

---
http://sam.aaron.name

Jeff Rose

unread,
Dec 18, 2011, 12:06:45 PM12/18/11
to over...@googlegroups.com
If you call (server-status) it will tell you how many synths are currently live on the server. Note that each instrument has a bus mixer which then pipes into a master mixer, and these are always active, so this number will never be at zero. If you want to see a list of the currently active synths you can call (active-synths) too. With the new release that is coming out soon that will also support a synth filter so if you only want to see active synths named "bell" you would call (active-synths "bell").

Cheers,
Jeff


On Monday, December 19, 2011 at 1:54 AM, Jennifer Smith wrote:

> That would be really cool!
>
> I might look at how I can use that cgen to plug into other examples - like the wobble too. I haven't really figured out how all the bits plug in together.
>
> Re. the synth IDs thing, is there some kind of call we can make to determine how many are currently active? That might be quite useful!
>
> Jen
>

Jennifer Smith

unread,
Dec 18, 2011, 12:08:42 PM12/18/11
to over...@googlegroups.com
That's cool - I am just thinking diagnostics wise it would be good to be able to monitor that number. Other than a large crunching sound appearing when there were too many synths, I didn't really know where to start! 
Reply all
Reply to author
Forward
0 new messages