--- linuxsampler/trunk/src/engines/AbstractEngine.h 2009/11/03 19:27:42 2027 +++ linuxsampler/trunk/src/engines/AbstractEngine.h 2010/03/20 11:37:52 2072 @@ -3,8 +3,8 @@ * LinuxSampler - modular, streaming capable sampler * * * * Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck * - * Copyright (C) 2005-2009 Christian Schoenebeck * - * Copyright (C) 2009 Grigor Iliev * + * Copyright (C) 2005-2008 Christian Schoenebeck * + * Copyright (C) 2009-2010 Christian Schoenebeck and Grigor Iliev * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -114,6 +114,11 @@ uint8_t GSCheckSum(const RingBuffer::NonVolatileReader AddrReader, uint DataSize); + float Random() { + RandomSeed = RandomSeed * 1103515245 + 12345; // classic pseudo random number generator + return RandomSeed / 4294967296.0f; + } + virtual void ResetInternal() = 0; virtual void KillAllVoices(EngineChannel* pEngineChannel, Pool::Iterator& itKillEvent) = 0; virtual void ProcessNoteOn(EngineChannel* pEngineChannel, Pool::Iterator& itNoteOnEvent) = 0; @@ -123,6 +128,7 @@ private: static std::map > engines; + uint32_t RandomSeed; ///< State of the random number generator used by the random dimension. static float* InitVolumeCurve(); static float* InitPanCurve();