Year 2023

Mastering absolute/relative file path conversions in Pascal in a cross-platform way

In this post, I'll discuss how to handle file paths in Pascal in a cross-platform manner. I have newly written the following functions, because I often encountered problems with the Delphi and FreePascal own appropriate functions in terms of cross-platform difficulties. So I reinvented the wheel out of necessity, but for the cross-platform special case, where each build variant must also support the each other path convention. Specifically, I'll focus on converting between relative and absolute paths, expanding relative paths, including handling UNC paths and so on. I'll also provide an in-depth analysis of each function, detailing the logic and edge cases they handle. So, let's get started.

IsPathSeparator

The IsPathSeparator function checks if a character is a path separator. It considers '/' and '\' as path separators. This fundamental function forms the basis for parsing the paths in the following functions, and is crucial for ensuring cross-platform compatibility. It's implemented as a function rather … (read more)

Vulkan memory management in PasVulkan

Memory management in Vulkan is a complex and intricate process that gives developers control over how graphics memory is allocated and used. The primary principle of Vulkan’s memory management is that it offers a lower-level interface to the GPU than APIs like OpenGL, entrusting developers with the responsibility of managing memory allocations themselves. This can lead to more efficient use of memory and enhanced performance, but it also necessitates a deeper understanding of how the GPU operates and the optimal way to manage its resources.

In Vulkan, memory is organized in a hierarchy that includes heaps, memory types, and memory property flags. Heaps are fixed-size memory resources exposed by the device, and each heap can support different memory types. When creating a resource like a buffer, Vulkan provides information about which memory types are compatible with that resource. Depending on the resource’s usage flags, the developer must select the right memory type and, based on that type, the … (read more)

Why Object Pascal is More Than Meets the Eye: Exploring the Power and Versatility of Delphi and FreePascal

1. About Object Pascal

If you aren't familiar with Object Pascal, you might not know that it's been around for decades - and it's still going strong. Object Pascal is a programming language evolved from Pascal that has been used to create a variety of software applications, including desktop and mobile apps, as well as games. Despite its capabilities, many developers and programmers tend to regard Object Pascal as an inferior language, and it is often the subject of jokes and ridicule.

2. Reasons why Object Pascal is seen as inferior

One of the main reasons that Object Pascal is seen as inferior is that it is not as widely used as other languages, such as C, C++, Rust and so on. This lack of popularity can make it difficult for developers to find resources and support when working with Object Pascal, which can be frustrating and time-consuming.

Another reason that Object Pascal is often criticized is that it is associated with older, legacy systems. Many developers view Object Pascal as a "dated" language that … (read more)

Approaches for timing in digital audio workstations (DAWs)

Today I want to write something about my still not released Digital Audio Workstation (DAW), namely about the timing within such a Digital Audio Workstation (DAW). 

Two approaches for timing in digital audio workstations (DAWs), at least as I have implemented them myself, are "MIDI-Time-Interval-per-Sample" and "Sample-Interval-per-MIDI-Time". 

The first "MIDI-Time-Interval-per-Sample" approach uses a 32.32bit fixed-point (with 64.64bit precalculations of some constants) value to represent the interval of MIDI time units per sample. It tracks the accumulated MIDI time by adding this interval to an accumulator for each sample processed. When the accumulator reaches a certain threshold, a MIDI event is processed and the accumulator is updated. With this approach it is also possible to determine a fractitional portion of the MIDI time unit, which can then be used for even more precise automation interpolation, for example.

The second "Sample-Interval-per-MIDI-Time" approach uses also a 32.32bit fixed-point … (read more)