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 » Discussion » Composition
Sample chance Composition Design
Post new topic   Reply to topic Moderators: elektro80
Page 1 of 1 [8 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
alphacore76



Joined: Jun 21, 2009
Posts: 36
Location: Seattle

PostPosted: Sat Jul 11, 2009 12:28 am    Post subject: Sample chance Composition Design Reply with quote  Mark this post and the followings unread

Hello Everyone,

I was up late watching Documentaries on john cage and Sound Art and the ideas of letting chance determine the output of compositions or form of art.. So i came up with this simple method or idea.. and wrote a simple explanation of how i thought it would work and wrote a simple ruby example..

Code:

# Builds Compositions based off Folder and sample hiarchie


# chooses the number of the sample based on postion with the folder..
# The key to this working is the random method as a ruby programmer
# the random method is ccreated using the rand() form of syntax 

# samp=rand(42)+1

#number of channels to be played will be detrimened by the role of a dice
#in computer terms and for show of example the random method can be used

dice_roll=rand(5)+1

# puts "The Dice rolled a #{dice_roll}"
# puts "The sample to be added is the #{samp} down"

# this is that concept inside created into a simple application
# That in ruby at least is a single method that looks like this

def sample_chance_composition_designer
 dice_roll=rand(5)+1
  puts "You rolled a #{ dice_roll }"
 
  dice_roll.times do
  puts "The sample to be added is the #{rand(42)+1} down"
 end
end

# in ruby this runs the method

 sample_chance_composition_designer


by school training I'm a ruby programmer. I'd like to hear what people think on this subject and maybe even simple code examples in other programming languages. I will be writing a full example of this concept and providing a few audio examples at my blog by tomorrow afternoon..

_________________
Within Literature there are endless sonic possibilities
Alphacore Blog Site
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Antimon



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

PostPosted: Sat Jul 11, 2009 3:35 am    Post subject: Reply with quote  Mark this post and the followings unread

A program that randomly finds samples on the disc and plays them... that's a pretty neat idea! Smile

/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
alphacore76



Joined: Jun 21, 2009
Posts: 36
Location: Seattle

PostPosted: Sun Jul 12, 2009 10:58 am    Post subject: Audio Example Added Reply with quote  Mark this post and the followings unread

I added a Audio sample of this concept to my blog if your interested in hearing the output..

the link is in my signature

thanks and chat with everyone later..

_________________
Within Literature there are endless sonic possibilities
Alphacore Blog Site
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dewdrop_world



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

PostPosted: Sun Jul 12, 2009 11:43 am    Post subject: Reply with quote  Mark this post and the followings unread

You could do this in SuperCollider pretty easily, which will also do the audio rendering in realtime or by batch. Instead of telling the user which sample to add, SC would play it at the right time with no other intervention.

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
Inventor
Stream Operator


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

PostPosted: Sun Jul 12, 2009 2:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

Last week I made a ChucK drum sequencer that has a random initialization button. It was amazing to me how good a randomly generated sequence could sound.

The sequencer is an 8-step sequencer simulating a two-handed drummer playing on a drum set with 8 drums.

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



Joined: Jun 21, 2009
Posts: 36
Location: Seattle

PostPosted: Mon Jul 13, 2009 11:49 am    Post subject: Last Night I was inspired by equations and serial music.. Reply with quote  Mark this post and the followings unread

Last night i was watching a video on fractals and serial music and got me thinking and programming Very Happy so knowing that music or midi falls in the range of 0-127 I wanted to write a simple program that created a serial composition that stayed within this range yet stay random in its output so this is what i came up with after a hour of playing around

Code:

composition=[] #creates a Array to store the notes generated

x=rand(2)+2
z=rand(5)+1
a = rand(3)+1

# equation is x = rand(2)+12 + rand(2) + 1 * rand(x) + 3 - a

200.times{|y|composition << x=rand(2) + 12 + rand(2) + 1 * rand(x)+3 - a }
puts "The Notes with the composition"
puts serial_2

# send the array and creates the midi file 
# serial_2.to_midi("song.mid")



This is the midi example of the above code..
[url] http://midishrine.com/midi/29748.mid [/url]

_________________
Within Literature there are endless sonic possibilities
Alphacore Blog Site
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dewdrop_world



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

PostPosted: Wed Jul 15, 2009 8:27 am    Post subject: Reply with quote  Mark this post and the followings unread

If you like ruby, I think you could get into SuperCollider pretty easily.

First a direct translation:

Code:
c=List.new; //creates a Array to store the notes generated

x=rand(2)+2;
z=rand(5)+1;
a = rand(3)+1;

// equation is x = rand(2)+12 + rand(2) + 1 * rand(x) + 3 - a

200.do{ c.add(x = rand(2) + 12 + rand(2) + rand(x) + 3 - a) };

c.postln;
c.asArray.plot;


But you can make it tighter even than explicitly adding items to a List.

Code:
x = rand(2)+2;
z = rand(5)+1;
a = rand(3)+1;

// the following two lines do exactly the same thing
c = Array.fill(200, { x = rand(2) + 12 + rand(2) + rand(x) + 3 - a });
c = { x = rand(2) + 12 + rand(2) + rand(x) + 3 - a } ! 200;


If you want to stream values out on demand instead of precalculating a whole array:

Code:
// pattern-routine, lazy style
p = Prout {
   var   x = rand(2)+2,
      z = rand(5)+1,
      a = rand(3)+1;
   loop {
      (x = rand(2) + 12 + rand(2) + rand(x) + 3 - a).yield
   }
};

// get a bunch
p.asStream.nextN(200);


Playing is easy, no intermediary midi file necessary (though you could write one using Wouter Snoei's SimpleMIDIFile class).

Code:
// automatically render using 'default' SynthDef
q = Pbind(
      // Pfin self-limits to 200 notes
      // you could use just "p+48" here and it'll play forever, until you stop it
   \midinote, Pfin(200, p) + 48,
   \dur, Pwrand([0.25, 0.5, 0.75, Pn(0.125, 2)], #[0.4, 0.3, 0.2, 0.1], inf)
).play;

q.stop;   // when done


The awesome kickass thing about patterns is how malleable they are. Three part polyphony with so little code, it blows my mind.

Code:
q = Pbind(
   \midinote, Pfin(200, p) + 48,
   \dur, Pwrand([0.25, 0.5, 0.75, Pn(0.125, 2)], #[0.4, 0.3, 0.2, 0.1], inf)
);

// Ppar handles the polyphony
// Pset assigns different panning to each strand
// note the Ruby-esque function argument syntax |i|
r = Ppar({ |i| Pset(\pan, (i-1) * 0.75, q) } ! 3).play;

r.stop;   // when done


Have a look - http://supercollider.sourceforge.net

BTW the equation is way cool - somehow it seems to modulate among different modal areas!

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
mysticalfairy



Joined: Dec 06, 2005
Posts: 7
Location: tampa

PostPosted: Mon Sep 07, 2009 8:32 am    Post subject: Reply with quote  Mark this post and the followings unread

algorythmic music has always held a special place in my heart Smile
_________________
Ephemeral Mists
The synthetic dream foundation
Abandoned Toys
Mythical Records
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: elektro80
Page 1 of 1 [8 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » Discussion » Composition
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