another (post-3.3?) pattern cleanup

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

another (post-3.3?) pattern cleanup

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

<RANT ON>

I'm writing a Pchain that receives:

- real events that need some post processing;
- rest events from Psync that should pass through unchanged;
- rest events from Pspawner that should pass through unchanged.

Now, how hard is that? Actually a lot harder than it could be because Psync uses Event.silent while Pspawner sets \freq to \rest.

!!!!!

A little consistency please!

</RANT OFF>

Whew. Sorry for ranting but gee whiz, this makes it just extra-fun to compose with SC.

Since I haven't heard about RC being packaged yet, let me take a chance on changing Spawner to use Event.silent too.

hjh



: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman


Re: another (post-3.3?) pattern cleanup

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Just to avert misunderstanding... I'm chuckling as I write this. Not that it wasn't frustrating today but I'm in good spirits about it.

hjh

On Apr 21, 2009, at 11:24 PM, James Harkins wrote:

<RANT ON>

I'm writing a Pchain that receives:

- real events that need some post processing;
- rest events from Psync that should pass through unchanged;
- rest events from Pspawner that should pass through unchanged.

Now, how hard is that? Actually a lot harder than it could be because Psync uses Event.silent while Pspawner sets \freq to \rest.

!!!!!

A little consistency please!

</RANT OFF>

Whew. Sorry for ranting but gee whiz, this makes it just extra-fun to compose with SC.

Since I haven't heard about RC being packaged yet, let me take a chance on changing Spawner to use Event.silent too.


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman


Re: another (post-3.3?) pattern cleanup

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A quick scan through and Ppar is the only other one left (that I can see quickly) that sets \freq to \rest. That seems bad to me. Maybe someone is using a non-default event prototype that doesn't identify rests by a Symbol for frequency?

hjh


On Apr 21, 2009, at 11:24 PM, James Harkins wrote:

<RANT ON>
... snip ...
</RANT OFF>


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman


Re: another (post-3.3?) pattern cleanup

by Josh Parmenter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi James,

Please let me know when you are done... also, did anything happen with MixedMessages?

Josh

On Apr 21, 2009, at 8:24 PM, James Harkins wrote:

Since I haven't heard about RC being packaged yet, let me take a chance on changing Spawner to use Event.silent too.


******************************************

/* Joshua D. Parmenter

http://www.realizedsound.net/josh/


“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono

*/


Re: another (post-3.3?) pattern cleanup

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Done. (I didn't do anything with the other.)
hjh

On Apr 22, 2009, at 12:09 AM, Josh Parmenter wrote:

Hi James,

Please let me know when you are done... also, did anything happen with MixedMessages?


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman


Re: another (post-3.3?) pattern cleanup

by Josh Parmenter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks James,

Josh

On Apr 21, 2009, at 9:16 PM, James Harkins wrote:

Done. (I didn't do anything with the other.)
hjh

On Apr 22, 2009, at 12:09 AM, Josh Parmenter wrote:

Hi James,

Please let me know when you are done... also, did anything happen with MixedMessages?


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman


******************************************

/* Joshua D. Parmenter

http://www.realizedsound.net/josh/


“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono

*/


Re: another (post-3.3?) pattern cleanup

by Scott Wilson-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 22 Apr 2009, at 05:09, Josh Parmenter wrote:

> Hi James,
>
> Please let me know when you are done... also, did anything happen  
> with MixedMessages?
>
It's really quite hard to say...

S.

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

Re: another (post-3.3?) pattern cleanup

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Apr 21, 2009, at 11:41 PM, James Harkins wrote:

A quick scan through and Ppar is the only other one left (that I can see quickly) that sets \freq to \rest. That seems bad to me. Maybe someone is using a non-default event prototype that doesn't identify rests by a Symbol for frequency?

Thinking further -- there is one advantage to setting a \rest key in the input event, which is that it's minimal change to the input event and downstream patterns that might be using expected values from the input event might not always have to check for a rest.

~asPattern = {
var valueFixes = Pbind(
#[start, bufnum], Pfunc { |ev|
[~segStart.wrapAt(ev[\bufIndex]).wrapAt(ev[\start]),
~buffers.wrapAt(ev[\bufIndex]).tryPerform(\bufnum) ? ~buffers[0].bufnum
]
},
\time, min(Pkey(\delta), Pkey(\time)) / Pfunc { thisThread.clock.tempo },
\instrument, Pif(Pkey(\amp) > 0, Pkey(\instrument), \rest)
);
Pchain(
// here's my rest check
Pif(Pbinop('==', Pkey(\type), \rest), Pfunc { |ev| ev }, valueFixes),
Pn(Plazy({
var meter = /*BP(~cond).currentMeter ?*/ thisThread.clock.beatsPerBar;
Psync(~getGesture.(meter), meter, meter);
}), inf)
)
};

What happened last night is that I put in the Pif rest check to catch the silent event from Psync, but then Pspawner (used in the get gesture function) surprised me with rests whose type is not rest.

With the change last night, the above works, but it also means rest checking is one more thing the user has to be aware of.

Maybe this is better?

(Event.sc):

*silent { arg dur = 1.0, inEvent;
// ^Event.new(8, nil, defaultParentEvent, true).put(\type, \rest).put(\dur, dur)
^inEvent.copy.put(\type, \rest).put(\dur, \dur)
}

... but then, there's one place (Spawner:wait) that doesn't have access to the input event. I don't see an easy fix for that.

Confused... at this point, MixedMessages is making more sense to me :)

hjh


: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman


Re: another (post-3.3?) pattern cleanup

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Apr 22, 2009, at 8:47 AM, James Harkins wrote:

Maybe this is better?

(Event.sc):

*silent { arg dur = 1.0, inEvent;
// ^Event.new(8, nil, defaultParentEvent, true).put(\type, \rest).put(\dur, dur)
^inEvent.copy.put(\type, \rest).put(\dur, \dur)
}

Erm, no, this:

*silent { arg dur = 1.0, inEvent;
inEvent.copy.put(\type, \rest).put(\dur, dur).put(\parent, defaultParentEvent)
inEvent[\delta] = inEvent.delta;
^inEvent
}

And I found how to handle Spawner:wait.

Diff attached.
hjh





: H. James Harkins
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman


rests.diff (2K) Download Attachment

Re: another (post-3.3?) pattern cleanup

by nescivi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 22 April 2009 03:03:12 Scott Wilson wrote:
> On 22 Apr 2009, at 05:09, Josh Parmenter wrote:
> > Hi James,
> >
> > Please let me know when you are done... also, did anything happen
> > with MixedMessages?
>
> It's really quite hard to say...

It really seems that Josh was interpreting it as a MissedMessage...
;)

sincerely,
Marije

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

Re: another (post-3.3?) pattern cleanup

by nescivi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 22 April 2009 09:30:29 nescivi wrote:

> On Wednesday 22 April 2009 03:03:12 Scott Wilson wrote:
> > On 22 Apr 2009, at 05:09, Josh Parmenter wrote:
> > > Hi James,
> > >
> > > Please let me know when you are done... also, did anything happen
> > > with MixedMessages?
> >
> > It's really quite hard to say...
>
> It really seems that Josh was interpreting it as a MissedMessage...
> ;)


Actually that class might be hard to implement, as we'd need to have a way to
keep track of the sender, to ensure that that one assumes the receiver got
the message.

sincerely,
Marije

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

Re: another (post-3.3?) pattern cleanup

by Scott Wilson-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 22 Apr 2009, at 14:30, nescivi wrote:

> On Wednesday 22 April 2009 03:03:12 Scott Wilson wrote:
>> On 22 Apr 2009, at 05:09, Josh Parmenter wrote:
>>> Hi James,
>>>
>>> Please let me know when you are done... also, did anything happen
>>> with MixedMessages?
>>
>> It's really quite hard to say...
>
> It really seems that Josh was interpreting it as a MissedMessage...
> ;)

I wouldn't assume that. ;-)

S.

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/

Re: another (post-3.3?) pattern cleanup

by James Harkins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Since we're waiting.... any objections to this patch? I think it's
good for consistency.

http://www.listarc.bham.ac.uk/lists/sc-dev/msg09579.html

I'll check it in soon if not.

hjh

On Wed, Apr 22, 2009 at 9:13 AM, James Harkins <jamshark70@...> wrote:

> On Apr 22, 2009, at 8:47 AM, James Harkins wrote:
>
> Maybe this is better?
> (Event.sc):
> *silent { arg dur = 1.0, inEvent;
> // ^Event.new(8, nil, defaultParentEvent, true).put(\type, \rest).put(\dur,
> dur)
> ^inEvent.copy.put(\type, \rest).put(\dur, \dur)
> }
>
> Erm, no, this:
> *silent { arg dur = 1.0, inEvent;
> inEvent.copy.put(\type, \rest).put(\dur, dur).put(\parent,
> defaultParentEvent)
> inEvent[\delta] = inEvent.delta;
> ^inEvent
> }
> And I found how to handle Spawner:wait.
> Diff attached.
> hjh


--
James Harkins /// dewdrop world
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-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/