[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Braille generator: Re: [sc-users] article: Audiovisuals with SC



I was just in need for an inspiration, Fredrik. Thanks.

As a part of a project I'm developing,  I'm working on Braille.
Here attached Braille tow simple code generator and visualizer classes.

// create a special Document
~brk = BrailleKeyboarder.new ;
// input text is translated in braille

// visualize the Braille Cell while writing in the Document
~br = Brailler(~brk)

Attachment: brailleKeyboarder.sc
Description: Binary data



Best

-a-

On 6 Feb 2009, at 00:36, Fredrik Olofsson wrote:

thanks.
1. the text was written >1 year ago when there was no ViewRedirect and i'd like to be backwards compatible.
2. for the first 3 images i didn't bother to include code examples.  it's just the output from the example code in the running text.  but ok, i've pasted some code below.  the 4th image (black&green) you'll get if you play with the environment variables at the bottom of example18.  (btw, you should try the environment variables at the bottom of all examples.)


(
var width= 220, height= 140;
var w= GUI.window.new("", Rect(99, 99, width, height), false);
var u= GUI.userView.new(w, Rect(0, 0, width, height));
u.drawFunc= {
GUI.pen.width= 1;
GUI.pen.fillColor= Color.red; //set fill color
GUI.pen.fillRect(Rect(10, 20, 200, 100)); //10 pixels from left, 20 from top
GUI.pen.strokeColor= Color.blue; //set stroke color
GUI.pen.strokeOval(Rect(20, 30, 180, 80)); //180 pixels wide, 80 high
};
w.view.background= "">
w.front;
)

(
var width= 220, height= 140;
var w= GUI.window.new("", Rect(99, 99, width, height), false);
var u= GUI.userView.new(w, Rect(0, 0, width, height));
u.drawFunc= {
GUI.pen.width= 8; //set pencil width in pixles
GUI.pen.strokeColor= Color.yellow; //set stroke color
GUI.pen.moveTo(Point(100, 100)); //go to start position
GUI.pen.lineTo(Point(150, 50));
GUI.pen.lineTo(Point(200, 100));
GUI.pen.lineTo(Point(100, 100));
GUI.pen.stroke; //perform all collected drawing commands in one go
};
w.view.background= "">
w.front;
)

(
var width= 220, height= 140;
var w= GUI.window.new("", Rect(99, 99, width, height), false);
var u= GUI.userView.new(w, Rect(0, 0, width, height));
u.drawFunc= {
GUI.pen.width= 1;
GUI.pen.strokeColor= Color.red;
GUI.pen.use{ //remember state (push)
5.do{|i|
GUI.pen.strokeColor= Color.grey(i/5);
GUI.pen.scale(0.75, 0.9); //scale width and height
GUI.pen.strokeOval(Rect(20, 30, 180, 80));//results in smaller ovals
};
};
GUI.pen.strokeOval(Rect(20, 30, 180, 80));
};
w.view.background= "">
w.front;
)


5 feb 2009 kl. 15.04 skrev Andrea Valle:

Wow pretty cool.
just two things:

- you use the GUI stuff. I was asking myself if we should (maybe not) promote the new interface (clearer for nebies)
- I cannot visualize the imgs in the page

Best and thanks

-a-

On 5 Feb 2009, at 10:49, thor wrote:


beautiful!


On 5 Feb 2009, at 01:31, Fredrik Olofsson wrote:

dear sc-users,
my humble investigation of audiovisual mappings... http://www.fredrikolofsson.com/f0blog/?q=node/316
cc-licensed.  all examples should run crossplatform on sc3.2 or newer.

there will be an intermediate level sc-workshop arranged around this article at pickledfeet berlin 7 march.  more details here later.

enjoy,
_f


  #|
     fredrikolofsson.com     klippav.org     musicalfieldsforever.com
  |#


_______________________________________________
sc-users mailing list


--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--------------------------------------------------

"The objectives of SuperCollider have been taken a stage further with the development of SAOL, the fruits of a research project based at MIT, launched in 1998" 
(P. Manning, Electronic and Computer Music, revised and expanded edition, 2004)