Re: [PD] Help with patch needed: keyname/route + textfile/gem
Quoth Martin Schied, on 16/09/09 16:02: Usually I use UTF-8 to circumvent all of these problems. Attached are my tools I use for it. It's a small command line tool to convert text files to utf8 coded decimals and an example patch showing use of the converted text in Gem. cheers Martin Thanks Martin, this is really useful! What I really need now is a way to automatically generate carriage returns or EOL's when the text hits the edge of the window - is this something that can be done in gem or do I have to format the text first in a text editor first? thanks James ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Help with patch needed: keyname/route + textfile/gem
James Dunn wrote: Thanks Martin, this is really useful! What I really need now is a way to automatically generate carriage returns or EOL's when the text hits the edge of the window - is this something that can be done in gem or do I have to format the text first in a text editor first? Hi, spent some time and made an abstraction for this (see attachment). I think formatting it outside of Pd is much more simple - but less flexible inside your patch. I had some problems when trying to use doubled newlines to create new paragraphs. text3d and text2d display some strange characters in this case. If it has not to be dynamically changeable text inside your patch you could use latex or something else to format text into pages and then convert them to pixel graphics. Like this you can also generate good looking hyphened justification which is hardly doable within pd. I figured out a way to have png from latex with nice alpha transparency: latex -- ps, split ps into single pages, ps2eps, eps2png. you'll find them here: http://www.tm.uka.de/~bless/ps2eps http://search.cpan.org/~jv/eps2png/ an other more out-of-the-box-method would be using your favorite office software, making pdfs and convert them to pixel graphics (using imagemagick or something else). Or simply use inkscape and export them to png. :D cheers Martin line-break.pd Description: application/puredata line-break-help.pd Description: application/puredata ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Help with patch needed: keyname/route + textfile/gem Hi all
Hi all, I use PHP and ImageMagick to create images from dynamic text (stored in mySql). Basically I've got a php web page, from which I call a shell command that output a fixed width and height image, filled with text. The text size vary to fill the whole image, so few words - bigger text, many words - smaller text. So you have always all your text formatted in the same space, and you don't have to worry about carriage return (it's all auto(image)magick) The core of the sequence of command is: [PHP code] $command = echo \. $text .\ | convert -channel RGBA -background none -font . $fontfile . -fill white -size .$width.x.$height. caption:@- . $phisicalPathAndFileNameOfTheNewImageFile; echo exec($command); [/PHP code] where the words preceded by $ are variables. After you run this command you'll find the image file ($phisicalPathAndFileNameOfTheNewImageFile). In the image, the text is white (I use dark background in PD) and the background is transparent. Then you can take it and use in PD. Hope this helps. Let me know if you want more details or screenshots - eg: php functions to fix the input text (addslashes etc...) ciao, dario ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Help with patch needed: keyname/route + textfile/gem
James Dunn wrote: The commas are fixed thanks to your patch, however I now have the following problems: 1) Apostrophes are not printed properly in the gem window Usually I use UTF-8 to circumvent all of these problems. Attached are my tools I use for it. It's a small command line tool to convert text files to utf8 coded decimals and an example patch showing use of the converted text in Gem. cheers Martin ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Help with patch needed: keyname/route + textfile/gem
Quoth Jack, on 14/09/09 19:25: Or, this patch can help you (actually, i don't know what you are looking for ;) ++ Jack Thanks for those patches Jack. I don't know much about gem but I'm learning! I'm working with a text file of 6000+ words and what I really want is to have the first 10 lines or so displayed in a gem window (fullscreen eventually) which then scrolls down when certain keys are pressed. The commas are fixed thanks to your patch, however I now have the following problems: 1) Apostrophes are not printed properly in the gem window 2) I've switched to the laptop for running this patch and the gem window is really buggy. it has no border and when the window is destroyed it leaves black patches behind. Is this a problem with gem or xorg / xserver? ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Help with patch needed: keyname/route + textfile/gem
Date: Tue, 15 Sep 2009 15:29:36 +0100 From: James Dunn ja...@4thharmonic.com Subject: Re: [PD] Help with patch needed: keyname/route + 2) I've switched to the laptop for running this patch and the gem window is really buggy. it has no border and when the window is destroyed it leaves black patches behind. Is this a problem with gem or xorg / xserver? mmm.. Probably. Have you tried to deactivate all visual effects from appereance preferences? which video card and distro you have? M -- Marco Donnarumma aka The !S.A.D! Independent New Media Arts Professional, Performer - Roma, IT LAB: http://www.thesaddj.com | http://www.flxer.net EVENT: http://www.liveperformersmeeting.net ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
[PD] Help with patch needed: keyname/route + textfile/gem
Hi all, I'm hoping someone might be able to help out with a patch I'm working on (attached to this mail). Basically the patch is designed to trigger samples when a specific key is pressed on the computer keyboard. Also I want to have scrolling text in gem which advances with each key press. My problems are: 1) Using keyname, the number keys don't work with route - why is this? Character keys and the Function keys work fine, but I would like to use the number keys as well. 2) Textfile only reads up to the comma - how can I print commas to the gem window AND specify how much of the text file should be read at a time? 3) I just tried running the gem window and triggering the sample at the same time and the audio was stuttering constantly! Any ideas for a solution? many thanks for any advice James 2012.pd Description: application/puredata ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Help with patch needed: keyname/route + textfile/gem
Hi James, James Dunn wrote: 1) Using keyname, the number keys don't work with route - why is this? Character keys and the Function keys work fine, but I would like to use the number keys as well. Number keys work with [key], however then they are ASCII value, which you would have to translate (maybe via a lookup to a [textfile] or [col] object) to their actual names. 3) I just tried running the gem window and triggering the sample at the same time and the audio was stuttering constantly! Any ideas for a solution? Bigger buffer/latency perhaps, but the best way is to separate the GEM and the audio threads by running two instances of Pd, one with -noaudio for GEM and the other for audio, and then use OSC or netsend/netreceive to communicate between the two running instances. A shell script of some kind would be best to start both instances with the proper patches. Best! D. -- ::: derek holzer ::: http://blog.myspace.com/macumbista ::: http://www.vimeo.com/macumbista ::: ---Oblique Strategy # 194: Steal a solution. ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Help with patch needed: keyname/route + textfile/gem
Quoth Derek Holzer, on 14/09/09 12:43: Bigger buffer/latency perhaps, but the best way is to separate the GEM and the audio threads by running two instances of Pd, one with -noaudio for GEM and the other for audio, and then use OSC or netsend/netreceive to communicate between the two running instances. A shell script of some kind would be best to start both instances with the proper patches. Best! D. Thanks Derek, running two instances of pd from a script works a treat with netsend and netreceive! Can anyone advise the best way to achieve scrolling text in gem? I want the text to advance after certain keystrokes. I'm still having trouble with commas in textfile too! thanks James ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] Help with patch needed: keyname/route + textfile/gem
Or, this patch can help you (actually, i don't know what you are looking for ;) ++ Jack Le lundi 14 septembre 2009 à 17:17 +0200, Jack a écrit : For the 2nd point. ++ Jack Le lundi 14 septembre 2009 à 12:36 +0100, James Dunn a écrit : Hi all, I'm hoping someone might be able to help out with a patch I'm working on (attached to this mail). Basically the patch is designed to trigger samples when a specific key is pressed on the computer keyboard. Also I want to have scrolling text in gem which advances with each key press. My problems are: 1) Using keyname, the number keys don't work with route - why is this? Character keys and the Function keys work fine, but I would like to use the number keys as well. 2) Textfile only reads up to the comma - how can I print commas to the gem window AND specify how much of the text file should be read at a time? 3) I just tried running the gem window and triggering the sample at the same time and the audio was stuttering constantly! Any ideas for a solution? many thanks for any advice James ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list #N canvas 563 49 647 658 10; #X obj 15 21 cnv 15 100 60 empty empty empty 20 12 0 14 -195568 -66577 0; #N canvas 0 0 450 300 gemwin 0; #X obj 132 136 gemwin; #X obj 67 89 outlet; #X obj 67 10 inlet; #X obj 67 41 route create; #X msg 67 70 set destroy; #X msg 142 68 set create; #X msg 198 112 destroy; #X msg 132 112 create \, 1; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 7 0; #X connect 3 1 5 0; #X connect 3 1 6 0; #X connect 4 0 1 0; #X connect 5 0 1 0; #X connect 6 0 0 0; #X connect 7 0 0 0; #X restore 20 60 pd gemwin; #X msg 20 41 destroy; #X text 16 20 Create window:; #X obj 239 364 gemhead; #X msg 314 449 text \$1; #X obj 452 476 loadbang; #X msg 452 501 7; #X text 506 581 Jack/RYBN 2009; #X msg 24 433 font \$1; #X obj 24 414 openpanel; #X obj 24 387 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 38 471 loadbang; #X msg 38 491 justify right base; #X obj 239 384 translateXYZ 3.8 0 0; #X obj 239 524 text3d enter your text with keyboard; #X text 44 385 - it is better to use; #X text 64 395 a typewriter style font; #X obj 9 107 cnv 15 200 250 empty empty empty 20 12 0 14 -233017 -66577 0; #X obj 54 139 gemkeyname; #X obj 105 250 t a; #X obj 21 219 spigot; #X obj 21 250 list prepend; #X obj 21 317 list2symbol; #X msg 84 296 symbol; #X obj 84 276 loadbang; #X text 124 139 - use keyboard; #X text 142 149 in GEM window; #X text 234 179 OR; #X text 234 199 I; #X text 234 219 DON'T; #X text 234 239 KNOW; #X text 234 259 WHAT; #X text 234 279 YOU; #X text 234 299 NEED :); #X obj 304 13 cnv 15 300 430 empty empty empty 20 12 0 14 -233017 -66577 0; #X msg 454 102 rewind; #X obj 435 196 textfile; #X msg 435 129 bang; #X msg 474 74 read monTexte.txt; #X obj 314 269 list-dripslow; #X obj 435 50 t b b b; #X obj 435 19 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 451 18 - 1; #X obj 314 110 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 314 203 f; #X floatatom 329 181 5 0 0 0 - - -; #X obj 314 231 until; #X text 362 181 - 2; #X text 330 109 - 3; #X obj 314 313 list prepend; #X obj 404 313 t a; #X obj 314 419 list2symbol; #X obj 435 252 symbol2list; #X obj 435 220 list2symbol; #X msg 522 235 symbol; #X obj 522 210 loadbang; #X msg 403 402 symbol; #X obj 403 377 loadbang; #X connect 1 0 2 0; #X connect 2 0 1 0; #X connect 4 0 14 0; #X connect 5 0 15 0; #X connect 6 0 7 0; #X connect 7 0 15 1; #X connect 9 0 15 0; #X connect 10 0 9 0; #X connect 11 0 10 0; #X connect 12 0 13 0; #X connect 13 0 15 0; #X connect 14 0 15 0; #X connect 19 0 21 1; #X connect 19 1 21 0; #X connect 20 0 22 1; #X connect 21 0 22 0; #X connect 22 0 20 0; #X connect 22 0 23 0; #X connect 23 0 5 0; #X connect 24 0 23 1; #X connect 25 0 24 0; #X connect 36 0 37 0; #X connect 37 0 54 0; #X connect 38 0 37 0; #X connect 39 0 37 0; #X connect 40 0 50 0; #X connect 40 1 50 1; #X connect 41 0 38 0; #X connect 41 1 36 0; #X connect 41 2 39 0; #X connect 42 0 41 0; #X connect 44 0 45 0; #X connect 45 0 47 0; #X connect 46 0 45 1; #X connect 47 0 40 0; #X connect 50 0 51 0; #X connect 50 0 52 0; #X connect 51 0 50 1; #X connect 52 0 5 0; #X connect 53 0 40 1; #X connect 54 0 53 0; #X connect 55 0 53 1; #X connect 56 0 55 0; #X connect 57 0 52 1; #X connect 58 0 57 0; Ceci est un texte\, ecrit sous 'editeur de texte'\, qui doit etre affiche sous GEM. Il faut\, egalement\, afficher quelques mots de ce texte. ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list