Difference between revisions of "Talk:Nyquist Audio Programming"

From Audacity Wiki
Jump to: navigation, search
(the inevitable grammar corrections)
(answers)
Line 1: Line 1:
'''Edgar wrote:''' I think I just will use <nowiki><pre>...</pre> </nowiki> tags. My code lines always are as short as possible (otherwise I won't understand myself) and the wacky "unbreakable" Nyquist plugin header lines will be just simply shortened by me myself to an appropriate length.
+
'''LATEST COMMENTS BELOW......'''
  
<font color="green"> OK, as long as the lines are short. I'll change the colours of Code Template anyway (I have an LCD too and even if I stand away from it I can still see the text against the background). It's also odd as I have checked my monitor against a calibration image and it was not very far out....
+
'''Edgar wrote:''' In the code template it would also be necessary to let the user specify the text foreground color, because comments must be displayable in a different color than ordinary code. I don't know how much this contradicts the meaning of a template, because if the user can change everything afterwards anyway you don't need a template...
 
 
 
 
Gale </font>
 
 
 
 
 
In the code template it would also be necessary to let the user specify the text foreground color, because comments must be displayable in a different color than ordinary code. I don't know how much this contradicts the meaning of a template, because if the user can change everything afterwards anyway you don't need a template...
 
  
 
<font color="green">  
 
<font color="green">  
Line 26: Line 20:
 
different color than the rest of the code.
 
different color than the rest of the code.
  
This must not necessarily
+
This must not necessarily be a "free" choice by the user but could also be a second text color predefined by the template programmer, which then can be used e.g. via
be a "free" choice by the user but could also be a second text color
+
<nowiki><comment>...</comment></nowiki> tags by the user. This then still would guarantee a "unified" look of the whole Wiki.
predefined by the template programmer, which then can be used e.g. via
+
 
<nowiki><comment>...</comment></nowiki> tags by the user. This then still
+
<font color="green">I'm not sure if you can write a template that itself has another template inside it, but the user can himself employ, say, the code template then nest another existing template inside it (like the case when the Intro template is used and the external template is used inside that to make an italicised link without the arrow). So we could have a "comment" template <nowiki> {{comment|...}}</nowiki> that just makes another text colour, rather than do it with <nowiki> <font color=""> </nowiki>, or by creating a span in the CSS (so that the user writes <nowiki><span class="comment"></nowiki> to produce the desired colour.)
would guarantee a "unified" look of the whole Wiki.
+
 
 +
I still don't really like blue or red even though it "may" be obvious it should not be a link.
 +
Without looking, I don't know if any of the extensions I was thinking of will produce another colour if the string starts with ";" this is specific to the code language concerned.   
 +
 
 +
Using <nowiki><pre> </nowiki> tags with <nowiki> <font color=""> </nowiki> tags won't of course work as the font declaration will be printed out. To save typing it all out, if you merely copy and paste the source code of each pre class from your page, strip out the <nowiki> <pre> </nowiki> tags and indent the first character, you'll get what you want, and I don't mind if the lines are short and if you don't use blue or red (just change the color code to something else, as below):  </font>
 +
 
 +
(if (arrayp s)        <font color="#FF7B00">; IF s is an array [= stereo]</font>
 +
    (stereo-function)  <font color="#0000CC">; THEN use the stereo function</font>
 +
  (mono-function))    <font color="#0000CC">; ELSE use the mono function</font>
 +
 
 +
<font color="green"> To clarify what I said last time, you could actually type it out and use carriage returns - the background <i>will</i> &nbsp;be retained <i>if </i>&nbsp; you indent the first character after the return. My objection would be if there were long lines (and personally I do not like the dotted border). But you can also use the code template if we make a text colour you like, and if you use "1=" after the pipe so that it does not interpret the code. Typing this:</font>
 +
 
 +
<nowiki>{{code|1= (if (arrayp s) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; <font color="#FF7B00">; IF s is an array [= stereo]</font>}} </nowiki>
 +
 
 +
<font color="green">produces this (note you have to use the non-breaking space code (&amp;nbsp;) to produce extra spaces):    </font>
 +
 
 +
{{code|1= (if (arrayp s)  &nbsp; &nbsp; &nbsp; &nbsp; <font color="#FF7B00">; IF s is an array [= stereo]</font>}}
 +
 
  
 
'''Maybe also important to know:'''
 
'''Maybe also important to know:'''
 
 
In the human eye and the related "visual" brain processing there exist three
 
In the human eye and the related "visual" brain processing there exist three
 
contrast values: red/green, blue/yellow, and black/white.
 
contrast values: red/green, blue/yellow, and black/white.
Line 44: Line 54:
  
 
Wether a color-blind person can read your wiki you can test just simple:
 
Wether a color-blind person can read your wiki you can test just simple:
 +
Make a screenshot, load it into the Gimp (or any other graphics tool) and convert it to a greyscale image. If you still can read the text, you have won (it's sometimes not-so-easy to judge from a color image, I have fooled myself often enough).
 +
 +
 +
<font color="green">I tried this produced by the current "Code" template 
 +
 +
{{code|1= (if (arrayp s)  &nbsp; &nbsp; &nbsp; &nbsp; ; IF s is an array [= stereo]}}
 +
 +
and could read the text perfectly in greyscale. So I think you have to suggest a text and background colour for Code template that suits your monitor.
  
Make a screenshot, load it into the Gimp (or any other graphics tool) and
+
Thanks
convert it to a greyscale image. If you still can read the text, you have
 
won (it's sometimes not-so-easy to judge from a color image, I have fooled
 
myself often enough).
 
  
Thanks anyway,
+
Gale
  
- edgar
+
  </font>

Revision as of 20:07, 11 February 2008

LATEST COMMENTS BELOW......

Edgar wrote: In the code template it would also be necessary to let the user specify the text foreground color, because comments must be displayable in a different color than ordinary code. I don't know how much this contradicts the meaning of a template, because if the user can change everything afterwards anyway you don't need a template...

Indeed, I said that text color was a decision to make, but it's a unitary color through the whole template. The user should not change the template really because as you say it is then no longer a template. There could be an alternative template with different text and background colour, if there is some definite opinion on a good colour scheme. Yellow on blue would be high contrast but not I think very popular....:) I'll do just a black on light pink I think like the old code tags, for the main template. You can suggest an alternative if you wish where the text colour is other than black. There is not much choice though (red and blue are not recommended as they are dead and active link colours), hence another reason for the pink choice.

If you are talking about displaying a range of colours in the code box like some text editors do for different types of string, that has to be wait to install an appropriate extension that can do that (or before then the user hard codes the whole thing in a table according to the color scheme they want).


Gale


What I meant is: if you look at the code example in my drafts, e.g.:

http://www.audacity-forum.de/download/edgar/nyquist/nyquist-doc/examples/audacity-wiki/basics/change-volume.htm#3-2

you will see that I use the comments to explain the source code. Therefore it is important that the comments (the explanations) get displayed in a different color than the rest of the code.

This must not necessarily be a "free" choice by the user but could also be a second text color predefined by the template programmer, which then can be used e.g. via <comment>...</comment> tags by the user. This then still would guarantee a "unified" look of the whole Wiki.

I'm not sure if you can write a template that itself has another template inside it, but the user can himself employ, say, the code template then nest another existing template inside it (like the case when the Intro template is used and the external template is used inside that to make an italicised link without the arrow). So we could have a "comment" template {{comment|...}} that just makes another text colour, rather than do it with <font color=""> , or by creating a span in the CSS (so that the user writes <span class="comment"> to produce the desired colour.)

I still don't really like blue or red even though it "may" be obvious it should not be a link. Without looking, I don't know if any of the extensions I was thinking of will produce another colour if the string starts with ";" this is specific to the code language concerned.

Using <pre> tags with <font color=""> tags won't of course work as the font declaration will be printed out. To save typing it all out, if you merely copy and paste the source code of each pre class from your page, strip out the <pre> tags and indent the first character, you'll get what you want, and I don't mind if the lines are short and if you don't use blue or red (just change the color code to something else, as below):

(if (arrayp s)         ; IF s is an array [= stereo]
    (stereo-function)  ; THEN use the stereo function
  (mono-function))     ; ELSE use the mono function

To clarify what I said last time, you could actually type it out and use carriage returns - the background will  be retained if   you indent the first character after the return. My objection would be if there were long lines (and personally I do not like the dotted border). But you can also use the code template if we make a text colour you like, and if you use "1=" after the pipe so that it does not interpret the code. Typing this:

{{code|1= (if (arrayp s) &nbsp; &nbsp; &nbsp; &nbsp; <font color="#FF7B00">; IF s is an array [= stereo]</font>}}

produces this (note you have to use the non-breaking space code (&nbsp;) to produce extra spaces):

(if (arrayp s)         ; IF s is an array [= stereo]


Maybe also important to know: In the human eye and the related "visual" brain processing there exist three contrast values: red/green, blue/yellow, and black/white.

The grayscale of a color image computes as:

0.33*RED + 0.57*GREEN + 0.11*BLUE

(I know: equals to 101 percent, what is based on the rounding of the missing digits).

Wether a color-blind person can read your wiki you can test just simple: Make a screenshot, load it into the Gimp (or any other graphics tool) and convert it to a greyscale image. If you still can read the text, you have won (it's sometimes not-so-easy to judge from a color image, I have fooled myself often enough).


I tried this produced by the current "Code" template

(if (arrayp s)         ; IF s is an array [= stereo]

and could read the text perfectly in greyscale. So I think you have to suggest a text and background colour for Code template that suits your monitor.

Thanks

Gale