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 
go to the radio page Live at electro-music.com radio 1 Please visit the chat
poster
 Forum index » DIY Hardware and Software » ChucK programming language
How to use external samples with Chuck
Post new topic   Reply to topic Moderators: Kassen
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
chuckman



Joined: Dec 06, 2019
Posts: 1
Location: chuck town

PostPosted: Fri Dec 06, 2019 9:27 am    Post subject: How to use external samples with Chuck
Subject description: Need help with using samples with Chuck
Reply with quote  Mark this post and the followings unread

Please help guys, i have a code that i written for chuck but i dont know how to assign externals samples to be used in chuck
Back to top
View user's profile Send private message
son0p



Joined: Aug 16, 2020
Posts: 1
Location: colombia

PostPosted: Sun Aug 16, 2020 8:00 am    Post subject: Reply with quote  Mark this post and the followings unread

From the examples in https://chuck.cs.princeton.edu/doc/examples/

sndbuf (file read/write/playback)

Code:

// sound file
me.sourceDir() + "/../data/snare.wav" => string filename;
if( me.args() ) me.arg(0) => filename;

// the patch
SndBuf buf => dac;
// load the file
filename => buf.read;

// time loop
while( true )
{
    0 => buf.pos;
    Math.random2f(.2,.5) => buf.gain;
    Math.random2f(.5,1.5) => buf.rate;
    100::ms => now;
}
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 [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 » 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