Year 2020

A brief insight in my my singable Text-To-Speech engine

(Hint: Here in this text is the word phone the phonetic phone, and not a phone device. And please do not confuse a phonetic phone with a phonetic phoneme, which is indeed something similar to a phonetic phone)
 
Today I'm going to tell you about my singable Text-To-Speech engine, which I also integrated into my own DAW. For simplicity's sake, I will primarily explain how MIDI events become the phone information data including f0 fundamental frequency envelopes, which my implementation of the MBROLA algorithm can process directly without re-parsing. And since a company is interested in my technology, where the DAW, which is quite well known, is also implemented in Object Pascal, I will not provide a code snippet this time. Let's start with the explanation of the procedure.

The first step is to extract all lyric text MIDI events from the remaining MIDI events and put them into a separate array, where each lyric text item has three fields, a text UTF8 string, a start time position 64-bit integer and an end time … (read more)

Interval-tree-less interval search on sorted array of linked MIDI events

Today I will tell you a trick to search an linear pre-sorted array of matching linked MIDI events with an interval without using an interval tree.

Each NoteOn MIDI event has a link pointer to its next NoteOff MIDI event, and each NoteOff MIDI event has a link pointer to its previous NoteOn MIDI event. This is important, because we'll stepping back in time while the search on the base on this interlink-information.

First we'll start at the interval start time with a help of a simple binary search, traverse the array until we'll either hit the interval end time or find a interlink-connection-information for stepping back in the time as new interval start time for a new second iteration (only a single next one!) for to get the full requested interval range.

This is now described here in a very simplified way, but as code it would look like this:  https://gist.github.com/BeRo1985/3c50be6480c77dfb320c23f4d88d2f10

The piano roll editor in my DAW project is based on this interval-tree-less interval search of MIDI … (read more)

Arithmetic right shift in Delphi

A little tip if you do need a "Arithmetic shift right" operation in Delphi:

function SARLongint(Value,Shift:longint):longint;
{$if defined(cpu386)}assembler; register;
asm
 mov ecx,edx
 sar eax,cl
end;
{$elseif defined(cpux64)} assembler;
asm
{$if defined(Windows) or defined(Win32) or defined(Win64)}
 mov eax,ecx
 mov ecx,edx
 sar eax,cl
{$else}
 push rcx
 mov eax,edi
 mov ecx,esi
 sar eax,cl
 pop rcx
{$ifend}
end;
{$else}
begin
 Shift:=Shift and 31;
 result:=(longword(Value) shr Shift) or (longword(longint(longword(0-longword(longword(Value) shr 31)) and longword(0-longword(ord(Shift<>0) and 1)))) shl (32-Shift));
end;
{$ifend}