Wow, I fell behind.
This commit is contained in:
@@ -1171,7 +1171,7 @@ sm-ssc v1.0 Public Beta 2 | 20100331
|
|||||||
20100309
|
20100309
|
||||||
--------
|
--------
|
||||||
* [ScreenSelectMaster] Add GetSelectionIndex(pn) Lua binding. (You'll have to
|
* [ScreenSelectMaster] Add GetSelectionIndex(pn) Lua binding. (You'll have to
|
||||||
call this one using GAMESTATE:GetTopScreen():GetSelectionIndex(PLAYER_1) or
|
call this one using SCREENMAN:GetTopScreen():GetSelectionIndex(PLAYER_1) or
|
||||||
something like that.)
|
something like that.)
|
||||||
|
|
||||||
20100308
|
20100308
|
||||||
@@ -1246,7 +1246,6 @@ helper functions available to you in scripts via the fallback theme, either. :)
|
|||||||
--------
|
--------
|
||||||
* [Player] CheckpointsFlashOnHold metric added. Fixes issue 16.
|
* [Player] CheckpointsFlashOnHold metric added. Fixes issue 16.
|
||||||
|
|
||||||
|
|
||||||
20100222
|
20100222
|
||||||
--------
|
--------
|
||||||
* [CodeDetector] NextBannerGroup and NextBannerGroup2 were previously used
|
* [CodeDetector] NextBannerGroup and NextBannerGroup2 were previously used
|
||||||
|
|||||||
@@ -8,6 +8,11 @@ ________________________________________________________________________________
|
|||||||
StepMania 5.0 Preview 3 | 20110???
|
StepMania 5.0 Preview 3 | 20110???
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
2011/07/31
|
||||||
|
----------
|
||||||
|
* [ScreenGameplay, LyricDisplay] Stop lyrics from animating on failure.
|
||||||
|
Fixes issue 298. [AJ]
|
||||||
|
|
||||||
2011/07/30
|
2011/07/30
|
||||||
----------
|
----------
|
||||||
* [ProfileManager] Fix an issue when deleting recently created profiles. [AJ]
|
* [ProfileManager] Fix an issue when deleting recently created profiles. [AJ]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ The following is a list of known issues with StepMania 5.
|
|||||||
|
|
||||||
* Hidden, Sudden, Stealth, and RandomVanish do not work with layered
|
* Hidden, Sudden, Stealth, and RandomVanish do not work with layered
|
||||||
note skins. Random Vanish, in particular, has caused crashes.
|
note skins. Random Vanish, in particular, has caused crashes.
|
||||||
* The course editor is not working completley.
|
* The course editor is not working completely.
|
||||||
* The scoring system needs to be made global for the game instead
|
* The scoring system needs to be made global for the game instead
|
||||||
of tying it to the theme. Right now, this is causing a number
|
of tying it to the theme. Right now, this is causing a number
|
||||||
of themes to have no score display during gameplay.
|
of themes to have no score display during gameplay.
|
||||||
|
|||||||
@@ -148,20 +148,3 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
The MAD library (included with most Windows binary distributions), and
|
The MAD library (included with most Windows binary distributions), and
|
||||||
interface code in RageSoundReader_MP3, is under the GPL, available in
|
interface code in RageSoundReader_MP3, is under the GPL, available in
|
||||||
Copying.MAD. Support for this library can be disabled at compile-time.
|
Copying.MAD. Support for this library can be disabled at compile-time.
|
||||||
|
|
||||||
******************************************************************************
|
|
||||||
|
|
||||||
NotesLoaderMidi contains code from STK under the following license:
|
|
||||||
|
|
||||||
Copyright 2003 Gary P. Scavone
|
|
||||||
|
|
||||||
LEGAL AND ETHICAL:
|
|
||||||
|
|
||||||
This software was designed and created to be made publicly available for
|
|
||||||
free, primarily for academic purposes, so if you use it, pass it on with
|
|
||||||
this documentation, and for free.
|
|
||||||
|
|
||||||
On April 19 2007, StepMania was granted an MIT license by Gary Scavone
|
|
||||||
for any STK code on the condition that all of the the STK
|
|
||||||
credits/disclaimers/copyrights from the README are retained in the
|
|
||||||
source code and in the project documentation.
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
sm-ssc Beginner's Guide
|
StepMania 5 Beginner's Guide
|
||||||
Written and edited by the spinal shark collective
|
Written and edited by the spinal shark collective
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Table of Contents
|
Table of Contents
|
||||||
@@ -14,15 +14,15 @@ Table of Contents
|
|||||||
2.3.1 Installing Song Files
|
2.3.1 Installing Song Files
|
||||||
2.3.2 Installing Noteskins/New Gametypes
|
2.3.2 Installing Noteskins/New Gametypes
|
||||||
2.3.3 Installing Themes
|
2.3.3 Installing Themes
|
||||||
3. sm-ssc
|
3. StepMania 5
|
||||||
================================================================================
|
================================================================================
|
||||||
Chapter 1: Introduction
|
Chapter 1: Introduction
|
||||||
================================================================================
|
================================================================================
|
||||||
Welcome to the sm-ssc Beginner's Guide. This guide is primarily meant for people
|
Welcome to the StepMania 5 Beginner's Guide. This guide is primarily meant for
|
||||||
who do not have any previous experience with StepMania, but also includes
|
people who do not have any previous experience with StepMania, but also includes
|
||||||
information on how sm-ssc differs from StepMania. If you already know what
|
information on how SM5 differs from previous StepMania versions. If you already
|
||||||
StepMania is, and the basics of adding things to an install, you can skip ahead
|
know what StepMania is, and the basics of adding things to an install, you can
|
||||||
to Chapter 3: sm-ssc. Otherwise, read on.
|
skip ahead to Chapter 3: StepMania 5. Otherwise, read on.
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
Chapter 2: StepMania
|
Chapter 2: StepMania
|
||||||
@@ -372,8 +372,9 @@ When in doubt, read any documentation that comes with the theme for proper
|
|||||||
installation instructions.
|
installation instructions.
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
Chapter 3: sm-ssc
|
Chapter 3: StepMania 5
|
||||||
================================================================================
|
================================================================================
|
||||||
sm-ssc is a fork of the current StepMania codebase. It is focused on adding
|
The modern StepMania 5 originally began life as sm-ssc, a fork of StepMania 4
|
||||||
features for theming, but also tries to make the process of dealing with
|
alpha 5 (later renamed to StepMania 5 after the reboot of SM4). sm-ssc was a fork
|
||||||
StepMania a little easier.
|
focused on adding features for theming, but also tried to make the process of
|
||||||
|
dealing with StepMania a little easier.
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[IMPORTANT INSTALL NOTE]
|
[IMPORTANT INSTALL NOTE]
|
||||||
If you are using Windows Vista or Windows 7, please do not install StepMania SSC into the Program Files directory.
|
If you are using Windows Vista or Windows 7, please do not install StepMania 5 into the Program Files directory.
|
||||||
|
|
||||||
[Using Google Chrome?]
|
[Using Google Chrome?]
|
||||||
If you are using Google Chrome as your primary web browser, you will have to perform some extra steps to get stepmania:// URI handling to work:
|
If you are using Google Chrome as your primary web browser, you will have to perform some extra steps to get stepmania:// URI handling to work:
|
||||||
|
|||||||
@@ -15,3 +15,6 @@ http://x-raise.cjb.net/bpm.html
|
|||||||
|
|
||||||
marfitude [GPL license]
|
marfitude [GPL license]
|
||||||
http://www.erestar.net/games/marfitude/
|
http://www.erestar.net/games/marfitude/
|
||||||
|
|
||||||
|
Kick it Up [unknown license]
|
||||||
|
http://club.paran.com/club/home.do?clubid=prg-bbsView.do?menuno=7209-clubno=291-bbs_no=0L6DV
|
||||||
@@ -212,10 +212,11 @@ local function GetSpeedMods()
|
|||||||
|
|
||||||
local playerMods = {}
|
local playerMods = {}
|
||||||
for pn in ivalues(GAMESTATE:GetHumanPlayers()) do
|
for pn in ivalues(GAMESTATE:GetHumanPlayers()) do
|
||||||
-- file loading logic per player;
|
-- file loading logic per player.
|
||||||
-- only bother if it's not the machine profile though.
|
if PROFILEMAN:IsPersistentProfile(pn) then
|
||||||
if PROFILEMAN:IsPersistentProfile(pn) or
|
playerMods[#playerMods+1] = ParseSpeedModFile(profileDirs[pn]..baseFilename)
|
||||||
MEMCARDMAN:GetCardState(pn) == 'MemoryCardState_ready' then
|
-- we need to make sure the memory card is ready if we're gonna grab from it.
|
||||||
|
elseif MEMCARDMAN:GetCardState(pn) == 'MemoryCardState_ready' then
|
||||||
playerMods[#playerMods+1] = ParseSpeedModFile(profileDirs[pn]..baseFilename)
|
playerMods[#playerMods+1] = ParseSpeedModFile(profileDirs[pn]..baseFilename)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -31,10 +31,18 @@ void LyricDisplay::Init()
|
|||||||
m_iCurLyricNumber = 0;
|
m_iCurLyricNumber = 0;
|
||||||
|
|
||||||
m_fLastSecond = -500;
|
m_fLastSecond = -500;
|
||||||
|
m_bStopped = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LyricDisplay::Stop() {
|
||||||
|
m_bStopped = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LyricDisplay::Update( float fDeltaTime )
|
void LyricDisplay::Update( float fDeltaTime )
|
||||||
{
|
{
|
||||||
|
if( m_bStopped )
|
||||||
|
return;
|
||||||
|
|
||||||
ActorFrame::Update( fDeltaTime );
|
ActorFrame::Update( fDeltaTime );
|
||||||
|
|
||||||
if( GAMESTATE->m_pCurSong == NULL )
|
if( GAMESTATE->m_pCurSong == NULL )
|
||||||
|
|||||||
@@ -13,10 +13,14 @@ public:
|
|||||||
// Call when song changes:
|
// Call when song changes:
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
|
// Call on song failed:
|
||||||
|
void Stop();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BitmapText m_textLyrics[2];
|
BitmapText m_textLyrics[2];
|
||||||
unsigned m_iCurLyricNumber;
|
unsigned m_iCurLyricNumber;
|
||||||
float m_fLastSecond;
|
float m_fLastSecond;
|
||||||
|
bool m_bStopped;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,386 +0,0 @@
|
|||||||
#include "global.h"
|
|
||||||
#include "PitchDetectionTest.h"
|
|
||||||
#include "PitchDetectionTestUtil.h"
|
|
||||||
#include "srpd.h"
|
|
||||||
#include "EST_filter.h"
|
|
||||||
#include "RageLog.h"
|
|
||||||
#include "RageUtil.h"
|
|
||||||
#include "NoteTypes.h"
|
|
||||||
#include <MMSystem.h>
|
|
||||||
|
|
||||||
MicrophoneStatus PitchDetectionTest::s_ms;
|
|
||||||
Microphone *PitchDetectionTest::s_pMicrophone = NULL;
|
|
||||||
|
|
||||||
#define MAX_BUFFERS 3
|
|
||||||
|
|
||||||
// http://tomscarff.tripod.com/midi_analyser/midi_note_frequency.htm
|
|
||||||
// http://musicdsp.org/showone.php?id=125
|
|
||||||
const float MIDI_A4_FREQUENCY = 440.0;
|
|
||||||
const int MIDI_A4_NUMBER = 69;
|
|
||||||
const int MIDI_C4_NUMBER = 60; // middle C
|
|
||||||
const RString NOTE_NAME[MIDI_NOTES_PER_OCTAVE] = {"A ","A#","B ","C ","C#","D ","D#","E ","F ","F#","G ","G#"};
|
|
||||||
|
|
||||||
float MidiNoteToFreq( int iMidiNote )
|
|
||||||
{
|
|
||||||
return MIDI_A4_FREQUENCY * powf( 2.0, ((float)iMidiNote - MIDI_A4_NUMBER) / MIDI_NOTES_PER_OCTAVE );
|
|
||||||
}
|
|
||||||
|
|
||||||
float log2f( float n )
|
|
||||||
{
|
|
||||||
// logb (x) = (loga(x)) / (loga(B))
|
|
||||||
return logf(n) / logf(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool FreqToMidiNote( float fFreq, float &fMidiNoteOut )
|
|
||||||
{
|
|
||||||
if( fFreq < 20 ) // well below A0 (MidiNote = 1)
|
|
||||||
return false;
|
|
||||||
fMidiNoteOut = MIDI_NOTES_PER_OCTAVE * log2f( fFreq / MIDI_A4_FREQUENCY) + MIDI_A4_NUMBER;
|
|
||||||
return fMidiNoteOut >= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef bool
|
|
||||||
|
|
||||||
bool PitchDetectionTest::MidiNoteToString( int iMidiNote, RString &sMidiNoteOut )
|
|
||||||
{
|
|
||||||
if( iMidiNote < 1 )
|
|
||||||
return false;
|
|
||||||
int iDiff = iMidiNote - MIDI_A4_NUMBER;
|
|
||||||
wrap( iDiff, MIDI_NOTES_PER_OCTAVE );
|
|
||||||
sMidiNoteOut = NOTE_NAME[iDiff];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MidiNoteToOctave( int iMidiNote, int &iOctaveOut )
|
|
||||||
{
|
|
||||||
if( iMidiNote < 1 )
|
|
||||||
return false;
|
|
||||||
// middle C is start of octave 4.
|
|
||||||
int iOctave = (int)floorf( ((float)iMidiNote - MIDI_C4_NUMBER) / MIDI_NOTES_PER_OCTAVE );
|
|
||||||
iOctaveOut = iOctave + 4;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool MidiNoteToStringAndOctave( int iMidiNote, RString &sMidiNoteOut )
|
|
||||||
{
|
|
||||||
if( !PitchDetectionTest::MidiNoteToString(iMidiNote, sMidiNoteOut) )
|
|
||||||
return false;
|
|
||||||
int iOctave;
|
|
||||||
if( !MidiNoteToOctave(iMidiNote, iOctave) )
|
|
||||||
return false;
|
|
||||||
sMidiNoteOut += ssprintf("%d",iOctave);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float PitchDetectionTest::WrapToNearestOctave( float fMidiNote, float fTargetMidiNote )
|
|
||||||
{
|
|
||||||
float fDiff = fMidiNote - fTargetMidiNote;
|
|
||||||
fDiff += MIDI_NOTES_PER_OCTAVE / 2;
|
|
||||||
wrap( fDiff, (float)MIDI_NOTES_PER_OCTAVE );
|
|
||||||
fDiff -= MIDI_NOTES_PER_OCTAVE / 2;
|
|
||||||
float fRet = fTargetMidiNote + fDiff;
|
|
||||||
return fRet;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CALLBACK waveInProc(HWAVEIN hwi,UINT uMsg,DWORD dwInstance,DWORD dwParam1,DWORD dwParam2);
|
|
||||||
|
|
||||||
class MicrophoneImpl
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
HWAVEIN m_hWaveIn;
|
|
||||||
WAVEFORMATEX m_stWFEX;
|
|
||||||
WAVEHDR m_stWHDR[MAX_BUFFERS];
|
|
||||||
DetectPitch m_dp;
|
|
||||||
HMMIO m_hOPFile;
|
|
||||||
MMIOINFO m_stmmIF;
|
|
||||||
MMCKINFO m_stckOut,m_stckOutRIFF;
|
|
||||||
|
|
||||||
static MicrophoneImpl *s_pMicrophoneImpl; // one and only for the callback function to use
|
|
||||||
|
|
||||||
|
|
||||||
void Init()
|
|
||||||
{
|
|
||||||
m_hWaveIn=NULL;
|
|
||||||
ZeroMemory(&m_stWFEX,sizeof(WAVEFORMATEX));
|
|
||||||
ZeroMemory(m_stWHDR,MAX_BUFFERS*sizeof(WAVEHDR));
|
|
||||||
s_pMicrophoneImpl = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FillDevices()
|
|
||||||
{
|
|
||||||
WAVEINCAPS stWIC={0};
|
|
||||||
|
|
||||||
UINT nDevices=waveInGetNumDevs();
|
|
||||||
|
|
||||||
for(UINT nC1=0;nC1<nDevices;++nC1)
|
|
||||||
{
|
|
||||||
ZeroMemory(&stWIC,sizeof(WAVEINCAPS));
|
|
||||||
MMRESULT mRes=waveInGetDevCaps(nC1,&stWIC,sizeof(WAVEINCAPS));
|
|
||||||
if(mRes==0)
|
|
||||||
LOG->Trace( stWIC.szPname );
|
|
||||||
else
|
|
||||||
FAIL_M("bad");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartRecording()
|
|
||||||
{
|
|
||||||
OpenDevice();
|
|
||||||
|
|
||||||
m_dp.Init( SAMPLES_PER_SEC );
|
|
||||||
|
|
||||||
PrepareBuffers();
|
|
||||||
MMRESULT mRes=waveInStart(m_hWaveIn);
|
|
||||||
if(mRes!=0)
|
|
||||||
FAIL_M("bad");
|
|
||||||
}
|
|
||||||
|
|
||||||
void StopRecording()
|
|
||||||
{
|
|
||||||
CloseDevice();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenDevice()
|
|
||||||
{
|
|
||||||
MMRESULT mRes=0;
|
|
||||||
|
|
||||||
m_stWFEX.nSamplesPerSec=SAMPLES_PER_SEC;
|
|
||||||
m_stWFEX.nChannels=1;
|
|
||||||
m_stWFEX.wBitsPerSample = 16;
|
|
||||||
m_stWFEX.wFormatTag=WAVE_FORMAT_PCM;
|
|
||||||
m_stWFEX.nBlockAlign=m_stWFEX.nChannels*m_stWFEX.wBitsPerSample/8;
|
|
||||||
m_stWFEX.nAvgBytesPerSec=m_stWFEX.nSamplesPerSec*m_stWFEX.nBlockAlign;
|
|
||||||
m_stWFEX.cbSize=sizeof(WAVEFORMATEX);
|
|
||||||
int device = 0;
|
|
||||||
|
|
||||||
WAVEINCAPS stWIC={0};
|
|
||||||
ZeroMemory(&stWIC,sizeof(WAVEINCAPS));
|
|
||||||
mRes=waveInGetDevCaps(device,&stWIC,sizeof(WAVEINCAPS));
|
|
||||||
if(mRes==0)
|
|
||||||
LOG->Trace( stWIC.szPname );
|
|
||||||
else
|
|
||||||
FAIL_M("bad");
|
|
||||||
|
|
||||||
|
|
||||||
mRes=waveInOpen(&m_hWaveIn,device,&m_stWFEX,(DWORD_PTR)waveInProc,(DWORD_PTR)this,CALLBACK_FUNCTION);
|
|
||||||
if(mRes!=MMSYSERR_NOERROR)
|
|
||||||
FAIL_M("bad");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const char *csT1 = "C:\\cvs\\stepmania\\speech-test.wav";
|
|
||||||
ZeroMemory(&m_stmmIF,sizeof(MMIOINFO));
|
|
||||||
DeleteFile((PCHAR)(LPCTSTR)csT1);
|
|
||||||
m_hOPFile=mmioOpen((PCHAR)(LPCTSTR)csT1,&m_stmmIF,MMIO_WRITE | MMIO_CREATE);
|
|
||||||
if(m_hOPFile==NULL)
|
|
||||||
FAIL_M("Can not open file...");
|
|
||||||
|
|
||||||
ZeroMemory(&m_stckOutRIFF,sizeof(MMCKINFO));
|
|
||||||
m_stckOutRIFF.fccType = mmioFOURCC('W', 'A', 'V', 'E');
|
|
||||||
mRes=mmioCreateChunk(m_hOPFile, &m_stckOutRIFF, MMIO_CREATERIFF);
|
|
||||||
if(mRes!=MMSYSERR_NOERROR)
|
|
||||||
{
|
|
||||||
FAIL_M("bad");
|
|
||||||
}
|
|
||||||
ZeroMemory(&m_stckOut,sizeof(MMCKINFO));
|
|
||||||
m_stckOut.ckid = mmioFOURCC('f', 'm', 't', ' ');
|
|
||||||
m_stckOut.cksize = sizeof(m_stWFEX);
|
|
||||||
mRes=mmioCreateChunk(m_hOPFile, &m_stckOut, 0);
|
|
||||||
if(mRes!=MMSYSERR_NOERROR)
|
|
||||||
{
|
|
||||||
FAIL_M("bad");
|
|
||||||
}
|
|
||||||
int nT1=mmioWrite(m_hOPFile, (HPSTR) &m_stWFEX, sizeof(m_stWFEX));
|
|
||||||
if(nT1!=sizeof(m_stWFEX))
|
|
||||||
{
|
|
||||||
FAIL_M("bad");
|
|
||||||
}
|
|
||||||
mRes=mmioAscend(m_hOPFile, &m_stckOut, 0);
|
|
||||||
if(mRes!=MMSYSERR_NOERROR)
|
|
||||||
{
|
|
||||||
FAIL_M("bad");
|
|
||||||
}
|
|
||||||
m_stckOut.ckid = mmioFOURCC('d', 'a', 't', 'a');
|
|
||||||
mRes=mmioCreateChunk(m_hOPFile, &m_stckOut, 0);
|
|
||||||
if(mRes!=MMSYSERR_NOERROR)
|
|
||||||
{
|
|
||||||
FAIL_M("bad");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PrepareBuffers()
|
|
||||||
{
|
|
||||||
MMRESULT mRes=0;
|
|
||||||
|
|
||||||
for(int nT1=0;nT1<MAX_BUFFERS;++nT1)
|
|
||||||
{
|
|
||||||
int iSampleCount = SAMPLES_PER_SEC / 60; // 60 times per second
|
|
||||||
int iBufferSizeBytes = iSampleCount*sizeof(short);
|
|
||||||
m_stWHDR[nT1].lpData=(LPSTR)HeapAlloc(GetProcessHeap(),8,iBufferSizeBytes);
|
|
||||||
m_stWHDR[nT1].dwBufferLength=iBufferSizeBytes;
|
|
||||||
m_stWHDR[nT1].dwUser=nT1;
|
|
||||||
mRes=waveInPrepareHeader(m_hWaveIn,&m_stWHDR[nT1],sizeof(WAVEHDR));
|
|
||||||
if(mRes!=0)
|
|
||||||
FAIL_M("bad");
|
|
||||||
mRes=waveInAddBuffer(m_hWaveIn,&m_stWHDR[nT1],sizeof(WAVEHDR));
|
|
||||||
if(mRes!=0)
|
|
||||||
FAIL_M("bad");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProcessHeader(WAVEHDR * pHdr)
|
|
||||||
{
|
|
||||||
//LOG->Trace("%d",pHdr->dwUser);
|
|
||||||
if(WHDR_DONE==(WHDR_DONE &pHdr->dwFlags))
|
|
||||||
{
|
|
||||||
//LOG->Trace("Got %d bytes of data", pHdr->dwBytesRecorded );
|
|
||||||
int iSampleCount = pHdr->dwBytesRecorded / sizeof(short);
|
|
||||||
m_dp.ReadOne( (short*)pHdr->lpData, iSampleCount );
|
|
||||||
|
|
||||||
mmioWrite(m_hOPFile,pHdr->lpData,pHdr->dwBytesRecorded);
|
|
||||||
MMRESULT mRes = waveInAddBuffer(m_hWaveIn,pHdr,sizeof(WAVEHDR));
|
|
||||||
if(mRes!=0)
|
|
||||||
FAIL_M("bad");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloseDevice()
|
|
||||||
{
|
|
||||||
MMRESULT mRes=0;
|
|
||||||
|
|
||||||
if(m_hWaveIn)
|
|
||||||
{
|
|
||||||
UnPrepareBuffers();
|
|
||||||
mRes=waveInClose(m_hWaveIn);
|
|
||||||
}
|
|
||||||
if(m_hOPFile)
|
|
||||||
{
|
|
||||||
mRes=mmioAscend(m_hOPFile, &m_stckOut, 0);
|
|
||||||
if(mRes!=MMSYSERR_NOERROR)
|
|
||||||
{
|
|
||||||
FAIL_M("bad");
|
|
||||||
}
|
|
||||||
mRes=mmioAscend(m_hOPFile, &m_stckOutRIFF, 0);
|
|
||||||
if(mRes!=MMSYSERR_NOERROR)
|
|
||||||
{
|
|
||||||
FAIL_M("bad");
|
|
||||||
}
|
|
||||||
mmioClose(m_hOPFile,0);
|
|
||||||
m_hOPFile=NULL;
|
|
||||||
}
|
|
||||||
m_hWaveIn=NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UnPrepareBuffers()
|
|
||||||
{
|
|
||||||
MMRESULT mRes=0;
|
|
||||||
|
|
||||||
if(m_hWaveIn)
|
|
||||||
{
|
|
||||||
mRes=waveInStop(m_hWaveIn);
|
|
||||||
for(int nT1=0;nT1<3;++nT1)
|
|
||||||
{
|
|
||||||
if(m_stWHDR[nT1].lpData)
|
|
||||||
{
|
|
||||||
mRes=waveInUnprepareHeader(m_hWaveIn,&m_stWHDR[nT1],sizeof(WAVEHDR));
|
|
||||||
HeapFree(GetProcessHeap(),0,m_stWHDR[nT1].lpData);
|
|
||||||
ZeroMemory(&m_stWHDR[nT1],sizeof(WAVEHDR));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GetStatus( MicrophoneStatus &out )
|
|
||||||
{
|
|
||||||
return m_dp.GetStatus( out );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
MicrophoneImpl *MicrophoneImpl::s_pMicrophoneImpl = NULL;
|
|
||||||
|
|
||||||
void CALLBACK waveInProc(HWAVEIN hwi,UINT uMsg,DWORD dwInstance,DWORD dwParam1,DWORD dwParam2)
|
|
||||||
{
|
|
||||||
switch(uMsg)
|
|
||||||
{
|
|
||||||
case WIM_CLOSE:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case WIM_DATA:
|
|
||||||
{
|
|
||||||
MicrophoneImpl::s_pMicrophoneImpl->ProcessHeader( (WAVEHDR *)dwParam1 );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case WIM_OPEN:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PitchDetectionTest::Update()
|
|
||||||
{
|
|
||||||
s_pMicrophone->GetStatus( s_ms );
|
|
||||||
}
|
|
||||||
|
|
||||||
void DoPitchDetectionTest()
|
|
||||||
{
|
|
||||||
MicrophoneImpl mr;
|
|
||||||
mr.Init();
|
|
||||||
mr.StartRecording();
|
|
||||||
|
|
||||||
//srpd2(); // do f0 tracking
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Microphone::Microphone()
|
|
||||||
{
|
|
||||||
m_pImpl = new MicrophoneImpl;
|
|
||||||
m_pImpl->Init();
|
|
||||||
m_pImpl->StartRecording();
|
|
||||||
}
|
|
||||||
Microphone::~Microphone()
|
|
||||||
{
|
|
||||||
m_pImpl->StopRecording();
|
|
||||||
SAFE_DELETE( m_pImpl );
|
|
||||||
}
|
|
||||||
|
|
||||||
void Microphone::GetStatus( MicrophoneStatus &out )
|
|
||||||
{
|
|
||||||
m_pImpl->GetStatus( out );
|
|
||||||
if( !FreqToMidiNote(out.fFreq, out.fMidiNote) )
|
|
||||||
out.fMidiNote = 0;
|
|
||||||
int iMidiNote = (int)roundf( out.fMidiNote );
|
|
||||||
if( !MidiNoteToStringAndOctave( iMidiNote, out.sMidiNote ) )
|
|
||||||
out.sMidiNote = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (c) 2007 Chris Danford
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
* copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, and/or sell copies of the Software, and to permit persons to
|
|
||||||
* whom the Software is furnished to do so, provided that the above
|
|
||||||
* copyright notice(s) and this permission notice appear in all copies of
|
|
||||||
* the Software and that both the above copyright notice(s) and this
|
|
||||||
* permission notice appear in supporting documentation.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
||||||
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
|
||||||
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
|
||||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
||||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
||||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
||||||
* PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
/* Microphone - Holdover from incomplete karaoke mode. */
|
|
||||||
|
|
||||||
#ifndef Microphone_H
|
|
||||||
#define Microphone_H
|
|
||||||
|
|
||||||
class MicrophoneImpl;
|
|
||||||
|
|
||||||
struct MicrophoneStatus
|
|
||||||
{
|
|
||||||
float fFreq;
|
|
||||||
float fMaxFreq;
|
|
||||||
bool bVoiced;
|
|
||||||
float fMidiNote;
|
|
||||||
RString sMidiNote;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Microphone
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Microphone();
|
|
||||||
~Microphone();
|
|
||||||
void GetStatus( MicrophoneStatus &out );
|
|
||||||
protected:
|
|
||||||
MicrophoneImpl *m_pImpl;
|
|
||||||
};
|
|
||||||
|
|
||||||
class PitchDetectionTest
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static MicrophoneStatus s_ms;
|
|
||||||
static Microphone *s_pMicrophone;
|
|
||||||
static void Update();
|
|
||||||
static bool MidiNoteToString( int iMidiNote, RString &sMidiNoteOut );
|
|
||||||
static float WrapToNearestOctave( float fMidiNote, float fTargetMidiNote );
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (c) 2004 Chris Danford
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
* copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, and/or sell copies of the Software, and to permit persons to
|
|
||||||
* whom the Software is furnished to do so, provided that the above
|
|
||||||
* copyright notice(s) and this permission notice appear in all copies of
|
|
||||||
* the Software and that both the above copyright notice(s) and this
|
|
||||||
* permission notice appear in supporting documentation.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
||||||
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
|
||||||
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
|
||||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
||||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
||||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
||||||
* PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,75 +0,0 @@
|
|||||||
/* PitchDetectionTestUtil - Holdover from incomplete karaoke mode. */
|
|
||||||
|
|
||||||
#ifndef PitchDetectionTestUtil_H
|
|
||||||
#define PitchDetectionTestUtil_H
|
|
||||||
|
|
||||||
enum EST_bo_t {bo_big, bo_little, bo_perq};
|
|
||||||
|
|
||||||
static int est_endian_loc = 1;
|
|
||||||
/* Sun, HP, SGI Mips, M68000 */
|
|
||||||
#define EST_BIG_ENDIAN (((char *)&est_endian_loc)[0] == 0)
|
|
||||||
/* Intel, Alpha, DEC Mips, Vax */
|
|
||||||
#define EST_LITTLE_ENDIAN (((char *)&est_endian_loc)[0] != 0)
|
|
||||||
#define EST_NATIVE_BO (EST_BIG_ENDIAN ? bo_big : bo_little)
|
|
||||||
#define EST_SWAPPED_BO (EST_BIG_ENDIAN ? bo_little : bo_big)
|
|
||||||
|
|
||||||
|
|
||||||
#define SAMPLES_PER_SEC 44100
|
|
||||||
|
|
||||||
struct Srpd_Op;
|
|
||||||
struct SEGMENT_;
|
|
||||||
struct CROSS_CORR_;
|
|
||||||
struct STATUS_;
|
|
||||||
class RageSoundReader_FileReader;
|
|
||||||
struct MicrophoneStatus;
|
|
||||||
|
|
||||||
class DetectPitch
|
|
||||||
{
|
|
||||||
Srpd_Op *m_pSrpdOp;
|
|
||||||
SEGMENT_ *m_pSegment;
|
|
||||||
int m_iSamplesFilledInSegment; // how many samples in m_pSegment are filled
|
|
||||||
CROSS_CORR_ *m_pCC;
|
|
||||||
STATUS_ *m_pPdaStatus;
|
|
||||||
|
|
||||||
public:
|
|
||||||
DetectPitch();
|
|
||||||
~DetectPitch();
|
|
||||||
|
|
||||||
void Init(RageSoundReader_FileReader *sample);
|
|
||||||
void Init(int iSampleFreq);
|
|
||||||
int ReadOne(RageSoundReader_FileReader *sample);
|
|
||||||
int ReadOne(short *pData, int iCount);
|
|
||||||
void GetStatus( MicrophoneStatus &out );
|
|
||||||
void End();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (c) 2004 Chris Danford
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
* copy of this software and associated documentation files (the
|
|
||||||
* "Software"), to deal in the Software without restriction, including
|
|
||||||
* without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
* distribute, and/or sell copies of the Software, and to permit persons to
|
|
||||||
* whom the Software is furnished to do so, provided that the above
|
|
||||||
* copyright notice(s) and this permission notice appear in all copies of
|
|
||||||
* the Software and that both the above copyright notice(s) and this
|
|
||||||
* permission notice appear in supporting documentation.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
||||||
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
|
||||||
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
|
||||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
||||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
||||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
||||||
* PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
@@ -1713,7 +1713,7 @@ void ScreenGameplay::Update( float fDeltaTime )
|
|||||||
{
|
{
|
||||||
m_pSoundMusic->StopPlaying();
|
m_pSoundMusic->StopPlaying();
|
||||||
SCREENMAN->PostMessageToTopScreen( SM_NotesEnded, 0 );
|
SCREENMAN->PostMessageToTopScreen( SM_NotesEnded, 0 );
|
||||||
// todo: stop lyrics (m_LyricDisplay) from animating -aj
|
m_LyricDisplay.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update living players' alive time
|
// Update living players' alive time
|
||||||
|
|||||||
Reference in New Issue
Block a user