@@ -16,6 +16,9 @@ import { CannonState, OutputAdapter } from 'wavegrid';
1616
1717import { hsbToRgb100 , hsbToRgb255 } from './color' ;
1818
19+ /** When true, log every OSC message sent. Set via DEBUG_OSC=1 env var. */
20+ export const DEBUG_OSC = ! ! process . env . DEBUG_OSC ;
21+
1922// ═══════════════════════════════════════════════════
2023// Types
2124// ═══════════════════════════════════════════════════
@@ -103,6 +106,13 @@ export class BeyondOscOutput implements OutputAdapter {
103106 if ( ! this . client ) return ;
104107
105108 const messages = encodeBeyondMessages ( grid , this . config . projectorMap ) ;
109+ if ( DEBUG_OSC && messages . length > 0 ) {
110+ const sample = messages . slice ( 0 , 4 ) ;
111+ const lines = sample . map ( m => ` ${ m . address } = ${ m . value } ` ) ;
112+ console . log ( ` [OSC→BEYOND] frame ${ this . frameCount } | ${ messages . length } msgs to ${ this . config . host } :${ this . config . port } ` ) ;
113+ for ( const line of lines ) console . log ( line ) ;
114+ if ( messages . length > 4 ) console . log ( ` ... +${ messages . length - 4 } more` ) ;
115+ }
106116 for ( const msg of messages ) {
107117 this . client . send ( msg . address , msg . value ) ;
108118 }
@@ -188,6 +198,13 @@ export class FB4OscOutput implements OutputAdapter {
188198 if ( ! this . client ) return ;
189199
190200 const messages = encodeFB4Messages ( grid , this . config . serialMap ) ;
201+ if ( DEBUG_OSC && messages . length > 0 ) {
202+ const sample = messages . slice ( 0 , 3 ) ;
203+ const lines = sample . map ( m => ` ${ m . address } = ${ m . value } ` ) ;
204+ console . log ( ` [OSC→FB4] frame ${ this . frameCount } | ${ messages . length } msgs to ${ this . config . host } :${ this . config . port } ` ) ;
205+ for ( const line of lines ) console . log ( line ) ;
206+ if ( messages . length > 3 ) console . log ( ` ... +${ messages . length - 3 } more` ) ;
207+ }
191208 for ( const msg of messages ) {
192209 this . client . send ( msg . address , msg . value ) ;
193210 }
0 commit comments