Quantcast

Google Doodles with SC

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Google Doodles with SC

Nick Inhofe
Hey everyone. As some of you probably have noticed, google has a guitar logo in honor of Les Paul.

Well...of course its time to pull out SC and see what this baby can do. :)  

I've been using the keystroke extension from wslib to sequence the guitar. It's a lot of fun! Here are links to some of the best ones I've come up with so far, with code below. It would be fun to get a thread of these going.

A word of warning though.. dont use an infinite loop for a keystroke routine since its really hard to get back to the SC app to stop the loop. It nearly crashed my computer once already.

-Nick

http://goo.gl/doodle/svAI
http://goo.gl/doodle/0Stm
http://goo.gl/doodle/CBbM

TempoClock.tempo = 125/60;
~notes = ["a", "s", "d", "f", "g", "h", "j", "k"]; //available notes

~st = { |n| n.keyStroke(app: "Firefox")}; //play a note in firefox


//http://goo.gl/doodle/xue3
(
Routine({
        var current, index, delt;

        index = Pseries(0, 1, inf) +.x Pseries(0, Pseries(0, 1, inf) +.x Pseq([3,2,3], 2), 8).wrap(0, ~notes.size-1);
       
        index = index.asStream.asStream;
       
        delt = Pseq([
                                Pseq([1,1, 0.5], 2),
                                Pseq([1, 0.5, 0.5], 1)
                                ],inf).asStream;
        70.do({
                |i|
        // i.postln;
                current = ~notes[index.next];
                ~st.(current);
                delt.next.wait;
        });
}).play(quant:4);
)


// http://goo.gl/doodle/svAI
(
Routine({
        var current, index, delt;

        index = Pseries(0, Pseq([1,2],inf), inf);
       
        index = index.asStream.asStream;
       
        delt = Pseq([2,1],inf).asStream;
        70.do({
                |i|
        // i.postln;
                current = index.next;
                ~st.(~notes.wrapAt(current));
                ~st.(~notes.wrapAt(current+2));
                delt.next.wait;
        });
}).play(quant:4);
)

// http://goo.gl/doodle/0Stm
(
Routine({
        var current, index, delt;

        index = Pseries(0, Pseq([3,2],inf), inf);
       
        index = index.asStream.asStream;
       
        delt = Pseq([1,1,2, 1,1,2, 0.5, 0.5, 0.5, 0.5],inf).asStream;
        40.do({
                |i|
        // i.postln;
                current = index.next;
                ~st.(~notes.wrapAt(current));
                ~st.(~notes.wrapAt(current+3));
                delt.next.wait;
        });
}).play(quant:4);
)

// http://goo.gl/doodle/CBbM
(
Routine({
        var current, index, delt;

        index = Pseries(0, Pseq([4,2, 1,1],inf), inf);
       
        index = index.asStream.asStream;
       
        delt = Place([1,1,1,1, 2],inf).asStream;
        40.do({
                |i|
        // i.postln;
                current = index.next;
                ~st.(~notes.wrapAt(current));
                ~st.(~notes.wrapAt(current+4));
                delt.next.wait;
        });
}).play(quant:4);
)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

Nick Inhofe
Well.. since there haven't been any takers, I made some more.  

links and code-
http://goo.gl/doodle/Umqyj
http://goo.gl/doodle/WNGCf
http://goo.gl/doodle/RRrMy

TempoClock.tempo = 125/60;
~notes = ["a", "s", "d", "f", "g", "h", "j", "k"];
~st = { |n| n.keyStroke(app: "Firefox")};


(
//http://goo.gl/doodle/Umqyj
Routine({
        var current, index, delt, reps = 16;

        index = Pstutter(reps, Pseries(0, 1, inf));
       
        index = index.asStream;
       
        delt = (Pgeom(2, 0.75, reps)++1).loop.asStream;
        98.do({
                |i|
        // i.postln;
                var tDelt = delt.next;
                current = index.next;
                ~st.(~notes.wrapAt(current));
                tDelt.wait;
                ~st.(~notes.wrapAt(current+2));
                tDelt.next.wait;
        });
}).play(quant:4);

)


(
//http://goo.gl/doodle/WNGCf
Routine({
        var current, index, delt;

        index = Pstutter(Pseq([1,2,1,2,1,1], inf), Pseries(1, 2, inf) *.x Pseries(0, 1, 2) +.x Pseries(0, 3, 3));
       
        index = index.asStream;
       
        delt = Pseq([
                                Pseq([1, 0.5, 0.5], 3),
                                Pseq([0.5, 0.5, 0.5, 0.5],1)
                        ], inf).asStream;
                       
        70.do({
                |i|
                var tDelt = delt.next * 0.5;
        // i.postln;
                current = index.next;
                ~st.(~notes.wrapAt(current));
                tDelt.wait;
                ~st.(~notes.wrapAt(current+2));
                tDelt.wait;
        });
}).play(quant:4);
)


//http://goo.gl/doodle/RRrMy
(
var root, rSet;
//set prog root

rSet = Routine({
        var prog, progDelt;
       
        prog = Pseries(0, 4, inf).wrap(0, ~notes.size).loop.asStream;
        progDelt = 4;
       
        //we can use inf here because its not actually scripting firefox
        inf.do({
                root = prog.next;
                //root.postln;
                progDelt.next.wait;
        });
}).play(quant: [4,0, 0.1]);

Routine({
        var current, index, delt;

        index = Pseq([0, 0, 4,2],inf).asStream;
       
        index = index.asStream;
       
        delt = Place([
                        Pseq([1,Pn(0.5, 6)], 1),
                        [
                                Pn(0.5, 8),
                                Pn(0.5, 8),
                                Pseq([0.5, 1, Pn(0.5, 4)])
                        ]
                ],inf).asStream;
                       
        100.do({
                |i|
                var tDelt = delt.next * 0.5;
        // i.postln;
                current = index.next + root;
                ~st.(~notes.wrapAt(current));
                delt.next.wait;
        });
        rSet.stop;
}).play(quant:4);
)


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

shreeswifty
This post has NOT been accepted by the mailing list yet.
Can you explain how you got supercollider to talk to the google step by step please? 

Patrick Pagano B.S.,M.F.A
Digital Media Engineer
UF Digital Worlds Institute
(352)294-2020


On Jun 10, 2011, at 9:06 PM, "Nick Inhofe [via New SuperCollider Mailing Lists Forums (Use These!!!)]" <[hidden email]> wrote:

Well.. since there haven't been any takers, I made some more.  

links and code-
http://goo.gl/doodle/Umqyj
http://goo.gl/doodle/WNGCf
http://goo.gl/doodle/RRrMy

TempoClock.tempo = 125/60;
~notes = ["a", "s", "d", "f", "g", "h", "j", "k"];
~st = { |n| n.keyStroke(app: "Firefox")};


(
//http://goo.gl/doodle/Umqyj
Routine({
        var current, index, delt, reps = 16;

        index = Pstutter(reps, Pseries(0, 1, inf));
       
        index = index.asStream;
       
        delt = (Pgeom(2, 0.75, reps)++1).loop.asStream;
        98.do({
                |i|
        // i.postln;
                var tDelt = delt.next;
                current = index.next;
                ~st.(~notes.wrapAt(current));
                tDelt.wait;
                ~st.(~notes.wrapAt(current+2));
                tDelt.next.wait;
        });
}).play(quant:4);

)


(
//http://goo.gl/doodle/WNGCf
Routine({
        var current, index, delt;

        index = Pstutter(Pseq([1,2,1,2,1,1], inf), Pseries(1, 2, inf) *.x Pseries(0, 1, 2) +.x Pseries(0, 3, 3));
       
        index = index.asStream;
       
        delt = Pseq([
                                Pseq([1, 0.5, 0.5], 3),
                                Pseq([0.5, 0.5, 0.5, 0.5],1)
                        ], inf).asStream;
                       
        70.do({
                |i|
                var tDelt = delt.next * 0.5;
        // i.postln;
                current = index.next;
                ~st.(~notes.wrapAt(current));
                tDelt.wait;
                ~st.(~notes.wrapAt(current+2));
                tDelt.wait;
        });
}).play(quant:4);
)


//http://goo.gl/doodle/RRrMy
(
var root, rSet;
//set prog root

rSet = Routine({
        var prog, progDelt;
       
        prog = Pseries(0, 4, inf).wrap(0, ~notes.size).loop.asStream;
        progDelt = 4;
       
        //we can use inf here because its not actually scripting firefox
        inf.do({
                root = prog.next;
                //root.postln;
                progDelt.next.wait;
        });
}).play(quant: [4,0, 0.1]);

Routine({
        var current, index, delt;

        index = Pseq([0, 0, 4,2],inf).asStream;
       
        index = index.asStream;
       
        delt = Place([
                        Pseq([1,Pn(0.5, 6)], 1),
                        [
                                Pn(0.5, 8),
                                Pn(0.5, 8),
                                Pseq([0.5, 1, Pn(0.5, 4)])
                        ]
                ],inf).asStream;
                       
        100.do({
                |i|
                var tDelt = delt.next * 0.5;
        // i.postln;
                current = index.next + root;
                ~st.(~notes.wrapAt(current));
                delt.next.wait;
        });
        rSet.stop;
}).play(quant:4);
)





If you reply to this email, your message will be added to the discussion below:
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Google-Doodles-with-SC-tp6456732p6464268.html
To start a new topic under New SuperCollider Mailing Lists Forums (Use These!!!), email [hidden email]
To unsubscribe from New SuperCollider Mailing Lists Forums (Use These!!!), click here.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

Nick Inhofe
Sure-

Google's Guitar doodle responds to keystrokes, where any row plays the same set of notes. I went with
asdfghjkl as the list of notes. This is represented by

~notes = ["a", "s", "d", "f", "g", "h", "j", "k"]; //possible notes stored here

The actual communication with Firefox is in this function -

~st = { |n| n.keyStroke(app: "Firefox")};

The method keyStroke is an extension in the wslib quark. If you dont have it, you can check it out by running the command-

Quarks.checkout("wslib");

You will have to re-compile by pressing cmd+k.

keyStroke is actually an extension to the String class. So this corresponds with the list of notes in ~note.
Keystroke can take an argument app which says which application to use. You could substitute Chrome or Safari etc if that is your browser of choice. So the function ~st just issues the keystroke in Firefox. You could do this manually by running something like

~st.(~notes[0]);

The most direct way of doing this is -
"a".keyStroke(app: "Firefox");

All this does is make Supercollider type "a" into Firefox via AppleScript. The rest of the code just sequences these keystrokes over time, accessing the ~notes array with various patterns.

Hope that helps
-Nick
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

bjornw
Saw this on CDM - very neat, way to bring some lost souls into the light.

On Fri, Jun 10, 2011 at 11:11 PM, Nick Inhofe <[hidden email]> wrote:
Sure-

Google's Guitar doodle responds to keystrokes, where any row plays the same
set of notes. I went with
asdfghjkl as the list of notes. This is represented by

~notes = ["a", "s", "d", "f", "g", "h", "j", "k"]; //possible notes stored
here

The actual communication with Firefox is in this function -

~st = { |n| n.keyStroke(app: "Firefox")};

The method keyStroke is an extension in the wslib quark. If you dont have
it, you can check it out by running the command-

Quarks.checkout("wslib");

You will have to re-compile by pressing cmd+k.

keyStroke is actually an extension to the String class. So this corresponds
with the list of notes in ~note.
Keystroke can take an argument app which says which application to use. You
could substitute Chrome or Safari etc if that is your browser of choice. So
the function ~st just issues the keystroke in Firefox. You could do this
manually by running something like

~st.(~notes[0]);

The most direct way of doing this is -
"a".keyStroke(app: "Firefox");

All this does is make Supercollider type "a" into Firefox via AppleScript.
The rest of the code just sequences these keystrokes over time, accessing
the ~notes array with various patterns.

Hope that helps
-Nick
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Google-Doodles-with-SC-tp6456732p6464430.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users 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-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/



--
Bjorn (http://phrontist.org)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

Dan Stowell
In reply to this post by Nick Inhofe
Oh nice! Sorry, from your first email I completely didn't understand
what it was you were doing. Using SC to strum your web browser :)

Dan

2011/6/11 Nick Inhofe <[hidden email]>:

> Sure-
>
> Google's Guitar doodle responds to keystrokes, where any row plays the same
> set of notes. I went with
> asdfghjkl as the list of notes. This is represented by
>
> ~notes = ["a", "s", "d", "f", "g", "h", "j", "k"]; //possible notes stored
> here
>
> The actual communication with Firefox is in this function -
>
> ~st = { |n| n.keyStroke(app: "Firefox")};
>
> The method keyStroke is an extension in the wslib quark. If you dont have
> it, you can check it out by running the command-
>
> Quarks.checkout("wslib");
>
> You will have to re-compile by pressing cmd+k.
>
> keyStroke is actually an extension to the String class. So this corresponds
> with the list of notes in ~note.
> Keystroke can take an argument app which says which application to use. You
> could substitute Chrome or Safari etc if that is your browser of choice. So
> the function ~st just issues the keystroke in Firefox. You could do this
> manually by running something like
>
> ~st.(~notes[0]);
>
> The most direct way of doing this is -
> "a".keyStroke(app: "Firefox");
>
> All this does is make Supercollider type "a" into Firefox via AppleScript.
> The rest of the code just sequences these keystrokes over time, accessing
> the ~notes array with various patterns.
>
> Hope that helps
> -Nick
>
>
> -----
> http://soundcloud.com/exit_only
> --
> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Google-Doodles-with-SC-tp6456732p6464430.html
> Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
>
> _______________________________________________
> sc-users 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-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>



--
http://www.mcld.co.uk

_______________________________________________
sc-users 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-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

shreeswifty
This post has NOT been accepted by the mailing list yet.
In reply to this post by Nick Inhofe
I am getting an error when I run these after I have added the quark

a Routine

ERROR: Message 'wrapAt' not understood.

RECEIVER:

   nil

ARGS:

   Integer 0

CALL STACK:

DoesNotUnderstandError:reportError   15EB5700

arg this = <instance of DoesNotUnderstandError>

Nil:handleError   15EB5D60

arg this = nil

arg error = <instance of DoesNotUnderstandError>

Thread:handleError   15EB4EC0

arg this = <instance of Thread>

arg error = <instance of DoesNotUnderstandError>

Thread:handleError   1C0D4770

arg this = <instance of Routine>

arg error = <instance of DoesNotUnderstandError>

Object:throw   15EB21E0

arg this = <instance of DoesNotUnderstandError>

Object:doesNotUnderstand   15EA3740

arg this = nil

arg selector = 'wrapAt'

arg args = [*1]

< FunctionDef in closed FunctionDef >   1C0D6130

arg i = 0

var tDelt = 2

Integer:do   1C0D4EF0

arg this = 98

arg function = <instance of Function>

var i = 0

Routine:prStart   1C0DBC70

arg this = <instance of Routine>

arg inval = 16





From: "Nick Inhofe [via New SuperCollider Mailing Lists Forums (Use These!!!)]" <[hidden email]>
Date: Fri, 10 Jun 2011 23:11:54 -0400
To: Patrick Pagano <[hidden email]>
Subject: Re: Google Doodles with SC

Sure-

Google's Guitar doodle responds to keystrokes, where any row plays the same set of notes. I went with
asdfghjkl as the list of notes. This is represented by

~notes = ["a", "s", "d", "f", "g", "h", "j", "k"]; //possible notes stored here

The actual communication with Firefox is in this function -

~st = { |n| n.keyStroke(app: "Firefox")};

The method keyStroke is an extension in the wslib quark. If you dont have it, you can check it out by running the command-

Quarks.checkout("wslib");

You will have to re-compile by pressing cmd+k.

keyStroke is actually an extension to the String class. So this corresponds with the list of notes in ~note.
Keystroke can take an argument app which says which application to use. You could substitute Chrome or Safari etc if that is your browser of choice. So the function ~st just issues the keystroke in Firefox. You could do this manually by running something like

~st.(~notes[0]);

The most direct way of doing this is -
"a".keyStroke(app: "Firefox");

All this does is make Supercollider type "a" into Firefox via AppleScript. The rest of the code just sequences these keystrokes over time, accessing the ~notes array with various patterns.

Hope that helps
-Nick



If you reply to this email, your message will be added to the discussion below:
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Google-Doodles-with-SC-tp6456732p6464430.html
To start a new topic under New SuperCollider Mailing Lists Forums (Use These!!!), email [hidden email]
To unsubscribe from New SuperCollider Mailing Lists Forums (Use These!!!), click here.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

Nick Inhofe
shreeswifty wrote
I am getting an error when I run these after I have added the quark


a Routine

ERROR: Message 'wrapAt' not understood.
After recompiling, you need to run these lines of code:

TempoClock.tempo = 125/60;
~notes = ["a", "s", "d", "f", "g", "h", "j", "k"];
~st = { |n| n.keyStroke(app: "Firefox")};

The reason you are getting an error is because you are trying to execute the wrapAt method on a nil value. This means that nothing has been assigned to the variable ~notes yet. Once you run those lines ~notes will be an array and will respond to the wrapAt method call.

-Nick
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

shreeswifty
This post has NOT been accepted by the mailing list yet.
Does firefox need to be running?

WARNING: keyword arg 'app' not found in call to Object:doesNotUnderstand

ERROR: Message 'keyStroke' not understood.

RECEIVER:

Instance of String {    (1709F4C0, gc=E8, fmt=07, flg=10, set=01)

  indexed slots [1]

      0 : a

}

ARGS:

CALL STACK:

DoesNotUnderstandError:reportError   17174590

arg this = <instance of DoesNotUnderstandError>

Nil:handleError   17174530

arg this = nil

arg error = <instance of DoesNotUnderstandError>

Thread:handleError   171744D0

arg this = <instance of Thread>

arg error = <instance of DoesNotUnderstandError>

Thread:handleError   17174410

arg this = <instance of Routine>

arg error = <instance of DoesNotUnderstandError>

Object:throw   171743B0

arg this = <instance of DoesNotUnderstandError>

Object:doesNotUnderstand   17174350

arg this = "a"

arg selector = 'keyStroke'

arg args = [*0]

< FunctionDef in closed FunctionDef >   17173E10

arg i = 0

var tDelt = 2

Integer:do   17173DB0

arg this = 98

arg function = <instance of Function>

var i = 0

Routine:prStart   17173C90

arg this = <instance of Routine>

arg inval = 40


Is what I get now

pp

From: "Nick Inhofe [via New SuperCollider Mailing Lists Forums (Use These!!!)]" <[hidden email]>
Date: Sat, 11 Jun 2011 23:23:09 -0400
To: Patrick Pagano <[hidden email]>
Subject: Re: Google Doodles with SC

shreeswifty wrote:
I am getting an error when I run these after I have added the quark


a Routine

ERROR: Message 'wrapAt' not understood.
After recompiling, you need to run these lines of code:

TempoClock.tempo = 125/60;
~notes = ["a", "s", "d", "f", "g", "h", "j", "k"];
~st = { |n| n.keyStroke(app: "Firefox")};

The reason you are getting an error is because you are trying to execute the wrapAt method on a nil value. This means that nothing has been assigned to the variable ~notes yet. Once you run those lines ~notes will be an array and will respond to the wrapAt method call.

-Nick



If you reply to this email, your message will be added to the discussion below:
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Google-Doodles-with-SC-tp6456732p6466440.html
To start a new topic under New SuperCollider Mailing Lists Forums (Use These!!!), email [hidden email]
To unsubscribe from New SuperCollider Mailing Lists Forums (Use These!!!), click here.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

shreeswifty
This post has NOT been accepted by the mailing list yet.
In reply to this post by Nick Inhofe

This is the current problem, should it be making an applescript?



WARNING: keyword arg 'app' not found in call to Object:doesNotUnderstand

ERROR: Message 'keyStroke' not understood.

RECEIVER:

Instance of String {    (17112F80, gc=18, fmt=07, flg=10, set=01)

  indexed slots [1]

      0 : a

}

ARGS:

CALL STACK:

DoesNotUnderstandError:reportError   171517F0

arg this = <instance of DoesNotUnderstandError>

Nil:handleError   17141B40

arg this = nil

arg error = <instance of DoesNotUnderstandError>

Thread:handleError   1714CBB0

arg this = <instance of Thread>

arg error = <instance of DoesNotUnderstandError>

Thread:handleError   17157F90

arg this = <instance of Routine>

arg error = <instance of DoesNotUnderstandError>

Object:throw   17150390

arg this = <instance of DoesNotUnderstandError>

Object:doesNotUnderstand   1714E990

arg this = "a"

arg selector = 'keyStroke'

arg args = [*0]

< FunctionDef in closed FunctionDef >   1714F410

arg i = 0

var tDelt = 2

Integer:do   17147710

arg this = 98

arg function = <instance of Function>

var i = 0

Routine:prStart   17163650

arg this = <instance of Routine>

arg inval = 612



From: "Nick Inhofe [via New SuperCollider Mailing Lists Forums (Use These!!!)]" <[hidden email]>
Date: Sat, 11 Jun 2011 23:23:09 -0400
To: Patrick Pagano <[hidden email]>
Subject: Re: Google Doodles with SC

shreeswifty wrote:
I am getting an error when I run these after I have added the quark


a Routine

ERROR: Message 'wrapAt' not understood.
After recompiling, you need to run these lines of code:

TempoClock.tempo = 125/60;
~notes = ["a", "s", "d", "f", "g", "h", "j", "k"];
~st = { |n| n.keyStroke(app: "Firefox")};

The reason you are getting an error is because you are trying to execute the wrapAt method on a nil value. This means that nothing has been assigned to the variable ~notes yet. Once you run those lines ~notes will be an array and will respond to the wrapAt method call.

-Nick



If you reply to this email, your message will be added to the discussion below:
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Google-Doodles-with-SC-tp6456732p6466440.html
To start a new topic under New SuperCollider Mailing Lists Forums (Use These!!!), email [hidden email]
To unsubscribe from New SuperCollider Mailing Lists Forums (Use These!!!), click here.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

shreeswifty
This post has NOT been accepted by the mailing list yet.
In reply to this post by Nick Inhofe
Hi nick

It seems like it wants an applescript to run to the Firefox key strokes?
I am at a loss, but I really want to try this
Please let me know how to fix this, I have some cool SC code I would like to add to this but am stuck at these errors

pp

From: "Nick Inhofe [via New SuperCollider Mailing Lists Forums (Use These!!!)]" <[hidden email]>
Date: Sat, 11 Jun 2011 23:23:09 -0400
To: Patrick Pagano <[hidden email]>
Subject: Re: Google Doodles with SC

shreeswifty wrote:
I am getting an error when I run these after I have added the quark


a Routine

ERROR: Message 'wrapAt' not understood.
After recompiling, you need to run these lines of code:

TempoClock.tempo = 125/60;
~notes = ["a", "s", "d", "f", "g", "h", "j", "k"];
~st = { |n| n.keyStroke(app: "Firefox")};

The reason you are getting an error is because you are trying to execute the wrapAt method on a nil value. This means that nothing has been assigned to the variable ~notes yet. Once you run those lines ~notes will be an array and will respond to the wrapAt method call.

-Nick



If you reply to this email, your message will be added to the discussion below:
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Google-Doodles-with-SC-tp6456732p6466440.html
To start a new topic under New SuperCollider Mailing Lists Forums (Use These!!!), email [hidden email]
To unsubscribe from New SuperCollider Mailing Lists Forums (Use These!!!), click here.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

shreeswifty
This post has NOT been accepted by the mailing list yet.
In reply to this post by Dan Stowell
Dan I am getting this weird error

ERROR: Message 'keyStroke' not understood.

RECEIVER:

Instance of String {    (16462070, gc=F0, fmt=07, flg=10, set=01)

  indexed slots [1]

      0 : a

}

ARGS:

CALL STACK:

DoesNotUnderstandError:reportError   1648DB70

arg this = <instance of DoesNotUnderstandError>

Nil:handleError   164ADE50

arg this = nil

arg error = <instance of DoesNotUnderstandError>

Thread:handleError   164ACD90

arg this = <instance of Thread>

arg error = <instance of DoesNotUnderstandError>

Thread:handleError   164A9690

arg this = <instance of Routine>

arg error = <instance of DoesNotUnderstandError>

Object:throw   1648B650

arg this = <instance of DoesNotUnderstandError>

Object:doesNotUnderstand   16495A30

arg this = "a"

arg selector = 'keyStroke'

arg args = [*0]

< FunctionDef in closed FunctionDef >   16491090

arg i = 0

Integer:do   16468AC0

arg this = 70

arg function = <instance of Function>

var i = 0

Routine:prStart   16494EF0

arg this = <instance of Routine>

arg inval = 88


Even after installing wslib as Nick suggested

Can you shed a light?


pp




From: "Dan Stowell-3 [via New SuperCollider Mailing Lists Forums (Use These!!!)]" <[hidden email]>
Date: Sat, 11 Jun 2011 06:23:23 -0400
To: Patrick Pagano <[hidden email]>
Subject: Re: Google Doodles with SC

Oh nice! Sorry, from your first email I completely didn't understand
what it was you were doing. Using SC to strum your web browser :)

Dan

2011/6/11 Nick Inhofe <[hidden email]>:

> Sure-
>
> Google's Guitar doodle responds to keystrokes, where any row plays the same
> set of notes. I went with
> asdfghjkl as the list of notes. This is represented by
>
> ~notes = ["a", "s", "d", "f", "g", "h", "j", "k"]; //possible notes stored
> here
>
> The actual communication with Firefox is in this function -
>
> ~st = { |n| n.keyStroke(app: "Firefox")};
>
> The method keyStroke is an extension in the wslib quark. If you dont have
> it, you can check it out by running the command-
>
> Quarks.checkout("wslib");
>
> You will have to re-compile by pressing cmd+k.
>
> keyStroke is actually an extension to the String class. So this corresponds
> with the list of notes in ~note.
> Keystroke can take an argument app which says which application to use. You
> could substitute Chrome or Safari etc if that is your browser of choice. So
> the function ~st just issues the keystroke in Firefox. You could do this
> manually by running something like
>
> ~st.(~notes[0]);
>
> The most direct way of doing this is -
> "a".keyStroke(app: "Firefox");
>
> All this does is make Supercollider type "a" into Firefox via AppleScript.
> The rest of the code just sequences these keystrokes over time, accessing
> the ~notes array with various patterns.
>
> Hope that helps
> -Nick
>
>
> -----
> http://soundcloud.com/exit_only
> --
> View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Google-Doodles-with-SC-tp6456732p6464430.html
> Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
>
> _______________________________________________
> sc-users 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-users/
> search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
>


--
http://www.mcld.co.uk

_______________________________________________
sc-users 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-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/



If you reply to this email, your message will be added to the discussion below:
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Google-Doodles-with-SC-tp6456732p6464957.html
To start a new topic under New SuperCollider Mailing Lists Forums (Use These!!!), email [hidden email]
To unsubscribe from New SuperCollider Mailing Lists Forums (Use These!!!), click here.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

Nick Inhofe
shreeswifty wrote
ERROR: Message 'keyStroke' not understood.

RECEIVER:

Instance of String {    (16462070, gc=F0, fmt=07, flg=10, set=01)

  indexed slots [1]

      0 : a

}
Try breaking down what the error message is telling you. Its saying an instance of the string "a" does not understand the keyStroke message. The keystroke message is an extension to String in the wslib Quark. This means that the Quark is not installed properly.  Look at the Quarks help file and also try installing the Quark via the GUI by running

Quarks.gui;

After installing you will need to recompile and rerun the SC code.



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

shreeswifty
This post has NOT been accepted by the mailing list yet.
Hi Nick
Well I installed from the 
Quarks.gui and that gave the same error 
I tried that AND Quarks.install("wslib"); 
Both with the same problem, so I went to sourceforge and grabbed the tarball of wslib specifically and replaced the folder, recompiled and then ran the webpage and the app successfully for a few seconds it played to my glee some notes
Then

TempoClock


[ a, s, d, f, g, h, j, k ]


a Function


a Routine

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

RESULT = 0

WARNING: keyword arg 'app' not found in call to Object:doesNotUnderstand

ERROR: Message 'keyStroke' not understood.

RECEIVER:

   nil

ARGS:

CALL STACK:

DoesNotUnderstandError:reportError   16FB0270

arg this = <instance of DoesNotUnderstandError>

Nil:handleError   16FAF850

arg this = nil

arg error = <instance of DoesNotUnderstandError>

Thread:handleError   16FB0D10

arg this = <instance of Thread>

arg error = <instance of DoesNotUnderstandError>

Thread:handleError   16FB96B0

arg this = <instance of Routine>

arg error = <instance of DoesNotUnderstandError>

Object:throw   16FB5590

arg this = <instance of DoesNotUnderstandError>

Object:doesNotUnderstand   16FBA770

arg this = nil

arg selector = 'keyStroke'

arg args = [*0]

< FunctionDef in closed FunctionDef >   1B92B590

arg i = 26

Integer:do   1B927CF0

arg this = 70

arg function = <instance of Function>

var i = 26

Routine:prStart   1B92A1D0

arg this = <instance of Routine>

arg inval = 28


Perhaps it's my version of SC that is wonky? I have version 3.4.3 
But I do not want to keep troubling you with such problems.
Looks like *0 is the culprit now if I use your guidance from before but I am not sure how to fix this.

pp


From: "Nick Inhofe [via New SuperCollider Mailing Lists Forums (Use These!!!)]" <[hidden email]>
Date: Sun, 12 Jun 2011 15:47:11 -0400
To: Patrick Pagano <[hidden email]>
Subject: Re: Google Doodles with SC

shreeswifty wrote:
ERROR: Message 'keyStroke' not understood.

RECEIVER:

Instance of String {    (16462070, gc=F0, fmt=07, flg=10, set=01)

  indexed slots [1]

      0 : a

}
Try breaking down what the error message is telling you. Its saying an instance of the string "a" does not understand the keyStroke message. The keystroke message is an extension to String in the wslib Quark. This means that the Quark is not installed properly.  Look at the Quarks help file and also try installing the Quark via the GUI by running

Quarks.gui;

After installing you will need to recompile and rerun the SC code.






If you reply to this email, your message will be added to the discussion below:
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Google-Doodles-with-SC-tp6456732p6467990.html
To start a new topic under New SuperCollider Mailing Lists Forums (Use These!!!), email [hidden email]
To unsubscribe from New SuperCollider Mailing Lists Forums (Use These!!!), click here.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Doodles with SC

shreeswifty
This post has NOT been accepted by the mailing list yet.
In reply to this post by Nick Inhofe
This one

// http://goo.gl/doodle/CBbM

Routine({ 

        var current, index, delt; 


        index = Pseries(0, Pseq([4,2, 1,1],inf), inf); 

        

        index = index.asStream.asStream; 

        

        delt = Place([1,1,1,1, 2],inf).asStream; 

        40.do({ 

                |i| 

        // i.postln; 

                current = index.next; 

                ~st.(~notes.wrapAt(current)); 

                ~st.(~notes.wrapAt(current+4)); 

                delt.next.wait; 

        }); 

}).play(quant:4); 


Did not generate any errors fwiw.


Cheers


pp




From: "Nick Inhofe [via New SuperCollider Mailing Lists Forums (Use These!!!)]" <[hidden email]>
Date: Sun, 12 Jun 2011 15:47:11 -0400
To: Patrick Pagano <[hidden email]>
Subject: Re: Google Doodles with SC

shreeswifty wrote:
ERROR: Message 'keyStroke' not understood.

RECEIVER:

Instance of String {    (16462070, gc=F0, fmt=07, flg=10, set=01)

  indexed slots [1]

      0 : a

}
Try breaking down what the error message is telling you. Its saying an instance of the string "a" does not understand the keyStroke message. The keystroke message is an extension to String in the wslib Quark. This means that the Quark is not installed properly.  Look at the Quarks help file and also try installing the Quark via the GUI by running

Quarks.gui;

After installing you will need to recompile and rerun the SC code.






If you reply to this email, your message will be added to the discussion below:
http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Google-Doodles-with-SC-tp6456732p6467990.html
To start a new topic under New SuperCollider Mailing Lists Forums (Use These!!!), email [hidden email]
To unsubscribe from New SuperCollider Mailing Lists Forums (Use These!!!), click here.
Loading...