public void update(float dAngle) {
		if (vertexBuffer == null) {
			ByteBuffer vertexByteBuffer = ByteBuffer.allocateDirect(vertices.length * SIZE_OF_FLOAT);
			vertexByteBuffer.order(ByteOrder.nativeOrder());
			vertexBuffer = vertexByteBuffer.asFloatBuffer();
			vertexBuffer.put(vertices);
			vertexBuffer.position(0);
		}
		float angle = currentAngle;
		angle += dAngle;
		currentAngle = angle;
		if (coefficient == 0 && latestCoefficient > 0) {
			coefficient = Utils.smooth(0, latestCoefficient, SMOOTH_A);
		}

		float val = (float) Math.sin(angle) * coefficient;
		if (prevVal > 0 && val <= 0 || prevVal < 0 && val >= 0) {
			coefficient = Utils.smooth(coefficient, latestCoefficient, SMOOTH_A);
			waveX = random.nextFloat() * 0.3f * (random.nextBoolean() ? 1 : -1);
		}
		prevVal = val;
		int i = 0;
		double step = 1.0 / POINTS_PER_WAVE;
		float posX = Utils.normalizeGl(waveX, fromX, toX);
		float posY = Utils.normalizeGl(val, fromY, toY);
        for (float time = 0; time < 1 - step / 2; time += step) {
			vertices[COORDS_PER_VERTEX * i + 1 + SKIP] = angle;
			vertexBuffer.put(COORDS_PER_VERTEX * i + SKIP, Utils.quad(time, vertices[6], posX, vertices[vertices.length - 6]));
			vertexBuffer.put(COORDS_PER_VERTEX * i + 1 + SKIP, Utils.quad(time, vertices[7], posY, vertices[vertices.length - 5]));
			i++;
		}
	}
Update wave position.
@param dAngle delta angle
library/src/main/java/com/cleveroad/audiovisualization/GLWave.java