{"id":497,"date":"2026-09-28T20:00:06","date_gmt":"2026-09-28T20:00:06","guid":{"rendered":"https:\/\/www.donaldswelt.ch\/?p=497"},"modified":"2026-10-01T19:58:10","modified_gmt":"2026-10-01T19:58:10","slug":"ascii-auf-88-tasten","status":"publish","type":"post","link":"https:\/\/www.donaldswelt.ch\/index.php\/2026\/09\/28\/ascii-auf-88-tasten\/","title":{"rendered":"ASCII auf 88 Tasten"},"content":{"rendered":"<div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1248px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-1\"><p><strong>Die Geschichte dahinter<\/strong><\/p>\n<p>Eigentlich wollte ich nur kurz testen, ob sich mein Clavinova per MIDI sauber mit dem PC und mit Sibelius verbinden l\u00e4sst. Die Verbindung funktionierte problemlos und kurz darauf konnte ich auch aus einem kleinen C#-Programm eine einzelne MIDI-Note direkt an das Clavinova senden. Und dann kam nat\u00fcrlich die n\u00e4chste Idee: Wenn eine MIDI-Note am Ende nur eine Zahl ist und ASCII-Zeichen ebenfalls Zahlenwerte besitzen, m\u00fcsste man doch eigentlich Buchstaben direkt als Noten verwenden k\u00f6nnen. Also wurde aus dem simplen Test kurzerhand ein kleines Experiment: <strong>HELLO WORLD<\/strong> wurde Zeichen f\u00fcr Zeichen in MIDI-Notennummern umgewandelt und vom Clavinova abgespielt. Das Resultat klang \u00fcberraschend faszinierend. Danach musste nat\u00fcrlich auch noch <strong>DONALDS WELT<\/strong> daran glauben. Das Prinzip ist denkbar einfach: Jeder Buchstabe wird \u00fcber seinen ASCII-Wert direkt zur entsprechenden MIDI-Notennummer. Aus Text wird dadurch tats\u00e4chlich eine kleine Melodie.<\/p>\n<p><strong>Der Code dazu:<\/strong><\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-1 > .CodeMirror, .fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-color7);}.fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-color2); }.fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-1 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:20px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:var(--awb-color3);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_1\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_1\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_1\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/javascript\">using Melanchall.DryWetMidi.Common;\nusing Melanchall.DryWetMidi.Core;\nusing Melanchall.DryWetMidi.Multimedia;\n\nnamespace Midi;\n\npublic partial class Form1 : Form\n{\n  public Form1()\n  {\n    InitializeComponent();\n\n    Load += OnLoad;\n    btnPlay.Click += OnPlayClick;\n  }\n\n  private void OnLoad(object? sender, EventArgs e)\n  {\n    \/\/ Verf\u00fcgbare MIDI-Ausgabeger\u00e4te auflisten.\n    listBox1.Items.Clear();\n\n    foreach(var device in OutputDevice.GetAll())\n      listBox1.Items.Add(device.Name);\n\n    if(listBox1.Items.Count > 0)\n      listBox1.SelectedIndex = 0;\n\n    txtText.Text = \"HELLO WORLD\";\n  }\n\n  private async void OnPlayClick(object? sender, EventArgs e)\n  {\n    if(listBox1.SelectedItem is not string deviceName)\n    {\n      MessageBox.Show(\"Bitte zuerst ein MIDI-Ausgabeger\u00e4t ausw\u00e4hlen.\");\n      return;\n    }\n\n    if(string.IsNullOrWhiteSpace(txtText.Text))\n    {\n      MessageBox.Show(\"Bitte einen Text eingeben.\");\n      return;\n    }\n\n    \/\/ Ausgew\u00e4hltes MIDI-Ger\u00e4t \u00f6ffnen.\n    using var output = OutputDevice.GetByName(deviceName);\n\n    btnPlay.Enabled = false;\n\n    try\n    {\n      \/\/ Zeichen in Grossbuchstaben umwandeln und ASCII-Wert\n      \/\/ direkt als MIDI-Notennummer verwenden.\n      foreach(char c in txtText.Text.ToUpperInvariant())\n      {\n        \/\/ MIDI-Notennummern sind auf 0 bis 127 begrenzt.\n        if(c > 127)\n          continue;\n\n        var note = (SevenBitNumber)(byte)c;\n\n        \/\/ Note einschalten.\n        output.SendEvent(new NoteOnEvent(note, (SevenBitNumber)60));\n\n        await Task.Delay(300);\n\n        \/\/ Note wieder ausschalten.\n        output.SendEvent(new NoteOffEvent(note, (SevenBitNumber)0));\n      }\n    }\n    finally\n    {\n      btnPlay.Enabled = true;\n    }\n  }\n}\n<\/textarea><\/div><div class=\"fusion-text fusion-text-2\"><p>Wichtig dabei: Das Leerzeichen wird nicht als Pause behandelt, sondern ebenfalls als ASCII-Zeichen. Dadurch entsteht mitten im Text pl\u00f6tzlich eine sehr tiefe Note \u2013 musikalisch fragw\u00fcrdig, technisch aber vollkommen korrekt. \ud83d\ude04<\/p>\n<p><strong>Die Ergebnisse:<br \/>\n<\/strong> Aus dem kleinen Experiment entstanden gleich zwei Mini-Kompositionen:<\/p>\n<p><strong>HELLO WORLD<\/strong><\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-497-1\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"http:\/\/www.donaldswelt.ch\/wp-content\/uploads\/2026\/09\/ASCII-MIDI-\u2013-HELLO-WORLD.mp3?_=1\" \/><a href=\"http:\/\/www.donaldswelt.ch\/wp-content\/uploads\/2026\/09\/ASCII-MIDI-\u2013-HELLO-WORLD.mp3\">http:\/\/www.donaldswelt.ch\/wp-content\/uploads\/2026\/09\/ASCII-MIDI-\u2013-HELLO-WORLD.mp3<\/a><\/audio>\n<p><a href=\"http:\/\/www.donaldswelt.ch\/wp-content\/uploads\/2026\/09\/ASCII-MIDI-\u2013-HELLO-WORLD.pdf\" target=\"_blank\" rel=\"noopener\">ASCII MIDI \u2013 HELLO WORLD<\/a><\/p>\n<p><strong>DONALDS WELT<\/strong><\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-497-2\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"http:\/\/www.donaldswelt.ch\/wp-content\/uploads\/2026\/09\/ASCII-MIDI-\u2013-DONALDS-WELT.mp3?_=2\" \/><a href=\"http:\/\/www.donaldswelt.ch\/wp-content\/uploads\/2026\/09\/ASCII-MIDI-\u2013-DONALDS-WELT.mp3\">http:\/\/www.donaldswelt.ch\/wp-content\/uploads\/2026\/09\/ASCII-MIDI-\u2013-DONALDS-WELT.mp3<\/a><\/audio>\n<p><a href=\"http:\/\/www.donaldswelt.ch\/wp-content\/uploads\/2026\/09\/ASCII-MIDI-\u2013-DONALDS-WELT.pdf\" target=\"_blank\" rel=\"noopener\">ASCII MIDI \u2013 DONALDS WELT<\/a><\/p>\n<p>Die Noten wurden anschliessend als MusicXML nach Sibelius \u00fcbernommen und dort als Partitur und Audio exportiert. Aus ein paar Zeilen Testcode wurden damit tats\u00e4chlich zwei kleine Musikst\u00fccke.<\/p>\n<p><strong>Fazit<br \/>\n<\/strong>Eigentlich sollte es nur ein kurzer MIDI-Test werden. Wenige Minuten sp\u00e4ter spielte mein Clavinova bereits <strong>HELLO WORLD<\/strong> und <strong>DONALDS WELT<\/strong>. Nicht jede Idee muss sinnvoll sein. Manche m\u00fcssen einfach nur funktionieren und gen\u00fcgend absurd sein, damit man dabei grinsen muss.<\/p>\n<p><strong>Bach hatte Noten. Ich habe ASCII.<\/strong><\/p>\n<\/div><\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":530,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[13,19,18],"tags":[],"class_list":["post-497","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-comics","category-musik","category-technikwelt"],"_links":{"self":[{"href":"https:\/\/www.donaldswelt.ch\/index.php\/wp-json\/wp\/v2\/posts\/497","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donaldswelt.ch\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donaldswelt.ch\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donaldswelt.ch\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donaldswelt.ch\/index.php\/wp-json\/wp\/v2\/comments?post=497"}],"version-history":[{"count":49,"href":"https:\/\/www.donaldswelt.ch\/index.php\/wp-json\/wp\/v2\/posts\/497\/revisions"}],"predecessor-version":[{"id":590,"href":"https:\/\/www.donaldswelt.ch\/index.php\/wp-json\/wp\/v2\/posts\/497\/revisions\/590"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.donaldswelt.ch\/index.php\/wp-json\/wp\/v2\/media\/530"}],"wp:attachment":[{"href":"https:\/\/www.donaldswelt.ch\/index.php\/wp-json\/wp\/v2\/media?parent=497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donaldswelt.ch\/index.php\/wp-json\/wp\/v2\/categories?post=497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donaldswelt.ch\/index.php\/wp-json\/wp\/v2\/tags?post=497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}