Autor Beitrag
jsbach
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 53

Win XP
D5 Ent
BeitragVerfasst: So 13.02.05 20:44 
Hallo zusammen,

wie kann man in Delphi einfache Töne erzeugen? In meinem alten Basicdialekt gab es einen eigenen Befehl dafür. Man konnte einfach die Frequenz, Wellenform und Tonlänge angeben.
Geht es in Delphi ähnlich einfach? Noch besser wäre es wenn ich direkt Sounds ansprechen könnte, z.B. einen Pianoklang.
Ich bin für jede Anregung dankbar, da ich ein Delphi-Neuling bin.

Tschau, Mike

P.S.: Ich möchte ein Programm schreiben, dass automatisch Fugen im Stil Bach´s generiert.
Existiert villeicht schon solch ein Programm?
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: So 13.02.05 21:19 
Moin :)!

Unter XP erzeugst du gar keine Töne, XP wertet das als direkten Hardarezugriff und dein Programm stürzt (meist) mit einer netten Access Violation ab ;)

AXMD
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 13.02.05 22:02 
Für Pianoklänge würde ich Dir die MIDI-API empfehlen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Elite
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 13.02.05 22:05 
Wenn es ganz schlicht sein soll, versuche mal
ausblenden Delphi-Quelltext
1:
windows.beep(100, 200);					

Der eine Paremeter ist die Frequenz, der andere die Dauer in ms. Wei nur nicht mehr welcher was ist. :gruebel:
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 13.02.05 23:47 
Die Parameter liegen in der Reihenfolge, in der Du sie genannt hast:
Erst Frequenz, dann Dauer.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mo 14.02.05 19:35 
Das ist ja geradezu klassisch ;)

Wie müsste man aber vorgehen, um so etwas wie einen Sythesizer zu bauen?
Ich glaube oft wird ja die FMOD Bibliothek genutzt, aber wie geht das am direktesten? DirectSound?

Keine Angst, ist nur interessehalber(bin ja nicht größenwahnsinnig ;)) hat da einer vielleicht einen Link?
galagher
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2562
Erhaltene Danke: 46

Windows 10 Home
Delphi 10.1 Starter, Lazarus 2.0.6
BeitragVerfasst: Di 15.02.05 22:12 
digi_c hat folgendes geschrieben:
hat da einer vielleicht einen Link?

www.delphi-fundgrube.de/faq13.htm
Vieleicht hilft dir das weiter!

_________________
gedunstig war's - und fahle wornen zerschellten karsig im gestrock. oh graus, es gloomt der jabberwock - und die graisligen gulpen nurmen!
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Di 15.02.05 22:34 
AXMD hat folgendes geschrieben:
Moin :)!

Unter XP erzeugst du gar keine Töne, XP wertet das als direkten Hardarezugriff und dein Programm stürzt (meist) mit einer netten Access Violation ab ;)

AXMD


hä, und was soll dann das sein? :shock: :wink:
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Di 15.02.05 22:43 
Karlson hat folgendes geschrieben:
AXMD hat folgendes geschrieben:
Moin :)!

Unter XP erzeugst du gar keine Töne, XP wertet das als direkten Hardarezugriff und dein Programm stürzt (meist) mit einer netten Access Violation ab ;)

AXMD


hä, und was soll dann das sein? :shock: :wink:


SetPort etc. ruft die AV hervor ;) Versuchs einfach mal ;)

AXMD
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 16.02.05 00:45 
Ich habe es bereits probiert, es gibt nichts geileres wenn ein freund bei einem ist:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
go;
for i := 1 to 20000 do
 Windows.beep(i, 1);
goto go;


auch cool ist:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
begin
a := false;
while a do
 begin
  b := Random(2000)+1;
  Windows.Beep(b,50);
 end;
end;



"Hör mal, mein PC macht voll die krassen geräusche. Ich glaub die HD ist kaputt!" :mrgreen:

Aber ich gebe mich trotzdem geschlagen, benutze nämlich Win2k ;)

Dann sollten die Schweizer aber mal das xp aus dem Header nehmen, aber gut, die sind ja immer etwas langsamer :mrgreen: *joke*
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Mi 16.02.05 05:24 
Zitat:

Dann sollten die Schweizer aber mal das xp aus dem Header nehmen, aber gut, die sind ja immer etwas langsamer :mrgreen: *joke*


Ich an deiner Stelle würde zuerst mal den Source Code richtig anschauen. :roll:
Der funktioniert sowohl unter XP als auch Win9x...
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 16.02.05 06:50 
Du könntest auch die Bass.dll nehmen:
www.un4seen.com/ (links auf "Bass", dann oben rechts auf "Download")

Da ist ein nettes Beispiel dabei, wie du einen Stream erzeugst und du kannste die Frequenz und Amplitude ändern. Das Beispiel heißt Stream-Test und Du kannst von Frequenz 1Hz bis zu 5KHz hochdrehen. Aber Achtung, 5KHz geht ganz schön auf die Nerven :wink: .

Wenn du dann einen Synthezizer machen willst, machst du z.B. verschiedene Buttons, die die Frequenzen ändern und den Ton kurz abspielen lassen. Schon hättest du einen kleinen Synthezizer.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 16.02.05 13:50 
toms hat folgendes geschrieben:
Zitat:

Dann sollten die Schweizer aber mal das xp aus dem Header nehmen, aber gut, die sind ja immer etwas langsamer :mrgreen: *joke*


Ich an deiner Stelle würde zuerst mal den Source Code richtig anschauen. :roll:
Der funktioniert sowohl unter XP als auch Win9x...


Dann würde ich an deiner Stelle mal den Thread richtig lesen :evil:
Ich war der Meinung das der Code funktioniert.
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Mi 16.02.05 20:58 
@galagher: Dankeschön, scheint bissel alt aber interessante Grundlage :D