/**
 * OSC utilities
 */ import { MsgType , OSCBundle , OSCMessage , OSCTimeType } from "@supercollider/osc" ; /**
 * Converts a message received from scsynth:
 *
 * ```js
 *  {address: '/n_go',
 *    args:
 *     [ 1000 ,
 *       0 ,
 *       -1 ,
 *       3 ,
 *       0  ],
 *    oscType: 'message' }
 * ```
 *
 * to a flat array format:
 *
 * ```js
 * ['/n_go', 1000, 0, -1, 3, 0]
 * ```
 */ export function parseMessage ( msg ) { return [ msg . address , ... msg . args ] ; } /**
 * Convert a simple Msg array to OSCMessage object for osc packMessage
 */ export function makeMessage ( msg ) { return { oscType : "message" , address : msg [ 0 ] , args : msg . slice ( 1 ) , } ; } param { null | Number | Array | Date } time param { Array } packets export function makeBundle ( time , packets ) { return { oscType : "bundle" , timetag : time , elements : packets . map ( asPacket ) , } ; } /**
 * Format children of a bundle as either OSCMessage or OSCBundle objects.
 * TODO: not supporting nested bundles yet
 */ export function asPacket ( thing ) { return makeMessage ( thing ) ; } export { dateToTimetag , deltaTimeTag } from "@supercollider/osc" ;