Patterns sync and best practice

View: New views
4 Messages — Rating Filter:   Alert me  

Patterns sync and best practice

by Jason Smalridge :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey,
I am learning how to make patterns with the Pdef and Pseq.  I was
reading someones example code yesterday for making a drum pattern.  He
made arrays to keep the multiple patterns in sync.
Ex:

a and b would be values for the amplitude of the notes.


snare
a = [0,0,0,1,0,0,0,1];

bass drum
b= [0,1,0,0,0,1,0,0];

etc....

but i was wondering if this is the best way to do this?  It seems to me
that it is a sort of hack to keep them in sync together when in reality
you are still processing the sounds.  Is there another way to sync up
multiple patterns where there are parts that are silent and parts that
are sounding.

If you were to get rid of the redundant notes - Obviously this wouldn't
work


snare
a = [1,1];

bass drum
b= [1,1];


Thanks,
Jason

_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Patterns sync and best practice

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On May 7, 2008, at 9:22 AM, Jason Smalridge wrote:

Hey,
I am learning how to make patterns with the Pdef and Pseq.  I was 
reading someones example code yesterday for making a drum pattern.  He 
made arrays to keep the multiple patterns in sync.

That could be my code. :)

A pattern can generate a "rest" event by setting the \type or \freq keys to the value \rest. The event will take up the required amount of time, but not send any message to the server.

p = Pbind(
\degree, Pn(Pseries(0, 1, 8), inf),
\dur, 0.125,
\legato, 0.8,
\type, Pwrand(#[note, rest], #[0.4, 0.6], inf)
).play;

p.stop;

If you're talking about my bufPerc or defPerc processes, the actual behavior is to preprocess the amplitude array to skip 0s. The times for the 0 items are added up, and those sums become the event durations. If the array starts with zero, a rest event is added at the beginning.

a = [0,0,0,1,0,0,0,1];

becomes (loosely... the actual implementation is slightly different)

(eventType: \rest, amp: 0, delta: 0.75)
(eventType: \note, amp: 1, delta: 1.0)
(eventType: \note, amp: 1, delta: 0.25)

Someone will probably tell you to use Ppar or Ptpar... I tend to avoid that in my own work because I prefer to be able to start and stop processes independently. Once you group a bunch of patterns into Ppar/Ptpar, you lose that ability. But, it's a good way to go if you know that you will always need to treat the patterns as a unit.

hjh


: H. James Harkins

: jamshark70@...

: http://www.dewdrop-world.net

.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:


"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman



_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Patterns sync and best practice

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On May 7, 2008, at 11:30 PM, James Harkins wrote:

(eventType: \rest, amp: 0, delta: 0.75)
(eventType: \note, amp: 1, delta: 1.0)
(eventType: \note, amp: 1, delta: 0.25)

Oops...

(type: \rest, amp: 0, delta: 0.75)
(type: \note, amp: 1, delta: 1.0)
(type: \note, amp: 1, delta: 0.25)


: H. James Harkins

: jamshark70@...

: http://www.dewdrop-world.net

.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:


"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman



_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

Re: Patterns sync and best practice

by Jason Smalridge :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks James!
Ok.  No problem.  I just wanted to make sure that I don't learn SC with
any bad habits that I would have to unlearn later.  But if that is how
everyone creates a rest .... "When in Rome..."

Thanks,
Jay

James Harkins wrote:

> On May 7, 2008, at 11:30 PM, James Harkins wrote:
>
>> (eventType: \rest, amp: 0, delta: 0.75)
>> (eventType: \note, amp: 1, delta: 1.0)
>> (eventType: \note, amp: 1, delta: 0.25)
>
> Oops...
>
> (type: \rest, amp: 0, delta: 0.75)
> (type: \note, amp: 1, delta: 1.0)
> (type: \note, amp: 1, delta: 0.25)
>
>
> : H. James Harkins
> : jamshark70@...
> : http://www.dewdrop-world.net
> .::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:
>
> "Come said the Muse,
> Sing me a song no poet has yet chanted,
> Sing me the universal."  -- Whitman
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> sc-users mailing list
> sc-users@...
> http://lists.create.ucsb.edu/mailman/listinfo/sc-users
>  
_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users