Posts

LilyPond: anacrusis, tuplets, multiple voices

Image
A very short introduction LilyPond is an incredible and powerful language for writing music scores. Every musician should learn it. But writing code is more suitable for programmers than for musicians and many attempts have to be made to write complete scores. In this post I show you some coding snippets regarding anacrusis, tuplets and multiple voices (If you’re reading this article you know what they are). Here is the basic patterns for each of them in LilyPond language: Musical item LilyPond pattern Anacrusis \partial x followed by a x duration note Tuplets \tuplet x/y {n1 n2 n3} : n(1, 2, 3) are the notes with “x” total duration instead of “y” Multiple voices << {musical expression 1} \\ {musical expession 2} , that’s the double backslash construct Colored items in a real score In the image shown at the top of the page you can see a fragment of a real score, limited to the first two measures, from the Piano Sonata No. 2 op. 19 , Sona...

Vim: some modalities to open single or multiple documents

Image
Synthesis table Some Vim commands we’ll talk about: I write To get vim document_name To run Vim and open a document gvim document_name To run Graphical Vim and open a document vim file-1 file-2 file-n To run Vim and open multiple documents vim -p file-1 file-2 file-n To run Vim and open multiple documents in tabs vim -o file-1 file-2 file-n To run Vim and open multiple documents in separate windows with horizontal rows vim -O file-1 file-2 file-n To run Vim and open multiple documents in separate windows with vertical rows sp doc_name To split a new file while Vim is running vs doc_name To vertical split a new file while Vim is running tabe doc_name To open a new file in a dedicated tab while Vim is running Vim offers a lot of options to open or create single or multiple files from the command line or while the application is running. Here is a brief review, with a few video clips, of the commands I use most frequently, under ...

Vim, Markdown, Snippets, UltiSnips: how to get a well-formatted link with a single command

Image
Vim, Markdown, Snippets, UltiSnips: how to get a well-formatted link with a single command Table of Contents 1. Objective of this post 2. An interesting solution found on the net 3. My solution 4. A simple animation 1 Objective of this post The objective of this post is to get a correctly formatted link in Markdown by merging in a single command a fragment of text and an Internet address previously saved in the Vim clipboard. Of course I assume that everybody that's reading this post knows how to create a well formatted link in Markdown, i.e. text in square brackets and URL in round brackets. Why did I ask myself this question? Very simple: I noticed that in "the-other-side-of-the-moon-called-Emacs" the link construction from a region (i. e. a selected text) is immediately available (markdown-mode, C-c C-l ) whereas in the honza list, which is used by Vim UltiSnips plugin, the same function is not among the presets. ...

Emacs, Expand-region and LaTeX

Image
Emacs, Expand-region and LaTeX Table of Contents 1. Emacs and text objects 2. Expand-region and LaTeX 3. Video clips about LaTeX and expand-region 4. Evil: i.e. Vim within Emacs 1 Emacs and text objects In composite documents there are often text fragments within well-defined semantic elements: parentheses of various kinds, single or double inverted commas, trailing commas, etc. In some text editors (Vim, in particular) they're called " text objects ". Emacs can handle these text blocks with a package called Expand-region that " increases the selected region by semantic units (original definition from the programmer's GitHub page): parenthesis, brackets, quotes, sentences and other objects ". To install the package, please read the programmer's instructions . Although the package also works in generic text documents, it must be used, for optimal performance, inside one of the language modes listed in the...

LaTeX, LilyPond and lyluatex package: state-of-the-art text and music typesetting

Image
LaTeX, LilyPond and lyluatex package: state-of-the-art text and music typesetting Table of Contents 1. LaTeX and LilyPond 2. Prerequisites for understanding this article 3. The LilyPond official solution 4. The single command solution: lyluatex package 5. INLINE EXAMPLE: 6. BLOCK CODE EXAMPLE: 1 LaTeX and Lilypond LaTeX is a " state-of-the art" pagination system for text, maths and more. LilyPond is the same for musical scores. LaTeX and LilyPond together are a true excellence to mix music notation and text within same documents. But it is not so easy to generate documents by using that combination of markup languages. This post is intended as a simple introduction to start using LaTeX and LilyPond in documents containing text and music notation. 2 Prerequisites for understanding this article In order to understand the content of this article, it is of course necessary to know the markup languages it deals with: ...

Vim: searching for text containing a slash or a question mark

Vim: searching for text containing a slash or a question mark Vim: the search command To activate a text search in Vim, press one of the following trigger keys in your keyboard: the slash "/" key (do not confuse with the back-slash "\" key) the question mark key. By pressing the slash "/" key will activate a forward search. By pressing the question mark "/" key will activate a backward search. To move the cursor to the results in your document, press the "n" key (mnemonic for “ next ”). To invert the direction of the cursor, press the "N" key, (“upper n”) . What about if you need to search for a slash or a question mark , i.e. the same trigger characters , in your document? You can prepend the Escape character to the trigger key. The Escape character The Escape character is the back-slash key: "\" . Just an example: if you need to forward search (then with / trigger k...

Vim: vertical motions through full or wrapped lines

In Vim a line is a set of characters ending with a Carriage Return. What’s so special about that definition? Think about wrapped lines that exceed the right edge: Vim handles each wrapped line as belonging to one line only. Standard vertical motions in Vim using j e k keys or the arrow keys occur within full lines. You can jump through wrapped lines by adding the g key to j e k . But, did you know that you can have both movements available without adding any keys? You can remap arrow keys by insering the following code in the .vimrc configuration file: nnoremap <Down> gj nnoremap <Up> gk vnoremap <Down> gj vnoremap <Up> gk inoremap <Down> <C-o>gj inoremap <Up> <C-o>gk From now you will be able to use the arrow keys for the motions through wrapped lines and the jk keys for the default Vim motions.

Vim: two methods to append blank lines under multiple text lines

My Table of Contents What are we talking about? The Regular Expression solution The Global Command solution

GoHugo: time to move on to modules

My Table of Contents Hugo Academic: from Theme to Modules Prerequisite: Go installation The outline: from Academic to Wowchemy Simple scheme to switch to modules in a Hugo Academic based site under Linux Mint

Emacs, Markdown-mode, insert spaces in text links created by the C-c C-l command - My Notebook Home

Image
  How to insert text links in Emacs Markdown-mode ( C-c C-l ) with spaces inside them The reference environment: Emacs, Markdown-mode, insert a link The official assistance service solution The reference environment: Emacs, Markdown-mode, insert a link This article applies to the following environment: Emacs: GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-12-03 Markdown Mode: markdown-mode-20200622.20 OS: Linux Ubuntu 20.4 LTS, Linux Fedora 32 The problem in a few words: You need to insert a link in a document written using Markdown-mode for Emacs and in the Link text you need to insert one or more spaces. The following are the steps: Activate the command C-c C-l Insert the URL of a link and press Return Insert text link with some spaces inside it … STOP! You could notice that the minibuffer does not accept the spaces! You also...

Join lines in Emacs using US International Dead Keys layout

Image
Join-lines: Vim vs Emacs Caret or Circumflex The original keys binding An alternative binding Join-lines: Vim vs Emacs Vim has a very simple system to join two lines. all you have to do is press the J (uppercase) key inside the line above. In Emacs , instead, you must use the C-^ binding in the lower line. But the Emacs solution may seem a bit more laborious if you use a keyboard with US International Dead Keys layout in MS Windows or GNU/Linux. However, with a few small adjustments, it can become super-efficient. What follows is my solution but, of course, everyone can find another one. Caret or Circumflex First of all we need to take a look at the US International Dead Keys keyboard layout for the key corresponding to the number 6 and, in specific to the two similar characters indicated on the top of the key. You can see that on the number 6 button ...