electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Supercollider
flies' noob questions
Post new topic   Reply to topic Moderators: v-un-v
Page 1 of 1 [2 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
flies



Joined: May 20, 2008
Posts: 33
Location: NJ

PostPosted: Wed Sep 02, 2009 3:50 pm    Post subject: flies' noob questions
Subject description: attenuate and play an audio bus
Reply with quote  Mark this post and the followings unread

so, unless ppl think this is a bad idea, i'm going to bundle all my noob questions together. this may make them less searchable but it won't clog the board with my mess.

here's my current problem: i want to send the output of a two synths to one bus, and attenuate that bus, then send the attenuated sum to speakers.

here's what i've got (working off of the busses tutorial)

Code:
s.reboot;
(
  SynthDef("tutorial-Infreq", { arg inBus, outBus, freqOffset = 0;
    // this will add freqOffset to whatever is read in from the bus
    Out.ar(outBus, SinOsc.ar(In.kr(inBus) + freqOffset, 0, 0.5));
  }).send(s);

  SynthDef("tutorial-Outfreq", {
    arg centerFreq = 400, modFreq = centerFreq/2, modAmount = 0.025, bus;
    Out.kr(bus, SinOsc.kr(modFreq, 0, centerFreq*modAmount, centerFreq));
    }).send(s);
  b = Bus.control(s,1);
  c = Bus.audio(s,1);
)

(
  f = 1000;
  x = Synth.new("tutorial-Outfreq", [\bus, b,\modFreq,f, \modAmount,2]);
  y = Synth.after(x, "tutorial-Infreq", [\inBus, b,\outBus, c]);
  z = Synth.after(x, "tutorial-Infreq", [\inBus, b,\outBus, c, \freqOffset, 200]);
)

x.free; y.free; z.free;
b.free;


so, now i have this bus c, and i want to attenuate it then output it. how do i do that? [/code]
Back to top
View user's profile Send private message
dewdrop_world



Joined: Aug 28, 2006
Posts: 858
Location: Guangzhou, China
Audio files: 4

PostPosted: Fri Sep 04, 2009 9:15 am    Post subject: Reply with quote  Mark this post and the followings unread

Attenuation = multiplication by a (positive) number less than 1.0

So you can use In.ar to read the signal from c, then multiply it, then Out.ar to bus 0 (main hardware output bus).

Or, if you want the mono signal to output in stereo:

Code:
Out.ar(0, (signal * attenuation) ! 2)


!2 duplicates the 1-channel signal into 2 channels.

James

_________________
ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic Moderators: v-un-v
Page 1 of 1 [2 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Supercollider
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use