@tialro2/rnbokit 1.0.14 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +242 -242
  2. package/dist/RNBO.css +113 -113
  3. package/dist/RNBO.svelte +230 -230
  4. package/dist/RNBO.svelte.d.ts +19 -18
  5. package/dist/RNBOcomponents/AudioDropIn.svelte +125 -125
  6. package/dist/RNBOcomponents/ExtMidiIn.svelte +85 -85
  7. package/dist/RNBOcomponents/ExtMidiIn.svelte.d.ts +2 -2
  8. package/dist/RNBOcomponents/ExtMidiOut.svelte +85 -85
  9. package/dist/RNBOcomponents/ExtMidiOut.svelte.d.ts +2 -2
  10. package/dist/RNBOcomponents/MicIn.svelte +80 -80
  11. package/dist/RNBOcomponents/RNBOInlet.svelte +66 -66
  12. package/dist/RNBOcomponents/RNBOInlet.svelte.d.ts +6 -6
  13. package/dist/RNBOcomponents/RNBOInport.svelte +21 -21
  14. package/dist/RNBOcomponents/RNBOMidiIn.svelte +63 -63
  15. package/dist/RNBOcomponents/RNBOMidiIn.svelte.d.ts +6 -6
  16. package/dist/RNBOcomponents/RNBOMidiOut.svelte +22 -22
  17. package/dist/RNBOcomponents/RNBOMidiOut.svelte.d.ts +4 -4
  18. package/dist/RNBOcomponents/RNBOOutport.svelte +36 -36
  19. package/dist/RNBOcomponents/RNBOOutport.svelte.d.ts +4 -4
  20. package/dist/RNBOcomponents/RNBOParam.svelte +37 -37
  21. package/dist/RNBOcomponents/XYMidiIn.svelte +93 -93
  22. package/dist/RNBOcomponents/XYMidiIn.svelte.d.ts +2 -2
  23. package/dist/UIcomponents/Controls.svelte +12 -12
  24. package/dist/UIcomponents/FileDropZone.svelte +118 -118
  25. package/dist/UIcomponents/ProgressBar.svelte +35 -35
  26. package/dist/UIcomponents/ProgressBar.svelte.d.ts +6 -6
  27. package/dist/UIcomponents/RadioGroup.svelte +27 -27
  28. package/dist/UIcomponents/RadioGroup.svelte.d.ts +4 -4
  29. package/dist/UIcomponents/RadioItem.svelte +96 -96
  30. package/dist/UIcomponents/RadioItem.svelte.d.ts +6 -6
  31. package/dist/UIcomponents/RangeSlider.svelte.d.ts +10 -10
  32. package/dist/index.js +20 -20
  33. package/package.json +7 -7
@@ -1,11 +1,11 @@
1
- <script>
2
- //TODO: create a nice way to visualise the average volume!
3
- import { onDestroy } from 'svelte';
4
-
5
-
6
- /** @type {MediaStream|null} */
7
- let stream = $state();
8
-
1
+ <script>
2
+ //TODO: create a nice way to visualise the average volume!
3
+ import { onDestroy } from 'svelte';
4
+
5
+
6
+ /** @type {MediaStream|null} */
7
+ let stream = $state();
8
+
9
9
  /**
10
10
  * @typedef {Object} Props
11
11
  * @property {AudioContext} context
@@ -14,75 +14,75 @@
14
14
 
15
15
  /** @type {Props & { [key: string]: any }} */
16
16
  let { context, audio = $bindable(), ...rest } = $props();
17
-
18
- let volumeCallback = null;
19
- /** @type {number|null} */
20
- let averageVolume = $state(0);
21
-
22
- /** @param {MediaStream} stream */
23
- const handleSuccess = (stream) => {
24
- const source = context.createMediaStreamSource(stream);
25
- let analyser = context.createAnalyser();
26
- analyser.fftSize = 512;
27
- analyser.minDecibels = -127;
28
- analyser.maxDecibels = 0;
29
- analyser.smoothingTimeConstant = 0.4;
30
- source.connect(analyser);
31
- const volumes = new Uint8Array(analyser.frequencyBinCount);
32
- //probe every 100ms for the average volume
33
- volumeCallback = setInterval(() => {
34
- analyser.getByteFrequencyData(volumes);
35
- let volumeSum = 0;
36
- for (const volume of volumes) volumeSum += volume;
37
- averageVolume = volumeSum / volumes.length;
38
- // console.log(`brightness-[${averageVolume / 100}]`);
39
- }, 100);
40
- source.connect(analyser);
41
- audio = analyser;
42
- // analyser.connect(device.node, inlet.index - 1);
43
- };
44
-
45
- async function connectMic() {
46
- if (!stream) {
47
- stream = await navigator.mediaDevices.getUserMedia({ audio: true, video: false });
48
- handleSuccess(stream);
49
- } else {
50
- disconnectMic();
51
- }
52
- }
53
- function disconnectMic() {
54
- if (!stream) return;
55
- clearInterval(volumeCallback);
56
- volumeCallback = null;
57
- averageVolume = 0;
58
- stream.getTracks().forEach((track) => track.stop());
59
- stream = null;
60
- }
61
- onDestroy(disconnectMic);
62
- </script>
63
-
64
- <div class="RNBOsubcomponent RNBOalign" {...rest}>
65
- <button onclick={connectMic} type="button" class="RNBObutton">
66
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512" class:RNBOfill={stream}>
67
- <path
68
- d="M176 352c53.02 0 96-42.98 96-96V96c0-53.02-42.98-96-96-96S80 42.98 80 96v160c0 53.02 42.98 96 96 96zm160-160h-16c-8.84 0-16 7.16-16 16v48c0 74.8-64.49 134.82-140.79 127.38C96.71 376.89 48 317.11 48 250.3V208c0-8.84-7.16-16-16-16H16c-8.84 0-16 7.16-16 16v40.16c0 89.64 63.97 169.55 152 181.69V464H96c-8.84 0-16 7.16-16 16v16c0 8.84 7.16 16 16 16h160c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16h-56v-33.77C285.71 418.47 352 344.9 352 256v-48c0-8.84-7.16-16-16-16z"
69
- />
70
- </svg>
71
- </button>
72
- <p>{averageVolume}</p>
73
- </div>
74
-
75
- <style>
76
- .RNBOfill {
77
- fill: rgb(var(--local-accent-color));
78
- transition: var(--local-animation) var(--local-animation-duration);
79
- transition-timing-function: var(--local-animation-function);
80
- }
81
- .RNBObutton {
82
- width: 3rem;
83
- border-style: none;
84
- background-color: transparent;
85
- transition: var(--local-animation) var(--local-animation-duration);
86
- transition-timing-function: var(--local-animation-function);
87
- }
88
- </style>
17
+
18
+ let volumeCallback = null;
19
+ /** @type {number|null} */
20
+ let averageVolume = $state(0);
21
+
22
+ /** @param {MediaStream} stream */
23
+ const handleSuccess = (stream) => {
24
+ const source = context.createMediaStreamSource(stream);
25
+ let analyser = context.createAnalyser();
26
+ analyser.fftSize = 512;
27
+ analyser.minDecibels = -127;
28
+ analyser.maxDecibels = 0;
29
+ analyser.smoothingTimeConstant = 0.4;
30
+ source.connect(analyser);
31
+ const volumes = new Uint8Array(analyser.frequencyBinCount);
32
+ //probe every 100ms for the average volume
33
+ volumeCallback = setInterval(() => {
34
+ analyser.getByteFrequencyData(volumes);
35
+ let volumeSum = 0;
36
+ for (const volume of volumes) volumeSum += volume;
37
+ averageVolume = volumeSum / volumes.length;
38
+ // console.log(`brightness-[${averageVolume / 100}]`);
39
+ }, 100);
40
+ source.connect(analyser);
41
+ audio = analyser;
42
+ // analyser.connect(device.node, inlet.index - 1);
43
+ };
44
+
45
+ async function connectMic() {
46
+ if (!stream) {
47
+ stream = await navigator.mediaDevices.getUserMedia({ audio: true, video: false });
48
+ handleSuccess(stream);
49
+ } else {
50
+ disconnectMic();
51
+ }
52
+ }
53
+ function disconnectMic() {
54
+ if (!stream) return;
55
+ clearInterval(volumeCallback);
56
+ volumeCallback = null;
57
+ averageVolume = 0;
58
+ stream.getTracks().forEach((track) => track.stop());
59
+ stream = null;
60
+ }
61
+ onDestroy(disconnectMic);
62
+ </script>
63
+
64
+ <div class="RNBOsubcomponent RNBOalign" {...rest}>
65
+ <button onclick={connectMic} type="button" class="RNBObutton">
66
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512" class:RNBOfill={stream}>
67
+ <path
68
+ d="M176 352c53.02 0 96-42.98 96-96V96c0-53.02-42.98-96-96-96S80 42.98 80 96v160c0 53.02 42.98 96 96 96zm160-160h-16c-8.84 0-16 7.16-16 16v48c0 74.8-64.49 134.82-140.79 127.38C96.71 376.89 48 317.11 48 250.3V208c0-8.84-7.16-16-16-16H16c-8.84 0-16 7.16-16 16v40.16c0 89.64 63.97 169.55 152 181.69V464H96c-8.84 0-16 7.16-16 16v16c0 8.84 7.16 16 16 16h160c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16h-56v-33.77C285.71 418.47 352 344.9 352 256v-48c0-8.84-7.16-16-16-16z"
69
+ />
70
+ </svg>
71
+ </button>
72
+ <p>{averageVolume}</p>
73
+ </div>
74
+
75
+ <style>
76
+ .RNBOfill {
77
+ fill: rgb(var(--local-accent-color));
78
+ transition: var(--local-animation) var(--local-animation-duration);
79
+ transition-timing-function: var(--local-animation-function);
80
+ }
81
+ .RNBObutton {
82
+ width: 3rem;
83
+ border-style: none;
84
+ background-color: transparent;
85
+ transition: var(--local-animation) var(--local-animation-duration);
86
+ transition-timing-function: var(--local-animation-function);
87
+ }
88
+ </style>
@@ -1,66 +1,66 @@
1
- <script>
2
- import RadioGroup from '../UIcomponents/RadioGroup.svelte';
3
- import RadioItem from '../UIcomponents/RadioItem.svelte';
4
- import AudioDropIn from './AudioDropIn.svelte';
5
- import MicIn from './MicIn.svelte';
6
-
7
- let context = device.context;
8
-
9
- /** @typedef {object} inlet
10
- * @property {number} index - the port index
11
- * @property {string} tag - the tag
12
- * @property {'signal'} type - the type
13
- * @property {string} meta - the meta
14
- */
15
-
16
- /** @type {AudioNode} */
17
- let audio = $state();
18
-
19
- /** @type {{default: 'default', mic: 'mic', dropIn: 'dropIn'}} */
20
- let modes = { default: 'default', mic: 'mic', dropIn: 'dropIn' };
21
-
22
- /**
23
- * @typedef {Object} Props
24
- * @property {import ('@rnbo/js').Device} device
25
- * @property {inlet} [inlet]
26
- * @property {'default'|'mic'|'dropIn'} [mode]
27
- * @property {import('svelte').Snippet<[any]>} [children]
28
- */
29
-
30
- /** @type {Props & { [key: string]: any }} */
31
- let {
32
- device,
33
- inlet = { index: 1, tag: 'in1', type: 'signal', meta: 'something' },
34
- mode = $bindable(modes.default),
35
- children,
36
- ...rest
37
- } = $props();
38
- //set a defaultMode so the radio group only shows if no mode has been specified
39
- /** @type {'default'|'mic'|'dropIn'} */
40
- let defaultMode = mode;
41
- //make sure the default mode is mic in the radio group
42
- if (mode == modes.default) mode = modes.mic;
43
-
44
- $effect(() => {
45
- if (audio) {
46
- audio.connect(device.node, inlet.index - 1);
47
- }
48
- });
49
- </script>
50
-
51
- <div class="RNBOcomponent RNBOsection" {...rest}>
52
- {#if children}{@render children({ context, audio })}{:else}
53
- <div class="RNBOtag">{inlet.tag}</div>
54
- {#if defaultMode === modes.default}
55
- <RadioGroup>
56
- <RadioItem bind:group={mode} name="Mic" value={modes.mic}>Mic</RadioItem>
57
- <RadioItem bind:group={mode} name="DropIn" value={modes.dropIn}>Drop-in</RadioItem>
58
- </RadioGroup>
59
- {/if}
60
- {#if mode === modes.dropIn}
61
- <AudioDropIn class="RNBOsubcomponent" bind:audio {context} />
62
- {:else}
63
- <MicIn bind:audio {context} />
64
- {/if}
65
- {/if}
66
- </div>
1
+ <script>
2
+ import RadioGroup from '../UIcomponents/RadioGroup.svelte';
3
+ import RadioItem from '../UIcomponents/RadioItem.svelte';
4
+ import AudioDropIn from './AudioDropIn.svelte';
5
+ import MicIn from './MicIn.svelte';
6
+
7
+ let context = device.context;
8
+
9
+ /** @typedef {object} inlet
10
+ * @property {number} index - the port index
11
+ * @property {string} tag - the tag
12
+ * @property {'signal'} type - the type
13
+ * @property {string} meta - the meta
14
+ */
15
+
16
+ /** @type {AudioNode} */
17
+ let audio = $state();
18
+
19
+ /** @type {{default: 'default', mic: 'mic', dropIn: 'dropIn'}} */
20
+ let modes = { default: 'default', mic: 'mic', dropIn: 'dropIn' };
21
+
22
+ /**
23
+ * @typedef {Object} Props
24
+ * @property {import ('@rnbo/js').Device} device
25
+ * @property {inlet} [inlet]
26
+ * @property {'default'|'mic'|'dropIn'} [mode]
27
+ * @property {import('svelte').Snippet<[any]>} [children]
28
+ */
29
+
30
+ /** @type {Props & { [key: string]: any }} */
31
+ let {
32
+ device,
33
+ inlet = { index: 1, tag: 'in1', type: 'signal', meta: 'something' },
34
+ mode = $bindable(modes.default),
35
+ children,
36
+ ...rest
37
+ } = $props();
38
+ //set a defaultMode so the radio group only shows if no mode has been specified
39
+ /** @type {'default'|'mic'|'dropIn'} */
40
+ let defaultMode = mode;
41
+ //make sure the default mode is mic in the radio group
42
+ if (mode == modes.default) mode = modes.mic;
43
+
44
+ $effect(() => {
45
+ if (audio) {
46
+ audio.connect(device.node, inlet.index - 1);
47
+ }
48
+ });
49
+ </script>
50
+
51
+ <div class="RNBOcomponent RNBOsection" {...rest}>
52
+ {#if children}{@render children({ context, audio })}{:else}
53
+ <div class="RNBOtag">{inlet.tag}</div>
54
+ {#if defaultMode === modes.default}
55
+ <RadioGroup>
56
+ <RadioItem bind:group={mode} name="Mic" value={modes.mic}>Mic</RadioItem>
57
+ <RadioItem bind:group={mode} name="DropIn" value={modes.dropIn}>Drop-in</RadioItem>
58
+ </RadioGroup>
59
+ {/if}
60
+ {#if mode === modes.dropIn}
61
+ <AudioDropIn class="RNBOsubcomponent" bind:audio {context} />
62
+ {:else}
63
+ <MicIn bind:audio {context} />
64
+ {/if}
65
+ {/if}
66
+ </div>
@@ -24,9 +24,9 @@ declare const RNBOInlet: import("svelte").Component<{
24
24
  * - the meta
25
25
  */
26
26
  meta: string;
27
- };
28
- mode?: "default" | "mic" | "dropIn";
29
- children?: import("svelte").Snippet<[any]>;
27
+ } | undefined;
28
+ mode?: "default" | "mic" | "dropIn" | undefined;
29
+ children?: import("svelte").Snippet<[any]> | undefined;
30
30
  } & {
31
31
  [key: string]: any;
32
32
  }, {}, "mode">;
@@ -49,7 +49,7 @@ type Props = {
49
49
  * - the meta
50
50
  */
51
51
  meta: string;
52
- };
53
- mode?: "default" | "mic" | "dropIn";
54
- children?: import("svelte").Snippet<[any]>;
52
+ } | undefined;
53
+ mode?: "default" | "mic" | "dropIn" | undefined;
54
+ children?: import("svelte").Snippet<[any]> | undefined;
55
55
  };
@@ -1,21 +1,21 @@
1
- <script>
2
- import Controls from '../UIcomponents/Controls.svelte';
3
- import rnbo from '@rnbo/js';
4
- const { TimeNow, MessageEvent } = rnbo;
5
-
6
- /**
7
- * @typedef {Object} Props
8
- * @property {string} tag
9
- * @property {import ('@rnbo/js').Device} device
10
- */
11
-
12
- /** @type {Props} */
13
- let { tag, device } = $props();
14
-
15
- const sendMessage = () => {
16
- const messageEvent = new MessageEvent(TimeNow, tag);
17
- device.scheduleEvent(messageEvent);
18
- };
19
- </script>
20
-
21
- <Controls {tag} {sendMessage} />
1
+ <script>
2
+ import Controls from '../UIcomponents/Controls.svelte';
3
+ import rnbo from '@rnbo/js';
4
+ const { TimeNow, MessageEvent } = rnbo;
5
+
6
+ /**
7
+ * @typedef {Object} Props
8
+ * @property {string} tag
9
+ * @property {import ('@rnbo/js').Device} device
10
+ */
11
+
12
+ /** @type {Props} */
13
+ let { tag, device } = $props();
14
+
15
+ const sendMessage = () => {
16
+ const messageEvent = new MessageEvent(TimeNow, tag);
17
+ device.scheduleEvent(messageEvent);
18
+ };
19
+ </script>
20
+
21
+ <Controls {tag} {sendMessage} />
@@ -1,63 +1,63 @@
1
- <script>
2
- import rnbo from '@rnbo/js';
3
- const { MIDIEvent, TimeNow } = rnbo;
4
- import XyMidiIn from './XYMidiIn.svelte';
5
- import ExtMidiIn from './ExtMidiIn.svelte';
6
- import RadioGroup from '../UIcomponents/RadioGroup.svelte';
7
- import RadioItem from '../UIcomponents/RadioItem.svelte';
8
-
9
- /** @type {{default: 'default', xy: 'xy', external: 'external'}} */
10
- let modes = { default: 'default', xy: 'xy', external: 'external' };
11
-
12
- /**
13
- * @typedef {Object} Props
14
- * @property {number} [port] - type {number} - the MIDI port index
15
- * @property {import ('@rnbo/js').Device} device
16
- * @property {import('@rnbo/js').MIDIData|undefined} [midiMessage]
17
- * @property {number|undefined} [midiChannel]
18
- * @property {'default'|'xy'|'external'} [mode]
19
- * @property {import('svelte').Snippet<[any]>} [children]
20
- */
21
-
22
- /** @type {Props & { [key: string]: any }} */
23
- let {
24
- port = 0,
25
- device,
26
- midiMessage = $bindable(undefined),
27
- midiChannel = 0,
28
- mode = $bindable(modes.default),
29
- children,
30
- ...rest
31
- } = $props();
32
-
33
- //set a defaultMode so the radio group only shows if no mode has been specified
34
- /** @type {'default'|'xy'|'external'} */
35
- let defaultMode = mode;
36
- //make sure the default mode is mic in the radio group
37
- if (mode == modes.default) mode = modes.xy;
38
-
39
- $effect(() => {
40
- if (midiMessage && midiMessage.length > 0) {
41
- console.log('from MidiIn', midiMessage);
42
- device.scheduleEvent(new MIDIEvent(TimeNow, port, midiMessage));
43
- }
44
- });
45
- </script>
46
-
47
- <div class="RNBOcomponent RNBOsection" {...rest}>
48
- {#if children}{@render children({ midiChannel })}{:else}
49
- <div class="RNBOtag">in {port}</div>
50
- {#if defaultMode === modes.default}
51
- <RadioGroup>
52
- <RadioItem bind:group={mode} name="xy" value={modes.xy}>XY-pad</RadioItem>
53
- <RadioItem bind:group={mode} name="external" value={modes.external}>ext. MIDI</RadioItem>
54
- </RadioGroup>
55
- {/if}
56
-
57
- {#if mode === modes.external}
58
- <ExtMidiIn bind:midiMessage {midiChannel} />
59
- {:else}
60
- <XyMidiIn bind:midiMessage {midiChannel} />
61
- {/if}
62
- {/if}
63
- </div>
1
+ <script>
2
+ import rnbo from '@rnbo/js';
3
+ const { MIDIEvent, TimeNow } = rnbo;
4
+ import XyMidiIn from './XYMidiIn.svelte';
5
+ import ExtMidiIn from './ExtMidiIn.svelte';
6
+ import RadioGroup from '../UIcomponents/RadioGroup.svelte';
7
+ import RadioItem from '../UIcomponents/RadioItem.svelte';
8
+
9
+ /** @type {{default: 'default', xy: 'xy', external: 'external'}} */
10
+ let modes = { default: 'default', xy: 'xy', external: 'external' };
11
+
12
+ /**
13
+ * @typedef {Object} Props
14
+ * @property {number} [port] - type {number} - the MIDI port index
15
+ * @property {import ('@rnbo/js').Device} device
16
+ * @property {import('@rnbo/js').MIDIData|undefined} [midiMessage]
17
+ * @property {number|undefined} [midiChannel]
18
+ * @property {'default'|'xy'|'external'} [mode]
19
+ * @property {import('svelte').Snippet<[any]>} [children]
20
+ */
21
+
22
+ /** @type {Props & { [key: string]: any }} */
23
+ let {
24
+ port = 0,
25
+ device,
26
+ midiMessage = $bindable(undefined),
27
+ midiChannel = 0,
28
+ mode = $bindable(modes.default),
29
+ children,
30
+ ...rest
31
+ } = $props();
32
+
33
+ //set a defaultMode so the radio group only shows if no mode has been specified
34
+ /** @type {'default'|'xy'|'external'} */
35
+ let defaultMode = mode;
36
+ //make sure the default mode is mic in the radio group
37
+ if (mode == modes.default) mode = modes.xy;
38
+
39
+ $effect(() => {
40
+ if (midiMessage && midiMessage.length > 0) {
41
+ console.log('from MidiIn', midiMessage);
42
+ device.scheduleEvent(new MIDIEvent(TimeNow, port, midiMessage));
43
+ }
44
+ });
45
+ </script>
46
+
47
+ <div class="RNBOcomponent RNBOsection" {...rest}>
48
+ {#if children}{@render children({ midiChannel })}{:else}
49
+ <div class="RNBOtag">in {port}</div>
50
+ {#if defaultMode === modes.default}
51
+ <RadioGroup>
52
+ <RadioItem bind:group={mode} name="xy" value={modes.xy}>XY-pad</RadioItem>
53
+ <RadioItem bind:group={mode} name="external" value={modes.external}>ext. MIDI</RadioItem>
54
+ </RadioGroup>
55
+ {/if}
56
+
57
+ {#if mode === modes.external}
58
+ <ExtMidiIn bind:midiMessage {midiChannel} />
59
+ {:else}
60
+ <XyMidiIn bind:midiMessage {midiChannel} />
61
+ {/if}
62
+ {/if}
63
+ </div>
@@ -9,12 +9,12 @@ declare const RNBOMidiIn: import("svelte").Component<{
9
9
  /**
10
10
  * - type {number} - the MIDI port index
11
11
  */
12
- port?: number;
12
+ port?: number | undefined;
13
13
  device: import("@rnbo/js").Device;
14
14
  midiMessage?: import("@rnbo/js").MIDIData | undefined;
15
15
  midiChannel?: number | undefined;
16
- mode?: "default" | "xy" | "external";
17
- children?: import("svelte").Snippet<[any]>;
16
+ mode?: "default" | "xy" | "external" | undefined;
17
+ children?: import("svelte").Snippet<[any]> | undefined;
18
18
  } & {
19
19
  [key: string]: any;
20
20
  }, {}, "mode" | "midiMessage">;
@@ -22,10 +22,10 @@ type Props = {
22
22
  /**
23
23
  * - type {number} - the MIDI port index
24
24
  */
25
- port?: number;
25
+ port?: number | undefined;
26
26
  device: import("@rnbo/js").Device;
27
27
  midiMessage?: import("@rnbo/js").MIDIData | undefined;
28
28
  midiChannel?: number | undefined;
29
- mode?: "default" | "xy" | "external";
30
- children?: import("svelte").Snippet<[any]>;
29
+ mode?: "default" | "xy" | "external" | undefined;
30
+ children?: import("svelte").Snippet<[any]> | undefined;
31
31
  };
@@ -1,9 +1,9 @@
1
- <script>
2
- import { MIDIEvent, TimeNow } from '@rnbo/js';
3
- // import ExtMidiOut from './ExtMidiOut.svelte';
4
-
5
-
6
-
1
+ <script>
2
+ import { MIDIEvent, TimeNow } from '@rnbo/js';
3
+ // import ExtMidiOut from './ExtMidiOut.svelte';
4
+
5
+
6
+
7
7
  /**
8
8
  * @typedef {Object} Props
9
9
  * @property {number} [port] - type {number} - the MIDI port index
@@ -20,19 +20,19 @@
20
20
  children,
21
21
  ...rest
22
22
  } = $props();
23
- // /** @type {number|undefined} */
24
- // export let midiChannel = 0;
25
-
26
- //TODO: replace block below with a midiMessage receive from a Max Midi out, send to extMidiOut
27
- device.midiEvent.subscribe((ev) => {
28
- console.log(ev);
29
- });
30
- </script>
31
-
32
- <div class="RNBOcomponent RNBOsection" {...rest}>
33
- {#if children}{@render children({ port, })}{:else}
34
- <div class="RNBOtag">in {port}</div>
35
-
36
- <!-- <ExtMidiOut bind:midiMessage /> -->
37
- {/if}
38
- </div>
23
+ // /** @type {number|undefined} */
24
+ // export let midiChannel = 0;
25
+
26
+ //TODO: replace block below with a midiMessage receive from a Max Midi out, send to extMidiOut
27
+ device.midiEvent.subscribe((ev) => {
28
+ console.log(ev);
29
+ });
30
+ </script>
31
+
32
+ <div class="RNBOcomponent RNBOsection" {...rest}>
33
+ {#if children}{@render children({ port, })}{:else}
34
+ <div class="RNBOtag">in {port}</div>
35
+
36
+ <!-- <ExtMidiOut bind:midiMessage /> -->
37
+ {/if}
38
+ </div>
@@ -9,10 +9,10 @@ declare const RNBOMidiOut: import("svelte").Component<{
9
9
  /**
10
10
  * - type {number} - the MIDI port index
11
11
  */
12
- port?: number;
12
+ port?: number | undefined;
13
13
  device: import("@rnbo/js").Device;
14
14
  midiMessage?: import("@rnbo/js").MIDIData | undefined;
15
- children?: import("svelte").Snippet<[any]>;
15
+ children?: import("svelte").Snippet<[any]> | undefined;
16
16
  } & {
17
17
  [key: string]: any;
18
18
  }, {}, "">;
@@ -20,8 +20,8 @@ type Props = {
20
20
  /**
21
21
  * - type {number} - the MIDI port index
22
22
  */
23
- port?: number;
23
+ port?: number | undefined;
24
24
  device: import("@rnbo/js").Device;
25
25
  midiMessage?: import("@rnbo/js").MIDIData | undefined;
26
- children?: import("svelte").Snippet<[any]>;
26
+ children?: import("svelte").Snippet<[any]> | undefined;
27
27
  };