<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Oleh Chaplia on Medium]]></title>
        <description><![CDATA[Stories by Oleh Chaplia on Medium]]></description>
        <link>https://medium.com/@olehch?source=rss-3a1bbc0bac9f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*O9p31bElBeUZ9EkJpk8CeA@2x.jpeg</url>
            <title>Stories by Oleh Chaplia on Medium</title>
            <link>https://medium.com/@olehch?source=rss-3a1bbc0bac9f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 01:00:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@olehch/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Large Language Models, Transformer Architecture, and Text Generation]]></title>
            <link>https://ai.plainenglish.io/large-language-models-transformer-architecture-text-generation-0f1a81f44873?source=rss-3a1bbc0bac9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f1a81f44873</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Oleh Chaplia]]></dc:creator>
            <pubDate>Wed, 07 Aug 2024 14:16:48 GMT</pubDate>
            <atom:updated>2024-08-13T12:31:09.211Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i_vBegktiANNjNIG" /><figcaption>Photo by <a href="https://unsplash.com/@davidclode?utm_source=medium&amp;utm_medium=referral">David Clode</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Advancing Towards General Artificial Intelligence</h3><p>Imagine a reality where machines understand human language with equal fluency and nuance to us. A place where artificial intelligence can seamlessly assist in writing, translating languages, answering questions, and engaging in meaningful conversations. Artificial Intelligence has transitioned from a distant dream to a present-day reality, thanks to the extraordinary advancements in Large Language Models (LLMs). These sophisticated AI models, powered by neural networks and modern architectures, are changing how we interact with technology. As we delve into the inner workings of LLMs, we uncover the remarkable science that makes these modern marvels possible, paving the way for a future where AI and human ingenuity converge like never before.</p><blockquote>“Artificial Intelligence has transitioned from a distant dream to a present-day reality.”</blockquote><h3>What Are Large Language Models</h3><p>Large Language Models (LLMs) are designed to understand and generate human-like language. LLMs are deep neural networks trained on a massive corpus of data. They generate output text by taking an input text and repeatedly predicting the next token. The resulting text is a combination of predicted tokens combined as words.</p><p>Nowadays, almost every big company has its own LLMs. Prominent examples include <a href="https://openai.com/">OpenAI GPT models</a>, <a href="https://ai.meta.com/resources/models-and-libraries/">Meta’s Llama3</a>, <a href="https://deepmind.google/technologies/gemini/">Google Gemini</a>, and many others, including open-source models on <a href="https://huggingface.co/">Hugging Face</a>.</p><p>Each LLM has different variants and millions or billions of parameters, which impact the models’ quality, speed, memory, and storage capacity. LLMs find applications in various domains, including text generation, translation, summarization, question answering, and sentiment analysis. Each model, depending on the architecture, e.g., <a href="https://wandb.ai/mostafaibrahim17/ml-articles/reports/An-Overview-of-Large-Language-Models-LLMs---VmlldzozODA3MzQz#autoencoder-based-model">Autoencoder-Based</a>, <a href="https://wandb.ai/mostafaibrahim17/ml-articles/reports/An-Overview-of-Large-Language-Models-LLMs---VmlldzozODA3MzQz#sequence-to-sequence-model">Sequence-to-Sequence</a>, <a href="https://wandb.ai/mostafaibrahim17/ml-articles/reports/An-Overview-of-Large-Language-Models-LLMs---VmlldzozODA3MzQz#transformer-based-models">Transformer</a>, <a href="https://wandb.ai/mostafaibrahim17/ml-articles/reports/An-Overview-of-Large-Language-Models-LLMs---VmlldzozODA3MzQz#recursive-neural-network-models">Recursive Neural Networks</a>, <a href="https://wandb.ai/mostafaibrahim17/ml-articles/reports/An-Overview-of-Large-Language-Models-LLMs---VmlldzozODA3MzQz#hierarchical-models">Hierarchical</a>, can solve particular kinds of tasks better than the other. Their versatility allows them to be fine-tuned for specific tasks or used as general-purpose language understanding tools.</p><p>Training LLMs involves using massive datasets and substantial computational resources. The training process comprises pre-training and fine-tuning. The model is trained on a diverse and extensive text corpus during pre-training. Common pre-training tasks include <a href="https://medium.com/@lokaregns/masked-language-modeling-with-hugging-face-transformers-a-beginners-guide-b36af74a7560">masked language modeling</a> (e.g., <a href="https://research.google/pubs/bert-pre-training-of-deep-bidirectional-transformers-for-language-understanding/">BERT</a>) and <a href="https://www.georgeho.org/deep-autoregressive-models/">autoregressive language modeling</a> (e.g., <a href="https://arxiv.org/abs/2305.10435">GPT</a>). Pre-training enables the model to learn general language patterns, syntax, and semantics. Pre-trained models are called base models. After pre-training, the model can be fine-tuned to use specialized knowledge. A fine-tuned model can generate text based on the additional expertise.</p><p>One of the defining features of modern LLMs is their scale. These models often have billions of parameters, making them capable of capturing subtle language nuances and producing high-quality text. Scaling up neural networks involves increasing the number of layers, attention heads, and parameters, which enhances the model’s expressive power and ability to generalize across diverse linguistic contexts.</p><h3>Traditional Neural Network Architectures</h3><p>Before the advent of Transformers, traditional neural networks such as <a href="https://www.ibm.com/topics/recurrent-neural-networks">Recurrent Neural Networks</a> (RNNs) and <a href="https://developer.ibm.com/tutorials/iot-deep-learning-anomaly-detection-1/">Long Short-Term Memory Networks</a> (LSTMs) were widely used for natural language processing (NLP) tasks. These networks process data sequences one step at a time, maintaining a hidden state that captures information about previous tokens. While effective to some extent, RNNs and LSTMs struggled with long-range dependencies due to issues like <a href="https://dennybritz.com/posts/wildml/recurrent-neural-networks-tutorial-part-3/">vanishing gradients</a>, limiting their ability to model complex language patterns over extended sequences.</p><h3>The Transformer Architecture</h3><p>Presented in the paper “<a href="https://arxiv.org/abs/1706.03762">Attention is All You Need</a>” in 2017, the Transformer architecture revolutionized NLP by addressing the limitations of traditional neural networks. The <a href="https://jalammar.github.io/illustrated-transformer/">Transformer architecture</a> relies on self-attention mechanisms to process input sequences in parallel, allowing it to capture long-range dependencies more efficiently than traditional recurrent neural networks (RNNs) or convolutional neural networks (CNNs). Transformers consist of stacks of identical layers containing an encoder and decoder module. The self-attention mechanism gives the model an understanding of the importance of different words in the input and focuses on relevant parts when decoding.</p><p>Key components of the <a href="https://jalammar.github.io/illustrated-transformer/">Transformer</a> include encoders, decoders, input and output embedding, self-attention mechanism, multi-head attention, positional encoding, feed-forward networks, residual connections, and layer normalization.</p><p>Figure 1 represents the transformer model architecture. The figure is taken from the paper “<a href="https://arxiv.org/abs/1706.03762">Attention Is All You Need</a>.” At first, it may be hard to understand the context of this architecture. But it will be described in the following sections.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o7VUVCyM_uMwlAysGtFz4Q.png" /><figcaption>Figure 1. The Transformer — model architecture.</figcaption></figure><p>Figure 1 can be simplified into two blocks — encoder and decoder. Implemented systems contain stacks of encoders and decoders (Nx). For example, six are used in the research paper “<a href="https://arxiv.org/abs/1706.03762">Attention Is All You Need</a>.”</p><p>Figure 2 represents the encoder and decoder. The figure is taken from the article “<a href="https://jalammar.github.io/illustrated-transformer/">The Illustrated Transformer</a>” by <a href="https://jalammar.github.io/">Jay Alammar</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/0*rDg9nJPwPpQGQ0Iz.png" /><figcaption>Figure 2. Encoder and decoder.</figcaption></figure><h4>Encoders</h4><p>Encoders are components designed to process input data and extract meaningful features. In the context of language models, an encoder reads input text and converts it into a fixed-size vector representation. Embedding is a word converted to a numerical format and embedded into a vector. This vector representation captures the essential information of the tokens and a context. The encoder consists of two parts — self-attention and a feed-forward neural network. The self-attention block helps look at other tokens while encoding them. The outputs of the self-attention layer are moved into a feed-forward neural network.</p><p>Encoders are represented on the left side of the Figure 1. A Multi-Head attention block is a self-attention block that processes the inputs in parallel.</p><h4>Decoders</h4><p>Decoders are responsible for generating output data from the encoded representation. In sequence-to-sequence tasks such as translation or text generation, the decoder takes the encoded input and produces the corresponding output sequence. Decoders work in tandem with encoders: while the encoder transforms the input into a dense representation, the decoder interprets this representation to construct the desired output. Transformer decoders consist of a self-attention block, encoder-decoder attention, and a feed-forward neural network. The encoder-decoder attention layer helps the decoder focus on relevant parts of the input sentence.</p><p>Decoders are represented on the right side of the Figure 1. A Multi-Head attention block is a self-attention block that processes the inputs in parallel.</p><h4>Input and Output Embedding</h4><p>Before stacks of encoders and decoders, the “Input Embedding” and “Output Embedding” phases are executed only before the first encoder and decoder, respectively. They provide inputs to the first encoder and decoder in the stack. The default dimension of the vector is 512. However, it may be changed for other variants of the architecture. They are represented in Figure 1.</p><p>Numerical vector representations of the words are called “embeddings” because they are embedded into a multi-dimensional vector space. Therefore, this vector space can calculate word similarity and closeness.</p><h4>Self-Attention Mechanism</h4><p>Self-Attention mechanism weights the importance of each token in the input sequence relative to every other token. By calculating attention scores as a weighted sum of input representations, the model can focus on relevant parts of the text, regardless of their position in the sequence. The self-attention mechanism is both position-agnostic and highly parallelizable.</p><p>This mechanism provides the ability to understand complex contexts, which include reference words like “it,” “these,” etc. For example, in the sentence “<em>The weather was sunny yesterday. It was warm and comfortable</em>,” the word “<em>it</em>” refers to the weather.</p><p>Figure 3 represents the flow for the self-attention calculation steps. The figure is taken from the paper “<a href="https://arxiv.org/abs/1706.03762">Attention Is All You Need</a>.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oGluVRzG0i_3LG99EfRgiA.png" /><figcaption>Figure 3. Scaled Dot-Product Attention on the left. Multi-Head Attention has several attention layers running in parallel on the right.</figcaption></figure><p>A short description of steps to calculate self-attention:</p><ol><li>Calculate three <em>key</em>, <em>query</em>, and <em>value vectors </em>for each embedded word.</li><li>Calculate scores for each word in the sentence against other words using the <em>key </em>and <em>query vectors</em>. Scores help to understand which word is more important than the other words.</li><li>Divide the <em>resulting scores</em> by 8 (the dimension of the key vectors — 64; 8 is the square root of 64). It is the default value, but it can be changed. Then, the result is passed to a softmax calculation to normalize the scores.</li><li>A multiplication of each <em>value</em> <em>vector</em> by the softmax score. It produces <em>weighted value vectors. </em>This step creates a focus on the selected words and drops irrelevant words.</li><li>Sum up the <em>weighted value vectors</em>. This produces the <em>resulting</em> <em>vector</em> as the output of the self-attention layer at this position (for the first word).</li><li>The <em>resulting</em> <em>vector</em> is sent to the feed-forward neural network.</li></ol><p>Please check the “Self-Attention in Detail” section in the “<a href="https://jalammar.github.io/illustrated-transformer/">The Illustrated Transformer</a>” article to gain more profound knowledge of the self-attention mechanism calculations.</p><h4>Multi-Head Attention</h4><p>Multiple attention heads capture relationships between tokens. This approach allows the model to consider various contexts for each word, improving its ability to understand nuanced language patterns.</p><p>Multi-head attention is the same as self-attention but with multiple heads. Each head operates independently in parallel. Its outputs are concatenated and linearly transformed to produce the final output.</p><p>Figure 4 represents a summarization of multiple attention calculations. The image is taken from the article “<a href="https://jalammar.github.io/illustrated-transformer/">The Illustrated Transformer</a>” written by <a href="https://jalammar.github.io/">Jay Alammar</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JaM6zGChMdadWkV7.png" /><figcaption>Figure 4. Multi-Head Attention calculation steps.</figcaption></figure><p>Figure 5 depicts a visualization of the attention for one or more attention heads in the same layer. In this image, each word has its prediction scores for the different layers. The next word is generated based on these scores and links. Figure 5 is taken from the <a href="https://github.com/jessevig/bertviz?tab=readme-ov-file#head-view">BertViz</a> repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7jsH2IwHsR2YFcjAxszD0A.png" /><figcaption>Figure 5. A visualization of the attention for one or more attention heads in the same layer.</figcaption></figure><p>Figure 6 shows a bird’s-eye view of attention across all layers and heads. Figure 6 is taken from the <a href="https://github.com/jessevig/bertviz?tab=readme-ov-file#model-view">BertViz</a> repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mDN0JuH5idY0OVQ8xP2nAw.png" /><figcaption>Figure 6. A bird’s-eye view of attention across all layers and heads.</figcaption></figure><p>Figure 7 visualizes individual neurons in the query and key vectors and shows how they are used to compute attention. Figure 7 is taken from the <a href="https://github.com/jessevig/bertviz?tab=readme-ov-file#neuron-view">BertViz</a> repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xs2ItWhJq-D6rjfzl-UkFA.png" /><figcaption>Figure 7. Visualization of individual neurons in the query and key vectors.</figcaption></figure><h4>Positional Encoding</h4><p>In natural language, the order of words is important. Even when the transformer processes tokens in parallel, the final result should acknowledge the positions of the input words. Therefore, the positional vector is added to each input embedding. These vectors help to determine the position of each word and the distance between the words. Based on these vectors, the final result contains a valid order of the words.</p><h4>Feed-Forward Networks</h4><p>Each layer of the Transformer includes position-wise fully connected feed-forward networks, which further process the outputs of the attention mechanisms. These networks introduce non-linearity and enhance the model’s capacity to learn language features.</p><h4>Residual Connections and Layer Normalization</h4><p>Each encoder layer, e.g., self-attention or feed-forward neural networks, has a residual connection around it. Then, a layer normalization step appears. It is important for stable training and performance improvements. Residual connections help propagate gradients and maintain the flow of information across layers.</p><p>Figure 8 represents a summarization of multiple attention calculations. The image is taken from the article “<a href="https://jalammar.github.io/illustrated-transformer/">The Illustrated Transformer</a>” written by <a href="https://jalammar.github.io/">Jay Alammar</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hnfvWnDyZVYatlSB.png" /><figcaption>Figure 8. Residual connections and normalization layers. An example of two stacked encoders.</figcaption></figure><h4>Linear and Softmax Layers</h4><p>The stack of decoders produces a numerical vector of results. This final vector is passed to the Linear layer. The Linear Layer is a fully connected neural network that produces the input vector of results into a logit vector. A logit vector is a vector of non-normalized raw predictions, in our case, the prediction of the next word. The softmax layer turns those numbers into probabilities for each word from a dictionary of unique words. The entry with the highest probability is chosen. Then, the word associated with that entry is produced.</p><h3>A Summary of the Process of Text Generation</h3><p>Let’s summarize the text generation process for the Transformer architecture to give more intuition.</p><p>When generating text, the process begins with receiving the input. The input can be any form of initial text. This text guides the model on what to generate next. The text is tokenized, which means it is split into smaller units, such as words, subwords, or characters, depending on the model’s tokenization scheme. Each token is converted into a numerical vector representation that captures its semantic meaning and context. Then, each numerical vector of each word is “embedded” into a vector for the encoders. Positional encodings are added to the embedded tokens to incorporate the order information.</p><p>Once the input is encoded and the attention mechanism has processed the relationships between tokens, the model moves to the decoding phase. During decoding, the model generates text sequentially, one token at a time. For each step in the sequence, the model uses the encoded input and the previously generated tokens to predict the next token. This prediction is based on probabilities derived from the model’s understanding of language patterns, grammar, and context.</p><p>For each token to be generated, the model outputs a probability distribution over its entire vocabulary. This distribution indicates the likelihood of each possible token being the next one in the sequence. Various sampling techniques can be applied to select the next token from this distribution.</p><p>Different approaches can be used to balance between diversity and optimality. Greedy search selects the token with the highest probability at each step, which may lead to repetitive and less diverse text. On the other hand, beam search explores multiple paths and selects the sequence with the highest cumulative probability, thus balancing diversity and optimality. Additionally, top-k sampling limits the selection to the top-k most probable tokens, adding diversity by not always choosing the highest probability token. Lastly, top-p (nucleus) sampling chooses tokens from the smallest set whose cumulative probability exceeds a certain threshold (p), ensuring a balance between diversity and relevance.</p><p>The selected token is then added to the sequence, and the process repeats until the model generates a complete sentence, paragraph, or desired length of text. The model uses context from the entire input and the already generated tokens to ensure the text is coherent and contextually appropriate.</p><p>After generating the text, some models and applications perform post-processing steps to refine the output. This can include grammar correction, adjusting punctuation, or ensuring consistency in the narrative.</p><h3>Conclusions</h3><p>Large Language Models based on the Transformer model represent a groundbreaking advancement in the Natural Language Processing (NLP) field. They change the way of interacting with machines and computer systems, opening new frontiers in AI-driven communication and understanding. The ability of LLMs to understand and generate human-like text has led to a wide array of applications, from automated content creation and chatbots to advanced translation and summarization tools.</p><p>With active ongoing innovations and research, I think LLMs will become even more integral to various applications, from everyday communication tools to advanced AI systems.</p><h3>References</h3><ol><li><a href="https://www.noemamag.com/artificial-general-intelligence-is-already-here/">“Artificial General Intelligence Is Already Here”</a> by Blaise Agüera y Arcas and Peter Norvig.</li><li><a href="https://wandb.ai/mostafaibrahim17/ml-articles/reports/An-Overview-of-Large-Language-Models-LLMs---VmlldzozODA3MzQz">“An Overview of Large Language Models (LLMs)”</a> by Mostafa Ibrahim</li><li><a href="https://www.sciencedirect.com/science/article/pii/S2666651021000231">“Pre-trained models: Past, present and future”</a> by Xu Han et al.</li><li>“<a href="https://www.v7labs.com/blog/neural-network-architectures-guide#what-are-neural-networks">The Essential Guide to Neural Network Architectures</a>” by <a href="https://www.v7labs.com/authors/pragati-baheti">Pragati Baheti</a></li><li>“<a href="https://towardsdatascience.com/the-fall-of-rnn-lstm-2d1594c74ce0">The fall of RNN / LSTM</a>” by <a href="https://culurciello.medium.com/?source=post_page-----2d1594c74ce0--------------------------------">Eugenio Culurciello</a></li><li>“<a href="https://dennybritz.com/posts/wildml/recurrent-neural-networks-tutorial-part-3/">Recurrent Neural Networks Tutorial, Part 3 — Backpropagation Through Time and Vanishing Gradients</a>” by Denny Britz</li><li><a href="https://arxiv.org/abs/1706.03762">“Attention is All You Need”</a> by Ashish Vaswani et al.</li><li><a href="https://arxiv.org/abs/2305.10435">“Generative Pre-trained Transformer: A Comprehensive Review on Enabling Technologies, Potential Applications, Emerging Challenges, and Future Directions</a>” by Gokul Yenduri et al.</li><li><a href="https://research.google/pubs/bert-pre-training-of-deep-bidirectional-transformers-for-language-understanding/">“BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding</a>”</li><li><a href="https://www.georgeho.org/transformers-in-nlp/">“Transformers in Natural Language Processing — A Brief Survey,”</a> by George Ho</li><li><a href="https://vladris.com/llm-book/">“Large Language Models at Work: Enhancing Software Systems with Language Models</a>” by Vlad Riscutia</li><li><a href="https://medium.com/@lokaregns/masked-language-modeling-with-hugging-face-transformers-a-beginners-guide-b36af74a7560">“Masked Language Modeling with Hugging Face Transformers: A Beginner’s Guide</a>” by Ganesh Lokare</li><li><a href="https://arxiv.org/abs/2302.02060">“Representation Deficiency in Masked Language Modeling</a>,” Yu Meng et al.</li><li><a href="https://www.georgeho.org/deep-autoregressive-models/">“Autoregressive Models in Deep Learning — A Brief Survey,”</a> by George Ho</li><li><a href="https://www.ibm.com/topics/recurrent-neural-networks">“What are recurrent neural networks?</a>” IBM</li><li><a href="https://developer.ibm.com/tutorials/iot-deep-learning-anomaly-detection-1/">“Introducing deep learning and long-short term memory networks</a>,” IBM</li><li><a href="https://web.stanford.edu/~jurafsky/slp3/">“Speech and Language Processing (3rd ed. draft)”</a>, by <a href="http://web.stanford.edu/people/jurafsky/">Daniel Jurafsky</a> and <a href="http://www.cs.colorado.edu/~martin/">James H. Martin</a></li></ol><h3>In Plain English 🚀</h3><p><em>Thank you for being a part of the </em><a href="https://plainenglish.io/"><strong><em>In Plain English</em></strong></a><em> community! Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://twitter.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a> | <a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a></li><li>Visit our other platforms: <a href="https://cofeed.app/"><strong>CoFeed</strong></a> | <a href="https://differ.blog/"><strong>Differ</strong></a></li><li>More content at <a href="https://plainenglish.io/"><strong>PlainEnglish.io</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f1a81f44873" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/large-language-models-transformer-architecture-text-generation-0f1a81f44873">Large Language Models, Transformer Architecture, and Text Generation</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Local Artificial Intelligence: Run LLM Models Locally with Ollama]]></title>
            <link>https://ai.plainenglish.io/run-llm-models-locally-with-ollama-b255ee1282b4?source=rss-3a1bbc0bac9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b255ee1282b4</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Oleh Chaplia]]></dc:creator>
            <pubDate>Thu, 27 Jun 2024 10:01:27 GMT</pubDate>
            <atom:updated>2024-08-14T18:59:06.018Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ew5RioYB_OruCTqC" /><figcaption><a href="https://unsplash.com/photos/robot-standing-near-luggage-bags-hND1OG3q67k"><strong>Photo by Lukas on Unsplash</strong></a></figcaption></figure><h4>Artificial Intelligence in the Age of Multiple Personal Devices</h4><p>Artificial Intelligence (AI) and Large Language Models (LLMs) have revolutionized our user experience and ways of interacting with applications. They offer a vast amount of capabilities in understanding and generating human-like text. Imagine harnessing this power locally without relying on cloud services. Running LLM models locally and deploying them on edge devices bring numerous advantages: enhanced privacy, reduced latency, and the ability to operate offline. Serverless and edge computing brings computation closer to the data source, combined with the power of AI.</p><h4>Introduction to Ollama</h4><p>Let’s start with a tool that can run models locally — <a href="https://ollama.com/">Ollama</a>. Jeffrey Morgan and Michael Chiang are the founders of Ollama. The main headquarters are in Toronto, Canada.</p><p>Ollama is an open-source tool for running LLM models on a local machine. Models are downloaded once and then run in offline mode. A recently added feature is a parallel run of several models. Ollama bundles LLM configuration, model weights, and metadata into a single package. The package is named Modelfile. Ollama also has an official <a href="https://hub.docker.com/r/ollama/ollama">Docker image</a>. Available LLM models are stored in the <a href="https://ollama.com/library">Ollama library</a> and can be freely downloaded.</p><h4>Ollama Models</h4><p>Ollama can download and run LLM models locally. <a href="https://ollama.com/library">Ollama’s LLM library</a> contains many open-source models with different sizes. Popular models like Llama3, Qwen2, Phi3, Mistral, Gemma, CodeGemma, CodeLlama, and StarCoder2 are available. Each model contains different variants of quantization. The size of the models varies from 500Mb to more than 30Gb.</p><p>The model uses the <a href="https://huggingface.co/docs/hub/gguf">GGUF</a> format. Custom models can be created using Modelfile. After downloading the model, it can be inferenced in the terminal or via REST API. The only constraint is the performance and RAM of the laptop where the model is running.</p><blockquote>Ollama authors say that you should have at least 8 GB of RAM available to run the 7B models, 16 GB to run the 13B models, and 32 GB to run the 33B models.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T0e7_1sg2Qf-_uBiP0PWoA.png" /><figcaption>LLM Model parameters, sizes, and commands to run. Image taken from Ollama GitHub repository.</figcaption></figure><p>Below is an image of the GGUF format description from the <a href="https://huggingface.co/docs/hub/gguf">HuggingFace documentation</a>. The first bytes contain system information, such as the <em>GGUF magic number</em>, <em>GGUF version</em>, <em>tensor count</em>, and <em>metadata key-value pairs </em>count. Then, a list of <em>metadata key-value pairs </em>is provided. The next block represents tensors with <em>tensor_count</em> values. And the rest of the file consists of the <em>tensors</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ierHPrQ4S1XAG_Qy.png" /><figcaption>GGUF format. Image taken from HuggingFace documentation.</figcaption></figure><h4>Using Ollama via CLI</h4><p>When you start Ollama in the terminal by running the command ollama, a help appears. The help is obvious and concise. Commands are very straightforward. The following section will review the flow of downloading and running the LLM model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GkTuTsV2TROIY1-HPM19Ew.png" /><figcaption>Terminal output for ollama command executed without arguments</figcaption></figure><p>These Ollama commands manage the models — create, show, run, pull, push, list, ps, cp, rm. The serve command starts the server. The server is already running when the Ollama application runs on Mac, so it is unnecessary to start it manually.</p><p>To download the selected model, in this case, <em>llama3</em>, from the model library and run the LLM, run this command:</p><pre>ollama run llama3</pre><p>This command downloads and runs the model locally in the terminal. When no additional model labels are provided, the default latest model version is downloaded. Provide the tag name after the semicolon to use a specific quantization level.</p><pre>ollama run llama3:70b</pre><p>Then, the model is started for the inference and is ready for a chat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u2PYniy6vxqmvE-sO0WTzQ.png" /><figcaption>Terminal output after running the Llama3 model</figcaption></figure><p>A pull command may download the model without running it. Then, the list command should show a newly downloaded model.</p><pre>ollama pull llama3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bwiQxNhXFoYiPVNncaKdGA.png" /><figcaption>Terminal output after pulling the Llama3 model</figcaption></figure><h4>Ollama Server and Useful Terminal Commands</h4><p>Ollama runs as a REST API server on the <em>11434</em> port. The port can be changed. The serve command starts the server or throws an error when the server is already running.</p><pre>ollama serve</pre><p>Here, a startup log is presented. A complete list of environment variables and their values is shown. Also, check the log level — INFO, which can be important when monitoring the app after deploying.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AYT1B1BVlK8JYB90NrFdYQ.png" /><figcaption>Terminal output after starting the Ollama server</figcaption></figure><p>Some properties can be changed by changing the environment variables like port, keep alive duration, max loaded models, max queued requests, number of parallel requests, origins, and maximum VRAM. The complete list of properties is in the image below.</p><p>From my experience, the most often used properties are the keep alive setting, max loaded models, max queue, number of parallel requests, and origins. Anyway, all of them are important in some way or another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DEJ_ELR4KIP895l2pWkMRw.png" /><figcaption>Terminal output for a list of Ollama environment variables for a server</figcaption></figure><p>Use the command tail to check the API requests and logs in real-time. This command is convenient for development purposes.</p><pre>tail -f ~/.ollama/logs/server.log</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wtmhLA-oglEu6GmCTZo5Gg.png" /><figcaption>Terminal output for Ollama logs</figcaption></figure><h4>REST API Endpoints</h4><p>Ollama’s REST API is fully presented in the <a href="https://github.com/ollama/ollama/blob/main/docs/api.md">GitHub documentation</a>. It describes simple but concise endpoints. The list of endpoints includes completion endpoint, chat completion, list models, manage existing models, downloading new models, generate embeddings, and list running models. The examples are taken from the official documentation on GitHub.</p><p>A model name and prompt are required to execute. Check the complete list of parameters <a href="https://github.com/ollama/ollama/blob/main/docs/api.md#parameters">here</a>. Streaming is set to true by default. Streaming mode is a mode in which one word at a time is provided and represented as a separate JSON object. It is convenient when we want to give the user ad-hoc visual feedback of the generated completion instead of waiting for the entire response.</p><p>Request in a <a href="https://github.com/ollama/ollama/blob/main/docs/api.md#request-raw-mode">raw mode</a> bypasses the templating system and provides a complete, prompt response. Sometimes, it can be convenient for specific purposes.</p><p>A simple REST API request without streaming property looks like this. The model will be loaded into memory if an empty prompt is provided. Then, the model stays loaded in the memory of the time controlled by the <em>keep_alive</em> property for the current request. The default value is 5 minutes.</p><pre>curl http://localhost:11434/api/generate -d &#39;{<br>  &quot;model&quot;: &quot;llama3&quot;,<br>  &quot;prompt&quot;: &quot;Why is the sky blue?&quot;,<br>  &quot;stream&quot;: false<br>}&#39;</pre><p>The response JSON object provides a response string with the generated completion text and additional metadata. All durations are returned in nanoseconds. By knowing the durations, we can calculate the performance of the LLM completion.</p><blockquote>According to the documentation, to calculate how fast the response is generated in tokens per second (token/s), divide eval_count / eval_duration * 10^9.</blockquote><pre>{<br>  &quot;model&quot;: &quot;llama3&quot;,<br>  &quot;created_at&quot;: &quot;2023-08-04T19:22:45.499127Z&quot;,<br>  &quot;response&quot;: &quot;The sky is blue because it is the color of the sky.&quot;<br>  &quot;done&quot;: true,<br>  &quot;context&quot;: [1, 2, 3],<br>  &quot;total_duration&quot;: 5043500667,<br>  &quot;load_duration&quot;: 5025959,<br>  &quot;prompt_eval_count&quot;: 26,<br>  &quot;prompt_eval_duration&quot;: 325953000,<br>  &quot;eval_count&quot;: 290,<br>  &quot;eval_duration&quot;: 4709213000<br>}</pre><p>Chat completion is almost the same as <em>completion</em> but has parameters like a list of <em>messages</em> (<em>message</em> objects), <em>role,</em> and <em>content</em>. The <em>role </em>can be either system, user, or assistant. <em>Content</em> is the content of the message. This example uses the <em>streaming</em> option.</p><pre>curl http://localhost:11434/api/chat -d &#39;{<br>  &quot;model&quot;: &quot;llama3&quot;,<br>  &quot;messages&quot;: [<br>    {<br>      &quot;role&quot;: &quot;user&quot;,<br>      &quot;content&quot;: &quot;Why is the sky blue?&quot;<br>    }<br>  ]<br>}&#39;</pre><p>A stream of JSON objects is returned.</p><pre>{<br>  &quot;model&quot;: &quot;llama3&quot;,<br>  &quot;created_at&quot;: &quot;2023-08-04T08:52:19.385406455-07:00&quot;,<br>  &quot;message&quot;: {<br>    &quot;role&quot;: &quot;assistant&quot;,<br>    &quot;content&quot;: &quot;The&quot;,<br>    &quot;images&quot;: null<br>  },<br>  &quot;done&quot;: false<br>}</pre><p>The final response is presented below.</p><pre>{<br>  &quot;model&quot;: &quot;llama3&quot;,<br>  &quot;created_at&quot;: &quot;2023-08-04T19:22:45.499127Z&quot;,<br>  &quot;done&quot;: true,<br>  &quot;total_duration&quot;: 4883583458,<br>  &quot;load_duration&quot;: 1334875,<br>  &quot;prompt_eval_count&quot;: 26,<br>  &quot;prompt_eval_duration&quot;: 342546000,<br>  &quot;eval_count&quot;: 282,<br>  &quot;eval_duration&quot;: 4535599000<br>}</pre><p>Sending images to the multimodal models such as llava or bakllava, a list of base64-encoded images is necessary.</p><pre>curl http://localhost:11434/api/generate -d &#39;{<br>  &quot;model&quot;: &quot;llava&quot;,<br>  &quot;prompt&quot;:&quot;What is in this picture?&quot;,<br>  &quot;stream&quot;: false,<br>  &quot;images&quot;: [&quot;iVBORw0KGgoAAAANSUhEUgAAAG0AAABmCAYAAADBPx+VAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA3VSURBVHgB7Z27r0zdG8fX743i1bi1ikMoFMQloXRpKFFIqI7LH4BEQ+NWIkjQuSWCRIEoULk0gsK1kCBI0IhrQVT7tz/7zZo888yz1r7MnDl7z5xvsjkzs2fP3uu71nNfa7lkAsm7d++Sffv2JbNmzUqcc8m0adOSzZs3Z+/XES4ZckAWJEGWPiCxjsQNLWmQsWjRIpMseaxcuTKpG/7HP27I8P79e7dq1ars/yL4/v27S0ejqwv+cUOGEGGpKHR37tzJCEpHV9tnT58+dXXCJDdECBE2Ojrqjh071hpNECjx4cMHVycM1Uhbv359B2F79+51586daxN/+pyRkRFXKyRDAqxEp4yMlDDzXG1NPnnyJKkThoK0VFd1ELZu3TrzXKxKfW7dMBQ6bcuWLW2v0VlHjx41z717927ba22U9APcw7Nnz1oGEPeL3m3p2mTAYYnFmMOMXybPPXv2bNIPpFZr1NHn4HMw0KRBjg9NuRw95s8PEcz/6DZELQd/09C9QGq5RsmSRybqkwHGjh07OsJSsYYm3ijPpyHzoiacg35MLdDSIS/O1yM778jOTwYUkKNHWUzUWaOsylE00MyI0fcnOwIdjvtNdW/HZwNLGg+sR1kMepSNJXmIwxBZiG8tDTpEZzKg0GItNsosY8USkxDhD0Rinuiko2gfL/RbiD2LZAjU9zKQJj8RDR0vJBR1/Phx9+PHj9Z7REF4nTZkxzX4LCXHrV271qXkBAPGfP/atWvu/PnzHe4C97F48eIsRLZ9+3a3f/9+87dwP1JxaF7/3r17ba+5l4EcaVo0lj3SBq5kGTJSQmLWMjgYNei2GPT1MuMqGTDEFHzeQSP2wi/jGnkmPJ/nhccs44jvDAxpVcxnq0F6eT8h4ni/iIWpR5lPyA6ETkNXoSukvpJAD3AsXLiwpZs49+fPn5ke4j10TqYvegSfn0OnafC+Tv9ooA/JPkgQysqQNBzagXY55nO/oa1F7qvIPWkRL12WRpMWUvpVDYmxAPehxWSe8ZEXL20sadYIozfmNch4QJPAfeJgW3rNsnzphBKNJM2KKODo1rVOMRYik5ETy3ix4qWNI81qAAirizgMIc+yhTytx0JWZuNI03qsrgWlGtwjoS9XwgUhWGyhUaRZZQNNIEwCiXD16tXcAHUs79co0vSD8rrJCIW98pzvxpAWyyo3HYwqS0+H0BjStClcZJT5coMm6D2LOF8TolGJtK9fvyZpyiC5ePFi9nc/oJU4eiEP0jVoAnHa9wyJycITMP78+eMeP37sXrx44d6+fdt6f82aNdkx1pg9e3Zb5W+RSRE+n+VjksQWifvVaTKFhn5O8my63K8Qabdv33b379/PiAP//vuvW7BggZszZ072/+TJk91YgkafPn166zXB1rQHFvouAWHq9z3SEevSUerqCn2/dDCeta2jxYbr69evk4MHDyY7d+7MjhMnTiTPnz9Pfv/+nfQT2ggpO2dMF8cghuoM7Ygj5iWCqRlGFml0QC/ftGmTmzt3rmsaKDsgBSPh0/8yPeLLBihLkOKJc0jp8H8vUzcxIA1k6QJ/c78tWEyj5P3o4u9+jywNPdJi5rAH9x0KHcl4Hg570eQp3+vHXGyrmEeigzQsQsjavXt38ujRo44LQuDDhw+TW7duRS1HGgMxhNXHgflaNTOsHyKvHK5Ijo2jbFjJBQK9YwFd6RVMzfgRBmEfP37suBBm/p49e1qjEP2mwTViNRo0VJWH1deMXcNK08uUjVUu7s/zRaL+oLNxz1bpANco4npUgX4G2eFbpDFyQoQxojBCpEGSytmOH8qrH5Q9vuzD6ofQylkCUmh8DBAr+q8JCyVNtWQIidKQE9wNtLSQnS4jDSsxNHogzFuQBw4cyM61UKVsjfr3ooBkPSqqQHesUPWVtzi9/vQi1T+rJj7WiTz4Pt/l3LxUkr5P2VYZaZ4URpsE+st/dujQoaBBYokbrz/8TJNQYLSonrPS9kUaSkPeZyj1AWSj+d+VBoy1pIWVNed8P0Ll/ee5HdGRhrHhR5GGN0r4LGZBaj8oFDJitBTJzIZgFcmU0Y8ytWMZMzJOaXUSrUs5RxKnrxmbb5YXO9VGUhtpXldhEUogFr3IzIsvlpmdosVcGVGXFWp2oU9kLFL3dEkSz6NHEY1sjSRdIuDFWEhd8KxFqsRi1uM/nz9/zpxnwlESONdg6dKlbsaMGS4EHFHtjFIDHwKOo46l4TxSuxgDzi+rE2jg+BaFruOX4HXa0Nnf1lwAPufZeF8/r6zD97WK2qFnGjBxTw5qNGPxT+5T/r7/7RawFC3j4vTp09koCxkeHjqbHJqArmH5UrFKKksnxrK7FuRIs8STfBZv+luugXZ2pR/pP9Ois4z+TiMzUUkUjD0iEi1fzX8GmXyuxUBRcaUfykV0YZnlJGKQpOiGB76x5GeWkWWJc3mOrK6S7xdND+W5N6XyaRgtWJFe13GkaZnKOsYqGdOVVVbGupsyA/l7emTLHi7vwTdirNEt0qxnzAvBFcnQF16xh/TMpUuXHDowhlA9vQVraQhkudRdzOnK+04ZSP3DUhVSP61YsaLtd/ks7ZgtPcXqPqEafHkdqa84X6aCeL7YWlv6edGFHb+ZFICPlljHhg0bKuk0CSvVznWsotRu433alNdFrqG45ejoaPCaUkWERpLXjzFL2Rpllp7PJU2a/v7Ab8N05/9t27Z16KUqoFGsxnI9EosS2niSYg9SpU6B4JgTrvVW1flt1sT+0ADIJU2maXzcUTraGCRaL1Wp9rUMk16PMom8QhruxzvZIegJjFU7LLCePfS8uaQdPny4jTTL0dbee5mYokQsXTIWNY46kuMbnt8Kmec+LGWtOVIl9cT1rCB0V8WqkjAsRwta93TbwNYoGKsUSChN44lgBNCoHLHzquYKrU6qZ8lolCIN0Rh6cP0Q3U6I6IXILYOQI513hJaSKAorFpuHXJNfVlpRtmYBk1Su1obZr5dnKAO+L10Hrj3WZW+E3qh6IszE37F6EB+68mGpvKm4eb9bFrlzrok7fvr0Kfv727dvWRmdVTJHw0qiiCUSZ6wCK+7XL/AcsgNyL74DQQ730sv78Su7+t/A36MdY0sW5o40ahslXr58aZ5HtZB8GH64m9EmMZ7FpYw4T6QnrZfgenrhFxaSiSGXtPnz57e9TkNZLvTjeqhr734CNtrK41L40sUQckmj1lGKQ0rC37x544r8eNXRpnVE3ZZY7zXo8NomiO0ZUCj2uHz58rbXoZ6gc0uA+F6ZeKS/jhRDUq8MKrTho9fEkihMmhxtBI1DxKFY9XLpVcSkfoi8JGnToZO5sU5aiDQIW716ddt7ZLYtMQlhECdBGXZZMWldY5BHm5xgAroWj4C0hbYkSc/jBmggIrXJWlZM6pSETsEPGqZOndr2uuuR5rF169a2HoHPdurUKZM4CO1WTPqaDaAd+GFGKdIQkxAn9RuEWcTRyN2KSUgiSgF5aWzPTeA/lN5rZubMmR2bE4SIC4nJoltgAV/dVefZm72AtctUCJU2CMJ327hxY9t7EHbkyJFseq+EJSY16RPo3Dkq1kkr7+q0bNmyDuLQcZBEPYmHVdOBiJyIlrRDq41YPWfXOxUysi5fvtyaj+2BpcnsUV/oSoEMOk2CQGlr4ckhBwaetBhjCwH0ZHtJROPJkyc7UjcYLDjmrH7ADTEBXFfOYmB0k9oYBOjJ8b4aOYSe7QkKcYhFlq3QYLQhSidNmtS2RATwy8YOM3EQJsUjKiaWZ+vZToUQgzhkHXudb/PW5YMHD9yZM2faPsMwoc7RciYJXbGuBqJ1UIGKKLv915jsvgtJxCZDubdXr165mzdvtr1Hz5LONA8jrUwKPqsmVesKa49S3Q4WxmRPUEYdTjgiUcfUwLx589ySJUva3oMkP6IYddq6HMS4o55xBJBUeRjzfa4Zdeg56QZ43LhxoyPo7Lf1kNt7oO8wWAbNwaYjIv5lhyS7kRf96dvm5Jah8vfvX3flyhX35cuX6HfzFHOToS1H4BenCaHvO8pr8iDuwoUL7tevX+b5ZdbBair0xkFIlFDlW4ZknEClsp/TzXyAKVOmmHWFVSbDNw1l1+4f90U6IY/q4V27dpnE9bJ+v87QEydjqx/UamVVPRG+mwkNTYN+9tjkwzEx+atCm/X9WvWtDtAb68Wy9LXa1UmvCDDIpPkyOQ5ZwSzJ4jMrvFcr0rSjOUh+GcT4LSg5ugkW1Io0/SCDQBojh0hPlaJdah+tkVYrnTZowP8iq1F1TgMBBauufyB33x1v+NWFYmT5KmppgHC+NkAgbmRkpD3yn9QIseXymoTQFGQmIOKTxiZIWpvAatenVqRVXf2nTrAWMsPnKrMZHz6bJq5jvce6QK8J1cQNgKxlJapMPdZSR64/UivS9NztpkVEdKcrs5alhhWP9NeqlfWopzhZScI6QxseegZRGeg5a8C3Re1Mfl1ScP36ddcUaMuv24iOJtz7sbUjTS4qBvKmstYJoUauiuD3k5qhyr7QdUHMeCgLa1Ear9NquemdXgmum4fvJ6w1lqsuDhNrg1qSpleJK7K3TF0Q2jSd94uSZ60kK1e3qyVpQK6PVWXp2/FC3mp6jBhKKOiY2h3gtUV64TWM6wDETRPLDfSakXmH3w8g9Jlug8ZtTt4kVF0kLUYYmCCtD/DrQ5YhMGbA9L3ucdjh0y8kOHW5gU/VEEmJTcL4Pz/f7mgoAbYkAAAAAElFTkSuQmCC&quot;]<br>}&#39;</pre><p>And a response with the completion.</p><pre>{<br>  &quot;model&quot;: &quot;llava&quot;,<br>  &quot;created_at&quot;: &quot;2023-11-03T15:36:02.583064Z&quot;,<br>  &quot;response&quot;: &quot;A happy cartoon character, which is cute and cheerful.&quot;<br>  &quot;done&quot;: true,<br>  &quot;context&quot;: [1, 2, 3],<br>  &quot;total_duration&quot;: 2938432250,<br>  &quot;load_duration&quot;: 2559292,<br>  &quot;prompt_eval_count&quot;: 1,<br>  &quot;prompt_eval_duration&quot;: 2195557000,<br>  &quot;eval_count&quot;: 44,<br>  &quot;eval_duration&quot;: 736432000<br>}</pre><p>To get a list of downloaded models, use the <em>tags</em> endpoint.</p><pre>curl http://localhost:11434/api/tags</pre><p>A single JSON will be returned. The <em>show</em> endpoint gets specific model details. The model can also be copied and deleted.</p><pre>{<br>  &quot;models&quot;: [<br>    {<br>      &quot;name&quot;: &quot;codellama:13b&quot;,<br>      &quot;modified_at&quot;: &quot;2023-11-04T14:56:49.277302595-07:00&quot;,<br>      &quot;size&quot;: 7365960935,<br>      &quot;digest&quot;: &quot;9f438cb9cd581fc025612d27f7c1a6669ff83a8bb0ed86c94fcf4c5440555697&quot;,<br>      &quot;details&quot;: {<br>        &quot;format&quot;: &quot;gguf&quot;,<br>        &quot;family&quot;: &quot;llama&quot;,<br>        &quot;families&quot;: null,<br>        &quot;parameter_size&quot;: &quot;13B&quot;,<br>        &quot;quantization_level&quot;: &quot;Q4_0&quot;<br>      }<br>    },<br>    {<br>      &quot;name&quot;: &quot;llama3:latest&quot;,<br>      &quot;modified_at&quot;: &quot;2023-12-07T09:32:18.757212583-08:00&quot;,<br>      &quot;size&quot;: 3825819519,<br>      &quot;digest&quot;: &quot;fe938a131f40e6f6d40083c9f0f430a515233eb2edaa6d72eb85c50d64f2300e&quot;,<br>      &quot;details&quot;: {<br>        &quot;format&quot;: &quot;gguf&quot;,<br>        &quot;family&quot;: &quot;llama&quot;,<br>        &quot;families&quot;: null,<br>        &quot;parameter_size&quot;: &quot;7B&quot;,<br>        &quot;quantization_level&quot;: &quot;Q4_0&quot;<br>      }<br>    }<br>  ]<br>}</pre><p>The <em>pull</em> endpoint will download a model from the ollama library. Canceled pulls are resumed from where they left off, and multiple calls will share the same download progress.</p><p>The <em>push</em> endpoint will upload a model to a model library. Requires registering for ollama.ai and adding a public key first.</p><p>A handy feature is the ability to <a href="https://github.com/ollama/ollama/blob/main/docs/api.md#generate-embeddings">generate embeddings</a>. A model should be provided for which embeddings are generated. The text which should be converted into embeddings is stated in the prompt.</p><pre>curl http://localhost:11434/api/embeddings -d &#39;{<br>  &quot;model&quot;: &quot;all-minilm&quot;,<br>  &quot;prompt&quot;: &quot;Here is an article about llamas...&quot;<br>}</pre><p>As a result, Ollama returns a list of vectors inside the <em>embedding</em> field. Then, these values can be put into a vector database. Vector databases with embeddings are a hot topic and help implement the RAG approach to improve completion results.</p><pre>{<br>  &quot;embedding&quot;: [<br>    0.5670403838157654, 0.009260174818336964, 0.23178744316101074, -0.2916173040866852, -0.8924556970596313,<br>    0.8785552978515625, -0.34576427936553955, 0.5742510557174683, -0.04222835972905159, -0.137906014919281<br>  ]<br>}</pre><h4>Model Options</h4><p>Model options include <em>temperature</em>, <em>top_k</em>, <em>top_p</em>, <em>seed, </em>and <em>stop</em>. By changing these model parameters, we can control the determinism of the responses — the balance between the same responses for the same input and creativity, different responses for the same input.</p><p>Additional options are also available but used rarely — primarily for fine-grained tuning the model response — <em>mirostat</em>, <em>mirostat_eta</em>, <em>mirostat_tau</em>, <em>num_ctx</em>, <em>repeat_last_n</em>, <em>repeat_penalty</em>, <em>tfs_z</em>, and <em>num_predict</em>. Read about these parameters <a href="https://github.com/ollama/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values">here</a>.</p><p>For performance tuning options like <em>numa</em>, <em>num_ctx</em>, <em>num_batch</em>, <em>num_gpu</em>, <em>main_gpu</em>, <em>low_vram</em>, <em>f16_kv</em>, <em>vocab_only</em>, <em>use_mmap</em>, <em>use_mlock</em>, and <em>num_thread</em> can be useful. Please check the full documentation <a href="https://github.com/ollama/ollama/blob/main/docs/api.md#generate-request-with-options">here</a>.</p><h4>Useful Ollama Configurations</h4><p>A list of useful notes taken from the official <a href="https://github.com/ollama/ollama/blob/main/docs/faq.md">Ollama FAQ page</a>.</p><p>By default, Ollama uses a context window size of 2048 tokens. To change this when using ollama run, use /set parameter. This is important when a bigger response is needed.</p><pre>/set parameter num_ctx 4096</pre><p>When using the API, specify the num_ctx parameter:</p><pre>curl http://localhost:11434/api/generate -d &#39;{<br>  &quot;model&quot;: &quot;llama3&quot;,<br>  &quot;prompt&quot;: &quot;Why is the sky blue?&quot;,<br>  &quot;options&quot;: {<br>    &quot;num_ctx&quot;: 4096<br>  }<br>}&#39;</pre><p>Use the ollama ps command to see what models are currently loaded into memory. Check the <em>processor</em> column. <em>GPU</em> says that the model is loaded into GPU, <em>CPU</em> — into system memory (RAM). CPU/GPU with percentages says that the model was loaded partially into GPU and system memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ssW0BOqO_1nPdIzZIoHfrQ.png" /><figcaption>Terminal output for a loaded model</figcaption></figure><p>One more interesting feature is keeping the model in the memory. By default, models are kept in memory for 5 minutes before unloading. This is good when a bulk of requests are executed with the appropriate response time. Sometimes, you can unload the model or keep it in the memory forever. Modify the <em>keep alive</em> parameter to change this behavior. Check the <a href="https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-keep-a-model-loaded-in-memory-or-make-it-unload-immediately">documentation</a> for more information.</p><blockquote>The <em>keep_alive</em> parameter can be set to a duration string (such as “10m” or “24h”), a number in seconds (such as 3600), any negative number that will keep the model loaded in memory (e.g., -1 or “-1m”) or ‘0’ which will unload the model immediately after generating a response.</blockquote><blockquote>Alternatively, you can change the amount of time all models are loaded into memory by setting the <em>OLLAMA_KEEP_ALIVE</em> environment variable when starting the Ollama server. The <em>OLLAMA_KEEP_ALIVE</em> variable uses the same parameter types as the <em>keep_alive</em> parameter types mentioned above.</blockquote><h4>Ollama in Docker</h4><p>Ollama also has an official <a href="https://ollama.com/blog/ollama-is-now-available-as-an-official-docker-image">Docker image</a>. This is very useful, especially for deploying to cloud services, e.g., Azure, AWS, or other clouds. Ollama handles the execution of the model with CPU and GPU acceleration. Check this <a href="https://github.com/ollama/ollama/blob/main/docs/docker.md#nvidia-gpu">Ollama guide</a> to install the <a href="https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/index.html">Nvidia Container Toolkit</a>. Using Ollama, all your interactions with LLMs happen locally without sending private data to third-party services.</p><p>Ollama Docker container can be deployed to any cloud, even with default settings. Then, different models may be downloaded and inferenced using the REST API. Be aware that for free cloud applications/containers, shared resources are used, and the application goes to sleep when it is not used for some time, e.g., 30 minutes. When the application sleeps, it is turned off, and the next start will be from scratch; therefore, the model should be re-downloaded. An always-on option can be used as a solution. Another solution is preparing your Docker container with the downloaded and configured model. So, we will run the model already downloaded and prepared at the next start.</p><h4>Conclusions</h4><p>I’ve worked with ollama for some time, and I can say that this is an excellent tool for experimenting and running LLMs locally. I also had experience deploying Azure Web App service with Ollama. I also can say that this tool is also ready for production purposes. Concise CLI and API interface, good support of different models, and ease of use are pros. I haven’t found any specific bugs or drawbacks yet. Recommended!</p><h4>References</h4><ol><li><a href="https://vladris.com/llm-book/large-language-models.html">Large Language Models at Work: Chapter 2: Large Language Models</a></li><li><a href="https://ollama.com/">Ollama’s official website</a></li><li><a href="https://ollama.com/library">Ollama’s official model library</a></li><li><a href="https://github.com/ollama/ollama?tab=readme-ov-file">Ollama GitHub repository</a></li><li><a href="https://pitchbook.com/profiles/company/537457-42">Ollama on PitchBook</a></li><li><a href="https://huggingface.co/docs/hub/gguf">GGUF file format</a></li><li><a href="https://github.com/ollama/ollama/blob/main/docs/api.md">Ollama REST API documentation</a></li><li><a href="https://github.com/ollama/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values">Ollama Model Parameters documentation</a></li><li><a href="https://ollama.com/blog/ollama-is-now-available-as-an-official-docker-image">Ollama Docker Image</a></li><li><a href="https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/index.html">Nvidia Container Toolkit</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b255ee1282b4" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/run-llm-models-locally-with-ollama-b255ee1282b4">Local Artificial Intelligence: Run LLM Models Locally with Ollama</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is NASA’s Deep Space Optical Communications (DSOC) and Why it is Important]]></title>
            <link>https://olehch.medium.com/nasa-deep-space-optical-communications-dsoc-1-7aa5f6d44a42?source=rss-3a1bbc0bac9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7aa5f6d44a42</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[space]]></category>
            <category><![CDATA[space-exploration]]></category>
            <category><![CDATA[nasa]]></category>
            <category><![CDATA[dsoc]]></category>
            <dc:creator><![CDATA[Oleh Chaplia]]></dc:creator>
            <pubDate>Sun, 21 Jan 2024 10:09:39 GMT</pubDate>
            <atom:updated>2024-01-21T10:09:39.985Z</atom:updated>
            <content:encoded><![CDATA[<h4>The article reviews recent deep-space optical communication technology innovations for transferring data between Space and Earth.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RBXKHgaUijJVnAEN" /><figcaption>Photo by <a href="https://unsplash.com/@shotbycerqueira?utm_source=medium&amp;utm_medium=referral">Shot by Cerqueira</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Look up at the stars twinkling in the night sky. Imagine if we could talk to the planets, send messages to the moon, or chat with rovers exploring Mars! That’s what space communication is all about — finding ways to talk and share information with spacecraft and exploring the vastness of space.</p><p>It’s like having a really long-distance conversation. But instead of using phones or computers, scientists and engineers use special tools and technologies to send signals, texts, pictures, and even videos across the enormous distances between Earth and other celestial bodies.</p><p>Space communication helps us learn more about the universe and the planets beyond our own. It’s an incredible way for us to connect with the wonders of space, sending our curiosity and discoveries out into the cosmos and bringing back the secrets and marvels hidden among the stars.</p><p>Space communication is our cosmic chat line, connecting Earth with distant planets and spacecraft. It’s our way of exploring the unknown, exchanging messages, and unraveling the mysteries of the universe hidden among the stars.</p><h3>NASA’s Deep Space Optical Communications (DSOC)</h3><p>Deep Space Optical Communications (DSOC) represents a groundbreaking frontier in space communication technology. Unlike traditional radio-frequency systems, DSOC utilizes optical wavelengths to transmit data across vast cosmic distances, promising unprecedented data transfer rates and efficiency in interplanetary communication. This article explores the innovative principles behind DSOC, its transformative potential for space exploration, and the intricate engineering challenges involved in deploying optical communication systems for communicating across the vastness of deep space.</p><blockquote>NASA’s DSOC experiment is the agency’s first demonstration of optical communications beyond the Earth-Moon system. DSOC is a system that consists of a flight laser transceiver, a ground laser transmitter, and a ground laser receiver. New advanced technologies have been implemented in each of these elements. [1, 2]</blockquote><blockquote>Tried-and-tested radio frequency communications from deep space are approaching their bandwidth limit, raising the need for upgraded communications systems. Future space missions, meanwhile, are expected to transmit huge volumes of science data, including high-definition images and video, significantly increasing the bandwidth required. [1, 2]</blockquote><h3>DSOC Mission Overview and Key Goals</h3><p>This mission is an ongoing emerging technology demonstration [1–3]. Existing deep space radio frequency communication systems are nearing their bandwidth capacity. It is insufficient for upcoming missions to transmit extensive scientific data, including high-resolution images and videos, demanding substantially more bandwidth [2, 3]. This experiment demonstrates optical communications beyond the Moon [2]. DSOC system consists of three modern advanced components — a flight laser transceiver, a ground laser transmitter, and a ground laser receiver [2, 3].</p><p>This mission is very important because it will place a great base for the following state-of-the-art technologies for deep space communications. It demonstrates that laser transmitters in deep space can successfully lock onto each other’s laser signals during the calibration commissioning phase [2, 3]. Also, data uplink and downlink will be measured while the Psyche spacecraft travels farther from Earth[2, 3]. The mission will be running for two years, and at least one contact per week is planned [2, 3].</p><h3>The Psyche Mission</h3><p>The Psyche mission was created to explore a metal-rich asteroid that may shed light on our planet’s formation [3]. Psyche is a distinctive metal asteroid about three times farther away from the sun than Earth. The asteroid Psyche is named after the goddess of the soul in ancient Greek mythology [3]. The asteroid was discovered in 1852 by Italian astronomer Annibale de Gasparis. Because it was the 16th asteroid to be discovered, it is sometimes referred to as 16 Psyche [3].</p><p>Traveling through space using an exceptionally effective solar electric propulsion system, the Psyche spacecraft aims to reach the asteroid for scientific operations by 2029. Its plan includes orbiting this extraordinary celestial body for at least 26 months upon arrival [3]. DSOC technology was integrated into the Psyche spacecraft and will be tested several years after the launch.</p><p>Since the discovery of the asteroid Psyche, scientists have observed this entity from a distance. Throughout time, they’ve deduced that Psyche is an extraordinary object, probably abundant in metal. However, numerous mysteries persist regarding its formation and structure. The Psyche mission will be the first to explore this kind of asteroid [3].</p><p>Based on information gathered through radar and optical telescopes on Earth, scientists theorize that the asteroid Psyche might constitute a segment of the metal-enriched core of a planetesimal — an elemental component forming rocky planets like Mercury, Venus, Mars, and Earth [3].</p><p>Scientists eagerly anticipate their inaugural close-up exploration of Psyche to unravel its origins. Should the asteroid represent remnant core material from a planetary precursor, they aim to understand the parallels and deviations in its history compared to rocky planets. Alternatively, if Psyche doesn’t reveal itself as an exposed core, it could signify an exceptionally unique early solar system object — a novelty in astronomical discoveries. The mission’s thrilling prospect lies in the potential unveiling of the unforeseen [3].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j1qkSkqlJqxu6TM8flLZBA.jpeg" /><figcaption><em>NASA’s Psyche Mission to an Asteroid: Official NASA Trailer. Credit: NASA/JPL.</em></figcaption></figure><p>The trajectory of the Psyche spacecraft follows a spiraling route towards the asteroid Psyche. This graphic illustrates the path from above the planetary plane, highlighting significant milestones of the primary mission. The test phases for NASA’s Deep Space Optical Communications (DSOC) technology demonstration are marked with red dots [3].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yzRWzd_i-0IlYsDDlDa-_g.jpeg" /><figcaption>Psyche’s Mission Plan. Credit: <em>NASA/JPL- Caltech</em></figcaption></figure><p><a href="http://go.nasa.gov/45k0OVY">NASA’s Eyes</a> is a web-based visualization tool that dynamically displays the spacecraft’s current position in a Solar System [3]. The image below depicts the Psyche spacecraft on November 30, 2023.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0FISq_oTgFilaCQUgFWpHg.png" /><figcaption>Eyes on the Solar System web application. Credit: NASA/JPL</figcaption></figure><h3>Official Psyche and DSOC Mission Timeline</h3><p>The mission timeline is taken from the official Technology Demonstration Factsheet [2], Psyche Press Kit [3], and Psyche’s Mission Plan [4]. Please keep in mind that dates may differ after the launch.</p><ul><li><strong>October 2023 </strong>— Psyche spacecraft is scheduled to launch from NASA’s Kennedy Space Center on a SpaceX Falcon Heavy rocket.</li><li><strong>Roughly 20 days after launch </strong>— the DSOC calibration and commissioning phase is expected to begin, preparing the tech demo for operation.</li><li><strong>Roughly 50 days after launch </strong>— first expected contact opportunity between DSOC ground systems and the flight transceiver aboard Psyche.</li><li><strong>June 2024</strong> — the first phase of this technology demonstration ends.</li><li><strong>January 2025 —</strong> the second phase of the tech demo begins.</li><li><strong>October 2025</strong> — DSOC tech demo ends.</li><li><strong>May 2026</strong> — The spacecraft is expected to fly by Mars, using the planet’s gravity as a slingshot to increase velocity.</li><li><strong>Late July 2029</strong> — If all goes as planned, the asteroid Psyche’s gravity will capture the spacecraft after a journey of about 2.2 billion miles (3.6 billion kilometers).</li><li><strong>August 2029 to November 2031</strong> — The spacecraft conducts its prime mission, gathering science data while orbiting the asteroid.</li></ul><p>The spacecraft was successfully launched on October 13, 2023, and is on it’s way to Psyche [5].</p><h3>Deep Space Optical Communication Technology</h3><p>The system consists of a flight laser transceiver for sending data, a sensitive photon-counting camera to receive the data, and a powerful near-infrared transceiver at the Jet Propulsion Laboratory’s Table Mountain facility near Wrightwood, California [2, 3, 6–8].</p><p>Laser communication systems present distinctive benefits and obstacles. While both radio and near-infrared laser communications utilize electromagnetic waves for data transmission, near-infrared light compresses data into much denser waves, allowing ground stations to receive larger data volumes simultaneously. However, employing this more focused laser beam from space necessitates extraordinarily precise pointing and tracking to efficiently transfer data to a ground station [3, 6-8].</p><p>Furthermore, when the gap between the laser transmitter and receiver widens, the laser signal weakens, demanding extremely sensitive sensors to perceive and capture the diminished laser light. Due to the signal’s feebleness across extensive distances, extraneous sources, such as scattered sunlight and atmospheric interference, can overpower the data conveyed by the minimal laser photons reaching the detector [3].</p><p>To overcome challenges and prove the effectiveness of deep space laser communications, DSOC’s flight laser transceiver is secured with stabilizing mechanisms to counter spacecraft vibrations. This isolates the hardware from minor movements, ensuring precise downlink laser alignment. Additionally, the transceiver’s telescope, equipped with an extended sunshade, stands out as one of Psyche’s recognizable features, preventing stray light from reaching the receiver [3, 6–8].</p><p>During operations, the spacecraft aids in roughly orienting the DSOC flight transceiver by turning it towards the ground-transmitted beacon at Table Mountain. The DSOC transceiver can autonomously locate and fixate on the beacon, stabilizing its view and transmitting a focused high-rate data downlink beam to Palomar’s 200-inch (5.1-meter) Hale Telescope [3, 6–8].</p><p>The Hale Telescope captures the faint signal and directs it to a superconducting nanowire photon-counting detector. This highly accurate detector precisely measures the arrival time of photons. Using sophisticated signal processing at the backend, it decodes the data modulated and encoded in the deep space laser beam, converting it into usable information on the ground [3, 6–8].</p><h4>Psyche spacecraft</h4><blockquote>The transceiver on the Psyche spacecraft can send and receive high-rate data. The transceiver’s 8.6-inch (22-centimeter) aperture telescope is mounted on an isolation-and-pointing assembly that stabilizes the optics and isolates it from spacecraft vibrations. The flight hardware is fitted with a sunshade and protrudes from the side of the spacecraft, making it one of Psyche’s easily identifiable features [2, 3].</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7bAlry35-2EL7LYve__mYA.jpeg" /><figcaption>DSOC’s Flight Laser Transceiver. Credit: NASA/JPL-Caltech</figcaption></figure><p>DSOC technology demonstration’s flight laser transceiver was shown at NASA’s Jet Propulsion Laboratory in Southern California in April 2021. Then, it was installed inside a box-like enclosure and integrated with NASA’s Psyche spacecraft [3, 6–8].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xNTfXkoh7aSYRFokoZ2nsQ.jpeg" /><figcaption>The DSOC (DSOC) flight transceiver inside a large tube-like sunshade and telescope on the Psyche spacecraft. Credit: NASA/JPL-Caltech</figcaption></figure><p>The flight laser transceiver on Psyche spacecraft inside a clean room at the agency’s Jet Propulsion Laboratory in Southern California in December 2021. The spacecraft shows a tube-shaped sunshade in gray/silver color jutting out from its side. This extension holds DSOC’s transceiver, which includes a laser transmitter using near-infrared light to send lots of data to Earth. It also has a highly sensitive camera that catches low-rate data sent from the ground [3, 6–8].</p><h4>Ground system</h4><blockquote>The second system’s component is a laser transmitter at the Jet Propulsion Laboratory’s Table Mountain facility near Wrightwood, California. This laser will uplink a modulated laser beam to the flight transceiver and demonstrate low-rate data transmission. It also acts as a beacon for the flight transceiver to lock onto. The data sent back by the DSOC transceiver on Psyche will be collected by the 200-inch (5.1-meter) Hale Telescope at Caltech’s Palomar Observatory in San Diego County, California, using a sensitive superconducting nanowire photon-counting receiver to demonstrate high-rate data transfer [3, 6–8].</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8b6z0mgOFZYLDYYnt14laQ.jpeg" /><figcaption>The dome of the 200-inch Hale Telescope at Palomar Observatory. Credit: JPL/<em>Palomar/Caltech</em></figcaption></figure><h4>The Overall System</h4><p>The current image below depicts the overall system connected together [3, 6–8]. Here is a visualization of how the laser beam sends data to Earth&#39;s receiver.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jglEhseEsjmYFbLlWiTspA.jpeg" /><figcaption>The Deep Space Optical Communication (DSOC) device will beam high data rates to a telescope at Palomar Mountain, California. Credit: NASA/JPL-Caltech</figcaption></figure><p>The following image below illustrates the Psyche spacecraft with its components mounted. This illustration was created before the spacecraft was created, therefore differences may apply [3, 6–8].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AN8N6kvDg7599qcPMPCrAQ.jpeg" /><figcaption><em>The illustration of Psyche spacecraft with its components. Credit: NASA/JPL-Caltech/ASU</em></figcaption></figure><h3>Conclusions</h3><p>This is a very important project and a big step towards deep space communications. DSOC is a continuation of laser communications that have come before it but from another point of view.</p><p>Deep Space Optical Communication will allow us to communicate with many spacecrafts in deep space and receive high-quality images and video streaming in the future. Just imagine a set of spacecrafts and probes in deep space around the ring of asteroids or planets. They communicate together and with the Earth. Scientists will use this data to continue the high-quality exploration of the space. And people who can’t go into deep space, except astronauts, can see much more in deep interplanetary space.</p><h3>References</h3><ol><li><a href="https://www.nasa.gov/mission/deep-space-optical-communications-dsoc/">Deep Space Optical Communications (DSOC) - NASA</a></li><li><a href="https://www.nasa.gov/wp-content/uploads/2023/07/dsoc-fact-sheet-06152023.pdf">Deep Space Optical Communications (DSOC) Technology Demonstration Factsheet</a></li><li><a href="https://www.jpl.nasa.gov/press-kits/psyche">Psyche Press Kit</a></li><li><a href="https://www.jpl.nasa.gov/images/pia24930-psyches-mission-plan">Psyche’s Mission Plan</a></li><li><a href="https://www.nasa.gov/news-release/nasas-psyche-spacecraft-optical-comms-demo-en-route-to-asteroid/">NASA’s Psyche Spacecraft, Optical Comms Demo En Route to Asteroid</a></li><li><a href="https://www.jpl.nasa.gov/images/pia24569-dsocs-flight-laser-transceiver">DSOC’s Flight Laser Transceiver</a></li><li><a href="https://www.jpl.nasa.gov/images/pia24570-dsoc-flight-laser-transceiver-integrated-with-nasas-psyche-spacecraft">DSOC Flight Laser Transceiver Integrated with NASA’s Psyche Spacecraft</a></li><li><a href="https://www.jpl.nasa.gov/news/deep-space-communications-via-faraway-photons">Deep Space Communications via Faraway Photons</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7aa5f6d44a42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Preserving Creativity: The Importance of Archiving Music Production Projects]]></title>
            <link>https://olehch.medium.com/preserving-creativity-the-importance-of-archiving-music-production-projects-af8ef8589c10?source=rss-3a1bbc0bac9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/af8ef8589c10</guid>
            <category><![CDATA[music]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[daw]]></category>
            <category><![CDATA[audio]]></category>
            <category><![CDATA[music-production]]></category>
            <dc:creator><![CDATA[Oleh Chaplia]]></dc:creator>
            <pubDate>Sun, 24 Dec 2023 15:10:04 GMT</pubDate>
            <atom:updated>2023-12-26T01:38:33.458Z</atom:updated>
            <content:encoded><![CDATA[<h4>Recommendations on preserving and archiving your music production projects created in Cubase 13.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DN0l-LZzCtK5JjQZ" /><figcaption>Photo by <a href="https://unsplash.com/@giamboscaro?utm_source=medium&amp;utm_medium=referral">Giammarco Boscaro</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>In the vast landscape of modern music creation, using Digital Audio Workstations (DAWs) has revolutionized how musicians, producers, and composers craft their music. These software platforms have become the cornerstone of contemporary music production, offering a multifaceted environment where ideas evolve, melodies flourish, and compositions take shape [1–3].</p><p>As technology continually progresses and software versions evolve, the challenge of preserving these invaluable musical creations arises. Archiving music production projects within DAWs has emerged as a crucial aspect of safeguarding artistic endeavors against the passage of time and the ever-changing technological landscape [4–5].</p><p>The challenges associated with archiving Digital Audio Workstation (DAW) projects revolve around technological advancements, compatibility issues, file formats, and storage considerations [1–3]. This article explores why archiving music in DAWs is necessary, ensuring that the hard work and creativity put into these projects don’t vanish within the time and space. It’s about keeping these digital creations safe for future music lovers and creators.</p><h3>The Importance of Archiving</h3><p>Archiving serves as a critical step in the lifecycle of a music project, often considered one of the final stages following the creation of a song or master mix. It ensures the preservation and accessibility of the final version, safeguarding artistic efforts and facilitating future revisions or reissues. Additionally, archiving acts as a safety net against potential data loss, protecting the completed project and its components from unforeseen technical issues or hardware failures [4–5].</p><p>Here are key reasons highlighting the significance of archiving:</p><ol><li><strong>Preservation of artistic work</strong> — once a song or master mix is completed, archiving ensures that the final version, along with all related project files, stems, and associated data, is securely stored. This preserves the creative effort, allowing artists to retain their work in its finished state for future reference or potential re-use [4–5].</li><li><strong>Protection against data loss</strong> — archiving safeguards music projects from potential loss due to hardware failure, accidental deletion, or unforeseen technical issues. It acts as a safety net, ensuring that the finalized version of a song or mix, alongside its components, remains safe and accessible [4–5].</li><li><strong>Facilitating revisions or reissues — </strong>should the need arise for revisions, remixes, or reissues of a song or mix in the future, archived files provide a starting point. Accessing the original project files allows artists to make modifications or create new versions without starting from scratch [4–5].</li><li><strong>Ensuring compatibility and accessibility</strong> — over time, technology evolves, and software versions change. Archiving projects in compatible file formats ensures they remain accessible despite technological advancements. It allows artists to open and work on archived projects even as software or hardware systems change [4–7].</li><li><strong>Documentation and record-keeping —</strong> archiving involves documenting details related to the project, such as versions used, settings, plugins, and other relevant information. This documentation assists in understanding the creative process and can be valuable for future reference or educational purposes [4–5].</li><li><strong>Legal and business considerations</strong> — archiving music projects can have legal implications, especially concerning copyright, ownership, or licensing agreements. Properly archived projects can serve as evidence of ownership and may be necessary for legal compliance or business transactions [4–5].</li></ol><p>In summary, while archiving may be seen as the final stage in the music creation process, its importance is profound. It ensures the preservation, protection, and accessibility of completed projects, facilitating future revisions, maintaining compatibility, aiding documentation, and addressing legal or business requirements. Archiving secures artistic efforts and allows artists to retain control over their musical creations even after the initial completion.</p><h3>The Mindset of Successful Project Archive Creation</h3><p>The mindset behind successful project archive creation involves a proactive and meticulous approach aimed at preserving the essence, integrity, and accessibility of the completed work [4–5]. At first, it is necessary to understand why the project archive will be created and what goals should be achieved [4–5]. Then, think about how you can restore the project archive in the future on a different laptop with another OS and missing VST plugins and instruments [6–7].</p><p>For example, I always question myself before archiving the project:</p><blockquote>1. Can I reproduce the song without losing details of the composition or recording in the future after ten years?</blockquote><blockquote>2. Can someone else reproduce the song exactly as it is in the future?</blockquote><blockquote>3. Can someone do a complete mixing and mastering, having the project archive without any studio rerecording?</blockquote><blockquote>4. Will software updates, DAW, or VST plugin upgrades impact the project archive or lead to missing sounds?</blockquote><blockquote>5. Can the DAW project be restored without VST instruments?</blockquote><blockquote>6. Have I stored several copies of the project archive in different places?</blockquote><p>Successful project archiving begins during the planning phase. A clear structure from the project’s inception ensures that file organization, metadata, and storage formats are integrated into the workflow [4–5].</p><p>A meticulous approach to archiving involves paying attention to the most minor details. This includes appropriately labeling files, documenting settings, plugins, and versions used, ensuring comprehensive metadata, and maintaining an organized folder structure [4–5].</p><p>Comprehensive documentation serves as a roadmap for understanding the archived project. Detailing project information, session notes, and relevant metadata assists future users in comprehending the creative process and technical aspects of the project [4–5].</p><h3>Challenges in DAW Project Management</h3><p>Challenges in managing DAW projects often revolve around the dynamic nature of software. DAW, software plugins, VST instruments, and software versions constantly update. Also, potential issues with missing elements or backups may appear [4–7].</p><p>Here’s a restructured breakdown of things that may impact the project:</p><ol><li><strong>Constant DAW updates</strong> — managing continuous updates to the Digital Audio Workstation (DAW) software, leading to potential compatibility issues and changes in functionalities [6–7].</li><li><strong>Plugin and VST instrument updates</strong> — dealing with frequent updates and newer versions of software plugins and VST instruments, which may render old versions unsupported or incompatible with more recent systems [6–7].</li><li><strong>Compatibility problems with old plugins</strong> — facing issues where older plugins might not be supported or function correctly on newer computers or operating systems, resulting in missing elements within projects [6–7].</li><li><strong>Expired trial licenses</strong> — managing expired trial licenses for plugins, leading to restrictions or loss of functionality within projects [6–7].</li><li><strong>Incompatibility with newer operating systems — </strong>Encountering problems where old plugins or software versions are incompatible or fail to work on updated operating systems, potentially disrupting project integrity [5–7].</li><li><strong>Project breakage — </strong>Instances where projects become broken or dysfunctional due to compatibility issues or missing components caused by software updates or changes [5–7].</li><li><strong>Lack of project backup — </strong>Facing the risk of losing project data due to inadequate or missing backups, potentially resulting in the loss of essential project elements [5–7].</li><li><strong>Incomplete project files — </strong>Saving only processed or edited multitracks without preserving the original Direct Input (DI) recordings, limiting future editing or modification capabilities within the project [5–7].</li></ol><p>These challenges emphasize the need for a proactive planning strategy for a proper project archive.</p><h3>What things should be archived?</h3><p>When archiving a Digital Audio Workstation (DAW) project, it’s essential to preserve various elements to maintain its integrity and ensure future usability. Most of the recommendations are from my many years of personal experience working with audio projects. In any case, you can always fit these recommendations into your specific workflow.</p><p>Here’s a comprehensive list of items to consider archiving:</p><ul><li>The folder with the DAW project [1–3]</li><li>Multitracks (DI) [1]</li><li>Multitracks (with Amp and FX) [1–3]</li><li>MIDI files of all available instruments [8]</li><li>Guitar Tabs in a “gp” and “pdf” formats [9]</li><li>Scores (if needed) [10]</li><li>Screenshots of important plugin settings that might be changed in the future [6–7]</li><li>Custom VST synth presets and settings (if needed) [6–7]</li></ul><p>What screenshots of the VST plugins and instruments will be necessary:</p><ul><li>guitar amplifiers + cabinets</li><li>bass amplifiers + cabinets</li><li>VST drums, routing, and drum maps</li><li>Custom VST presets</li><li>Any other VST instruments</li></ul><h3>Cubase Project Structure</h3><p>All examples for this article will be created for Cubase 13 because this is my primary DAW [11]. But you can track the difference between the Cubase project structure and other DAW projects and update the structure for your needs.</p><p>This main folder contains default files generated by Cubase and several additional folders I added [12]. A review of the folder structure with additional custom folders is provided here:</p><ul><li><strong>Audio</strong> — this folder contains all the audio files you import into your project, or recordings, or samples you use in your project [12].</li><li><strong>Edits</strong> — temporary files, backups, and edit files [12].</li><li><strong>Freeze</strong> — when you freeze some tracks, all generated WAV files are stored here [13].</li><li><strong>Images</strong> — temporary image files of audio peaks [12].</li><li><strong><em>Licenses</em></strong> — a custom folder with the pdf files, images, and screenshots of the licenses for the plugins and samples used in the project.</li><li><strong>Mixdown</strong> — a default folder with a custom structure for mix versioning [14].</li><li><strong><em>Multitracks</em></strong> — a custom folder that contains all DI, with amp and FX multitracks.</li><li><strong><em>Plugins</em></strong> — a custom folder that contains screenshots of all plugins [6–7].</li><li><strong><em>Tabs</em></strong> — a custom folder that contains Guitar Pro tabs and MIDI files for the song [8-10].</li><li><strong>Track Pictures</strong> — they are small thumbnail images used to visually represent tracks in the project window [15].</li><li><strong>Video</strong> — this folder will contain video files if exist [16].</li><li><strong>*.csh</strong> — cache files that store preprocessed information about your project to speed up opening the project and working with it.</li><li><strong>*.cpr</strong> — the Cubase project file has a .cpr extension. It’s the main file that you open when working on your project [12].</li><li><strong>*.bak</strong> — these files are essential for maintaining the project’s history or providing recovery options if something goes wrong.</li><li><strong><em>*.txt</em> — </strong>a custom file that contains tempo, tonality, sample rate, and bit depth. This helps to understand the project settings without opening the project.</li><li><strong><em>lyrics.txt</em></strong><em> </em>— a custom file with song lyrics.</li></ul><h3>Cubase Project Setup</h3><p>A Cubase project archive is a comprehensive snapshot of a musical project created within the Cubase digital audio workstation (DAW) [12]. The example below will use the abstract “Rock Song” as a Cubase 13 project. Cubase project setup and archive preparation is easy. To have a cleaner project archive, we can add additional metadata and remove redundant files.</p><p>First, open a Project Setup Dialog presented in Fig. 1 [17]. Please check “Sample Rate” and “Bit Depth” in the “Record File Format” section. Then, the author and company name can be entered in the “Project Ownership” section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8De3X8I6EnMcgav1nR6EYA.png" /><figcaption>Figure 1. Cubase project setup window.</figcaption></figure><p>The next step is to check all recorded tracks. Please validate that they are in good shape, bounce all tracks if needed, and bounce all minor editing states. Then, all redundant files from the project pool can be safely removed.</p><p>To open the pool window, click on the menu item <strong>“Media”</strong> <strong><em>→ </em>“Open Pool Window” </strong>[18].<strong> </strong>The pool window allows you to manage the media files of the active project. The pool window is presented in Figure 2.</p><ul><li><strong>The “Audio”</strong> folder contains all audio clips and regions in the project [18].</li><li><strong>The “Video” folder</strong> contains all video clips that are in the project [18].</li><li><strong>The “Trash” folder</strong> contains unused clips that have been moved here for later permanent removal from the hard disk [18].</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r5vpPTUv4BefkWmj0sjPbA.png" /><figcaption>Figure 2. Cubase Pool window.</figcaption></figure><p>To remove redundant files in the Trash folder, click the right mouse button on the <strong>“Audio”</strong> folder, and select <strong>“Remove Unused Media”</strong> [19].<strong> </strong>Then pick the <strong>“Trash,”</strong> do a right button mouse click and select <strong>“Empty Trash”</strong> [19].</p><h3>VST Plugin Settings</h3><p>VST (Virtual Studio Technology) plugins are essential in music production, offering various effects, instruments, and tools within your digital audio workstation (DAW) like Cubase [6–7]. VST plugins are designed to be easily replaceable or interchangeable, allowing users to switch between different plugins to achieve varied sounds, effects, or instruments within their music production projects [6–7]. This is one of the main pitfalls when archiving the project. Imagine that you opened the project in the future on a new laptop with another OS, and there are no VST plugins [6–7]. In this case, missing VST plugins may be installed again, or the same settings may be recreated via other plugins or hardware. How can these settings be saved to be played in the future? By keeping presets and making screenshots of the settings.</p><p>Let’s take a look at several examples with drums and guitars. I like to use <strong>One Kit Wonder Architects</strong> from <strong>GGD</strong> for drums [20] and <strong>Neural DSP Plini X </strong>for guitars [21].</p><p>To properly restore drum settings, it is necessary to save them as a file and screenshot potential changeable settings. The first screenshot in Fig. 3 represents the entire drum kit and its elements. The second screenshot in Fig. 3. depicts a drum map. It is very important to have a drum map because all VST drums are different, and without one, it is tough to recreate the same notes using another VST drum kit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vSiid21Gdqccy1tLilv99g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Pvj45hht3NTx6Pkskpk6w.png" /><figcaption>Figure 3. GGD One Kit Wonder Architects VST drumkit</figcaption></figure><p>Let’s take a look at the electric guitar sound. We need to store the preset file and make screenshots of the settings. Fig. 4–6 shows all <strong>Neural DSP Plini X</strong> plugin settings for the distorted electric rhythm guitars.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*InOpAJrrPIBM05qyZgdDGw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*enHOj4lEm0ZIDMD70k5VzA.png" /><figcaption>Figure 4. Neural DSP Plini X pedals and amp view.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rRlEW97p8q4SIDCBiJtpUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2Qm-RpDStzpWpxQ413WaA.png" /><figcaption>Figure 5. Neural DSP Plini X cabinet and eq view.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f9W8VfaOYk7oa7PANLV7ng.png" /><figcaption>Figure 6. Neural DSP Plini X pedals with time effects view.</figcaption></figure><p>Here, we reviewed only two examples with drums and guitars. If your project contains many more VST plugins and you don’t want to spend too much time on them, just select only the most essential plugins and save them. For example, I always keep VST drum and guitar amp settings. VST drum kits are constantly changing and evolving, especially drum maps, which are very different. For guitars, it may be possible to recreate the virtual sound from VST on the real amp. And these screenshots will be a good reference for it.</p><h3>Cubase Folder Archive Example</h3><p>An example project is named “Rock Song.” Putting the year before the song name is recommended to properly sort files. That’s why the folder is called “2024 Rock Song.”</p><p>Fig. 7. shows the “License” folder. This folder contains licenses for VST plugins and samples used in the song in PDF, JPG, or other formats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vYwiJQnLG8MzVUAwqXAPOg.png" /><figcaption>Figure 7. Cubase 13 project folder structure with opened licenses folder</figcaption></figure><p>Fig. 8 represents the Cubase 13 folder structure with an opened “Mixdown” folder. This folder keeps all mixdown versions. As an author, you can place all the song versions you need there. The folder versioning consists of the number starting from zero (0) or two zeros (00). It depends on your preference. When you start counting from two zeros, sorting files inside the folder will be correct for more than ten versions. Each folder has a count like “0” or “00” and an additional short comment, like “Instrumental.” A short comment is just your description of the song version for you and your colleagues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I5h-_RhtSDjDg1HgzzxEFQ.png" /><figcaption>Figure 8. Cubase 13 project folder structure with opened mixdown folder</figcaption></figure><p>Fig. 9 depicts a project with an opened “Multitracks” folder. This folder should contain all DI recordings and Amped tracks, with and without FX. This is the first place that will be used to recreate the project when DAW or VST plugins change or won’t be available on the new machine.</p><p>DI multitracks of all recordings and rendered tracks are needed to have a foundation. Amped tracks, with and without additional processing or FX, are needed to keep the intended processing and FX. These amped tracks may be used as a reference when specific plugins are not available on the new machine and recreating the sound is not possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XAz0ZtN3P661faaHO-e3ew.png" /><figcaption>Figure 9. Cubase 13 project folder structure with opened multitracks folder</figcaption></figure><p>Fig. 10. shows the “Plugins” folder. This folder contains the screenshots of the VST plugin settings described in the section above. It is also ok to put here all other plugin settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cf94WFLz0NI6APKTq-ziJQ.png" /><figcaption>Figure 10. Cubase 13 project folder structure with opened plugins folder</figcaption></figure><p>Figure 11. shows a folder named “Tabs.” This folder contains Guitar Pro Tabs and all necessary MIDI files. Please ensure the tabs and scores have all musical parts for the vocals, guitars, bass, drums, synths, and other instruments used for your song. Having these things, anyone can recreate the exact song in the future or play it live with a new band. You can put your musical scores here, too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z7QNGq4ml5d-frdKxAVe8Q.png" /><figcaption>Figure 11. Cubase 13 project folder structure with opened tabs folder</figcaption></figure><p>The last step is to create a zip archive of the folder named “2024 Rock Song.” Now, you can save this archive somewhere. Please keep at least two copies of this archive in different places, e.g., one on a hard drive and another on a cloud storage. Three copies in different places are better. Also, you can add some additional information to the archive name if needed.</p><h3>Conclusion</h3><p>The process of archiving music projects within Digital Audio Workstations (DAWs) stands as a vital bridge between preserving creative endeavors and navigating the ever-evolving landscape of technology. In this dynamic realm, challenges arise from the constant updates in software and plugins and the potential loss of essential project elements. Yet, archiving represents more than safeguarding files; it embodies the preservation of artistic vision and the perpetuation of musical legacies.</p><p>By meticulously archiving DAW projects, multitracks, MIDI data, scores, plugin configurations, and essential documentation, creators secure their creative essence for the future. It ensures that the nuances of musical compositions and the ingenuity embedded within production decisions persist beyond the technological changes. Archiving, thus, honors the dedication of artists, enabling future generations to delve into the intricacies of their craft and fostering an unbroken continuum of musical innovation and artistic expression.</p><h3>References</h3><ol><li><a href="https://bobbyowsinski.com/recording-engineers-handbook/">B. Owsinski, “The Recording Engineer’s Handbook,” 4th ed. Boston, MA, USA: Cengage Learning, 2017</a></li><li><a href="https://bobbyowsinski.com/mixing-engineers-handbook/">B. Owsinski, “The Mixing Engineer’s Handbook,” 4th ed. Boston, MA, USA: Berklee Press, 2017</a></li><li><a href="https://bobbyowsinski.com/mastering-engineers-handbook/">B. Owsinski, “The Mastering Engineer’s Handbook,” 4th ed. Boston, MA, USA: Berklee Press, 2017</a></li><li><a href="https://unesdoc.unesco.org/ark:/48223/pf0000243973">R. Edmondson, “Audiovisual archiving: philosophy and principles”, UNESCO, 2016</a></li><li><a href="https://www.aes.org/journal/suppmat/gladney_2001_7.pdf">H. Gladney, ”Audio Archiving for 100 Years and Longer: Once We Decide What to Save, How Should We Do It?”, J. Audio Eng. Soc., vol. 49, no. 7/8, 2001</a></li><li><a href="https://www.taylorfrancis.com/books/mono/10.4324/9780429490248/designing-audio-effect-plugins-pirkle">W. Pirkle<em>, “</em>Designing Audio Effect Plugins in C++. For AAX, AU, and VST3 with DSP Theory”, Focal Press, New York, 2019</a></li><li><a href="https://ciit.finki.ukim.mk/data/papers/10CiiT/10CiiT-39.pdf">“Virtual Studio Technology and it’s Application in Digital Music Production”, Skopje, Macedonia, 2001</a></li><li><a href="https://www.midi.org/specifications">MIDI Association, Official MIDI Specifications, 2023</a></li><li><a href="https://www.guitar-pro.com/c/10-guitar-pro-new-features">Arobas Music — Guitar Pro 8</a></li><li><a href="https://berkleepress.com/arranging-composing/music-notation-preparing-scores-and-parts/">M. Nicholl, R. Grudzinski, “Music Notation. Preparing Scores and Parts”, Berklee Press, Boston, 2007</a></li><li><a href="https://www.steinberg.net/cubase/new-features/">Cubase 13, Steinberg, 2023</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/project_handling/project_handling_about_project_files_c.html">Cubase 13 Pro Operational Manual — Project Files</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/sampler_track/sampler_track_freezing_t.html">Cubase 13 Pro Operational Manual — Freezing Sampler Tracks</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/export_audio_mixdown/export_audio_mixdown_options_r.html?hl=project%2Cmixdown%2Cfolder">Cubase 13 Pro Operational Manual — Export Audio Mixdown Dialog</a></li><li><a href="https://steinberg.help/cubase_pro_artist/v9/en/cubase_nuendo/topics/track_handling/track_handling_showing_track_pictures_t.html">Cubase 13 Pro Operational Manual — Track Pictures</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/video/video_introduction_c.html">Cubase 13 Pro Operational Manual — Video</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/project_handling/project_handling_project_setup_dialog_r.html?hl=project%2Csetup">Cubase 13 Pro Operational Manual — Project Setup Window</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/pool/pool_window_r.html?hl=pool">Cubase 13 Pro Operational Manual — Pool Window</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/pool/pool_clips_deleting_removing_unused_clips_from_the_pool_t.html?hl=unused">Cubase 13 Pro Operational Manual — Removing Unused Clips from the Pool</a></li><li><a href="https://www.getgooddrums.com/products/one-kit-wonder-architects">GGD One Kit Wonder Architects</a></li><li><a href="https://neuraldsp.com/plugins/archetype-plini">Neural DSP Plini X</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af8ef8589c10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modern Music Production Workflow]]></title>
            <link>https://olehch.medium.com/modern-music-production-workflow-d4ba16e40292?source=rss-3a1bbc0bac9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4ba16e40292</guid>
            <category><![CDATA[music-production]]></category>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[mixing-and-mastering]]></category>
            <category><![CDATA[songwriting]]></category>
            <category><![CDATA[music]]></category>
            <dc:creator><![CDATA[Oleh Chaplia]]></dc:creator>
            <pubDate>Sat, 09 Dec 2023 15:27:55 GMT</pubDate>
            <atom:updated>2023-12-09T19:14:15.723Z</atom:updated>
            <content:encoded><![CDATA[<h4>A modern approach to workflow and pipeline of modern music production that includes songwriting, composition, mixing, and mastering.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TnCW-KzaPOLy-LQ3" /><figcaption>Photo by <a href="https://unsplash.com/@ttcollect?utm_source=medium&amp;utm_medium=referral">Troy T</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>We live in such times where songwriting, music production, and audio engineering are tightly connected [1–3]. Also, the technical possibility of writing the music on any laptop with a MIDI keyboard and external audio interface is fantastic. Anyone with a related musical background can open the DAW and write a pop song or epic soundtrack for the movie.</p><p>In such a creative industry, every artist and producer has his own workflow for creating a song. Of course, their steps are based on the industry standard workflow and experience. More experienced producers know that well-defined steps and expected outcomes produce better overall results [2-4]. The workflow directly impacts the results achieved [2-4]. I also want to cite Conway’s Law [5], which states:</p><blockquote>&quot;Organizations, who design systems, are constrained to produce designs which are copies of the communication structures of these organizations.” [5]</blockquote><blockquote>— Melvin E. Conway</blockquote><p>This idea was primarily introduced for software engineering companies. But we can make parallels between Agile software development and modern music production. Both of them have so many similarities.</p><p>Let’s also review some of the artistic questions. What is the difference between a fantastic song and a regular song? What makes a song great? How do listeners choose songs they like? How do we know a song has enough mixing or mastering quality? As songwriters or producers, how do we know when to stop writing and release the final product? These questions are tough. But the answers to these questions exist [3, 7]. It’s a theory combined with many hours of practice. As you know, a theory of 10000 hours says that a person is a master of his work when he worked on it more than 10000 hours [8].</p><p>Therefore, I would like to share some of my experience and knowledge of organizing an effective music production workflow using which you can work on your music without undefined elements or distractions. Most things are gathered from personal experience, so this is not a final statement of truth. All of us have different personalities and tastes. Therefore, you have an excellent opportunity to adapt this workflow to yourself and even optimize it a lot better.</p><h3>The Mindset of Writing and Producing a Song</h3><p>Music production workflow combines the mindset, psychology, teamwork, and technical aspects [1–4, 9]. Before planning the work, you and your team should be aligned with the same mood, goals, and expected results. The song results from teamwork [1, 2, 4, 7, 9]. Of course, if you are not the only one creating the song. It is vital to have answers to these questions before the work starts:</p><ul><li>Your mindset — how do you perceive the music production process? Do you understand it well?</li><li>Team roles — do you and your team know what each person is doing and the expected results?</li><li>Team mood — are you and your team aligned with the mood and resources to work on the song?</li><li>Expected deadlines — does the team know the deadlines for each milestone and final release?</li><li>Tools and skills — does each team member have enough tools and skills to fit their role?</li><li>The final goal — does the team know what is expected as the final output? Have you prepared any music, photo, or video references?</li></ul><p>By knowing the answers to these questions, we can move on to the music production workflow. Each step in the workflow uses the answers provided above to understand the expected results.</p><h3>Music Production Stages</h3><p>Anyone who has already written and produced at least several songs knows that several stages must be completed to finish the release [2-4, 9]. Each step in the music production pipeline is crucial and impacts the specific properties of the song of the final release. We will review and analyze each step.</p><p>Table 1 depicts all steps with the input and output results [2–4, 9]. Lyrics, composition, and songwriting are the initial steps that inspire the artist and provide the first kick-off to do the job. Then, arrangement and production steps are involved to finish the song and prepare it for the studio recording. Recording, mixing, and mastering are technical steps that take the song sound to the next level and prepare the audio file for the release. Exporting and converting are necessary for archiving and further distribution of the release.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rgVBAepnRU5iFYFIhlhzGA.png" /><figcaption>Table 1. Stages of the music production.</figcaption></figure><h3>The Music Production Workflow</h3><p>Previously, we reviewed all the steps needed to create a song. They are executed in some order. This order is called a workflow or pipeline. To create the workflow, we need to take the stages defined before and put them into specific order that will lead to the successful creation of the song. Many workflow variations may exist and depend on the artist and producer&#39;s desire. However, in the current article, only one optimal workflow is suggested and reviewed.</p><p>Figure 1. depicts the modern pipeline of music production. Here, all violet blocks are grouped into one big block because, in the modern world, most of the song pieces are written inside DAW, and all stages are executed simultaneously without a specific order. These steps may be executed in any order the artist or producer wants or repeated many times until the final song version is achieved. Technically, mixing and mastering can even be completed when writing the song, but it is not a good practice and should be omitted. After the final song version is achieved and the artist has a demo of the song, studio work starts. In the studio, the artist, producer, and engineer record all remaining song parts on live instruments, for example, vocals, live drums, bass, guitar, and piano. Then, in the editing stage, the producer or mixing engineer will edit recorded vocals and instruments to fit the song. Mixing and mastering are the following stages. After that, the exporting and converting stages are executed. Ultimately, the artist receives its final product with all the necessary multitracks, stems, and song versions prepared for release.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*79tvNyHKcBNY_CK5aYO7Gw.png" /><figcaption>Figure 1. Music production workflow.</figcaption></figure><h4>Inspiration</h4><p>This is the most artistic phase. This is just when inspiration comes to the artist’s or producer’s mind, and he starts singing the melody, writing some lyrics, or playing the riff on the guitar [3-4, 9]. This stage is the most initial in the overall workflow.</p><blockquote>It is important to record everything that comes to your mind because you will forget it as soon as possible. This is just the limitation of our brain. At this phase, any recorder, even a cellphone microphone, may be used.</blockquote><h4>Composition, songwriting, lyrics, arrangement and production</h4><p>These following stages are fundamental things that define the final result of your song [3–4, 9]. Having the best possible arrangement, vocals, and lyrics is crucial [6]. Because, without these fundamentals, the final product is just a waste of time and resources. The melody, rhythm, emotions, feelings, atmosphere, vibe, and the song&#39;s main idea are the most visible things to the listener [6]. They are even more important than the technical quality of mixing and mastering [6, 11–12]. I think that the main rule should say that:</p><blockquote>A great song sounds great as a demo. It sounds fantastic when played live or after the mixing and can be easily rerecorded and remastered.</blockquote><blockquote>Inadequate arrangements or lyrics in a song do not connect with the listeners in any way. In this case, even the top mixing or mastering can’t fix the unsuitable vibe of the song.</blockquote><p>Please focus on the remarkable arrangements, vocals, and lyrics. Try to make the song with some idea, vibe, and atmosphere [6]. Each song should provide the listener with emotions and vibes [6]. Each song should have a purpose [6]. The music genres define the distribution market — e.g., studio music, live music, video game soundtracks, and movie soundtracks. So don’t be afraid to experiment and try to create something unique. Creative and innovative approaches to music are always interesting [1, 3].</p><p>Music production in the arrangement context is tightly connected to the previous ones [3–4, 6, 9]. At this stage, artists can work with producers, or one person can be an artist and producer [4, 9]. Anyway, this is a particular stage that transforms the primary idea into a more final-sounding product. Here, the producer can add spicy sounds, back vocals, adlibs, and sound effects, change the arrangement slightly, or rewrite many song sections [2-3, 9]. Of course, the selected methods are related to the genre and expected final result defined by the reference. In jazz, classical, or even rock music, the producing techniques may be more oriented to getting the best-sounding melody or harmony from the artist. However, in electronic music, the production is based on electronic samples, sound design, and synths [3].</p><p>The artifacts produced from these steps are scores, MIDI notes, lyrics, some demo recordings, and the demo project within the DAW. I also want to remind you to write scores, guitar tabs, and MIDI for any music, even if you prepared the project inside the DAW. It will allow you to prepare rehearsal scores for other musicians, restore the broken DAW project, or even rerecord the same song many years later with the newer version of the DAW and plugins.</p><blockquote>If you have spare time, always prepare scores, guitar tabs, and MIDI notes in addition to the project inside DAW.</blockquote><h4>Recording</h4><p>The next step is recording everything you have written in the studio [2, 4, 7, 9-10]. At this step, we record all vocals, drums, guitars, bass guitars, synths, or other things you’ve created for the song. However, you may already have a recording of everything within the previous stage if you have enough expertise. For example, I prefer to record all guitars and bass with the highest quality while writing the song. Using this approach, I don’t need to re-record these musical parts once again because they already have high-quality sound and performance. But I always record vocals and live drums in the studio because it gives a better vibe to the singer, and a professional studio has better sound treatment than at home.</p><p>You may think that this is a very generic step. To some extent, it is. But the nuances are connected with cooperation with the recording engineer, producer, and your team.</p><blockquote>Be well prepared for a recording stage. Know your music parts well. Do some training before recording. Refer to the song scores before the recording. Value your time and the time of your studio recording engineer.</blockquote><p>The quality of the performance and recording is the foundation for your mix and mastering. The quality of the artist&#39;s performance is the foundation of the song’s emotions and vibe for the song [6–7]. So please pay considerable attention to how the song is performed and recorded. The recording engineer may help with the recording setup and technical preparations if you don’t know how to do it yourself [10].</p><blockquote>Try to capture the best record take as possible. Or record several takes. Remember that it is better to record the take again than fix it later in the mixing stage. At the mixing stage, the mixing engineer combines multiple tracks into one. He prepares the overall balance, improves the sound of your instruments, and adds effects.</blockquote><p>Therefore, I think it is essential to take this as a valuable rule:</p><blockquote>Lousy performance and recording means the mixing engineer will fix the song issues.</blockquote><blockquote>Great recording means the mixing engineer will improve the overall sound and create a high-quality mix for the song.</blockquote><h4>Mixing</h4><p>Mixing is a second technical step in music production after recording [2, 4, 9, 11]. It defines the quality of the sound of your song. At this step, the mixing engineer will receive the raw tracks from the artist [11]. What is it important to do?</p><blockquote>Prepare your raw tracks — give considerable names, prepare the common starting point for all tracks, include the song’s BPM and key in the text file, and provide the reference song.</blockquote><p>The artist will rely on the mixing engineer’s skills at this step [11]. The artist sends the prepared archive and waits for the first revision. Then, the artist listens to the song and prepares notes for the mixing engineer if any. Then, the artist will receive a second revision of the mix. This process repeats till the artist is happy. Of course, the mixing engineer may put some limits and comprehensive constraints. For example, only several mix versions are allowable, and the next ones should be paid.</p><p>A mixing engineer is a person. He works with music every day. His ears will be tired after several days of working with your song. The best way to mix the song is when the engineer’s ears are refreshed. If the artist wants too many mix revisions and changes, the mixing engineer won’t be able to effectively implement them because of such things as ear fatigue [11, 12].</p><blockquote>Please remember about ear fatigue. Mixing the song only with the refreshed mind and ears is crucial. In other cases, the mix will have a poor sound.</blockquote><h4>Mastering</h4><p>The mastering is the process of making the final mix sound great on different audio devices [2, 4, 9, 13–14]. The mastering engineer will improve the mix&#39;s overall volume, recheck your mix balance, and improve the frequency characteristics of the final mix [13–14]. As output, the artist receives the final mastered file or even different versions of the files — e.g., for streaming services, for YouTube, for CD, and other devices [13-14].</p><blockquote>Please remember that the mastering phase is just for managing the overall sound to sound great on the different audio devices and polishing the small nuances of the mix. Mastering will not help when the mix is terrible at its core.</blockquote><p>Exporting the final master versions and stems is helpful for future use, for example, using them for playing live gigs.</p><h4>Final Product</h4><p>Now, we have a final mastered song ready to be released. So, now you can take these master versions and distribute them [15, 16].</p><blockquote>Archive and store your release pack with all final song versions, cover art, additional metadata for the song, tempo, key, scores, or tabs. This release pack may be used for rerelease or rerecording in the future.</blockquote><h3>Conclusion</h3><p>In this article, the modern music production workflow was reviewed. Also, was reviewed and depicted each stage with its details. Each stage is essential and should be carefully implemented for the best result. But please do not forget about creativity and inspiration! It is essential when working with vocalists and musicians in the creative industry. Also, I shared some tips based on my personal experience and essential things to remember for each workflow stage. The defined goals, expected results, deadlines, and confidence in executing each step will provide an excellent result without any distractions or uncertainty. I hope you will have an excellent and productive music production workflow!</p><h3>References</h3><ol><li><a href="https://www.tandfonline.com/doi/full/10.1080/17510694.2021.1960705">“Towards an understanding of creativity in independent music production,” Creative Industries Journal, 2023</a></li><li><a href="https://www.researchgate.net/publication/361590539_Technology_and_Music_Production_in_Different_Genres_Key_Issues_for_a_Significant_Music_Education_Technology_and_Music_Production">“Technology and Music Production in Different Genres: Key Issues for a Significant Music Education Technology and Music Production,” Faculty of Fine and Applied Arts Chulalongkorn University, 2022</a></li><li><a href="https://cdn-resources.ableton.com/resources/uploads/makingmusic/MakingMusic_DennisDeSantis.pdf">“Making Music: 74 Creative Strategies for Electronic Music Producers”, Ableton, 2015</a></li><li><a href="https://assets.online.berklee.edu/handbooks/berklee-online-music-production-handbook.pdf">“Music Production Process,” Music Production Degree Handbook, Berklee, 2023, pp. 68–73</a></li><li><a href="https://www.melconway.com/Home/pdf/committees.pdf">M. E. Conway, “How do committees invent?” Datamation, vol. 14, no. 4, pp. 28–31, 1968</a></li><li><a href="https://assets.online.berklee.edu/handbooks/berklee-online-music-production-handbook.pdf">“What Makes a Great Record,” Music Production Degree Handbook, Berklee, 2023, pp. 6–12</a></li><li><a href="https://assets.online.berklee.edu/handbooks/berklee-online-music-production-handbook.pdf">“Saving Spontaneity on Your Recordings,” Music Production Degree Handbook, Berklee, 2023, pp. 31–33</a></li><li><a href="https://www.hachettebookgroup.com/titles/malcolm-gladwell/outliers/9780316017930/">M. Gladwell, “Outliers: The Story of Success,” New York, NY, USA: Little, Brown and Company, 2008</a></li><li><a href="https://assets.online.berklee.edu/handbooks/berklee-online-music-production-handbook.pdf">“The Four Vital Roles of a Music Producer,” Music Production Degree Handbook, Berklee, 2023, pp. 46–54</a></li><li><a href="https://bobbyowsinski.com/recording-engineers-handbook/">B. Owsinski, “The Recording Engineer’s Handbook,” 4th ed. Boston, MA, USA: Cengage Learning, 2017</a></li><li><a href="https://bobbyowsinski.com/mixing-engineers-handbook/">B. Owsinski, “The Mixing Engineer’s Handbook,” 4th ed. Boston, MA, USA: Berklee Press, 2017</a></li><li><a href="https://journals.pan.pl/dlibra/publication/116809/edition/101540/content">“Preliminary Study on the Influence of Headphones for Listening Music on Hearing Loss of Young People.” Archives of Acoustics, 2013</a></li><li><a href="https://bobbyowsinski.com/mastering-engineers-handbook/">B. Owsinski, “The Mastering Engineer’s Handbook,” 4th ed. Boston, MA, USA: Berklee Press, 2017</a></li><li><a href="http://dx.doi.org/10.12801/1947-5403.2014.06.01.01">“Gateway of Sound: Reassessing the Role of Audio Mastering in the Art of Record Production,” Dancecult, vol. 6, no. 1, pp. 8–25, 2014</a></li><li><a href="http://dx.doi.org/10.1007/978-3-319-93022-0_6">S. Hyojung, “Digital Music Distribution Networks: The Case of the Recording Industry,” 2019</a></li><li><a href="http://umu.diva-portal.org/smash/get/diva2:1366593/FULLTEXT01.pdf">M. Eriksson, “Online music distribution and the unpredictability of software logistics,” Umeå University, Faculty of Arts, Department of culture and media studies, 2019</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4ba16e40292" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Comprehensive Guide to Audio Latency in Cubase 13]]></title>
            <link>https://olehch.medium.com/a-comprehensive-guide-to-audio-latency-in-cubase-161d4145631c?source=rss-3a1bbc0bac9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/161d4145631c</guid>
            <category><![CDATA[mixing]]></category>
            <category><![CDATA[music-production]]></category>
            <category><![CDATA[recording]]></category>
            <category><![CDATA[cubase]]></category>
            <category><![CDATA[audio-engineering]]></category>
            <dc:creator><![CDATA[Oleh Chaplia]]></dc:creator>
            <pubDate>Sun, 19 Nov 2023 11:28:44 GMT</pubDate>
            <atom:updated>2023-11-20T20:03:07.084Z</atom:updated>
            <content:encoded><![CDATA[<h4>A comprehensive guide to audio latency and audio system settings in Cubase 13 for recording, mixing, and mastering.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_o28DT-uk_GPlVaU" /><figcaption>Photo by <a href="https://unsplash.com/@jesmanfabio?utm_source=medium&amp;utm_medium=referral">Jesman Fabio</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Hi! Recently, a <a href="https://www.steinberg.net/cubase/">new version of Cubase</a> was released. Therefore, I think writing a new story about DAW is a good time. Today’s topic will be Cubase 13 audio settings — how to understand and configure them for the best performance and usability. I think many of you want the best performance for recording audio and responsiveness of the application while working on music within your DAW. I know that sometimes, some audio latency settings may be confusing. So here, I’ll give you a complete and detailed overview of these settings. This article will help you choose the best monitoring, mixing, or mastering workflow settings.</p><h3>The Aspects of Audio Latency</h3><p>Let’s take a look at the general concepts of audio performance.</p><p>Audio latency is a short period of delay (several milliseconds) between when an audio signal enters a system and when it emerges on the output [1, 2]. All software and hardware devices in the chain, for example, audio interfaces, OS, audio drivers, DAW, and VST plugins, produce some latency. Latency is not an issue for analog systems because it is near zero. Analog-to-digital (ADC) and digital-to-analog (DAC) conversion provide very little latency in nanoseconds, which is also minor and can be ignored. However, it is an issue for digital processing [1, 2]. Where audible audio latency occurs [1, 2]:</p><ul><li>Audio interface connection type, protocol, or bus to the computer or laptop</li><li>Audio interface drivers inside the operating system</li><li>Inside the operating system (which may require additional time to process and mix streams from other applications before passing them out to the speakers)</li><li>Inside DAW (Digital Audio Workstations) (e.g., monitored tracks, native effects, plug-ins, etc.)</li><li>Inside AU, AAX, VST Plugins</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IbopluPpCDoONRi2IB0cYw.jpeg" /><figcaption>Signal flow</figcaption></figure><p>An analog-to-digital (ADC) signal converter transforms an analog signal, such as a sound picked up by a microphone, from an electric guitar, bass guitar, or synth into a digital signal representation [1, 2]. Digital representation consists of numbers within some buffer (a buffer is an array with a defined size containing numbers). Digital-to-analog (DAC) converters reversely convert data to an analog audio signal sent to the speakers or other devices.</p><p>In digital recording, audio is represented by a series of numbers called “samples.” Each “sample” is a digital number representing an analog voltage value from the analog input. The higher sample rate allows for capturing more snapshots of the audio signal within one second. The audio sample rate is measured in hertz (Hz) or kilohertz (kHz). The most used sample rates are 44100 Hz, 48000 Hz, 96000 Hz, and 192000 Hz. Higher sample rates will result in slightly lower global latency but create more demand on the CPU [2, 3].</p><p>Buffer is needed to do a conversion. A buffer is a region of the computer memory storage used to store chunks of these samples. System or software often uses two or three buffers when converting the signal to prevent audio glitches. When one buffer is filled with the data, the second one is sent to the output, and this process repeats. As such, the minimum latency is equivalent to the time required for a single audio buffer to be processed within a given rate of samples per second [2, 3].</p><blockquote>Buffer Size (number of samples) ÷ Sample Rate (Hz) = Expected Latency (ms)</blockquote><p>For example, while running with a Buffer Size of 128 samples and a Sample Rate of 44100 Hz (44.1 kHz), an audio interface will convert the incoming signal with 2.9 milliseconds of expected latency before it appears inside the DAW [3]. Then, the same latency is needed to convert the signal from DAW and send it to the audio interface to listen to speakers or headphones. We need to add the latency from the DAW and all processing units within the DAW, like VST Plugins [2].</p><p>The formula above applies to a single signal conversion stage — for example, only on input or output. Also, the term “Overall Latency” exists. It means the sum of both latencies on input and output. All additional layers of processing may add some more latency delay. Sometimes, audio interfaces report inaccurate latency values, which can be corrected manually by a driver error compensation value [2]. Overall latency:</p><blockquote>Input Latency + DAW/Plugins Processing Latency + Output Latency = Expected Latency (ms)</blockquote><h3>Different Delays on a Tracks</h3><p>Each track within your DAW may have some delays created by the MIDI instrument or plugins. Each of these tracks will have a different number of delays. To work correctly, DAW has a compensation mechanism, which takes the longer latency delay and uses it as a reference for other tracks. Then, other tracks with the more minor delay are correctly aligned to the longer delay. The delay applied to a track’s output will be interpreted as latency when the signal is monitored in real-time [2].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SCGlFi9-To4olbjIsd9opg.png" /><figcaption>Cubase 13 audio latency on tracks</figcaption></figure><p>Cubase provides the Channel Latency Overview window that shows the latency for the current channel [4]. In the image above, we can see that each channel has a different amount of latency. The maximum latency is 64 ms (3072 samples) for the last channel where FabFilter Pro-Q exists. Therefore, the overall latency is the latency on the channel that has the maximum value among all channels.</p><p>The Channel Latency Overview displays the latencies caused by insert effects, channel strip modules, or panners for audio-related channels in the MixConsole [4]. The Channel Latency Overview is only available if latencies are present.</p><ul><li><strong>Name</strong> — the name of the plug-in that causes the latency [4].</li><li><strong>Type</strong> — indicates if the latency is caused by an insert effect, a channel strip module, or a panner [4].</li><li><strong>Latency (ms)</strong> — Shows the latency in milliseconds. If the latency value is marked with <strong>(*)</strong>, the corresponding plug-in features a <strong>Live</strong> button or a low latency mode. If you activate <strong>Constrain Delay Compensation</strong>, this mode is automatically activated. If the latency value is marked with <strong>(**)</strong>, the corresponding plug-in does not feature a <strong>Live</strong> button or a low latency mode. If you activate <strong>Constrain Delay Compensation</strong> and the plug-in latency is higher than the <strong>Constrain Delay Compensation</strong> threshold, this plug-in is automatically deactivated [4].</li></ul><p>Also, there is an additional feature called “lookahead.” This applies a slight delay on the incoming signals but provides a better processing quality. For example, some compressors or dynamic processors may have this feature [2]. A medium or large buffer is needed to convert a signal from the time domain to the frequency domain for processing or display. Therefore, spectral analyzers or equalizers may create some latency [2]. Huge sample buggers also may be needed for intelligent plugins like iZotope Ozone [2].</p><h3>Constrain Delay Compensation</h3><p>There are cases when you play a VST or real instrument in real-time with many plugins that give some latency. This makes playing the instrument unplayable and distracting. <strong>Constrain Delay Compensation may</strong> be activated to fix these issues [5]<strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FBRb9uoFslhnfcHTkHVNxg.png" /><figcaption>Constrain Delay Compensation</figcaption></figure><p>If you activate <strong>Constrain Delay Compensation</strong> for instrument channels, record-enabled audio track channels, group channels, and output channels, the following happens:</p><ul><li>For VST 3 plug-ins with a Live button and third-party VST 3 plug-ins with a low latency mode, activating <strong>Constrain Delay Compensation</strong> activates the <strong>Live</strong> button or the low latency mode for that particular plug-in <strong>[5]</strong>.</li><li>For VST plug-ins with no low latency mode, activating <strong>Constrain Delay Compensation</strong> turns off that plug-in [5].</li></ul><p>VST plug-ins that are activated for FX channels are disregarded. After recording or using a VST instrument, deactivate <strong>Constrain Delay Compensation</strong> again to restore total delay compensation [5].</p><p>You can set your threshold value for the Constrain Delay Compensation value inside Cubase settings. Just open <strong><em>Cubase</em> <em>→ Settings → VST </em></strong>window. This means all plugins that give the latency more than this value will be turned off.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IGx0Xq3y0PTkXOd7xCV19g.png" /><figcaption>Constrain Delay Compensation settings</figcaption></figure><h3>Does UI Graphics impact audio delay?</h3><p>No, graphics in DAW should not impact audio delay. The UI and graphics are processed in different process threads. Therefore, UI and graphics may lag, but it is expected not to impact the audio latency. The UI may lag when the UI shows the data based on the audio processing results or, for example, Fourier transformations [2].</p><h3>How to find a suitable audio latency balance</h3><p>As I said, latency is the time needed to process the sound. For daily usage of your DAW, you need to take into account your audio interface model, audio interface drivers, DAW, audio settings, plugin settings, and the count of plugins, OS, CPU, memory, and all additional processing. The faster your computer, the more tracks, effects, and EQ you can play. The human ear can recognize any delays. The latest research from Aalto University says that human ears are sensitive even to half of millisecond delays [6]. But generic studies say:</p><ul><li>Delays up to 4 ms are great for monitoring and recording.</li><li>Delays from 4 ms to 7 ms are acceptable for monitoring and recording.</li><li>Delays of more than 8 ms are distracting for monitoring and recording.</li><li>Delays of more than 8 ms are completely allowable for mixing and mastering but not for recording or monitoring.</li></ul><p>Please consider that each person has its characteristics and hearing nuances. Therefore, these values may vary for each person. More information is represented within Head Related Transfer Function (HRTF) research [7].</p><h3>Cubase 13 Audio Settings</h3><p>Let’s take a closer look at Cubase 13 audio settings. We’ll start with opening the main window with the settings. This information is taken from the official Cubase 13 operational manual because this is the first source of truth [8]. Please check official references for more details. You can open these settings by clicking on <strong><em>Studio → Studio Setup → Audio System.</em></strong></p><h4>Studio Setup</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omNCzs3TPgre1XtUMc1PPg.png" /><figcaption>Studio <em>→ </em>Studio Setup <em>→ Audio System</em></figcaption></figure><ul><li><strong>ASIO Driver</strong> — selected audio driver for the connected audio interface[8].</li><li><strong>Release Driver when Application is in Background</strong> — releases the driver and allows other applications to playback via your audio hardware even though Cubase is running [8]. Cubase will not use this audio driver in this mode while in the background mode. This mode may be usable for Windows users when switching between multiple software applications using the same audio driver.</li><li><strong>Input Latency</strong> — shows the input latency of the audio hardware [8].</li><li><strong>Output Latency</strong> —shows the output latency of the audio hardware [8].</li><li><strong>ASIO-Guard Latency</strong> — shows the ASIO-Guard latency [8].</li><li><strong>HW Sample Rate</strong> — shows the sample rate of your audio hardware [8].</li><li><strong>HW Pull Up/Down</strong> — shows the pull up/down status of the audio hardware [8].</li></ul><h4>Advanced Options</h4><ul><li><strong>Processing Precision</strong> — allows you to set the audio processing precision to 32-bit or 64-bit float. Depending on this setting, all channels are processed and mixed in a 32-bit floating-point or 64-bit floating-point format. A processing precision of 64-bit float can increase CPU load and memory consumption. To show all plug-ins that support 64-bit float processing, open the <strong>VST Plug-in Manager</strong> from the <strong>Studio</strong> menu and activate <strong>Show Plug-ins That Support 64-bit Float Processing</strong> in the <strong>Display Options</strong> pop-up menu. VST 2 plug-ins and instruments are always processed with 32-bit precision [8].</li><li><strong>Activate Multi Processing</strong> — you can distribute the processing load evenly to all available CPUs. This way, Cubase can fully use the combined power of multiple processors [8]. I recommend keeping this option turned on.</li><li><strong>Activate ASIO-Guard</strong> — activates the ASIO-Guard. This is only available if <strong>Activate Multi Processing</strong> is activated, too [8].</li><li><strong>ASIO-Guard Level</strong> — allows you to set the ASIO-Guard level. The higher the level, the higher the processing stability and audio processing performance. However, higher levels also lead to an increased ASIO-Guard latency and memory usage [8].</li><li><strong>Audio Priority (Windows only)</strong> —this setting should be set to <strong>Normal</strong>, if you work with audio and MIDI. If you do not use MIDI at all, you can set this to <strong>Boost</strong> [8].</li><li><strong>Activate Steinberg Audio Power Scheme (Windows only)</strong> —if this option is activated, all power safe modes that have an impact on real-time processing are deactivated. Note that this is only effective for very low latencies, and that it increases the power consumption [8].</li><li><strong>Disk Preload</strong> — allows you to specify how many seconds of audio are preloaded into RAM prior to starting playback. This allows for smooth playback [8].</li><li><strong>Adjust for Record Latency</strong> — if this is activated, the plug-in latencies are taken to account during recording [8].</li><li><strong>Record Shift</strong> — allows you to shift the recordings by the specified value [8].</li></ul><h4>Audio System ASIO Driver Setup</h4><p>When you click on the name of your audio interface — in my case, Scarlett 4i4 USB you’ll see additional options. Here, you can set up your audio interface driver. Input and Output latency is the same as we saw before. Also, it is possible to turn on the external clock, direct monitoring, and configure ports [9].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IO7U2r4Absd4JlaIDCRkNw.png" /><figcaption>Audio System <strong><em>→</em></strong> Scarlett 4i4 USB Settings</figcaption></figure><ul><li><strong>Control Panel </strong>— opens the control panel for the audio hardware [9].</li><li><strong>Input Latency</strong> — shows the input latency of the audio driver [9].</li><li><strong>Output Latency</strong> — shows the output latency of the audio driver [9].</li><li><strong>Clock Source</strong> — allows you to select a clock source [9].</li><li><strong>Externally Clocked</strong> — activate this option if you use an external clock source [9].</li><li><strong>Direct Monitoring</strong> — activate this option to monitor via your audio hardware and to control it from Cubase [9].</li></ul><p>In the <strong>Ports</strong> section, the following options are available:</p><ul><li><strong>Reset </strong>— allows you to restore the default port names and to enable the visibility for all ports [9].</li><li><strong>I/O</strong> — the port input/output status [9].</li><li><strong>Port System Name</strong> — the system name of the port [9].</li><li><strong>Show As</strong> — allows you to rename the port. This name is used in the <strong>Input Routing</strong> and <strong>Output Routing</strong> pop-up menus [9].</li><li><strong>Visible</strong> — allows you to activate/deactivate audio ports [9].</li><li><strong>State</strong> — the state of the audio port [9].</li></ul><p>At the bottom of the page, the following options are available:</p><ul><li><strong>Reset</strong> — sends a reset signal to the active ASIO device and restarts the audio processing. This can solve problems with audio playback. This leads to a short interruption of the playback [9].</li></ul><h4>CoreAudio Device Settings</h4><p>Clicking on the <strong>Control Panel</strong> opens a new dialog with the <strong>Buffer Size</strong> setting. Select the buffer size you want. Remember that a smaller buffer needs a more powerful CPU and provides more negligible audio latency. The bigger buffer size can work with less powerful CPUs but provides more latency and is unsuitable for near real-time monitoring or recording. Therefore, experiment with these settings to determine which <strong>Buffer Size</strong> value is better for your setup. I prefer not to select <strong>Set Device Attenuation To 0 dB</strong>. So you can also leave it as it is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*FVILNJGWDGR4FYzntSOy_Q.png" /><figcaption>Audio System <strong><em>→</em></strong> Control Panel <strong><em>→</em></strong> CoreAudio Device Settings</figcaption></figure><h4>ASIO Guard</h4><p>The ASIO-Guard allows you to shift as much processing as possible from the ASIO real-time path to the ASIO-Guard processing path. This results in a more stable system. The ASIO-Guard allows you to preprocess all channels and VST instruments that do not need to be calculated in real-time. This leads to fewer dropouts, the ability to process more tracks or plug-ins, and the use of smaller buffer sizes. High ASIO-Guard levels lead to an increased ASIO-Guard latency. For example, when you adjust a volume fader, you will hear the parameter changes with a slight delay. The ASIO-Guard latency, in contrast to the latency of the audio hardware, is independent of live input. The ASIO-Guard cannot be used for real-time-dependent signals and external effects and instruments. If you activate the monitoring for an input channel, a MIDI instrument, or a VST instrument channel, the audio channel and all dependent channels are automatically switched from ASIO-Guard to real-time processing and vice versa. This results in a gentle fade out and fade in of the audio channel [10].</p><h4>Audio Performance Window</h4><p>The <strong>Audio Performance</strong> panel shows the audio processing load and the hard disk transfer rate. This allows you to ensure you do not run into performance problems when adding effects or plug-ins, for example [11].</p><p>To open the <strong>Audio</strong> <strong>Performance</strong> window, select <strong><em>Studio</em></strong><em> </em><strong><em>→</em></strong><em> </em><strong><em>Audio Performance</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*-5Pyu0D6Fm2NprPe0loHhA.png" /><figcaption><em>Studio → </em>Audio Performance</figcaption></figure><ul><li><strong>Real-Time</strong> — shows the average load of all audio realtime processes [11].</li><li><strong>ASIO-Guard</strong> — shows the average load of processes that can be preprocessed [11]. Preprocessing only takes effect if you activate <strong>Activate ASIO-Guard</strong> on the <strong>Audio System</strong> page of the <strong>Studio Setup</strong> dialog [11].</li><li><strong>Peak</strong> — shows the processing load in the real-time path of the audio engine. The higher this value, the higher the risk that dropouts occur [11].</li><li><strong>Processing Overload</strong> — the overload indicator on the top right indicates dropouts. Dropouts occur if the processing load exceeds 100% or if the audio engine is restarted due to the internal detection of excessive processing delay. For example, this can occur if the preprocessing buffer runs empty as a result of the real-time load exceeding the limits. If the overload indicator lights up, decrease the number of EQ modules, active effects, and audio channels that play back simultaneously. You can also activate the ASIO-Guard [11].</li><li><strong>Disk Cache</strong> — shows the hard disk transfer load [11].</li><li><strong>Disk Cache Overload</strong> — the overload indicator to the right of the disk indicator lights up if the hard disk does not supply data fast enough. If it lights up, use <strong>Disable Selected Tracks</strong> to reduce the number of tracks playing back. If this does not help, you need a faster hard disk. To reset the overload indicator, click its display. In the <strong>Audio Performance</strong> category of the <strong>Key Commands</strong>, you can also assign a key command for this. You can show a simple view of the performance meter on the <strong>Transport</strong> panel and on the <strong>Project</strong> window toolbar. These meters only feature the average and the disk indicator [11].</li></ul><h4>VST Plug-in Manager</h4><p>You can manage VST effects and VST instruments in the <strong>VST Plug-in Manager</strong> window. To open the <strong>VST Plug-in Manager</strong> window, select <strong><em>Studio</em></strong><em> → </em><strong><em>VST Plug-in Manager</em> </strong>[12]. You can find more information about the selected plugin by clicking the small icon “<strong>i</strong>” on the bottom left. The Plug-in Information panel shows the ASIO-Guard setting, the count of ts, I/O configuration, and the Latency in samples and other settings. ASIO-Guard was described in this article in the chapter above. You can enable or disable this setting for a specific plugin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q674z8SoHu4fysBR36g8Bw.png" /><figcaption><em>Studio → </em>VST Plug-in Manager</figcaption></figure><h3>Summary</h3><p>In this article, we reviewed the many aspects of audio latency. Completed a detailed review of all audio settings for Cubase 13, audio drivers, audio interface, audio performance window, and VST Plug-in Manager. Technically, there are many details that we need to know to fine-tune the DAW. But overall, the rule is still the same:</p><blockquote>Small buffer size — faster response time between the input and output, but needs a powerful CPU. If the CPU does not have enough processing power, the sound clicks, pops, or is corrupted. This mode is suitable for monitoring and recording.</blockquote><blockquote>Big buffer size — slower response time between the input and output. Can be used for less powerful CPUs. A slower response time leads to audible sound delay between sound input and output, which is unsuitable for monitoring and recording. But this mode is suitable for mixing and mastering.</blockquote><p>I hope this article helped you to have a better understanding of how audio latency and Cubase settings work.</p><h3>References</h3><ol><li><a href="https://en.wikipedia.org/wiki/Latency_(audio)">Wikipedia — Latency (Audio)</a></li><li><a href="https://help.ableton.com/hc/en-us/articles/360010545559-How-Latency-Works#h_ce4efd1f-7192-4e1a-a780-9ffe6b1fe43c">Ableton — How Latency Works</a></li><li><a href="https://en.wikipedia.org/wiki/Sampling_(signal_processing)#Sampling_rate">Wikipedia — Sampling (signal processing)</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/mixconsole/mixconsole_channel_latencies_r.html">Cubase Pro 13.0.10 Operation Manual — Channel Latency Overview</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/vst_instruments/vst_instruments_constrain_delay_compensation_c.html#vst_instruments_constrain_delay_compensation_c">Cubase Pro 13.0.10 Operation Manual — Constrain Delay Compensation</a></li><li><a href="https://www.aalto.fi/en/news/the-human-ear-detects-half-a-millisecond-delay-in-sound">Aalto University — The human ear detects half a millisecond delay in sound</a></li><li><a href="https://en.wikipedia.org/wiki/Head-related_transfer_function">Wikipedia — Head-Related Transfer Function</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/setting_up/setting_up_audio_vst_audio_system_r.html">Cubase Pro 13.0.10 Operation Manual — Audio System Page</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/setting_up/setting_up_audio_asio_driver_setup_r.html">Cubase Pro 13.0.10 Operation Manual — ASIO Driver Setup Page</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/optimizing/optimizing_asio_guard_c.html?hl=asio%2Cguard">Cubase Pro 13.0.10 Operation Manual — ASIO-Guard</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/optimizing/optimizing_vst_performance_window_r.html">Cubase Pro 13.0.10 Operation Manual — Audio Performance Panel</a></li><li><a href="https://steinberg.help/cubase_pro/v13/en/cubase_nuendo/topics/installing_and_managing_plugins/installing_and_managing_plugins_plugin_manager_window_r.html?hl=vst%2Cmanager">Cubase Pro 13.0.10 Operation Manual — VST Plug-in Manager</a></li></ol><h3>Additional References</h3><ol><li><a href="https://www.youtube.com/watch?v=AYK2bNi18kQ">The Essential Guide to Latency in Cubase 12 (Pt.1) — Understanding Buffers</a></li><li><a href="https://www.youtube.com/watch?v=yIkGKLXZ278">The Essential Guide to Latency in Cubase 12 (Pt.3) — Delay Compensation</a></li><li><a href="https://www.youtube.com/watch?v=L_dLZ-1PIyA">The Essential Guide to Latency in Cubase 12 (Pt.4) — Record Latency &amp; Manual Adjustment</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=161d4145631c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Great links for further learning of Node.js Software Engineering]]></title>
            <link>https://olehch.medium.com/great-links-for-further-learning-of-node-js-software-engineering-d254d8bebeeb?source=rss-3a1bbc0bac9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d254d8bebeeb</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Oleh Chaplia]]></dc:creator>
            <pubDate>Sat, 13 Mar 2021 20:33:41 GMT</pubDate>
            <atom:updated>2023-11-13T18:18:47.761Z</atom:updated>
            <content:encoded><![CDATA[<h3>Excellent links for further learning of Node.js Software Engineering</h3><p>Here is my collection of links to great articles about software engineering and development using Node.js that will improve your skills and practice to a higher level of experience. Have fun!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_TRMY6v4jjv3FB2dywS-Rw.jpeg" /></figure><h4>Blogs</h4><ol><li><a href="https://2ality.com/">2ality — JavaScript and more (Node.js, JavaScript)</a></li><li><a href="https://blog.risingstack.com/">RisingStack Blog</a><a href="https://2ality.com/"> (Node.js, JavaScript)</a></li><li><a href="https://nodesource.com/blog">The NodeSource Blog (</a><a href="https://2ality.com/">Node.js, JavaScript</a><a href="https://nodesource.com/blog">)</a></li><li><a href="https://nodeweekly.com/">Node Weekly</a><a href="https://2ality.com/"> (Node.js, JavaScript)</a></li><li><a href="http://javascript.crockford.com/">DouglasCrockford Blog (JavaScript)</a></li><li><a href="https://nodejs.medium.com/">Node.js Medium Blog</a></li><li><a href="https://benediktmeurer.de/">Benedikt Meurer Blog (JavaScript, Engines)</a></li><li><a href="https://medium.com/@addyosmani">Addy Osmani Medium Blog (JavaScript, Web)</a></li><li><a href="https://medium.com/@dan_abramov">Dan Abramov Medium Blog</a><a href="https://medium.com/@addyosmani"> (JavaScript, Web)</a></li><li><a href="https://overreacted.io/">Overreacted — Dan Abramov’s Blog (JavaScript, Web)</a></li><li><a href="http://jayconrod.com/posts">Jay Conrod (V8, Compilers)</a></li><li><a href="https://nikhilm.github.io/uvbook/">An Introduction to Libuv</a> (Book)</li><li><a href="http://www.erahm.org/">Eric Rahm — Notes on performance and memory usage</a></li><li><a href="https://codeascraft.com/">Etsy — Code as Craft (Web)</a></li><li><a href="http://blog.dloh.org/index.html">Dave’s Life On Hold</a></li><li><a href="https://rsms.me/">Rasmus Andersson (JavaScript, Web)</a></li><li><a href="http://ferd.ca/">“As bad as anything else” (Software Engineering)</a></li><li><a href="http://lucasfcosta.com/">Lucas Fernandes da Costa (JavaScript)</a></li><li><a href="http://smallcultfollowing.com/babysteps/">Niko Matsaki (JavaScript, Rust)</a></li><li><a href="https://bartoszmilewski.com/">Bartosz Milewski (Concurrency, C++, Haskell, Category theory)</a></li><li><a href="http://shuheikagawa.com/">Shuhei Kagawa (JavaScript, Haskell, Rust)</a></li><li><a href="https://wingolog.org/tags/v8">Andy Wingo about V8 (JavaScript, V8)</a></li><li><a href="http://mrale.ph/">Vyacheslav Egorov (Compiler engineer, V8)</a></li><li><a href="http://jayconrod.com/">Jay Conrod (V8, Compilers)</a></li><li><a href="https://github.com/v8/v8/wiki/Introduction">Developer Documentation for V8</a></li><li><a href="https://v8project.blogspot.com/">Official V8 JavaScript Engine Blog</a></li><li><a href="https://github.com/sq/JSIL/wiki/Optimizing-dynamic-JavaScript-with-inline-caches">Optimizing dynamic JavaScript with inline caches (Optimization Guide)</a></li></ol><h4>System programming and Networking</h4><ol><li><a href="http://www.brendangregg.com/linuxperf.html">Linux Performance</a></li><li><a href="http://www.memorymanagement.org/">Memory Management Reference</a></li><li><a href="https://powerdns.org/hello-dns/">A warm welcome to DNS</a></li><li><a href="https://hpbn.co/">Ilya Grigorik — High Performance Browser Networking</a></li></ol><h4>Software Architecture and Program Design</h4><ol><li><a href="http://www.ccs.neu.edu/home/matthias/HtDP2e/">How to Design Programs, Second Edition</a></li><li><a href="https://martinfowler.com/architecture/">Martin Fowler — Software Architecture Guide</a></li><li><a href="https://martinfowler.com/articles/serverless.html">Martin Fowler — Serverless Architectures</a></li><li><a href="https://addyosmani.com/resources/essentialjsdesignpatterns/book/">Addy Osmani — Learning JavaScript Design Patterns</a></li><li><a href="https://micro-frontends.org/">Micro Frontends — Michael Geers</a></li><li><a href="https://wiki.solidbook.io/">Solidbook — Software Design and Architecture</a></li><li><a href="https://refactoring.guru/">Refactoring Guru</a></li><li><a href="http://microservices.io/index.html">Microservice Architecture</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d254d8bebeeb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to test VST/AU audio plugins using PluginDoctor]]></title>
            <link>https://olehch.medium.com/how-to-test-your-audio-plugins-using-plugindoctor-b24a923f451a?source=rss-3a1bbc0bac9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b24a923f451a</guid>
            <category><![CDATA[music-production]]></category>
            <category><![CDATA[daw]]></category>
            <category><![CDATA[audio-engineering]]></category>
            <category><![CDATA[music]]></category>
            <category><![CDATA[software-testing]]></category>
            <dc:creator><![CDATA[Oleh Chaplia]]></dc:creator>
            <pubDate>Mon, 03 Sep 2018 14:48:12 GMT</pubDate>
            <atom:updated>2023-11-13T18:17:53.470Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to test VST/AU plugins using PluginDoctor</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pb3aTKhDF52Gg4f4ES505w.png" /><figcaption>PluginDoctor with CLA-2A</figcaption></figure><p>Have you ever wondered how exactly your favorite audio plugins process your sound? What effects do they give to your sound? Why do they sound so good?</p><p>Many of us are looking for great UI and listening to the final sound that the plugin produces. But behind all that, there are math algorithms and programming work. Of course, we couldn’t see the source code of audio plugins because they are packaged as a binary. But we can test them using a “black box” approach.</p><h4>Short review of PluginDoctor</h4><p>PluginDoctor is a simple cross-platform application that can analyze your VST and AU plugins. There are 2 versions of this application — demo and full. The demo version has the same tools as the full, but sometimes it is blocked for 30 seconds and can load only 1 plugin at a time. The demo of PluginDoctor can be downloaded <a href="https://ddmf.eu/plugindoctor/">here</a>.</p><p>Features (taken from the official website) [1]:</p><ul><li>Highest quality, double precision FFT engine, independent stereo channel analysis</li><li>Linear analysis: magnitude and phase response using delta or random input signal</li><li>Harmonic analysis: highly accurate frequency response analysis to a sinusoidal input signal. Input strength and frequency can be varied for THD/THD+N calculation — intermodular distortion modus.</li><li>Oscilloscope: watch what happens to a sinusoidal input signal in real-time.</li><li>Dynamics: use a ramping signal to test compression or expansion or an attack-release signal to check your compressor’s attack and decay curves.</li><li>Performance: how many milliseconds are spent in your plugin’s audio processing callback (as a function of buffer size)</li><li>Freely resizable user interface</li><li>Three quality settings corresponding to three different FFT buffer sizes</li><li>Storage option of curves in Linear and Harmonic analysis mode for easy comparison of settings or of different plugins</li><li>Built-in screenshot function</li><li>Comes as a 32 and a 64-bit executable</li><li>Can load VST and (on Mac) AU effect plugins</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KmIYv4nQk2JMavSDzoXh0w.png" /><figcaption>Screenshot with loaded plugin to test</figcaption></figure><p>Just for note — this plugin was made with the <a href="https://juce.com/">JUCE framework</a> 😁</p><h4>Settings and plugin selection</h4><p>First, we need to set plugin settings. To do this, press the settings button (yellow circle at the top right corner), and you’ll see a settings window. Set the <em>quality</em> to the <em>highest </em>and validate your audio hardware settings to use the proper audio buffer size<em>. </em>I prefer to set it to 128 samples (2.9ms).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kXAWR6ONX5K5p6pFFnNS9Q.png" /><figcaption>PluginDoctor settings menu</figcaption></figure><p>Let’s check the other buttons at the top right corner:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l-Wz0Fjllvf3wbt8olWwFw.png" /><figcaption>PluginDoctor settings bar</figcaption></figure><ol><li>The first one enables hardware analysis. This mode is enabled in the full version of this application.</li><li>Shows a list of all available VST/AU plugins for testing</li><li>Shows or hides the UI of the loaded plugin</li><li>Takes a screenshot from the PluginDoctor</li><li>Opens settings menu</li></ol><p>The next step is to load your VST plugin into this plugin. Just press on the plugin selection button. If you don’t see any plugins in the list, scan your computer to find them. Select <strong><em>CLA-2A Mono</em></strong> and click on the <strong><em>Load Plugin </em></strong>button. If you don’t have <strong>CLA-2A</strong> installed, you can choose any other VST plugin you like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gT5nfH1Q88XSNnhWd3ALBQ.png" /><figcaption>A list of VST/AU plugins</figcaption></figure><h4>Real-life test on CLA-2A from Waves</h4><p>I chose <a href="https://www.waves.com/plugins/cla-2a-compressor-limiter">Waves CLA-2A</a> to test because this compressor/limiter is an excellent example for testing harmonics, dynamics, and frequency response. Let’s load CLA-2A into PluginDoctor. This is a total reset state. As we can see, CLA-2A already changed our signal even if we didn’t touch any knobs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXDETKBeZ73aDXJRpgg3Zg.png" /><figcaption>CLA-2A loaded into PluginDoctor</figcaption></figure><p>PluginDoctor can analyze several characteristics of your plugin. They are:</p><ul><li><strong><em>Linear Analysis </em></strong>— in other words, it shows you a frequency response like parametric EQs.</li><li><strong><em>Harmonic Analysis</em></strong> — this shows you how many harmonics your output signal contains.</li><li><strong><em>Oscilloscope</em></strong> — a simple oscilloscope.</li><li><strong><em>Dynamics</em></strong> — shows the relation between your input sound and output sound volume (compression or expansion curve).</li><li><strong><em>Performance</em></strong> — performance of your plugin.</li></ul><h4>Linear Analysis</h4><p>Linear analysis is the first view showing you a blue line graph. It has 3 modes. You can also switch between <strong><em>Delta</em></strong> and <strong><em>Random</em></strong> signals. Let’s check <strong><em>Freq, Phase, </em></strong>and<strong><em> IR</em></strong> for the <strong><em>Delta</em></strong> signal. We didn’t change any parameters on CLA-2A.</p><ul><li><strong><em>Delta </em></strong>— input signal is a full-scale Dirac Pulse that contains all frequencies in a constant amplitude and is ideally in phase.</li><li><strong><em>Random </em></strong>— input signal’s frequency response is changed in time by random values.</li></ul><p><strong><em>The frequency</em></strong> view shows you a frequency response over the spectrum. Here, you should see a similarity with graphics in other spectrum analyzers like <a href="https://www.voxengo.com/product/span/">Voxengo SPAN</a>. Changing some parameters in your will change the output’s signal frequency. This spectrum is helpful for knowing how your plugin changes the signal frequency.</p><p>As we can see, CLA-2A changes low frequencies by High-Pass Filter on 20Hz and has some small attenuation on high frequencies near 15 kHz. The human listening range is from 20Hz to 20kHz, so HPF is OK.</p><ul><li>X-axis — frequency, from 20 Hz to 20kHz</li><li>Y-axis — signal volume, from -10.0 dB to 10.0 dB</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wtfn1zbuWc5q2b8DhF2p3Q.png" /><figcaption>Linear Analysis — Frequency view — Delta</figcaption></figure><p>The second view is <strong><em>Phase</em></strong>. In this view, you can see the difference between phase and frequency. Who remembered math should know that 3.14 is the Pi number 😀. And that is the ratio of a circle’s circumference to its diameter. Why do we have it here? Phase is directly related to the sine wave. As we know, all audio signals are compounded from multiple sine waves. When the sound wave starts, it should have some starting point. A phase value defines this starting point. For example, we all know that signals in phase have bigger volume output, and signals out of phase are canceling. Additional reading is <a href="https://theproaudiofiles.com/phase/">here</a> [2].</p><p>For example, we can see that CLA-2A changes w frequencies using this setting. But this is not a very big issue because this compressor is often used for vocals, and we know it is good to do a low cut on vocals up to 80Hz.</p><ul><li>X-axis — frequency, from 20 Hz to 20kHz</li><li>Y-axis — phase, from -3.14 to 3.14</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UIW_m0mDoP6QGUBCgU9n9g.png" /><figcaption>Linear Analysis — Phase view — Delta</figcaption></figure><p>The third view shows you the <strong><em>Impulse Response</em></strong> (IR). This shows an impulse that was produced in the output of this plugin. As we can see here, there is no difference between input and output, so we can think that the plugin doesn’t change <strong><em>IR</em></strong> timing. For example, this graph could be changed by the reverb of delay effects. For CLA-2A, it is OK not to change the IR.</p><ul><li>X-axis — time, ms</li><li>Y-axis — output signal amplitude, from -1.0 to 1.0</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1s5-9xecgRqC9X8viYsk8Q.png" /><figcaption>Linear Analysis — Impulse Response view — Delta</figcaption></figure><h4>Harmonic Analysis</h4><p>The harmonic Analysis view shows you a spectrum of the output signal. Generally speaking, here you can see all harmonics in the audio signal that compressor CLA-2A produced. As we can see, the fundamental frequency for the input signal is 1kHz and contains harmonics till the end of the spectrum, each with a lower volume than the previous. [3]</p><ul><li>X-axis — frequency, from 20 Hz to 20 kHz</li><li>Y-axis — output signal volume, from -200.0 dB to 0.0 dB</li></ul><p>Harmonics can be viewed in 2 modes — THD and IMD. The first is THD — total harmonic distortion — the ratio of all the harmonics to the fundamental frequency. THD is measured by one sinusoid. It shows you how the CLA-2A distorts all harmonics. You&#39;ll see smaller amplitude peaks if you look at the main harmonic at 1kHz. And the same image around other harmonics. This means that they are distorted somehow. [4]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DJXupEEZSIVP-v4dqL4h3g.png" /><figcaption>Harmonic Analysis — THD</figcaption></figure><p>This view shows you an IMD — intermodulation distortion. This is a related measure of distortion. IMD is measured using the sum of two or more sinusoids as an input signal. Typically, the frequencies combined in the input are not harmonically related. This is convenient because it allows for examining many distortion components in a narrow bandwidth. [4]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F08GExE6C3biMd50eu_qfw.png" /><figcaption>Harmonic Analysis — IMD</figcaption></figure><h4>Oscilloscope</h4><p>The oscilloscope view shows your sound wave produced by the CLA-2A in the time domain.</p><ul><li>X-axis — time, in milliseconds</li><li>Y-axis — output signal amplitude, from -1.0 to 1.0</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n3nWP2Hj3Q9i8_I6pQWo7Q.png" /><figcaption>Oscilloscope</figcaption></figure><h4>Dynamics</h4><p>Dynamics shows you a dependency of input signal volume to output signal volume.</p><ul><li>X-axis — input signal volume, from -100.0 dB to 0.0 dB</li><li>Y-axis — output signal volume, from -100.0 dB to 0.0 dB</li></ul><p>The dashed line is the volume of the input signal over time. The solid line is the volume of the produced signal by CLA-2A. As you can see, a slope on the top was created because we changed some compression parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lHLay0WWq_-G6WBO3dTnmg.png" /><figcaption>Dynamics — Ramp</figcaption></figure><p>Also, you can switch to a view of attenuation/release over time domain.</p><ul><li>X-axis — time, from 0.0 s to 4.0 s</li><li>Y-axis — amplitude, from -1.1 to 1.1 (amplitude is somewhat equal to volume)</li></ul><p>Here, you can see how this signal is modified in the time domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N5J8k21vwiVqLNm8w8GMeQ.png" /><figcaption>Dynamics — Attenuation/Release</figcaption></figure><h4>Performance</h4><p>This performance view shows you the overall CLA-2A latency in processing from small to big buffers. The graph below shows a dependency of buffer size on processing time. That peak in the middle was produced when I took a screenshot.</p><ul><li>X-axis — buffer size, from 327 to 65536</li><li>Y-axis — overall latency from 0.0ms to 18.3 ms</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XSTAyLhDfZMLA-csf3d3Tw.png" /><figcaption>Performance</figcaption></figure><h4>Summary</h4><p>Of course, PluginDoctor has some cons. For example, there is no bypass mode to compare the raw signal from the input to the produced output signal by the loaded plugin. Also, the spectrum view is not so contrasting, and it is hard to see signal lines over the spectrum background. It would be great to have more fluid visual animations.</p><p>There are few tools like this on the market, so PluginDoctor can be a great tool to test and analyze your VST/AU plugins and understand better how they work their characteristics, and their pros/cons. Knowing how they deform sound in the output, you can create emulations of the tested plugin using other plugins 😁.</p><h4>References</h4><ol><li><a href="https://ddmf.eu/plugindoctor/">Official website of PluginDoctor</a> [1]</li><li><a href="https://theproaudiofiles.com/phase/">Phase: Timing Difference or Polarity?</a> [2]</li><li><a href="http://www.dspguide.com/ch11/5.htm">The Scientist and Engineer’s Guide to Digital Signal Processing. Chapter 11: Fourier Transform Pairs</a> [3]</li><li><a href="https://www.uaudio.com/blog/total-harmonic-distortion/">Total harmonic distortion</a> [4]</li><li><a href="https://www.waves.com/plugins/cla-2a-compressor-limiter">CLA-2A Compressor / Limiter</a></li><li><a href="http://www.dspguide.com/ch22/7.htm">The Scientist and Engineer’s Guide to Digital Signal Processing. Chapter 22: Audio Processing. Nonlinear Audio Processing</a></li><li><a href="https://www.voxengo.com/product/span/">Voxengo SPAN</a></li><li><a href="https://www.physicsclassroom.com/class/sound/Lesson-4/Fundamental-Frequency-and-Harmonics">Fundamental Frequency and Harmonics</a></li><li><a href="http://soundbytesmag.net/review-plugindoctor-from-ddmf/">Review — PluginDoctor from DDMF</a></li><li><a href="https://www.kvraudio.com/product/vst-plugin-analyser-by-christian-budde">VST Plugin Analyser by Christian Budde</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b24a923f451a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time stretching algorithms and audio warping techniques used in modern music production]]></title>
            <link>https://olehch.medium.com/time-stretching-algorithms-and-audio-warping-techniques-used-in-modern-music-production-63f4d33804d2?source=rss-3a1bbc0bac9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/63f4d33804d2</guid>
            <category><![CDATA[music-production]]></category>
            <category><![CDATA[dsp]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[daw]]></category>
            <category><![CDATA[music]]></category>
            <dc:creator><![CDATA[Oleh Chaplia]]></dc:creator>
            <pubDate>Fri, 24 Aug 2018 14:19:46 GMT</pubDate>
            <atom:updated>2018-08-24T14:19:46.301Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3G_8i8cTdYQ5SAqfGglBiQ.jpeg" /></figure><h4>Introduction</h4><p>Hi! Today’s article will be about time stretching algorithms and several methods of aligning recorded audio takes to the beat tempo. It is natural that musicians are not machines and they can’t play the same musical part with the same intonation, attack, speed even if they are playing with a metronome.</p><p>But sometimes music production needs this perfect synchronization between notes played by musicians to produce top-quality music tracks. So, many mixing engineers have to do something to fix instrumental and voice timing and align it to the bar beats to sync to the song. In this article, I’ll do a short review of possible ways how to edit tracks and align them to the bars. I’m a guitarist, therefore all examples will be based on electric guitar recording 😊.</p><h4>A bit of history</h4><p>Before starting to talk about modern algorithms let’s spend a minute to talk about how it is done in the analog world. With analog recording media like tape and turntables, if you wanted to speed up or slow down already-recorded audio, you’d vary the playback speed. But along with the change in speed comes a change in pitch — the familiar “Chipmunk effect” where the tone of the audio gets either squeaky and high-pitched (speed-up) or deep and spooky (slow-down). Even with digital media, if you simply speed up or slow down the playback (<em>i. e.</em> change the sample rate), you’ll get the same artifacts.</p><p>Modern time-shifting algorithms don’t change the pitch of the audio, but they are doing some additional processing under the hood. At first, audio must be broken up into individual notes and syllables. This is done by transient detection and in some cases also by frequency analysis (material that has separate notes <em>without</em> strong transients). Switching between algorithms reveal individual markers for the newly separated notes, which are embedded in the audio file’s header. If you want a more detailed description of whats going on under the hood, please reference publications and videos in the latter part of this article. [1]</p><h4>Time-Scale Modification Overview</h4><blockquote>Time-scale modification (TSM) is the task of speeding up or slowing down an audio signal’s playback speed without changing its pitch. In digital music production, TSM has become an indispensable tool, which is nowadays integrated in a wide range of music production software. Music signals are diverse — they comprise harmonic, percussive, and transient components, among others. Because of this wide range of acoustic and musical characteristics, there is no single TSM method that can cope with all kinds of audio signals equally well.[2]</blockquote><p>Therefore we know that for every specific musical instrument we have their own algorithms which do TSM in the best way. Let’s see what algorithms are provided by Cubase Pro 9.5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZDeHBaIaVz7Wo5VlFhfNyQ.png" /><figcaption>Elastique algorithms in Cubase</figcaption></figure><p>Elastique Pro is the all-around solution for time-stretching and pitch-shifting. The Pro version is suited for professional use without introducing usual phasing artifacts and thus providing sharp transients and crystal clear vocals. It is made for best audio quality, without formant preservation and Elastique Pro Formant includes formant preservation.</p><p>Elastique Efficient is suited for complex polyphonic signals like complete mixes etc. This algorithm has improved performance at the price of a slightly decreased quality level. Both versions can be used over monophonic and polyphonic audio [3]. All algorithms work in 3 modes [4]:</p><ul><li><strong><em>Time</em></strong> — favors timing accuracy over pitch accuracy.</li><li><strong><em>Pitch</em></strong> — favors pitch accuracy over timing accuracy.</li><li><strong><em>Tape</em></strong> — locks the pitch shift to the time stretch as if playing back a tape with varying speed. If you stretch the audio material, the pitch decreases automatically. This variant has no effect if you use it with event transpose or the transpose track.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jvcQwg0g4Ltc0op13IHCLQ.png" /><figcaption>Standard Cubase algorithms</figcaption></figure><p>Cubase also offers its own standard algorithms under the name “Standard”. This review is taken from official Cubase documentation [5]:</p><ul><li><strong><em>Standard Drums</em></strong> — for percussive sounds. This mode does not change the timing of your audio. If you use it with certain tuned percussion instruments, you may experience audible artifacts. In this case, try the <strong>Mix</strong> mode as an alternative.</li><li><strong><em>Standard Plucked</em></strong> — for audio with transients and a relatively stable spectral sound character like plucked instruments.</li><li><strong><em>Standard Pads</em></strong><em> </em>— for pitched audio with slower rhythm and a stable spectral sound character. This minimizes sound artifacts, but the rhythmic accuracy is not preserved.</li><li><strong><em>Standard Vocals</em></strong> — for slower signals with transients and a prominent tonal character like vocals.</li><li><strong><em>Standard Mix</em></strong> — for pitched material with a less homogenous sound character. This mode preserves the rhythm and minimizes the artifacts.</li><li><strong><em>Standard Custom</em></strong> — allows you to set the time stretching parameters manually.</li><li><strong><em>Standard Solo</em></strong> — for monophonic material like solo woodwind/brass instruments or solo vocals, monophonic synths or string instruments that do not play harmonies. This mode preserves the timbre of the audio.</li></ul><p>If you select the <strong>Standard — Custom</strong> mode, a dialog opens where you can manually adjust the parameters that govern the sound quality of the time stretching:</p><ul><li><strong><em>Grain size</em></strong><em> — </em>allows you to determine the size of the grains in which the standard time-stretching algorithm splits the audio. Low grain size values lead to good results for material that has many transients.</li><li><strong><em>Overlap</em></strong><em> — </em>this is the percentage of the whole grain that will overlap with other grains. Use higher values for material with a stable sound character.</li><li><strong><em>Variance</em></strong><em> — </em>this is a percentage of the whole length of the grains, and sets a variation in positioning so that the overlapping area sounds smooth. A variance setting of 0 produces a sound akin to time stretching used in early samplers, whereas higher settings produce more rhythmic smearing effects but less audio artifacts.</li></ul><h4>Audio warping techniques in real cases</h4><p>That’s great that we have such cool algorithms that can solve our issue but let’s have a look at how we can use them in real life.</p><ul><li><strong><em>Split &amp; Crossfade</em></strong> — without time warping</li><li><strong><em>Split &amp; Time Stretch</em></strong> — with time warping</li><li><strong><em>Audio Warp</em></strong> — with time warping</li><li><strong><em>Slip editing</em></strong> — without time warping</li></ul><p>We as music producers want to have the best quality sound using our DAWs to edit recorded takes. I’ll be using Cubase Pro 9.5 to show you how you can edit your audio takes in different ways. This techniques also can be applied to other DAWs like Reaper, Pro Tools, Ableton Live, Logic Pro etc. All examples will be based on DI guitar recording.</p><h4>Preconditions</h4><p>To have the best quality result you need to take into account several things:</p><ul><li>The tempo of the song</li><li>Quality of recorded audio takes</li><li>Tempo difference of recorded audio takes and project tempo</li><li>The monophonic or polyphonic sound in audio take</li><li>Signal-to-noise ratio</li></ul><blockquote>Monophonic — one note at a time (e.g. vocals, or when bassist or guitarist plays one note at a time)</blockquote><blockquote>Polyphonic — multiple notes at the same time (e.g. chords or harmonies)</blockquote><p>Recorded audio takes for a musical instrument or vocals should be as close to the beat grid as possible to have the best results from warping. Let’s start with the basic guitar sample recorded at 110 BPM. As we can see, I intentionally played this part not in time to show to you the starting point how we can apply those techniques in real life. Almost all of the notes are played a faster than a metronome click. Therefore let’s fix it by using different techniques.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tLcvRIp0gaX2libPBAeWIw.png" /></figure><h4>Split &amp; Crossfade</h4><p>I think this is the most simple technique to edit guitars. The main idea is to crop your recorded audio by beats (manually or automatically using beat detection in your DAW), snap your slices of audio to the beat grid and crossfade them to fill the gaps between if any. This can be done easily in any DAW, but I’ll be using Cubase for this. This is the best way to align tempo for percussive instruments like drums (e.g. kick, snare, toms).</p><p>First of all, create proper slices before the note transients using the “Split (Scissors)” tool. Those big peaks indicate that note has been started and guitar pick hit the string. The low noise before is a pick noise, therefore I prefer to not include it into the note transient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8FjUVlh6-gll44KhROg-yQ.png" /><figcaption>Proper slices before the note transient</figcaption></figure><p>Now you have sliced all the notes and should see a view like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iNFe88w7XAlx3VKZMlujUA.png" /><figcaption>All sliced notes</figcaption></figure><p>After you moved all the notes to their correct positions a free space was created. This empty space should be filled by something because you don’t want to listen to silent pauses that easily distract listeners.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fdJRVPUDyTXE99dpuIkTZw.png" /><figcaption>Place every note on their correct beat positions</figcaption></figure><p>This space can be filled by changing a length of a selected note (pre- and post-length) and crossfading it with previous.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fw1QlOyUfB1WofuV22MJHQ.png" /><figcaption>Use crossfades between split samples</figcaption></figure><p>And the last step is to do this for all notes in the recording take. Of course, doing this manually can take some time so you can use automation tools. So the final result should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LB-rV-DH85H6p3OiD4qn5w.png" /><figcaption>Final result</figcaption></figure><h4>Split &amp; Time Stretch</h4><p>This concept is similar to previous but the main difference is in the last step — you should do a time warp of all samples to fit the bars entirely and make a crossfade for all samples to prevent clicking.</p><p>Let’s assume that you’ve sliced all the notes and placed them into correct beat positions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fdJRVPUDyTXE99dpuIkTZw.png" /><figcaption>The sliced notes</figcaption></figure><p>Next step will be to warp every note to fill the bar and crossfade them to prevent unwanted noises and clicks. In Cubase we a have a special tool for it — “Close Gaps (Time Stretch)”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fZfcUSGIi7vXOnXuUBV20g.png" /></figure><p>After clicking on it it should process all your selected slices and close gaps warping your notes. As you can see every slice has a special marker (red selection) that tell you that this slice was warped.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pQt5smkAX1K7an-fGp7Dow.png" /></figure><p>Maybe it is a bit hard to see not, but when we zoom into the slice margins, we can see that there is a silence on both ends of the slice and some empty space. In this case, this empty space does nothing to our record take, because it has silence on both ends. But to be 100% sure that everything is ok you can close these gaps by using crossfades.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2YwWsogg3ROUFZWnzYBIgw.png" /></figure><p>But in any case, you should be aware that their gaps are generated between note transients. It won’t be listenable in heavy rock or metal mixes but can be annoying on clean electric guitar sound or acoustic guitars. For example, I prefer other methods of warping against this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c8WYD0fBRCL_TP-4p7bKZg.png" /></figure><h4>Audio Warp</h4><p>Here you just need to set warp markers and move them around to stay in correct positions. We start from a raw guitar take without any slicing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tLcvRIp0gaX2libPBAeWIw.png" /></figure><p>The first step is to open the warp editor in Cubase. When you double click on the recorded take, you’ll see the sample editor with many options. You should concentrate only on red selected options. The first one is the algorithm — I prefer to use “Elastique Pro — Time” for guitars and bass. Next point is to set the “Threshold” parameter to filter only that notes that we need, but remove noise. You can also set the “Beats” parameter to the max note timing played on the guitar. It will help the algorithm to create time warp markers without unnecessary notes. Almost last step is to create markers by clicking on “Create Warp Markers”. As you can see on the tab above “AudioWarp” an orange button highlighted. This indicates that your markers were created and the next step is to open that tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MWp35vrRBEWXLuG6vScYFQ.png" /></figure><p>After you have created warp markers you have 2 choices — to move them manually by using the “Free Warp” tool or automatically by quantizing. I prefer to use “Free Warp” tool and move them manually because you have more control and precision in aligning markers to the grid. But in this case, I’ll show you automatic marker placement by quantizing. Open the “Quantize Panel”, click on “AudioWarp” button to select correct mode and press “Auto”. This will move markers to their correct positions on the grid. Of course, you can correct them manually if you need by using the “Free Warp” tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C0VjZKmajg66ICqtGGYm7g.png" /></figure><p>After pressing “Auto” and clicking on “Free Warp” button you will see this view. Take into account red selection — every marker that you can move is colored in orange and contains small orange triangle. Near every triangle there is a number — this shows you how much you warped you sample by markers. I don’t recommend to warp samples more than 1.10 or 0.90, because this impacts timbre of the instrument and note sound unnatural.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UhopJS2egdNaTy94JqQrCg.png" /></figure><p>Therefore the final result will be like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yaZOdXWmfj4Uohvy2-KAyg.png" /></figure><h4>Slip editing</h4><p>This is the last technique I want to mention. The main point of this technique is to slice notes, move them using the time shift function in their events and crossfade gaps. We start from sliced view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4JU2K6L_zlpapn_Vgaz9sw.png" /></figure><p>Next step is to select some sample and move the waveform. Pressing CMD+ALT on Mac opens special tool to time shift your sample event without any processing, that you can align it to the grid perfectly. Next step is to create a crossfade before the note to prevent any clicks or pops.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sjQiL5X8-qPBuh1z3sSnTg.png" /></figure><p>The final result should look like this. After that, you can securely bounce the recorded event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TUuIZ3SzPGot4gomF7-_iQ.png" /></figure><h4>Possible artifacts after time modification</h4><p>A list of artifacts might occur when using warping:</p><ul><li>Phase modulation</li><li>Transient doubling (when stretching a signal)</li><li>Transient skipping (when compressing a signal)</li><li>Clipping, distorted signal or pops (when there are no crossfades between samples)</li></ul><p>As a bottom line, I can say that these techniques will help you to improve the overall quality of your tracks and make your guitars or other instruments sound more professionally 😃.</p><h4>Want to know a bit more?</h4><p>The most used time- and pitch-shifting algorithms in music production are made by <a href="http://products.zplane.de/">ZPlane company</a>. The offer different set of products including time-shifting, pitch-shifting, retuning and harmonization applications. These tools are used almost in every DAW behind the custom UI.</p><h4>References &amp; Publications</h4><ol><li><a href="https://ask.audio/articles/understanding-time-shift-algorithms-for-music-producers">Understanding Time Shift Algorithms For Music Producers</a> [1]</li><li><a href="https://www.google.com.ua/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=11&amp;cad=rja&amp;uact=8&amp;ved=0ahUKEwj_zK2FyIXYAhXHFJoKHU1qDGYQFgiJATAK&amp;url=http%3A%2F%2Fwww.mdpi.com%2F2076-3417%2F6%2F2%2F57%2Fpdf&amp;usg=AOvVaw10vdkM1SSyZ53XVtj7XwA2">A Review of Time-Scale Modification of Music Signals — MDPI</a> [2, PDF]</li><li><a href="http://licensing.zplane.de/technology#elastique">Comparison of Elastique time stretching and pitch shifting algorithms</a> [3]</li><li><a href="https://steinberg.help/cubase_pro_artist/v9/en/cubase_nuendo/topics/audio_processing_and_functions/audio_processing_time_stretch_and_pitch_shift_elastique_r.html">Steinberg élastique algorithms overview</a> [4]</li><li><a href="https://steinberg.help/cubase_pro_artist/v9/en/cubase_nuendo/topics/audio_processing_and_functions/audio_processing_time_stretch_and_pitch_shift_standard_r.html">Steinberg Standard algorithms overview</a> [5]</li><li><a href="https://en.audiofanzine.com/pitch-shifter-time-stretcher/editorial/articles/time-stretching-pitch-shifting-comparison-part-i.html">Time Stretching &amp; Pitch Shifting: Comparison Part I</a></li><li><a href="https://en.wikipedia.org/wiki/Audio_time_stretching_and_pitch_scaling">Audio time stretching and pitch scaling — Wikipedia</a></li><li><a href="http://www.guitarpitchshifter.com/">Guitar Pitch Shifter — Introduction</a></li><li><a href="http://www.panix.com/~jens/pvoc-dolson.par">Jens Johansson The Phase Vocoder: A Tutorial</a></li><li><a href="http://blogs.zynaptiq.com/bernsee/time-pitch-overview/">Time Stretching And Pitch Shifting of Audio Signals — An Overview</a></li></ol><h4>Video References</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FE6YfxgYd6qQ%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DE6YfxgYd6qQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FE6YfxgYd6qQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/82c52b2d966b4d1cd22d7102dbc773d7/href">https://medium.com/media/82c52b2d966b4d1cd22d7102dbc773d7/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZR6IU7KgUPU%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZR6IU7KgUPU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZR6IU7KgUPU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/19cbf8a55f780fe772c60b7488fdeb23/href">https://medium.com/media/19cbf8a55f780fe772c60b7488fdeb23/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FJ6jSw8N0Ivo%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DJ6jSw8N0Ivo&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FJ6jSw8N0Ivo%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/90cf9fec72a86591fdff4133af2118cf/href">https://medium.com/media/90cf9fec72a86591fdff4133af2118cf/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FPP_crycALUk%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPP_crycALUk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FPP_crycALUk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/86da95e8d369bc448788b0f14d756e81/href">https://medium.com/media/86da95e8d369bc448788b0f14d756e81/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63f4d33804d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 2. Basic sound waves with C++ and JUCE]]></title>
            <link>https://olehch.medium.com/basic-sound-waves-with-c-and-juce-50ec9f0bfe5c?source=rss-3a1bbc0bac9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/50ec9f0bfe5c</guid>
            <category><![CDATA[music]]></category>
            <category><![CDATA[juce]]></category>
            <category><![CDATA[cpp]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[digital-signal-processing]]></category>
            <dc:creator><![CDATA[Oleh Chaplia]]></dc:creator>
            <pubDate>Thu, 18 Aug 2016 12:04:57 GMT</pubDate>
            <atom:updated>2023-11-13T18:04:01.585Z</atom:updated>
            <content:encoded><![CDATA[<p>In this tutorial, we’ll create a simple application with 4 different oscillators, which produce 4 basic sound wave types. Oscillators are function generators that produce sound waves with defined properties. Basic waveform types are in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*L97m9CObrdBxMKgHAfrFVA.png" /><figcaption>Different types of sound waves</figcaption></figure><p>Sine wave was used in my previous <a href="https://medium.com/@olehch/lets-write-a-simple-sine-wave-generator-with-c-and-juce-c8ab42d1f54f#.fzjz9wz9e">tutorial</a>. This application is based on an application from the previous tutorial. Therefore, you should know how to create components and handle audio output in <a href="https://www.juce.com/">JUCE</a>. I’ll clone the oscillator from the previous tutorial and add support to generate different sound wave types. In this tutorial, we will generate other 3 wave types and mix them.</p><h4>Algorithms for generating different wave types</h4><p>There are several ways to generate sound waves:</p><ul><li><strong>Formulas</strong>— math formulas</li><li><strong>Lookup table</strong>— a predefined table with input and output values.</li><li><strong>Polynomial Approx </strong>— This will estimate the sinusoid function using a predefined mathematical expression.</li></ul><p>In this project, I’ll use the first approach, formulas. Below are samples of code with implementation. Notes:</p><ul><li><strong>t</strong> — is a current time value</li><li><strong>level </strong>— amplitude (or volume of a signal)</li><li><strong>frequency </strong>— signal frequency set by the user</li><li><strong>phase </strong>— phase of a signal set by the user</li><li><strong>double_Pi</strong> — Pi number with double precision</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ixZDlGWIKDH19JGXYhPhBA.png" /><figcaption>waves.cpp</figcaption></figure><h4>How to mix them</h4><p>This is very easy. Let’s mix them:</p><blockquote>y(t) = sin(t) + saw(t) + triangle(t) + square(t)</blockquote><p>Oscilloscope and spectral views help visualize the sound. Square, saw, and triangle waves sound unclear because of many harmonics and other issues, but you should know how to generate them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*D9AHySm0yC9KX_qgyHby9Q.png" /><figcaption>Waves Generator Application</figcaption></figure><p>The source code is hosted on <a href="https://github.com/olehxch/simpleWavesGenerator">GitHub</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50ec9f0bfe5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>