File:ParsonsCode-Ode to Joy.png
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
ParsonsCode-Ode_to_Joy.png (286 × 243 pixels, file size: 5 KB, MIME type: image/png)
File information
Structured data
Captions
Summary
[edit]DescriptionParsonsCode-Ode to Joy.png |
English: 'Ode to Joy' melodic contour (Parsons code)
(+schema)
Français : Contour mélodique de l'Hymne à la joie (code Parsons) |
Date | |
Source | Own work |
Author | Xofc |
This text image could be re-created using vector graphics as an SVG file. This has several advantages; see Commons:Media for cleanup for more information. If an SVG form of this image is available, please upload it and afterwards replace this template with
{{vector version available|new image name}} .
It is recommended to name the SVG file “ParsonsCode-Ode to Joy.svg”—then the template Vector version available (or Vva) does not need the new image name parameter. |
This PNG image was uploaded in a graphics format such as GIF, PNG, JPEG, or SVG. However, it consists purely or largely of information which is better suited to representation in wikitext (possibly using MediaWiki's special syntax for tables, math, or music). This will make the information easier to edit, as well as make it accessible to users of screen readers and text-based browsers.
If possible, please replace any inclusions of this image in articles (noted under the “File links” header) with properly formatted wikitext. After doing so, please consider nominating this image for deletion. Deutsch ∙ English ∙ +/− |
Licensing
[edit]I, the copyright holder of this work, hereby publish it under the following license:
This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. | |
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
Source code
[edit]Parsons$ ./contour *RUURDDDDRUURDR *-* / \ * * / \ *-* * *-* \ / \ * * *-* \ / *-* Parsons$
The contour has been generated by this 'C' program :
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define MAXLEN 20
void usage(char *str)
{
fprintf(stderr, "%s\n", str);
exit(-1);
}
main(int argc, char *argv[])
{
int i;
int x, y;
int level, max_level, min_level;
int level_tab[MAXLEN];
int code_len;
if (argc != 2)
usage("nombre d'arguments invalide");
if (argv[1][0] != '*')
usage("mauvais code initial");
if ((code_len = strlen(argv[1])) > MAXLEN)
usage("code trop long");
/*
** minimax
*/
max_level = min_level = level = 0;
level_tab[0] = 0;
for (i = 1; argv[1][i]; i++)
{
switch (argv[1][i])
{
case 'u': case 'U':
level += 1;
if (level > max_level)
max_level = level;
break;
case 'd': case 'D':
level -= 1;
if (level < min_level)
min_level = level;
break;
case 'r': case 'R':
break;
default:
usage("mauvais code");
break;
}
level_tab[i] = level;
}
printf("\n");
for (y = max_level; y >= min_level; y--)
{
if (y == 0)
printf(" *");
else printf(" ");
for (x = 1; x < code_len; x++)
{
if (level_tab[x] == y)
{
if (level_tab[x-1] == level_tab[x])
printf("-*");
else printf(" *");
}
else printf(" ");
}
printf("\n ");
for (x = 1; x < code_len; x++)
{
if (level_tab[x] == y)
{
if (level_tab[x-1] < y)
printf(" /");
else printf(" ");
}
else if (level_tab[x-1] == y && level_tab[x] < y)
{
printf(" \\");
}
else printf(" ");
}
printf("\n");
}
printf("\n");
}
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 06:49, 16 May 2011 | 286 × 243 (5 KB) | Xofc (talk | contribs) | {{Information |Description ={{en|1='Ode to Joy' melodic contour (Parsons code) (+schema)}} {{fr|1=Contour mélodique de l'Hymne à la joie (code Parsons)}} |Source ={{own}} |Author =Xofc |Date =2011-05-45 |Permis |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on fr.wikipedia.org