Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
using-worker-threads-with-konduktiva [2024/02/05 20:08] – steve.wang | using-worker-threads-with-konduktiva [2025/07/29 03:11] (current) – steve.wang | ||
---|---|---|---|
Line 3: | Line 3: | ||
**Overview: ** Sometimes running too many actions in the same nodejs thread can cause Konduktiva sequencing to be delayed because of the heavy load on the system and the single threaded nature of nodejs. To avoid this issue, we can create other threads and run heavy actions there. Reading the [[https:// | **Overview: ** Sometimes running too many actions in the same nodejs thread can cause Konduktiva sequencing to be delayed because of the heavy load on the system and the single threaded nature of nodejs. To avoid this issue, we can create other threads and run heavy actions there. Reading the [[https:// | ||
- | **Things To Note:** This tutorial assumes you have already installed Konduktiva successfully using the [[https:// | + | **Things To Note:** This tutorial assumes you have already installed Konduktiva successfully using the [[https:// |
+ | <code javascript> | ||
+ | const K = require(' | ||
+ | let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject, | ||
+ | </ | ||
===== giveWorkerWork ===== | ===== giveWorkerWork ===== | ||
Line 39: | Line 42: | ||
Here is an example of adding the information given by workers to the musical environment. In this example, I will user workers to create a QuantizedMap for filterMap. The contents will be the same as chromatic. | Here is an example of adding the information given by workers to the musical environment. In this example, I will user workers to create a QuantizedMap for filterMap. The contents will be the same as chromatic. | ||
<code javascript> | <code javascript> | ||
- | //load the worker version of the code. | ||
- | let K = require(' | ||
- | let e = K.setUpMusicalEnvironment(0) | ||
let QWorkerCode = `let {QuantizedMap} = require(' | let QWorkerCode = `let {QuantizedMap} = require(' | ||
let QResults = await K.giveWorkerWork(QWorkerCode) | let QResults = await K.giveWorkerWork(QWorkerCode) | ||
Line 47: | Line 47: | ||
</ | </ | ||
+ | [[adding-midi-file-to-musical-environment|Learn about playing midi files in Konduktiva]] |