GetMusicFreq
FreqValue = GetMusicFreq(Index)
 
Parameters:

    Index = The Index of Music you wish to query
Returns:

    FreqValue = The Freq of this music channel (0 to 44000)
 

THe GetMusicFreq() function will return the play back frequency of a Music channel.



FACTS:


* GetMusicFreq values range between 0 to 44000

* GetMusicFreq can read not the default frequency of loaded music. Only the frequency values the user has assigned with Music Freq.




Mini Tutorial:


This example will load a music file then change the playback frequency via a cosine wave.

  
; Set the app to run no faster than 30 frames per second
  SetFPS 30
  
; Ask PlayBASIC for the Music Index that is currently free for use.
  MyMusic=GetFreeMusic()
  
; Load a Sound File into this Free Music
  LoadMusic "..\..\..\sfx\out.wav",MyMusic
  
;  Play the Music
  PlayMusic MyMusic
  
  
; Start a Do/loop
  Do
   ;Clear the Screen to black
     Cls RGB(0,0,0)
     
   ; display a message
     Print "Music Freq Is Panning"
     
   ; Bump the Angle# variable by 1
     angle#=WrapAngle(angle#,5)
     
   ; Bend the music freq by a sine wave.
     MusicFreq MyMusic,22000+CosRadius(angle#,22000)
     
   ; Display the Music curremt Freq value
     Print GetMusicFreq(MyMusic)
     
     If GetMusicPlaying(MyMusic)=0
        PlayMusic MyMusic
        angle#=0
     EndIf
     
   ; display the screen
     Sync
   ; Loop back to the DO statement.
  Loop
  
  




 
Related Info: DeleteMusic | GetFreeMusic | LoadMusic | LoopMusic | MusicFreq | MusicPan | MusicVolume | PlayMusic | StopMusic :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com