[C++] beep tone (frequency, duration [, loudness]) -> -> audio out?

hi,
has someone got an idea how to generate tones (C/C++) for a beep command e.g.,
beep (frequency, duration [, loudness])
and output to standard audio out?
(audio out as current settings by system preferences or manually adjusted, either headphone jacks or HDMI or USB soundcard or automatic)

e.g., something like the former NXC command PlayTone() ?

#define d6 1175
#define e6 1319
#define f6 1397
#define g6 1568
#define a6 1760
#define h6 1976

task main()
{
   PlayTone(d6, 400);  Wait(500);
   PlayTone(e6, 400);  Wait(500);
   PlayTone(f6, 400);  Wait(500);
   PlayTone(g6, 400);  Wait(500);
   PlayTone(a6, 800);  Wait(900);
   PlayTone(a6, 800);  Wait(900);
   PlayTone(h6, 400);  Wait(500);
   PlayTone(h6, 400);  Wait(500);
   PlayTone(h6, 400);  Wait(500);
   PlayTone(h6, 400);  Wait(500);
   PlayTone(a6, 800);  Wait(900);
}

That would be handled on the Raspberry Pi, independent of the BrickPi. Start by looking at this thread, and try using google if you don’t find what you need.

I already used Google and searched through different forums, but also in the topic you linked to I cannot see a solution yet. (I also found already your link recently.)
So finally you also don’t know a solution and also no different Raspi users in this forum… ? :-/