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 » ChucK programming language
Slicing a sample
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [13 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Arnaud06



Joined: Jul 13, 2009
Posts: 40
Location: France
Audio files: 1

PostPosted: Tue Jul 28, 2009 2:41 pm    Post subject: Slicing a sample Reply with quote  Mark this post and the followings unread

Hi,

It's me again. I have a question, wich mught not be related to ChucK, but I think a can find some people here who can help me. I want to "slice" a sample, but when I do it the butcher way, it (obviously) click at each part.

I just want to learn how to cut a sample properly with ChucK's generator or analyzers.... So if anyone have a website or anything on the subject, link me Wink

Thank you !!
Back to top
View user's profile Send private message
mrcold



Joined: Jun 18, 2009
Posts: 187
Location: USA
Audio files: 31

PostPosted: Tue Jul 28, 2009 7:35 pm    Post subject: Reply with quote  Mark this post and the followings unread

what are using to do the slicing? I've used SndBuf and did the slicing by editing the start position of the file and I didn't notice any clicking... i was slicing a beat though, so i probably wouldn't have noticed the clicking.

In any case, look up SndBuf in the documentation (look at the otf examples for usage) and then something like THIS:

44100 => buf.pos;

will start playback at sample 44100.

when the file is read into memory, you can get the total length (in samples) by reading buf.samples.

when i sliced up a beat i got the total length in samples and divided that number by 8 or 16 and then send THAT number multiplied to buf.pos, so i got 8 or 16 even slices.

if that gives you clicks, you could use a quick volume envelope to smooth out the edges of the slicing.

good luck
Back to top
View user's profile Send private message
Arnaud06



Joined: Jul 13, 2009
Posts: 40
Location: France
Audio files: 1

PostPosted: Wed Jul 29, 2009 1:09 am    Post subject: Reply with quote  Mark this post and the followings unread

That is exactly what I did !! We are on the same page (like in the Bubbles melody you post, I put my melody into arrays Wink ). I thought about the enveloppe, but it works for the first part, after that the envelope doesn't reset. I use the ADSR, with KeyOn/KeyOff.
Back to top
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Wed Jul 29, 2009 3:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

One thing is to try to find a position in the sample where it crosses zero, and switch there. Check out this zero crossing thingie by Kassen:

http://electro-music.com/forum/viewtopic.php?highlight=sample+zero+crossing&t=23167

Otherwise I've had fairly good results with a fast envelope, but you need two voices for that - one ramping down as the other ramps up.

/Stefan

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
Arnaud06



Joined: Jul 13, 2009
Posts: 40
Location: France
Audio files: 1

PostPosted: Thu Jul 30, 2009 12:40 am    Post subject: Reply with quote  Mark this post and the followings unread

What do you mean two voices ?
Back to top
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Thu Jul 30, 2009 12:52 am    Post subject: Reply with quote  Mark this post and the followings unread

Two SndBufs (if that's what you're using) each with an envelope, one silent and one playing. Then, when you're changing what part of the sample you're playing, you set the position on the one that is silent and do env1.keyOff(); env2.keyOn();

...

Come to think of it, maybe I misunderstand what "slice" means... do you want to change what part of the sample is playing, or do you just want to make it go quiet every now and then?

/Stefan

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
Kassen
Janitor
Janitor


Joined: Jul 06, 2004
Posts: 7678
Location: The Hague, NL
G2 patch files: 3

PostPosted: Thu Jul 30, 2009 3:26 am    Post subject: Reply with quote  Mark this post and the followings unread

Antimon wrote:
Two SndBufs (if that's what you're using) each with an envelope, one silent and one playing. Then, when you're changing what part of the sample you're playing, you set the position on the one that is silent and do env1.keyOff(); env2.keyOn();


LiSa
LiSa
LiSa
LiSa
LiSa
LiSa

Did I mention LiSa lately? She does all of that, with ready made multiple voices, each with envelopes, exactly because it helps deal with zero-x-ings. Really, LiSa is the bestest for everything.
Wink

_________________
Kassen
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 6221
Location: near Austin, Tx, USA
Audio files: 267

PostPosted: Thu Jul 30, 2009 5:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Haha LiSa LiSa LiSa! Our Alice in Wonderland character, such a dear she is! I tried to get LiSa working but couldn't understand how the read pointer worked or how it sucked in samples. Does LiSa just suck in a minute's worth of samples or does it take a minute to do that? How do you playback backwards? I want to make an accelerometer-based record scratcher for the Laptop Battle using LiSa.

Les

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Thu Jul 30, 2009 8:52 am    Post subject: Reply with quote  Mark this post and the followings unread

Heh, yeah LiSa is a great gal. I just think that she's a bit clumsy with sound files. I know there are a couple of tricks to read in, connecting to blackhole and shuffling bits, or just piping and recording, but that's tricky enough to distract I think.

/Stefan

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
Arnaud06



Joined: Jul 13, 2009
Posts: 40
Location: France
Audio files: 1

PostPosted: Fri Jul 31, 2009 10:35 am    Post subject: Reply with quote  Mark this post and the followings unread

But... Who is LiSa ?
Back to top
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4145
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Fri Jul 31, 2009 1:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

http://chuck.cs.princeton.edu/doc/program/ugen_full.html#LiSa
_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
DrumAliens



Joined: Jul 10, 2008
Posts: 31
Location: UK
Audio files: 1

PostPosted: Fri Jul 31, 2009 11:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

Not sure if any of this helps

http://electro-music.com/forum/topic-33705.html
Back to top
View user's profile Send private message
Arnaud06



Joined: Jul 13, 2009
Posts: 40
Location: France
Audio files: 1

PostPosted: Sat Aug 01, 2009 10:11 am    Post subject: Reply with quote  Mark this post and the followings unread

Oh ok, I didn't look into the UGen list, sorry Embarassed

I'm not at home right now, so I'll take a loop deep into this LiSa, and in your script DrumAliens too Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [13 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 » ChucK programming language
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