Buchempfehlung
MySQL kurz & gut
MySQL kurz & gut
Das preiswerte Taschen- buch stellt MySQL-rele- vante Inhalte systematisch und knapp dar, sodass es sich optimal zum Nach- schlagen beim Pro- grammieren eignet. [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

Software-Synthesizer?

Uploader:MitgliedPMedia
Datum/Zeit:13.10.2007 18:42:35

#include once "fmod.bi"
#include once "fbgfx.bi"

Const BufLen = 800
Const False  = 0
Const True   = Not False
Const flags=(&h2 Or &h00000008 Or &h00000020 Or &h00000080 Or &h00008000 Or &h00010000)

Dim tempbuffer As Zstring * buflen
Dim Shared Freq As Long =440
Dim Shared Handle As Long Ptr,Chn As Long
Dim Shared As Short LoopOn, LoopOff
Dim I As Integer, lent as integer
Dim OldFreq as Long, Vol As Long
Dim X As Integer
Screen 18, 32

If( FSOUND_GetVersion() < FMOD_VERSION ) Then
    Print  "FMOD version " & FMOD_VERSION & " or greater required"
    Sleep
    End
End If

If( FSOUND_Init(44100, 8, 0) = FALSE ) Then
    Print  "Can't initialize FMOD"
    Sleep
    End
End If

Randomize Timer
For i = 0 to 800
  'TempBuffer += Chr((rnd*255)+1)
  'Diese Formel für das Sample bearbeiten
  TempBuffer += Chr(i ^ 2)
Next


LoopOff = Len(TempBuffer)


Handle=FSOUND_Sample_Load(-1 ,Byval Varptr(tempbuffer),flags,0,LoopOff-LoopOn)
Chn=FSOUND_PlaySound (-1,Handle)
i = 1
Cls
For x = 0 to 640 Step (640 / len(TempBuffer))
    Line (X - (640 / len(TempBuffer)), Asc(Mid(TempBuffer, i-1, 1))+16) - (X, Asc(Mid(TempBuffer, i, 1))+16), &hFFFFFF
    i += 1
next
Do
  FSOUND_SetFrequency Chn,Freq
  FSOUND_SetVolume Chn, Vol
  Sleep 10
  locate 1,1
  print str(freq) + "   "
  oldfreq = freq
  If Multikey(fb.sc_q) then freq = 440
  If Multikey(fb.sc_w) then freq = 540
  If Multikey(fb.sc_e) then freq = 640
  If Multikey(fb.sc_r) then freq = 740
  If Multikey(fb.sc_t) then freq = 840
  If Multikey(fb.sc_y) then freq = 940
  If Multikey(fb.sc_u) then freq = 1040
  If Multikey(fb.sc_i) then freq = 1140
  If Multikey(fb.sc_o) then freq = 1240
  If Multikey(fb.sc_p) then freq = 1340

  If Multikey(fb.sc_a) then freq = 1440
  If Multikey(fb.sc_s) then freq = 1540
  If Multikey(fb.sc_d) then freq = 1640
  If Multikey(fb.sc_f) then freq = 1740
  If Multikey(fb.sc_g) then freq = 1840
  If Multikey(fb.sc_h) then freq = 1940
  If Multikey(fb.sc_j) then freq = 2040
  If Multikey(fb.sc_k) then freq = 2140
  If Multikey(fb.sc_l) then freq = 2240

  If Multikey(fb.sc_z) then freq = 2340
  If Multikey(fb.sc_x) then freq = 2440
  If Multikey(fb.sc_c) then freq = 2540
  If Multikey(fb.sc_v) then freq = 2640
  If Multikey(fb.sc_b) then freq = 2740
  If Multikey(fb.sc_n) then freq = 2840
  If Multikey(fb.sc_m) then freq = 2940

  If multikey(fb.sc_plus) Then
    freq += 100
  ElseIf multikey(fb.sc_Minus) Then
    freq -= 100
  End If
  If Freq < 20 then freq = 20

  If Freq <> OldFreq then
      Vol = 200
  End If
  Vol -= 10

Loop Until Multikey(fb.sc_escape)
Open "last-sound.txt" for output as #1
print #1, tempbuffer
close #1
FSOUND_Close