### Define Different DAWs Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Application.md Examples of initializing Application objects for various DAW software. ```java // Bitwig Studio Application bitwig = new Application(); bitwig.name = "Bitwig Studio"; bitwig.version = "5.0.9"; // Cubase Application cubase = new Application(); cubase.name = "Steinberg Cubase"; cubase.version = "14.0.10"; // Studio One Application studioOne = new Application(); studioOne.name = "PreSonus Studio One"; studioOne.version = "6.5.0"; // n-Track Studio Application nTrack = new Application(); nTrack.name = "n-Track Studio"; nTrack.version = "10.2.2"; ``` -------------------------------- ### Create RealParameter instances Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/RealParameter.md Examples of initializing RealParameter with different units and configurations. ```java RealParameter tempo = new RealParameter(); tempo.value = 120.0; tempo.unit = Unit.BPM; tempo.min = 20.0; tempo.max = 666.0; tempo.name = "Tempo"; tempo.id = "tempo_id"; ``` ```java RealParameter volume = new RealParameter(); volume.value = 0.8; volume.unit = Unit.LINEAR; volume.min = 0.0; volume.max = 2.0; volume.name = "Volume"; volume.parameterID = 42; // VST parameter ID ``` ```java RealParameter gain = new RealParameter(); gain.value = 6.0; gain.unit = Unit.DECIBEL; gain.min = -80.0; gain.max = 24.0; gain.name = "Gain"; ``` ```java RealParameter frequency = new RealParameter(); frequency.value = 1000.0; frequency.unit = Unit.HERTZ; frequency.min = 20.0; frequency.max = 20000.0; frequency.name = "Cutoff"; frequency.parameterID = 10; ``` ```java RealParameter pan = new RealParameter(); pan.value = 0.5; pan.unit = Unit.NORMALIZED; pan.min = 0.0; pan.max = 1.0; pan.name = "Pan"; ``` ```java RealParameter ratio = new RealParameter(); ratio.value = 50.0; ratio.unit = Unit.PERCENT; ratio.min = 0.0; ratio.max = 100.0; ratio.name = "Ratio"; ``` ```java RealParameter transpose = new RealParameter(); transpose.value = 12.0; transpose.unit = Unit.SEMITONES; transpose.min = -12.0; transpose.max = 12.0; transpose.name = "Transpose"; ``` ```java RealParameter delay = new RealParameter(); delay.value = 0.5; delay.unit = Unit.SECONDS; delay.min = 0.0; delay.max = 10.0; delay.name = "Delay Time"; ``` ```java RealParameter noteLength = new RealParameter(); noteLength.value = 0.25; noteLength.unit = Unit.BEATS; noteLength.min = 0.0625; noteLength.max = 4.0; noteLength.name = "Note Length"; ``` -------------------------------- ### Full Transport Setup in Java Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Transport.md Configures both tempo and time signature parameters and assigns the transport to a project instance. ```java Transport transport = new Transport(); // Set tempo RealParameter tempo = new RealParameter(); tempo.value = 149.0; tempo.unit = Unit.BPM; tempo.min = 20.0; tempo.max = 666.0; tempo.name = "Tempo"; transport.tempo = tempo; // Set time signature TimeSignatureParameter timeSig = new TimeSignatureParameter(); timeSig.numerator = 4; timeSig.denominator = 4; timeSig.name = "TimeSignature"; transport.timeSignature = timeSig; Project project = new Project(); project.transport = transport; ``` -------------------------------- ### Build Effect Bus Setup in Java Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Send.md Sets up a master channel, effect buses, and tracks with sends to demonstrate a complete routing structure. ```java // Create master channel Channel master = new Channel(); master.id = "master"; master.name = "Master"; master.role = MixerRole.MASTER; // Create effect buses Channel reverbBus = new Channel(); reverbBus.id = "reverb_bus"; reverbBus.name = "Reverb"; reverbBus.role = MixerRole.EFFECT_TRACK; reverbBus.destination = master; Channel delayBus = new Channel(); delayBus.id = "delay_bus"; delayBus.name = "Delay"; delayBus.role = MixerRole.EFFECT_TRACK; delayBus.destination = master; // Create tracks with sends Channel track1 = new Channel(); track1.name = "Track 1"; track1.destination = master; Send reverbSend = new Send(); reverbSend.type = SendType.POST; reverbSend.destination = reverbBus; RealParameter reverbLevel = new RealParameter(); reverbLevel.value = 0.2; reverbLevel.unit = Unit.LINEAR; reverbSend.volume = reverbLevel; track1.sends = new ArrayList<>(); track1.sends.add(reverbSend); ``` -------------------------------- ### Assign RealParameter to components Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/RealParameter.md Examples of assigning parameters to Channels, Transport, and Devices. ```java Channel channel = new Channel(); RealParameter volume = new RealParameter(); volume.value = 1.0; volume.unit = Unit.LINEAR; volume.min = 0.0; volume.max = 2.0; volume.name = "Volume"; channel.volume = volume; ``` ```java Transport transport = new Transport(); RealParameter tempo = new RealParameter(); tempo.value = 140.0; tempo.unit = Unit.BPM; tempo.min = 20.0; tempo.max = 666.0; tempo.name = "Tempo"; tempo.id = "id_tempo"; transport.tempo = tempo; ``` ```java Vst3Plugin eq = new Vst3Plugin(); eq.deviceName = "FabFilter Pro-Q"; eq.deviceRole = DeviceRole.AUDIO_FX; RealParameter eqGain = new RealParameter(); eqGain.parameterID = 5; eqGain.value = 0.0; eqGain.unit = Unit.DECIBEL; eqGain.min = -24.0; eqGain.max = 24.0; eqGain.name = "Gain"; eq.automatedParameters = new ArrayList<>(); eq.automatedParameters.add(eqGain); ``` -------------------------------- ### DAWproject XML Structure Source: https://github.com/bitwig/dawproject/blob/main/README.md A complete example of a DAWproject file defining transport settings, tracks with instruments, and arrangement clips. ```xml ``` -------------------------------- ### Define Arrangement Time Signature Automation Source: https://github.com/bitwig/dawproject/blob/main/Reference.html Example XML structure for defining time signature automation points within an Arrangement element. ```xml ... ``` -------------------------------- ### Define Audio Warping Source: https://github.com/bitwig/dawproject/blob/main/Reference.html Example of a simple audio clip using Warps to map beats to seconds. ```xml ``` -------------------------------- ### Define Scene Content Timeline Source: https://github.com/bitwig/dawproject/blob/main/Reference.html Example XML structure for defining the content timeline within a Scene element using Lanes and ClipSlots. ```xml ... ... ``` -------------------------------- ### Create a Basic Project Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Project.md Initialize a new project instance and configure essential metadata, application info, and transport settings. ```java Project project = new Project(); project.version = Project.CURRENT_VERSION; Application app = new Application(); app.name = "My DAW"; app.version = "1.0"; project.application = app; Transport transport = new Transport(); RealParameter tempo = new RealParameter(); tempo.value = 120.0; tempo.unit = Unit.BPM; transport.tempo = tempo; project.transport = transport; ``` -------------------------------- ### Initialize and Save a Full DAWProject Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Arrangement.md Demonstrates the construction of a project hierarchy including transport settings, tempo automation, markers, and lanes before saving to a file. ```java // Create project Project project = new Project(); // Create transport Transport transport = new Transport(); RealParameter tempo = new RealParameter(); tempo.id = "id0"; tempo.value = 120.0; tempo.unit = Unit.BPM; transport.tempo = tempo; TimeSignatureParameter timeSig = new TimeSignatureParameter(); timeSig.id = "id1"; timeSig.numerator = 4; timeSig.denominator = 4; transport.timeSignature = timeSig; project.transport = transport; // Create arrangement with automation Arrangement arrangement = new Arrangement(); // Add tempo automation Points tempoAuto = new Points(); tempoAuto.target = new AutomationTarget(); tempoAuto.target.parameter = "id0"; RealPoint rp = new RealPoint(); rp.time = 0.0; rp.value = 120.0; tempoAuto.points.add(rp); arrangement.tempoAutomation = tempoAuto; // Add markers Markers markers = new Markers(); Marker m = new Marker(); m.time = 0.0; m.name = "Start"; markers.markers.add(m); arrangement.markers = markers; // Create lanes Lanes lanes = new Lanes(); lanes.timeUnit = TimeUnit.BEATS; arrangement.lanes = lanes; project.arrangement = arrangement; // Save MetaData metadata = new MetaData(); metadata.title = "My Project"; DawProject.save(project, metadata, new HashMap<>(), new File("project.dawproject")); ``` -------------------------------- ### Create a Minimal Project Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/INDEX.md Initializes a new project with basic application and metadata fields before saving to a file. ```java Project project = new Project(); project.application = new Application(); project.application.name = "App"; project.application.version = "1.0"; MetaData metadata = new MetaData(); metadata.title = "Song"; DawProject.save(project, metadata, new HashMap<>(), new File("project.dawproject")); ``` -------------------------------- ### Adding Parameters to a Device Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Parameter.md Demonstrates how to instantiate a plugin and associate Real and Bool parameters with it. ```java Vst3Plugin synth = new Vst3Plugin(); synth.deviceName = "Serum"; synth.deviceRole = DeviceRole.INSTRUMENT; // Create real parameter RealParameter oscAmp = new RealParameter(); oscAmp.parameterID = 10; oscAmp.value = 0.8; oscAmp.unit = Unit.NORMALIZED; oscAmp.min = 0.0; oscAmp.max = 1.0; oscAmp.name = "Osc Amp"; // Create bool parameter BoolParameter oscUnison = new BoolParameter(); oscUnison.parameterID = 20; oscUnison.value = true; oscUnison.name = "Unison"; synth.automatedParameters = new ArrayList<>(); synth.automatedParameters.add(oscAmp); synth.automatedParameters.add(oscUnison); ``` -------------------------------- ### Build the project with Gradle Source: https://github.com/bitwig/dawproject/blob/main/README.md Execute the build process using the Gradle wrapper. ```bash ./gradlew build ``` -------------------------------- ### Create and Save Project Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Project.md Populate a project instance, define metadata, and persist the data to a .dawproject file. ```java // Create project Project project = new Project(); // ... populate project ... // Create metadata MetaData metadata = new MetaData(); metadata.title = "My Song"; metadata.artist = "My Band"; // Save to file Map embeddedFiles = new HashMap<>(); DawProject.save(project, metadata, embeddedFiles, new File("output.dawproject")); ``` -------------------------------- ### Building Metadata Step by Step Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/MetaData.md Construct metadata incrementally before saving the project. ```java MetaData metadata = new MetaData(); // Song information metadata.title = "Untitled"; metadata.album = "Working Demos"; metadata.genre = "Electronic"; // Creator information metadata.composer = "Jane Smith"; metadata.songwriter = "Jane Smith"; metadata.producer = "John Producer"; metadata.arranger = "Jane Smith"; // Admin information metadata.year = "2024"; metadata.copyright = "Copyright © 2024 Jane Smith"; metadata.website = "https://janesmith.music"; metadata.comment = "Demo version for feedback"; Project project = new Project(); // ... configure project ... DawProject.save(project, metadata, new HashMap<>(), new File("my_song.dawproject")); ``` -------------------------------- ### Create Simple Automation Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Points.md Demonstrates initializing a Points object and adding linear automation points for a generic parameter. ```java Points automation = new Points(); automation.timeUnit = TimeUnit.BEATS; automation.unit = Unit.LINEAR; AutomationTarget target = new AutomationTarget(); target.parameter = "param_volume_id"; automation.target = target; RealPoint point1 = new RealPoint(); point1.time = 0.0; point1.value = 0.5; point1.interpolation = Interpolation.LINEAR; RealPoint point2 = new RealPoint(); point2.time = 8.0; point2.value = 1.0; automation.points.add(point1); automation.points.add(point2); ``` -------------------------------- ### Create a Simple Audio Clip in Java Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Clip.md Initializes a basic clip with defined timing and fade parameters. ```java Clip audioClip = new Clip(); audioClip.time = 0.0; audioClip.duration = 8.0; audioClip.playStart = 0.0; audioClip.playStop = 8.0; audioClip.name = "Drumloop"; audioClip.fadeTimeUnit = TimeUnit.BEATS; audioClip.fadeInTime = 0.0; audioClip.fadeOutTime = 0.0; ``` -------------------------------- ### Create a minimal project Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/GUIDE.md Initializes a new project object with required application and transport settings before saving. ```java // Create project Project project = new Project(); project.version = Project.CURRENT_VERSION; // Set application info Application app = new Application(); app.name = "My DAW"; app.version = "1.0"; project.application = app; // Add transport (required for beat-based timelines) Transport transport = new Transport(); RealParameter tempo = new RealParameter(); tempo.value = 120.0; tempo.unit = Unit.BPM; transport.tempo = tempo; project.transport = transport; // Save MetaData metadata = new MetaData(); metadata.title = "My Song"; DawProject.save(project, metadata, new HashMap<>(), new File("project.dawproject")); ``` -------------------------------- ### Create and Save a DAWProject Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/GUIDE.md Initializes a project structure with application info, transport settings, tracks, and arrangement data before saving to a file. ```java // Create project Project project = new Project(); project.version = Project.CURRENT_VERSION; // Application info Application app = new Application(); app.name = "My App"; app.version = "1.0"; project.application = app; // Transport Transport transport = new Transport(); RealParameter tempo = new RealParameter(); tempo.value = 120.0; tempo.unit = Unit.BPM; tempo.id = "tempo_id"; transport.tempo = tempo; project.transport = transport; // Create track Track track = new Track(); track.name = "Drums"; track.contentType = new ContentType[]{ContentType.AUDIO}; Channel channel = new Channel(); channel.role = MixerRole.REGULAR; track.channel = channel; project.structure.add(track); // Create arrangement Arrangement arrangement = new Arrangement(); Lanes lanes = new Lanes(); lanes.timeUnit = TimeUnit.BEATS; Lanes trackLane = new Lanes(); trackLane.track = track; Clips clips = new Clips(); clips.timeUnit = TimeUnit.BEATS; Clip clip = new Clip(); clip.time = 0.0; clip.duration = 8.0; clips.clips.add(clip); trackLane.lanes.add(clips); lanes.lanes.add(trackLane); arrangement.lanes = lanes; project.arrangement = arrangement; // Save MetaData metadata = new MetaData(); metadata.title = "My Project"; metadata.artist = "Artist Name"; Map embeddedFiles = new HashMap<>(); DawProject.save(project, metadata, embeddedFiles, new File("project.dawproject")); ``` -------------------------------- ### DawProject.loadProject Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Project.md Loads a Project instance from a .dawproject file. ```APIDOC ## DawProject.loadProject ### Description Deserializes a .dawproject file into a Project object. ### Parameters - **file** (File) - The source file to load. ### Returns - **Project** - The loaded project instance. ``` -------------------------------- ### Load Project from File Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Project.md Read project data and associated metadata from an existing .dawproject file. ```java Project project = DawProject.loadProject(new File("project.dawproject")); MetaData metadata = DawProject.loadMetadata(new File("project.dawproject")); System.out.println("Project saved by: " + project.application.name); System.out.println("Title: " + metadata.title); System.out.println("Tracks: " + project.structure.size()); System.out.println("Scenes: " + project.scenes.size()); ``` -------------------------------- ### Add Audio Unit Plugins Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/GUIDE.md Initialize an Audio Unit plugin with basic device metadata. ```java AuPlugin plugin = new AuPlugin(); plugin.deviceName = "AU Synth"; plugin.deviceRole = DeviceRole.INSTRUMENT; ``` -------------------------------- ### Create Tracks Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/GUIDE.md Instantiate and configure audio or note tracks by setting the name and content type. ```java Track audioTrack = new Track(); audioTrack.name = "Drums"; audioTrack.contentType = new ContentType[]{ContentType.AUDIO}; audioTrack.loaded = true; Track notesTrack = new Track(); notesTrack.name = "Bass"; notesTrack.contentType = new ContentType[]{ContentType.NOTES}; notesTrack.loaded = true; ``` -------------------------------- ### Creating Basic Metadata Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/MetaData.md Initialize a MetaData object and populate core fields. ```java MetaData metadata = new MetaData(); metadata.title = "My Song"; metadata.artist = "My Band"; metadata.album = "My Album"; metadata.year = "2024"; metadata.genre = "Rock"; ``` -------------------------------- ### Create Clip Launcher Scenes Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/GUIDE.md Instantiate a Scene object and populate it with clip slots for each track in the project structure. ```java Scene scene = new Scene(); scene.name = "Verse"; scene.id = "scene_1"; // Create clip slots for each track Lanes sceneContent = new Lanes(); sceneContent.timeUnit = TimeUnit.BEATS; for (Track track : project.structure) { ClipSlot slot = new ClipSlot(); slot.track = track; slot.hasStop = true; Clip clip = new Clip(); clip.time = 0.0; clip.duration = 8.0; slot.clip = clip; sceneContent.lanes.add(slot); } scene.content = sceneContent; project.scenes.add(scene); ``` -------------------------------- ### Create a Basic Channel Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Channel.md Initializes a new channel instance with a name, role, and audio channel count. ```java Channel channel = new Channel(); channel.name = "Guitar"; channel.role = MixerRole.REGULAR; channel.audioChannels = 2; ``` -------------------------------- ### Create a VST2 Plugin Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Device.md Initializes a VST2 plugin instance using a decimal integer for the device ID. ```java Vst2Plugin plugin = new Vst2Plugin(); plugin.deviceName = "Operator"; plugin.deviceID = "1234567890"; // VST2 uses decimal integer ID plugin.deviceRole = DeviceRole.INSTRUMENT; plugin.deviceVendor = "Ableton"; plugin.pluginVersion = "5.0"; ``` -------------------------------- ### Create Application Metadata Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Application.md Instantiate an Application object and assign it to a Project instance. ```java Application app = new Application(); app.name = "Bitwig Studio"; app.version = "5.0"; Project project = new Project(); project.application = app; ``` -------------------------------- ### Create an Audio Track in Java Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Track.md Instantiate a Track object and configure its content type and mixer channel for audio playback. ```java Track audioTrack = new Track(); audioTrack.name = "Drumloop"; audioTrack.contentType = new ContentType[]{ContentType.AUDIO}; audioTrack.loaded = true; audioTrack.color = "#b53bba"; Channel channel = new Channel(); channel.role = MixerRole.REGULAR; channel.audioChannels = 2; audioTrack.channel = channel; ``` -------------------------------- ### Configure Built-in Devices Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/GUIDE.md Instantiate and configure built-in audio processing devices like equalizers, compressors, gates, and limiters. ```java Equalizer eq = new Equalizer(); EqBand band = new EqBand(); band.type = EqBandType.HIGH_PASS; eq.bands.add(band); ``` ```java Compressor comp = new Compressor(); comp.threshold = createRealParameter(-20.0, Unit.DECIBEL); comp.ratio = createRealParameter(4.0, Unit.PERCENT); ``` ```java NoiseGate gate = new NoiseGate(); gate.threshold = createRealParameter(-40.0, Unit.DECIBEL); ``` ```java Limiter limiter = new Limiter(); limiter.threshold = createRealParameter(0.0, Unit.DECIBEL); ``` -------------------------------- ### Access Arrangement Data Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Arrangement.md Demonstrates how to load a project and inspect the arrangement's properties and automation data. ```java Project project = DawProject.loadProject(new File("project.dawproject")); if (project.arrangement != null) { Arrangement arr = project.arrangement; System.out.println("Arrangement ID: " + arr.id); if (arr.tempoAutomation != null) { System.out.println("Tempo Automation Points: " + arr.tempoAutomation.points.size()); } if (arr.timeSignatureAutomation != null) { System.out.println("Time Sig Automation Points: " + arr.timeSignatureAutomation.points.size()); } if (arr.markers != null) { System.out.println("Markers: " + arr.markers.markers.size()); } if (arr.lanes != null) { System.out.println("Track Lanes: " + arr.lanes.lanes.size()); } } ``` -------------------------------- ### Create a VST3 Plugin Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Device.md Initializes a VST3 plugin instance with specific metadata, enabled status, and an embedded state file. ```java Vst3Plugin plugin = new Vst3Plugin(); plugin.deviceName = "Serum"; plugin.deviceID = "5653544b-0001-4400-8000-000005000100"; // Xfer Serum ID plugin.deviceRole = DeviceRole.INSTRUMENT; plugin.deviceVendor = "Xfer Records"; plugin.pluginVersion = "1.33"; BoolParameter enabled = new BoolParameter(); enabled.value = true; plugin.enabled = enabled; FileReference state = new FileReference(); state.path = "plugins/serum_preset.clap-preset"; state.external = false; plugin.state = state; ``` -------------------------------- ### Create Enumeration Automation in Java Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Points.md Sets up enumeration-based automation using EnumPoint with HOLD interpolation. ```java Points enumAutomation = new Points(); enumAutomation.timeUnit = TimeUnit.BEATS; AutomationTarget target = new AutomationTarget(); target.parameter = "waveform_id"; enumAutomation.target = target; EnumPoint sine = new EnumPoint(); sine.time = 0.0; sine.value = 0; // Sine waveform sine.interpolation = Interpolation.HOLD; EnumPoint square = new EnumPoint(); square.time = 4.0; square.value = 1; // Square waveform square.interpolation = Interpolation.HOLD; enumAutomation.points.add(sine); enumAutomation.points.add(square); ``` -------------------------------- ### Load project from ZIP Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/DawProject.md Reads a project structure from a .dawproject ZIP file. ```java Project project = DawProject.loadProject(new File("project.dawproject")); System.out.println("App: " + project.application.name); System.out.println("Tracks: " + project.structure.size()); ``` -------------------------------- ### Create a Basic Send in Java Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Send.md Initializes a new Send object and assigns it to a channel with a defined destination and volume parameter. ```java Channel guitarChannel = new Channel(); guitarChannel.id = "guitar"; guitarChannel.name = "Guitar"; Channel reverbBus = new Channel(); reverbBus.id = "reverb_bus"; reverbBus.name = "Reverb"; Send send = new Send(); send.type = SendType.POST; send.destination = reverbBus; RealParameter sendLevel = new RealParameter(); sendLevel.value = 0.3; sendLevel.unit = Unit.LINEAR; sendLevel.min = 0.0; sendLevel.max = 1.0; sendLevel.name = "Level"; send.volume = sendLevel; guitarChannel.sends = new ArrayList<>(); guitarChannel.sends.add(send); ``` -------------------------------- ### Add VST3 Plugins Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/GUIDE.md Configure a VST3 plugin with device metadata and an optional state file reference. ```java Vst3Plugin synth = new Vst3Plugin(); synth.deviceName = "Serum"; synth.deviceID = "5653544b-0001-4400-8000-000005000100"; synth.deviceRole = DeviceRole.INSTRUMENT; synth.deviceVendor = "Xfer Records"; synth.pluginVersion = "1.33"; FileReference state = new FileReference(); state.path = "plugins/serum_state.vstpreset"; state.external = false; synth.state = state; channel.devices.add(synth); ``` -------------------------------- ### Complete Metadata Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/MetaData.md Populate all available metadata fields for a project. ```java MetaData metadata = new MetaData(); metadata.title = "Untitled"; metadata.artist = "John Doe"; metadata.album = "First Album"; metadata.originalArtist = ""; metadata.composer = "John Doe"; metadata.songwriter = "John Doe"; metadata.producer = "Producer Name"; metadata.arranger = "Arranger Name"; metadata.year = "2024"; metadata.genre = "Ambient"; metadata.copyright = "Copyright © 2024 John Doe"; metadata.website = "https://example.com"; metadata.comment = "This is a test project"; ``` -------------------------------- ### Organize file structure for saving Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/FileReference.md Group assets into subdirectories within the project ZIP by specifying path strings in the map. ```java // Audio files embeddedFiles.put(new File("kick.wav"), "audio/drum_kit/kick.wav"); embeddedFiles.put(new File("snare.wav"), "audio/drum_kit/snare.wav"); embeddedFiles.put(new File("hihat.wav"), "audio/drum_kit/hihat.wav"); // Plugin states embeddedFiles.put(new File("serum.vstpreset"), "plugins/synths/serum.vstpreset"); embeddedFiles.put(new File("wavetable.vstpreset"), "plugins/synths/wavetable.vstpreset"); // Effects embeddedFiles.put(new File("reverb.vstpreset"), "plugins/effects/reverb.vstpreset"); DawProject.save(project, metadata, embeddedFiles, new File("complete_project.dawproject")); ``` -------------------------------- ### Add CLAP Plugins Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/GUIDE.md Initialize a CLAP plugin using a string-based device ID. ```java ClapPlugin plugin = new ClapPlugin(); plugin.deviceName = "Surge XT"; plugin.deviceID = "org.surge-synth-team.surge-xt"; plugin.deviceRole = DeviceRole.INSTRUMENT; ``` -------------------------------- ### Create a Master Channel Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Channel.md Initializes a channel with the MASTER role and specific volume settings. ```java Channel masterChannel = new Channel(); masterChannel.name = "Master"; masterChannel.role = MixerRole.MASTER; masterChannel.audioChannels = 2; RealParameter volume = new RealParameter(); volume.value = 1.0; volume.unit = Unit.LINEAR; volume.min = 0.0; volume.max = 2.0; masterChannel.volume = volume; ``` -------------------------------- ### Accessing Transport Data in Java Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Transport.md Demonstrates how to safely retrieve and print tempo and time signature values from a loaded project. ```java Project project = DawProject.loadProject(new File("project.dawproject")); if (project.transport != null) { if (project.transport.tempo != null) { System.out.println("Tempo: " + project.transport.tempo.value + " BPM"); } if (project.transport.timeSignature != null) { System.out.println("Time Signature: " + project.transport.timeSignature.numerator + "/" + project.transport.timeSignature.denominator); } } ``` -------------------------------- ### Compare Application Versions Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Application.md Use the Version utility to verify if the application version meets minimum requirements. ```java Application app = project.application; if (app != null) { Version appVersion = Version.parse(app.version); Version minRequired = Version.parse("5.0.0"); if (appVersion.isAtLeast(minRequired)) { System.out.println("Application version is supported"); } else { System.out.println("Application version may not be fully supported"); } } ``` -------------------------------- ### Use Infinity Values Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/RealParameter.md Demonstrates setting infinite values for parameters. ```java RealParameter threshold = new RealParameter(); threshold.value = Double.POSITIVE_INFINITY; threshold.unit = Unit.DECIBEL; threshold.min = Double.NEGATIVE_INFINITY; threshold.max = 0.0; threshold.name = "Threshold"; ``` -------------------------------- ### Add Plugins to a Channel Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Channel.md Populates the devices list with Vst3Plugin instances. ```java Channel channel = new Channel(); channel.name = "Vocals"; channel.role = MixerRole.REGULAR; Vst3Plugin compressor = new Vst3Plugin(); compressor.deviceName = "FabFilter Pro-C 2"; compressor.deviceID = "8800..." ; // FabFilter ID compressor.deviceRole = DeviceRole.AUDIO_FX; Vst3Plugin eq = new Vst3Plugin(); eq.deviceName = "FabFilter Pro-Q 3"; eq.deviceID = "8801..."; eq.deviceRole = DeviceRole.AUDIO_FX; channel.devices = new ArrayList<>(); channel.devices.add(compressor); channel.devices.add(eq); ``` -------------------------------- ### Channel Parameters Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Parameter.md Sets up volume, pan, and mute parameters for a channel. ```java Channel channel = new Channel(); // Volume RealParameter volume = new RealParameter(); volume.value = 1.0; volume.unit = Unit.LINEAR; volume.min = 0.0; volume.max = 2.0; channel.volume = volume; // Pan RealParameter pan = new RealParameter(); pan.value = 0.5; pan.unit = Unit.NORMALIZED; pan.min = 0.0; pan.max = 1.0; channel.pan = pan; // Mute BoolParameter mute = new BoolParameter(); mute.value = false; channel.mute = mute; ``` -------------------------------- ### loadProject Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/DawProject.md Loads a project from a ZIP file. ```APIDOC ## public static Project loadProject(File file) ### Description Loads a project from a ZIP file. ### Parameters - **file** (File) - Required - The .dawproject ZIP file to load ### Returns - **Project** - The loaded project object ### Throws - IOException - Could not load the project ``` -------------------------------- ### Create an Audio Effect Plugin Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Device.md Initializes a VST3 plugin configured as an audio effect. ```java Vst3Plugin compressor = new Vst3Plugin(); compressor.deviceName = "Pro-C 2"; compressor.deviceID = "8800..."; // FabFilter ID compressor.deviceRole = DeviceRole.AUDIO_FX; compressor.deviceVendor = "FabFilter"; ``` -------------------------------- ### Add Devices to Channel Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/INDEX.md Configures a VST3 plugin instance and appends it to a channel's device list. ```java Vst3Plugin plugin = new Vst3Plugin(); plugin.deviceName = "Synth Name"; plugin.deviceRole = DeviceRole.INSTRUMENT; channel.devices.add(plugin); ``` -------------------------------- ### Loading Metadata Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/MetaData.md Load and display metadata from an existing .dawproject file. ```java MetaData metadata = DawProject.loadMetadata(new File("song.dawproject")); System.out.println("Title: " + metadata.title); System.out.println("Artist: " + metadata.artist); System.out.println("Album: " + metadata.album); System.out.println("Genre: " + metadata.genre); System.out.println("Year: " + metadata.year); System.out.println("Copyright: " + metadata.copyright); System.out.println("Website: " + metadata.website); System.out.println("Comment: " + metadata.comment); ``` -------------------------------- ### Add Devices to a Track in Java Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Track.md Attach a VST3 plugin to a track's channel by adding it to the channel's devices list. ```java Track track = new Track(); track.name = "Synth Track"; track.contentType = new ContentType[]{ContentType.NOTES}; Channel channel = new Channel(); // ... configure channel ... Vst3Plugin synth = new Vst3Plugin(); synth.deviceName = "Serum"; synth.deviceID = "5653544b-0001-4400-8000-000005000100"; // Xfer Serum VST3 ID synth.deviceRole = DeviceRole.INSTRUMENT; channel.devices.add(synth); track.channel = channel; ``` -------------------------------- ### Saving with Metadata Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/MetaData.md Save a project along with its associated metadata to a file. ```java Project project = new Project(); // ... configure project ... MetaData metadata = new MetaData(); metadata.title = "My Song"; metadata.artist = "My Artist"; Map embeddedFiles = new HashMap<>(); DawProject.save(project, metadata, embeddedFiles, new File("song.dawproject")); ``` -------------------------------- ### Create an external file reference Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/FileReference.md Set external to true to treat the path as relative to the .dawproject file location. ```java FileReference externalAudio = new FileReference(); externalAudio.path = "../shared_samples/kick.wav"; externalAudio.external = true; // File is relative to .dawproject ``` -------------------------------- ### Create a Notes Track in Java Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Track.md Configure a track specifically for note data, ensuring the content type is set to NOTES. ```java Track notesTrack = new Track(); notesTrack.name = "Bass"; notesTrack.contentType = new ContentType[]{ContentType.NOTES}; notesTrack.loaded = true; notesTrack.color = "#a2eabf"; Channel channel = new Channel(); channel.role = MixerRole.REGULAR; audioTrack.channel = channel; ``` -------------------------------- ### Create a Master Track in Java Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Track.md Configure a master track with the MASTER mixer role and appropriate content types. ```java Track masterTrack = new Track(); masterTrack.name = "Master"; masterTrack.contentType = new ContentType[]{ContentType.AUDIO, ContentType.NOTES}; Channel channel = new Channel(); channel.role = MixerRole.MASTER; channel.audioChannels = 2; masterTrack.channel = channel; ``` -------------------------------- ### Create MIDI Notes Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/GUIDE.md Initializes a Notes timeline and adds individual Note objects with specified timing, pitch, and velocity properties. ```java Notes notesTimeline = new Notes(); notesTimeline.timeUnit = TimeUnit.BEATS; Note note1 = new Note(); note1.time = 0.0; note1.duration = 0.25; note1.key = 60; note1.velocity = 0.8; note1.releaseVelocity = 0.5; Note note2 = new Note(); note2.time = 1.0; note2.duration = 0.25; note2.key = 64; note2.velocity = 0.7; notesTimeline.notes.add(note1); notesTimeline.notes.add(note2); ``` -------------------------------- ### Create a basic Arrangement Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Arrangement.md Initializes a new Arrangement object with a unique ID and name, and sets the time unit for its lanes. ```java Arrangement arrangement = new Arrangement(); arrangement.id = "arrangement1"; arrangement.name = "Main"; Lanes lanes = new Lanes(); lanes.timeUnit = TimeUnit.BEATS; arrangement.lanes = lanes; ``` -------------------------------- ### Initialize Arrangement Structure Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/GUIDE.md Constructs the arrangement hierarchy by iterating through project tracks and creating lane containers. ```java Arrangement arrangement = new Arrangement(); // Create lanes structure Lanes lanes = new Lanes(); lanes.timeUnit = TimeUnit.BEATS; // For each track, add a lanes container for (Track track : project.structure) { Lanes trackLane = new Lanes(); trackLane.track = track; trackLane.timeUnit = TimeUnit.BEATS; Clips clips = new Clips(); clips.timeUnit = TimeUnit.BEATS; trackLane.lanes.add(clips); lanes.lanes.add(trackLane); } arrangement.lanes = lanes; project.arrangement = arrangement; ``` -------------------------------- ### Create Integer Automation in Java Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Points.md Configures integer-based automation using IntegerPoint with HOLD interpolation. ```java Points intAutomation = new Points(); intAutomation.timeUnit = TimeUnit.BEATS; AutomationTarget target = new AutomationTarget(); target.parameter = "preset_id"; intAutomation.target = target; IntegerPoint point1 = new IntegerPoint(); point1.time = 0.0; point1.value = 0; point1.interpolation = Interpolation.HOLD; // No interpolation for integers IntegerPoint point2 = new IntegerPoint(); point2.time = 8.0; point2.value = 5; point2.interpolation = Interpolation.HOLD; intAutomation.points.add(point1); intAutomation.points.add(point2); ``` -------------------------------- ### DawProject.loadMetadata Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Project.md Loads the metadata associated with a .dawproject file. ```APIDOC ## DawProject.loadMetadata ### Description Extracts the metadata from a .dawproject file without loading the full project structure. ### Parameters - **file** (File) - The source file to load. ### Returns - **MetaData** - The metadata object containing title, artist, etc. ``` -------------------------------- ### Create a CLAP Plugin Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Device.md Initializes a CLAP plugin instance using a text-based identifier. ```java ClapPlugin plugin = new ClapPlugin(); plugin.deviceName = "Surge XT"; plugin.deviceID = "org.surge-synth-team.surge-xt"; // CLAP uses text ID plugin.deviceRole = DeviceRole.INSTRUMENT; plugin.deviceVendor = "Surge Synth Team"; plugin.pluginVersion = "1.2.3"; ``` -------------------------------- ### Project File Organization Structure Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/README.md Visual representation of the documentation directory structure for the DAWproject API. ```text output/ ├── README.md (This file) ├── INDEX.md (Quick reference index) ├── GUIDE.md (Comprehensive guide) ├── types.md (Type definitions) └── api-reference/ (API documentation) ├── DawProject.md ├── Project.md ├── Track.md ├── Channel.md ├── Device.md ├── Arrangement.md ├── Clip.md ├── Parameter.md ├── Points.md ├── Transport.md ├── MetaData.md ├── Application.md ├── RealParameter.md ├── BoolParameter.md ├── Lanes.md ├── Send.md └── FileReference.md ``` -------------------------------- ### Creating Automation Points Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/api-reference/Parameter.md Shows how to define automation curves using time-based points and interpolation settings. ```java Points automation = new Points(); automation.timeUnit = TimeUnit.BEATS; automation.unit = Unit.NORMALIZED; AutomationTarget target = new AutomationTarget(); target.parameter = "param_cutoff_id"; automation.target = target; RealPoint point1 = new RealPoint(); point1.time = 0.0; point1.value = 0.3; point1.interpolation = Interpolation.LINEAR; RealPoint point2 = new RealPoint(); point2.time = 8.0; point2.value = 0.8; automation.points.add(point1); automation.points.add(point2); ``` -------------------------------- ### Save a project Source: https://github.com/bitwig/dawproject/blob/main/_autodocs/GUIDE.md Writes project data, metadata, and associated files to a .dawproject container. ```java Project project = new Project(); MetaData metadata = new MetaData(); Map embeddedFiles = new HashMap<>(); DawProject.save(project, metadata, embeddedFiles, new File("song.dawproject")); ```