# Unable to Setup Quartz in C++?

**URL:** <https://forums.unrealengine.com/t/unable-to-setup-quartz-in-c/631787>\
**Category:** Audio\
**Tags:** unreal-engine, UE5-0, question\
**Created:** [August 19, 2022, 2:30pm UTC](https://forums.unrealengine.com/t/unable-to-setup-quartz-in-c/631787 "2022-08-19T14:30:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![MaxHayes](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/maxhayes/32/924234_2.png) [@MaxHayes](https://forums.unrealengine.com/u/MaxHayes)\
**Post date:** [August 19, 2022, 5:16pm UTC](https://forums.unrealengine.com/t/unable-to-setup-quartz-in-c/631787/2 "2022-08-19T17:16:45Z")

</div>

What engine version are you on? There is a lot of work I’ve done coming out in 5.1 to make managing Quartz from C++ a bit easier.

Can you tell where you are crashing with a debugger attached? Something inside of the `UClockHandle::SetBeatsPerMinute()` function is null. With a debugger attached, you could see what it invalid.

> Might be worth to mention that I’m still fairly new to C++.

If you aren’t running with a debugger attached, this is the first thing I’d figure out. It will make life sooo much easier :). That and poking around on how to debug Unreal in general (specifically, un-optimizing modules) will give you way more info as you’re working.

That said, if I were to hip-fire a guess, I’d say make sure that these functions aren’t just returning null:

```auto
UQuartzSubsystem* QuartzSubsystem = AudioComponent->GetQuartzSubsystem();
const UWorld* World = AudioComponent->QuartzGetWorld();

```

This is one of the things that has been improved in 5.1, but those things are lazy-initialized all over Audio Component with code like this:

```auto
	//Initialize the tickable object portion of the Audio Component, if it hasn't been initialized already
	if (!FQuartzTickableObject::IsInitialized())
	{
		Init(GetWorld());
	}
	check(FQuartzTickableObject::IsInitialized());

```

So I’d guess your problem is those things haven’t been initialized on the AudioComponent by the time you’re calling those functions.

It would be safer to obtain that information yourself.

`AActor` inherits from `UObject` (I’m assuming that your `ANewConductor` class inherits from `AActor`). So you can get the world from your own actor there instead of the AudioComponent, replacing it with :

```auto
const UWorld* World = GetWorld();

```

Then right below that, you can use the UWorld to get the Quartz Subsystem directly (using a static method on that class):

```auto
UQuartzSubsystem::Get(World);

```

This code may or may not work depending on which engine version you’re on.

Good luck!

---

_[View the full topic](https://forums.unrealengine.com/t/unable-to-setup-quartz-in-c/631787)._
