From 4d0fd9a02ef33bee6256c1bfe536427cf72411d0 Mon Sep 17 00:00:00 2001 From: Ali Somay Date: Wed, 18 Dec 2024 11:57:56 +0100 Subject: [PATCH] Add copy and reset commands --- Cargo.lock | 93 +- externals/rytm/API_DOCS.md | 20 + externals/rytm/README.md | 7 +- externals/rytm/rytm-external/src/lib.rs | 47 +- externals/rytm/rytm-external/src/utils.rs | 3 +- externals/rytm/rytm-object/Cargo.toml | 5 +- externals/rytm/rytm-object/src/api.rs | 1 + externals/rytm/rytm-object/src/api/global.rs | 3 + externals/rytm/rytm-object/src/api/kit.rs | 36 + externals/rytm/rytm-object/src/api/pattern.rs | 40 + .../rytm/rytm-object/src/api/settings.rs | 3 + externals/rytm/rytm-object/src/api/sound.rs | 5 + externals/rytm/rytm-object/src/error.rs | 4 + externals/rytm/rytm-object/src/parse.rs | 58 +- externals/rytm/rytm-object/src/parse/types.rs | 6 + externals/rytm/rytm-object/src/types.rs | 2 + justfile | 11 + petunia/docs/rytm.maxref.xml | 43 + petunia/help/rytm.maxhelp | 2066 ++++++++++++++++- 19 files changed, 2386 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index baf6721..fc9b0bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -42,7 +42,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.89", + "syn 2.0.90", "which", ] @@ -72,9 +72,9 @@ checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" [[package]] name = "cc" -version = "1.2.1" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" dependencies = [ "shlex", ] @@ -142,12 +142,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -156,7 +156,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -181,7 +181,7 @@ version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -216,9 +216,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "lazy_static" @@ -234,15 +234,15 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.164" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets", @@ -442,7 +442,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -550,7 +550,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -587,8 +587,8 @@ dependencies = [ [[package]] name = "rytm-rs" -version = "0.1.2" -source = "git+https://github.com/alisomay/rytm-rs.git?branch=main#b61e838610071714ae5ce506987fc806341cf0fe" +version = "0.1.3" +source = "git+https://github.com/alisomay/rytm-rs.git?branch=main#5638457daeb8359870d3d05b23edee480db89f45" dependencies = [ "bitstream-io", "derivative", @@ -610,7 +610,7 @@ checksum = "fbe3ddcd78e30275a5563fd59b2f7239272b3c6ffcd49f8ceb861ec8ae0d88b5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -667,7 +667,7 @@ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -716,9 +716,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.89" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -727,22 +727,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.3" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +checksum = "643caef17e3128658ff44d85923ef2d28af81bb71e0d67bbfe1d76f19a73e053" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.3" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +checksum = "995d0bbc9995d1f19d28b7215a9352b0fc3cd3a2d2ec95c2cadc485cdedbcdde" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -757,9 +757,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -768,20 +768,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -789,9 +789,9 @@ dependencies = [ [[package]] name = "tracing-error" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" dependencies = [ "tracing", "tracing-subscriber", @@ -810,9 +810,9 @@ dependencies = [ [[package]] name = "tracing-serde" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" dependencies = [ "serde", "tracing-core", @@ -820,9 +820,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -921,7 +921,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -932,7 +932,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.90", ] [[package]] @@ -953,6 +953,15 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" version = "0.52.6" diff --git a/externals/rytm/API_DOCS.md b/externals/rytm/API_DOCS.md index 8406ea4..da0f48b 100644 --- a/externals/rytm/API_DOCS.md +++ b/externals/rytm/API_DOCS.md @@ -31,6 +31,8 @@ Also do not forget to check the max help files and max reference for the `rytm` - `set` Sets data to the `rytm` external. - `load` Loads either full or partial project data using `.rytm` or `.sysex` files. - `save` Saves either full or partial project data using `.rytm` or `.sysex` files. + - `copy` Copies full patterns and kits in the external. + - `reset` Resets the external to its default state. - `loglevel` `rytm` also logs to stdout with different levels of verbosity using [`tracing`](https://docs.rs/tracing/latest/tracing/) this selector is used to set the log level in runtime. - `` A symbol which defines the type of the object. - `pattern` A pattern. @@ -117,6 +119,24 @@ Examples: - `save ~/Desktop/project.rytm` - `save settings ~/Desktop/settings.sysex` +## Copy format + +The copy format is used to copy full patterns and kits in the external. + +`copy []` + +Depending on the type of the object `` can be either a source index or a target index. +For work buffer objects `` is the target index. On the other hand for non-work buffer objects `` is the source index. + +Examples: + +- `copy pattern 1 2` +- `copy pattern 1` -> _Copies the pattern to the work buffer._ +- `copy kit 1 2` +- `copy kit 1` -> _Copies the kit to the work buffer._ +- `copy pattern_wb 1` +- `copy kit_wb 1` + ## Get format The get format is used to get data from the `rytm` external. diff --git a/externals/rytm/README.md b/externals/rytm/README.md index 7c5eded..c4c9c7b 100644 --- a/externals/rytm/README.md +++ b/externals/rytm/README.md @@ -146,11 +146,16 @@ Accepted formats are: This is done by starting our messages with `get` selector. The details of the format and the output format are explained in the [api docs](API_DOCS.md). -#### Setting data in the `rytm` external +#### Setting data in `rytm` external This is done by starting our messages with `set` selector. The details of the format and the input format are explained in the [api docs](API_DOCS.md). +#### Copying patterns and kits in `rytm` external + +This is done by starting our messages with `copy` selector. +The details of the format and the input format are explained in the [api docs](API_DOCS.md). + #### Parameter locking The pattern structure holds the parameter lock pool for that pattern. diff --git a/externals/rytm/rytm-external/src/lib.rs b/externals/rytm/rytm-external/src/lib.rs index 48a59fd..2aec744 100644 --- a/externals/rytm/rytm-external/src/lib.rs +++ b/externals/rytm/rytm-external/src/lib.rs @@ -38,6 +38,7 @@ use median::{ wrapper::MaxObjWrapper, }; use rytm_object::{api::Response, types::CommandType, value::RytmValue, RytmObject}; +use rytm_rs::RytmProject; use std::sync::{ atomic::{AtomicIsize, Ordering}, Arc, @@ -82,11 +83,12 @@ impl RytmExternal { const SELECTOR_SET: &'static str = "set"; const SELECTOR_GET: &'static str = "get"; const SELECTOR_LOG_LEVEL: &'static str = "loglevel"; + const SELECTOR_COPY: &'static str = "copy"; + const SELECTOR_RESET: &'static str = "reset"; // TODO: Implementations for these are sketches. // For proper impl move some of the logic to the RytmObject. // Make nice interfaces with proper error handling management here. - const SELECTOR_LOAD: &'static str = "load"; const SELECTOR_SAVE: &'static str = "save"; @@ -133,6 +135,8 @@ impl RytmExternal { Self::SELECTOR_LOG_LEVEL, Self::SELECTOR_LOAD, Self::SELECTOR_SAVE, + Self::SELECTOR_COPY, + Self::SELECTOR_RESET ].join(", "); match selector.as_str() { Self::SELECTOR_QUERY => self.query(atoms), @@ -142,6 +146,8 @@ impl RytmExternal { Self::SELECTOR_LOG_LEVEL => self.change_log_level(atoms), Self::SELECTOR_LOAD => self.load(atoms), Self::SELECTOR_SAVE => self.save(atoms), + Self::SELECTOR_COPY => self.copy(atoms), + Self::SELECTOR_RESET => self.reset(atoms), _ => Err(format!("Parse Error: Invalid command type {selector}. Possible commands are {possible_selectors}.").into()), }.inspect_err(|_| { if selector.as_str() != Self::SELECTOR_LOG_LEVEL { @@ -249,6 +255,38 @@ impl RytmExternal { Ok(()) } + #[instrument(skip_all)] + pub fn copy(&self, atoms: &[Atom]) -> Result<(), RytmExternalError> { + self.response_to_outlet( + self.inner + .command(CommandType::Copy, self.get_rytm_values(atoms)?)?, + ) + .ok(); + + Ok(()) + } + + #[instrument(skip_all)] + pub fn reset(&self, atoms: &[Atom]) -> Result<(), RytmExternalError> { + if !atoms.is_empty() { + let warning = + "Warning: Reset command does not accept any arguments. Ignoring the arguments."; + self.send_status_warning(); + warn!("{}", warning); + warning.obj_warn(self.max_obj()); + } + + if let Ok(p) = RytmProject::try_default().inspect_err(|err| { + let err = format!("Error creating new RytmProject while resetting: {err}"); + self.send_status_error(); + error!("{}", err); + err.obj_error(self.max_obj()); + }) { + *self.inner.project.lock() = p; + } + Ok(()) + } + #[instrument(skip_all)] #[log_errors] fn get_rytm_values( @@ -310,6 +348,13 @@ impl RytmExternal { value.as_atom(), ][..], ), + Response::Unsupported(reason) => { + self.send_status_warning(); + let warning = format!("Warning: Unsupported action. Rytm will currently ignore this command. Reason: {reason}"); + warning.obj_warn(self.max_obj()); + warn!("{}", warning); + Ok(()) + } Response::Ok => Ok(()), } .inspect_err(|_| { diff --git a/externals/rytm/rytm-external/src/utils.rs b/externals/rytm/rytm-external/src/utils.rs index aa62ff3..7fd4d80 100644 --- a/externals/rytm/rytm-external/src/utils.rs +++ b/externals/rytm/rytm-external/src/utils.rs @@ -1,10 +1,9 @@ +use crate::{traits::Post, RytmExternal}; use camino::Utf8PathBuf; use homedir::my_home; use median::object::MaxObj; use tracing::{debug, instrument, warn}; -use crate::{traits::Post, RytmExternal}; - impl RytmExternal { #[instrument( skip(self), diff --git a/externals/rytm/rytm-object/Cargo.toml b/externals/rytm/rytm-object/Cargo.toml index 7e046c9..7c4cf59 100644 --- a/externals/rytm/rytm-object/Cargo.toml +++ b/externals/rytm/rytm-object/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rytm-object" version = "0.1.0" -authors = [ "Ali Somay " ] +authors = ["Ali Somay "] edition = "2021" [dependencies] @@ -16,6 +16,3 @@ thiserror = "2" lazy_static = "1.4.0" tracing = "0.1" parking_lot = "0.12" - - - diff --git a/externals/rytm/rytm-object/src/api.rs b/externals/rytm/rytm-object/src/api.rs index d45252b..411b2eb 100644 --- a/externals/rytm/rytm-object/src/api.rs +++ b/externals/rytm/rytm-object/src/api.rs @@ -635,5 +635,6 @@ pub enum Response { key: RytmValue, value: RytmValue, }, + Unsupported(String), Ok, } diff --git a/externals/rytm/rytm-object/src/api/global.rs b/externals/rytm/rytm-object/src/api/global.rs index b708c53..6e8378c 100644 --- a/externals/rytm/rytm-object/src/api/global.rs +++ b/externals/rytm/rytm-object/src/api/global.rs @@ -62,6 +62,9 @@ pub fn handle( } } } + CommandType::Copy => Ok(Response::Unsupported( + "Currently copy command is not supported for global object. If you need this badly please open an issue and implementation will be considered.".into(), + )), } } diff --git a/externals/rytm/rytm-object/src/api/kit.rs b/externals/rytm/rytm-object/src/api/kit.rs index 5444295..45ac5da 100644 --- a/externals/rytm/rytm-object/src/api/kit.rs +++ b/externals/rytm/rytm-object/src/api/kit.rs @@ -137,6 +137,42 @@ pub fn handle( } } } + CommandType::Copy => { + match next_token { + Some(ParsedValue::CopyTargetIndex(target_index)) => { + let target_index = *target_index; + if let Some(i) = index { + if i == target_index { + return Ok(Response::Ok); + } + let source = guard.kits()[i].clone(); + let target = &mut guard.kits_mut()[target_index]; + target.copy_data_from(&source); + } else { + let source = guard.work_buffer().kit().clone(); + let target = &mut guard.kits_mut()[target_index]; + target.copy_data_from(&source); + } + } + None => { + // Copy to work buffer + if let Some(i) = index { + let source = guard.kits()[i].clone(); + let target = guard.work_buffer_mut().kit_mut(); + target.copy_data_from(&source); + } else { + // We're not going to copy from work buffer to work buffer. + // It's a no-op. + return Ok(Response::Ok); + } + } + _ => { + unreachable!("Parser should take care of this. Invalid copy format.") + } + } + + return Ok(Response::Ok); + } } } diff --git a/externals/rytm/rytm-object/src/api/pattern.rs b/externals/rytm/rytm-object/src/api/pattern.rs index fcb138b..cdb89c7 100644 --- a/externals/rytm/rytm-object/src/api/pattern.rs +++ b/externals/rytm/rytm-object/src/api/pattern.rs @@ -29,6 +29,43 @@ pub fn handle( let mut tokens = tokens[1..].iter(); + if let CommandType::Copy = command_type { + match tokens.next() { + Some(ParsedValue::CopyTargetIndex(target_index)) => { + let target_index = *target_index; + if let Some(i) = index { + if i == target_index { + return Ok(Response::Ok); + } + let source = guard.patterns()[i].clone(); + let target = &mut guard.patterns_mut()[target_index]; + target.copy_data_from(&source); + } else { + let source = guard.work_buffer().pattern().clone(); + let target = &mut guard.patterns_mut()[target_index]; + target.copy_data_from(&source); + } + } + None => { + // Copy to work buffer + if let Some(i) = index { + let source = guard.patterns()[i].clone(); + let target = guard.work_buffer_mut().pattern_mut(); + target.copy_data_from(&source); + } else { + // We're not going to copy from work buffer to work buffer. + // It's a no-op. + return Ok(Response::Ok); + } + } + _ => { + unreachable!("Parser should take care of this. Invalid copy format.") + } + } + + return Ok(Response::Ok); + } + match tokens.next() { Some(ParsedValue::TrackIndex(track_index)) => match tokens.next() { Some(ParsedValue::TrigIndex(trig_index)) => match tokens.next() { @@ -48,6 +85,7 @@ pub fn handle( Some(ident_or_enum) => { // Treat as trig and apply the command. match command_type { + CommandType::Copy => unreachable!("Copy command should be handled before."), CommandType::Get => { let object = index.map_or_else( || { @@ -115,6 +153,7 @@ pub fn handle( Some(ident_or_enum) => { // Treat as track and apply the command. match command_type { + CommandType::Copy => unreachable!("Copy command should be handled before."), CommandType::Get => { let object = index.map_or_else( || &guard.work_buffer().pattern().tracks()[*track_index], @@ -171,6 +210,7 @@ pub fn handle( Some(ident_or_enum) => { // Treat as pattern and apply the command. match command_type { + CommandType::Copy => unreachable!("Copy command should be handled before."), CommandType::Get => { let object = index .map_or_else(|| guard.work_buffer().pattern(), |i| &guard.patterns()[i]); diff --git a/externals/rytm/rytm-object/src/api/settings.rs b/externals/rytm/rytm-object/src/api/settings.rs index 5652c11..c0c0b42 100644 --- a/externals/rytm/rytm-object/src/api/settings.rs +++ b/externals/rytm/rytm-object/src/api/settings.rs @@ -52,6 +52,9 @@ pub fn handle( } } } + CommandType::Copy => Ok(Response::Unsupported( + "Copy command is not supported for settings object".into(), + )), } } diff --git a/externals/rytm/rytm-object/src/api/sound.rs b/externals/rytm/rytm-object/src/api/sound.rs index 524f5e0..a53e714 100644 --- a/externals/rytm/rytm-object/src/api/sound.rs +++ b/externals/rytm/rytm-object/src/api/sound.rs @@ -105,6 +105,11 @@ pub fn handle( } } } + + // TODO: Implement for the release! + CommandType::Copy => Ok(Response::Unsupported( + "Currently copy is not supported for sounds. If you need this badly please open an issue and implementation will be considered.".into(), + )), } } diff --git a/externals/rytm/rytm-object/src/error.rs b/externals/rytm/rytm-object/src/error.rs index 02e52c3..533be77 100644 --- a/externals/rytm/rytm-object/src/error.rs +++ b/externals/rytm/rytm-object/src/error.rs @@ -38,6 +38,10 @@ pub enum ParseError { "Parse Error: Query selector index missing or invalid: This query selector must be followed by an integer index." )] QuerySelectorIndexMissingOrInvalid, + #[error("Parse Error: Command needs to be followed by an index.")] + CommandNeedsIndex, + #[error("Parse Error: copy command is not supported for settings object since the settings object is global.")] + CopyCommandNotSupportedForSettings, #[error("Parse Error: Parameter lock operation {0} is invalid. {1}")] InvalidPlockOperation(String, String), diff --git a/externals/rytm/rytm-object/src/parse.rs b/externals/rytm/rytm-object/src/parse.rs index b42fabf..c88adbc 100644 --- a/externals/rytm/rytm-object/src/parse.rs +++ b/externals/rytm/rytm-object/src/parse.rs @@ -53,6 +53,63 @@ pub fn parse_command( // Add the object type to the result result.push(ParsedValue::ObjectType(object_type_selector)); + // Handle special case for 'copy' command + if let CommandType::Copy = command_type { + if values.len() > 3 { + return Err(ParseError::InvalidFormat( + "Copy command only supports a maximum of 3 arguments.".to_owned(), + )) + .inspect_err(|err| { + error!("{}", err); + }); + } + match iter.next() { + Some(RytmValue::Int(target_index)) => { + match object_type_selector { + ObjectTypeSelector::Pattern(_) | ObjectTypeSelector::PatternWorkBuffer => { + validate_index(target_index, 0, 127, "Pattern index")?; + } + ObjectTypeSelector::Kit(_) | ObjectTypeSelector::KitWorkBuffer => { + validate_index(target_index, 0, 127, "Kit index")?; + } + ObjectTypeSelector::Sound(_) | ObjectTypeSelector::SoundWorkBuffer(_) => { + validate_index(target_index, 0, 127, "Sound index")?; + } + ObjectTypeSelector::Global(_) | ObjectTypeSelector::GlobalWorkBuffer => { + validate_index(target_index, 0, 3, "Global index")?; + } + ObjectTypeSelector::Settings => { + return Err(ParseError::CopyCommandNotSupportedForSettings).inspect_err( + |err| { + error!("{}", err); + }, + ); + } + } + + result.push(ParsedValue::CopyTargetIndex(*target_index as usize)); + return Ok(result); + } + None => { + if !object_type_selector.is_indexable() { + return Err(ParseError::InvalidFormat( + "Copying work buffer object to a stored object requires a target index." + .to_owned(), + )) + .inspect_err(|err| { + error!("{}", err); + }); + } + return Ok(result); + } + _ => { + return Err(ParseError::InvalidFormat("Copy command requires either an integer index or nothing which would make the copy target the work buffer target.".to_owned())).inspect_err(|err| { + error!("{}", err); + }); + } + } + } + // Continue parsing the remainder of the command parse_remainder(command_type, &object_type_selector, &mut iter, &mut result)?; @@ -1105,7 +1162,6 @@ mod tests { } #[test] - fn test_set_focused_parse_requires_enum_values() { // set focused sequencermode let values = vec![ diff --git a/externals/rytm/rytm-object/src/parse/types.rs b/externals/rytm/rytm-object/src/parse/types.rs index a675fb7..53eea38 100644 --- a/externals/rytm/rytm-object/src/parse/types.rs +++ b/externals/rytm/rytm-object/src/parse/types.rs @@ -67,6 +67,10 @@ pub enum ParsedValue { ElementIndex(usize), /// A plock operation (e.g., "plockget", "plockset", "plockclear") PlockOperation(PlockOperation), + /// The target index for a copy operation + CopySourceIndex(usize), + /// The target index for a copy operation + CopyTargetIndex(usize), } impl std::fmt::Display for ParsedValue { @@ -85,6 +89,8 @@ impl std::fmt::Display for ParsedValue { ParsedValue::Element(s) => write!(f, "{}", s), ParsedValue::ElementIndex(i) => write!(f, "{}", i), ParsedValue::PlockOperation(s) => write!(f, "{}", s), + ParsedValue::CopyTargetIndex(i) => write!(f, "{}", i), + ParsedValue::CopySourceIndex(i) => write!(f, "{}", i), } } } diff --git a/externals/rytm/rytm-object/src/types.rs b/externals/rytm/rytm-object/src/types.rs index c677028..61a8164 100644 --- a/externals/rytm/rytm-object/src/types.rs +++ b/externals/rytm/rytm-object/src/types.rs @@ -5,6 +5,7 @@ use std::str::FromStr; pub enum CommandType { Get, Set, + Copy, } impl FromStr for CommandType { @@ -14,6 +15,7 @@ impl FromStr for CommandType { match s { "get" => Ok(Self::Get), "set" => Ok(Self::Set), + "copy" => Ok(Self::Copy), other => Err(ParseError::InvalidCommandType(other.to_owned())), } } diff --git a/justfile b/justfile index 7afc1e8..49f0fd1 100644 --- a/justfile +++ b/justfile @@ -16,6 +16,17 @@ TEAM_ID := env_var('TEAM_ID') notarize: #!/usr/bin/env bash + + cleanup() { + local dir="{{justfile_directory()}}/petunia/externals" + echo "🧹 Cleaning up artifacts..." + rm -f "${dir}/rytm.zip" + rm -f "${dir}/rytm_notarization.log" + } + + # Register cleanup function to run on script exit + trap cleanup EXIT + set -euo pipefail cd {{justfile_directory()}}/petunia/externals rm -f rytm.zip diff --git a/petunia/docs/rytm.maxref.xml b/petunia/docs/rytm.maxref.xml index b3d8aff..de2512d 100644 --- a/petunia/docs/rytm.maxref.xml +++ b/petunia/docs/rytm.maxref.xml @@ -347,6 +347,47 @@ + + + + + + + + Copy a pattern or kit to another target. + + + The copy format is used to copy full patterns and kits in the external. +
+
+ Format: save <object> <index> [<target-index>] +
+
+ Depending on the type of the object <index> can be either a source index or a target index. + For work buffer objects <index> is the target index. On the other hand for non-work buffer objects <index> is the source index. +
+
+ Examples: +
    +
  • copy pattern 1 2
  • +
  • copy pattern 1 - Copies the pattern to the work buffer.
  • +
  • copy kit 1 2
  • +
  • copy kit 1 - Copies the kit to the work buffer.
  • +
  • copy pattern_wb 1
  • +
  • copy kit_wb 1
  • +
+
+
+ + + + Reset the rytm object to the default state. + + + Reset the rytm object to the default state. + + + @@ -421,6 +462,8 @@
  • set Sets data to the rytm external.
  • load Loads either full or partial project data using .rytm or .sysex files.
  • save Saves either full or partial project data using .rytm or .sysex files.
  • +
  • copy Copies a pattern or kit to another.
  • +
  • reset Resets the rytm external to its default state.
  • loglevel rytm also logs to stdout with different levels of verbosity using tracing, this selector is used to set the log level in runtime.
  • diff --git a/petunia/help/rytm.maxhelp b/petunia/help/rytm.maxhelp index f9e0c34..3ddd4c5 100644 --- a/petunia/help/rytm.maxhelp +++ b/petunia/help/rytm.maxhelp @@ -41,6 +41,1892 @@ "showontab" : 0, "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 0, + "patcher" : { + "fileversion" : 1, + "appversion" : { + "major" : 8, + "minor" : 6, + "revision" : 0, + "architecture" : "x64", + "modernui" : 1 + } +, + "classnamespace" : "box", + "rect" : [ 0.0, 26.0, 1386.0, 958.0 ], + "bglocked" : 0, + "openinpresentation" : 0, + "default_fontsize" : 13.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 1, + "gridsize" : [ 15.0, 15.0 ], + "gridsnaponopen" : 1, + "objectsnaponopen" : 1, + "statusbarvisible" : 2, + "toolbarvisible" : 1, + "lefttoolbarpinned" : 0, + "toptoolbarpinned" : 0, + "righttoolbarpinned" : 0, + "bottomtoolbarpinned" : 0, + "toolbars_unpinned_last_save" : 0, + "tallnewobj" : 0, + "boxanimatetime" : 200, + "enablehscroll" : 1, + "enablevscroll" : 1, + "devicewidth" : 0.0, + "description" : "", + "digest" : "", + "tags" : "", + "style" : "", + "subpatcher_template" : "", + "showontab" : 1, + "assistshowspatchername" : 0, + "boxes" : [ { + "box" : { + "bubble" : 1, + "bubble_bgcolor" : [ 0.796078431372549, 0.725490196078431, 0.870588235294118, 1.0 ], + "bubbleside" : 2, + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-133", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 17.5, 141.0, 134.0, 40.0 ], + "style" : "helpfile_label", + "text" : "Reset to default state" + } + + } +, { + "box" : { + "id" : "obj-134", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 66.5, 184.0, 37.0, 23.0 ], + "text" : "reset" + } + + } +, { + "box" : { + "bgcolor" : [ 0.847058823529412, 0.890196078431372, 0.607843137254902, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-132", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 1207.0, 605.5, 96.0, 53.0 ], + "presentation_linecount" : 3, + "text" : "Some example warnings:" + } + + } +, { + "box" : { + "bgcolor" : [ 0.56078431372549, 0.592156862745098, 0.32156862745098, 1.0 ], + "bgcolor2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_angle" : 270.0, + "bgfillcolor_autogradient" : 0.0, + "bgfillcolor_color" : [ 0.56078431372549, 0.592156862745098, 0.32156862745098, 1.0 ], + "bgfillcolor_color1" : [ 0.56078431372549, 0.592156862745098, 0.32156862745098, 1.0 ], + "bgfillcolor_color2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_proportion" : 0.5, + "bgfillcolor_type" : "gradient", + "gradient" : 1, + "id" : "obj-129", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1207.0, 701.5, 96.0, 23.0 ], + "text" : "copy global 1 2" + } + + } +, { + "box" : { + "id" : "obj-130", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 1207.0, 737.0, 107.0, 23.0 ], + "text" : "s command-copy" + } + + } +, { + "box" : { + "bgcolor" : [ 0.56078431372549, 0.592156862745098, 0.32156862745098, 1.0 ], + "bgcolor2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_angle" : 270.0, + "bgfillcolor_autogradient" : 0.0, + "bgfillcolor_color" : [ 0.56078431372549, 0.592156862745098, 0.32156862745098, 1.0 ], + "bgfillcolor_color1" : [ 0.56078431372549, 0.592156862745098, 0.32156862745098, 1.0 ], + "bgfillcolor_color2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_proportion" : 0.5, + "bgfillcolor_type" : "gradient", + "gradient" : 1, + "id" : "obj-131", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1207.0, 672.5, 97.0, 23.0 ], + "text" : "copy sound 1 2" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-113", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 684.0, 586.5, 167.0, 53.0 ], + "presentation_linecount" : 3, + "text" : "Send messages from left to right and see the output:" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 0.752941176470588, 0.752941176470588, 0.75 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-114", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 686.0, 542.5, 163.0, 38.0 ], + "presentation_linecount" : 2, + "text" : "Copying objects to work buffer objects" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-115", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 967.0, 796.0, 20.0, 22.0 ], + "text" : "0" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-116", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 912.0, 737.5, 20.0, 22.0 ], + "text" : "0" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-117", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 902.0, 707.5, 20.0, 22.0 ], + "text" : "1" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-118", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 860.0, 653.5, 20.0, 22.0 ], + "text" : "0" + } + + } +, { + "box" : { + "id" : "obj-119", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 732.0, 707.5, 166.0, 23.0 ], + "text" : "get pattern_wb 0 15 enable" + } + + } +, { + "box" : { + "id" : "obj-120", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 795.0, 795.5, 166.0, 23.0 ], + "presentation_linecount" : 2, + "text" : "get pattern_wb 0 15 enable" + } + + } +, { + "box" : { + "id" : "obj-121", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 778.0, 765.5, 91.0, 23.0 ], + "text" : "copy pattern 3" + } + + } +, { + "box" : { + "id" : "obj-122", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 752.0, 736.5, 153.0, 23.0 ], + "text" : "get pattern 3 0 15 enable" + } + + } +, { + "box" : { + "id" : "obj-123", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 708.0, 679.5, 176.0, 23.0 ], + "text" : "set pattern_wb 0 15 enable 1" + } + + } +, { + "box" : { + "id" : "obj-124", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 686.0, 843.5, 107.0, 23.0 ], + "text" : "s command-copy" + } + + } +, { + "box" : { + "id" : "obj-125", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 686.0, 652.5, 166.0, 23.0 ], + "text" : "get pattern_wb 0 15 enable" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-112", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 363.0, 587.0, 167.0, 53.0 ], + "presentation_linecount" : 3, + "text" : "Send messages from left to right and see the output:" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 0.752941176470588, 0.752941176470588, 0.75 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-111", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 365.0, 543.0, 163.0, 38.0 ], + "presentation_linecount" : 2, + "text" : "Copying work buffer objects to objects" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-90", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 635.0, 797.0, 20.0, 22.0 ], + "text" : "1" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-91", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 591.0, 738.0, 20.0, 22.0 ], + "text" : "0" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-92", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 581.0, 708.0, 20.0, 22.0 ], + "text" : "1" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-93", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 539.0, 654.0, 20.0, 22.0 ], + "text" : "0" + } + + } +, { + "box" : { + "id" : "obj-98", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 411.0, 708.0, 166.0, 23.0 ], + "presentation_linecount" : 2, + "text" : "get pattern_wb 0 15 enable" + } + + } +, { + "box" : { + "id" : "obj-105", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 474.0, 796.0, 153.0, 23.0 ], + "text" : "get pattern 2 0 15 enable" + } + + } +, { + "box" : { + "id" : "obj-106", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 457.0, 766.0, 115.0, 23.0 ], + "presentation_linecount" : 2, + "text" : "copy pattern_wb 2" + } + + } +, { + "box" : { + "id" : "obj-107", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 431.0, 737.0, 153.0, 23.0 ], + "text" : "get pattern 2 0 15 enable" + } + + } +, { + "box" : { + "id" : "obj-108", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 387.0, 680.0, 176.0, 23.0 ], + "presentation_linecount" : 2, + "text" : "set pattern_wb 0 15 enable 1" + } + + } +, { + "box" : { + "id" : "obj-109", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 365.0, 844.0, 107.0, 23.0 ], + "text" : "s command-copy" + } + + } +, { + "box" : { + "id" : "obj-110", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 365.0, 653.0, 166.0, 23.0 ], + "presentation_linecount" : 2, + "text" : "get pattern_wb 0 15 enable" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-89", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 306.0, 797.0, 20.0, 22.0 ], + "text" : "1" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-88", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 262.0, 738.0, 20.0, 22.0 ], + "text" : "0" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-86", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 247.0, 708.0, 20.0, 22.0 ], + "text" : "1" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-85", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 201.0, 649.0, 20.0, 22.0 ], + "text" : "0" + } + + } +, { + "box" : { + "id" : "obj-83", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 82.0, 708.0, 153.0, 23.0 ], + "text" : "get pattern 0 0 15 enable" + } + + } +, { + "box" : { + "id" : "obj-82", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 145.0, 796.0, 153.0, 23.0 ], + "text" : "get pattern 1 0 15 enable" + } + + } +, { + "box" : { + "id" : "obj-81", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 128.0, 766.0, 102.0, 23.0 ], + "text" : "copy pattern 0 1" + } + + } +, { + "box" : { + "id" : "obj-76", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 102.0, 737.0, 153.0, 23.0 ], + "text" : "get pattern 1 0 15 enable" + } + + } +, { + "box" : { + "bgcolor" : [ 0.752941176470588, 0.968627450980392, 1.0, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-59", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 36.0, 587.0, 163.0, 53.0 ], + "presentation_linecount" : 3, + "text" : "Send messages from left to right and see the output:" + } + + } +, { + "box" : { + "id" : "obj-26", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 58.0, 680.0, 163.0, 23.0 ], + "text" : "set pattern 0 0 15 enable 1" + } + + } +, { + "box" : { + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 36.0, 844.0, 107.0, 23.0 ], + "text" : "s command-copy" + } + + } +, { + "box" : { + "id" : "obj-25", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 36.0, 653.0, 153.0, 23.0 ], + "presentation_linecount" : 7, + "text" : "get pattern 0 0 15 enable" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 212.0, 62.0, 68.0, 23.0 ], + "text" : "r help-port" + } + + } +, { + "box" : { + "id" : "obj-95", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 18.0, 244.0, 68.0, 23.0 ], + "text" : "r help-port" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 0.752941176470588, 0.752941176470588, 0.75 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-54", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 1039.0, 550.5, 163.0, 22.0 ], + "text" : "Some example errors:" + } + + } +, { + "box" : { + "bgcolor" : [ 0.592156862745098, 0.32156862745098, 0.32156862745098, 1.0 ], + "bgcolor2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_angle" : 270.0, + "bgfillcolor_autogradient" : 0.0, + "bgfillcolor_color" : [ 0.592156862745098, 0.32156862745098, 0.32156862745098, 1.0 ], + "bgfillcolor_color1" : [ 0.592156862745098, 0.32156862745098, 0.32156862745098, 1.0 ], + "bgfillcolor_color2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_proportion" : 0.5, + "bgfillcolor_type" : "gradient", + "gradient" : 1, + "id" : "obj-84", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1039.0, 672.0, 80.0, 23.0 ], + "text" : "copy pattern" + } + + } +, { + "box" : { + "bgcolor" : [ 0.592156862745098, 0.32156862745098, 0.32156862745098, 1.0 ], + "bgcolor2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_angle" : 270.0, + "bgfillcolor_autogradient" : 0.0, + "bgfillcolor_color" : [ 0.592156862745098, 0.32156862745098, 0.32156862745098, 1.0 ], + "bgfillcolor_color1" : [ 0.592156862745098, 0.32156862745098, 0.32156862745098, 1.0 ], + "bgfillcolor_color2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_proportion" : 0.5, + "bgfillcolor_type" : "gradient", + "gradient" : 1, + "id" : "obj-43", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1039.0, 643.0, 116.0, 23.0 ], + "text" : "copy pattern 0 178" + } + + } +, { + "box" : { + "bgcolor" : [ 0.592156862745098, 0.32156862745098, 0.32156862745098, 1.0 ], + "bgcolor2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_angle" : 270.0, + "bgfillcolor_autogradient" : 0.0, + "bgfillcolor_color" : [ 0.592156862745098, 0.32156862745098, 0.32156862745098, 1.0 ], + "bgfillcolor_color1" : [ 0.592156862745098, 0.32156862745098, 0.32156862745098, 1.0 ], + "bgfillcolor_color2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_proportion" : 0.5, + "bgfillcolor_type" : "gradient", + "gradient" : 1, + "id" : "obj-44", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1039.0, 613.0, 104.0, 23.0 ], + "text" : "copy pattern_wb" + } + + } +, { + "box" : { + "id" : "obj-45", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 1039.0, 707.0, 107.0, 23.0 ], + "text" : "s command-copy" + } + + } +, { + "box" : { + "bgcolor" : [ 0.592156862745098, 0.32156862745098, 0.32156862745098, 1.0 ], + "bgcolor2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_angle" : 270.0, + "bgfillcolor_autogradient" : 0.0, + "bgfillcolor_color" : [ 0.592156862745098, 0.32156862745098, 0.32156862745098, 1.0 ], + "bgfillcolor_color1" : [ 0.592156862745098, 0.32156862745098, 0.32156862745098, 1.0 ], + "bgfillcolor_color2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_proportion" : 0.5, + "bgfillcolor_type" : "gradient", + "gradient" : 1, + "id" : "obj-46", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1039.0, 584.0, 113.0, 23.0 ], + "text" : "copy pattern 1 2 3" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 822.5, 267.0, 23.0, 23.0 ], + "text" : "t b" + } + + } +, { + "box" : { + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 748.5, 299.0, 58.0, 23.0 ], + "text" : "deferlow" + } + + } +, { + "box" : { + "autofit" : 1, + "forceaspect" : 1, + "id" : "obj-4", + "maxclass" : "fpic", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "jit_matrix" ], + "patching_rect" : [ 1300.0, 873.0, 73.0, 73.0 ], + "pic" : "petunia_transparent.png" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 0.752941176470588, 0.752941176470588, 0.75 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-37", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 165.0, 18.0, 356.0, 38.0 ], + "text" : "This version of rytm does not expose the api to set or get machine parameters." + } + + } +, { + "box" : { + "bubble" : 1, + "bubble_bgcolor" : [ 0.796078431372549, 0.725490196078431, 0.870588235294118, 1.0 ], + "bubbleside" : 2, + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-22", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 1000.5, 342.0, 134.0, 69.0 ], + "style" : "helpfile_label", + "text" : "Check the last warning from the console" + } + + } +, { + "box" : { + "bgcolor" : [ 0.737254901960784, 0.741176470588235, 0.164705882352941, 1.0 ], + "bgcolor2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_angle" : 270.0, + "bgfillcolor_autogradient" : 0.0, + "bgfillcolor_color" : [ 0.737254901960784, 0.741176470588235, 0.164705882352941, 1.0 ], + "bgfillcolor_color1" : [ 0.737254901960784, 0.741176470588235, 0.164705882352941, 1.0 ], + "bgfillcolor_color2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_proportion" : 0.5, + "bgfillcolor_type" : "gradient", + "gradient" : 1, + "id" : "obj-21", + "linecount" : 6, + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 907.5, 416.0, 266.0, 96.0 ], + "text" : "Warning: Unsupported action. Rytm will currently ignore this command. Reason: Currently copy command is not supported for global object. If you need this badly please open an issue and implementation will be considered.", + "textcolor" : [ 1.0, 1.0, 1.0, 1.0 ] + } + + } +, { + "box" : { + "bgcolor" : [ 0.847058823529412, 0.890196078431372, 0.607843137254902, 0.749019607843137 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-104", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 642.5, 23.0, 96.0, 22.0 ], + "text" : "Status Codes:" + } + + } +, { + "box" : { + "id" : "obj-103", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 636.5, 184.0, 107.0, 23.0 ], + "text" : "bgfillcolor 1 1 0 1" + } + + } +, { + "box" : { + "id" : "obj-101", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 636.5, 166.0, 107.0, 23.0 ], + "text" : "bgfillcolor 1 0 0 1" + } + + } +, { + "box" : { + "id" : "obj-99", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 636.5, 148.0, 107.0, 23.0 ], + "text" : "bgfillcolor 0 1 0 1" + } + + } +, { + "box" : { + "id" : "obj-96", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 638.5, 308.0, 107.0, 23.0 ], + "text" : "bgfillcolor 0 0 0 1" + } + + } +, { + "box" : { + "id" : "obj-50", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 636.5, 274.0, 29.5, 23.0 ], + "text" : "set" + } + + } +, { + "box" : { + "id" : "obj-35", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 748.5, 267.0, 72.0, 23.0 ], + "text" : "delay 2000" + } + + } +, { + "box" : { + "id" : "obj-34", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "" ], + "patching_rect" : [ 744.5, 110.0, 44.0, 23.0 ], + "text" : "t b b s" + } + + } +, { + "box" : { + "id" : "obj-33", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "" ], + "patching_rect" : [ 694.5, 110.0, 44.0, 23.0 ], + "text" : "t b b s" + } + + } +, { + "box" : { + "id" : "obj-32", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "bang", "bang", "" ], + "patching_rect" : [ 625.5, 110.0, 44.0, 23.0 ], + "text" : "t b b s" + } + + } +, { + "box" : { + "id" : "obj-31", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "warning" ], + "patching_rect" : [ 744.5, 84.0, 61.0, 23.0 ], + "text" : "t warning" + } + + } +, { + "box" : { + "id" : "obj-30", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "error" ], + "patching_rect" : [ 694.5, 84.0, 43.0, 23.0 ], + "text" : "t error" + } + + } +, { + "box" : { + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "success" ], + "patching_rect" : [ 625.5, 84.0, 63.0, 23.0 ], + "text" : "t success" + } + + } +, { + "box" : { + "bgcolor" : [ 0.376470588235294, 0.384313725490196, 0.4, 1.0 ], + "bgcolor2" : [ 0.376470588235294, 0.384313725490196, 0.4, 1.0 ], + "bgfillcolor_angle" : 270.0, + "bgfillcolor_autogradient" : 0.0, + "bgfillcolor_color" : [ 0, 0, 0, 1 ], + "bgfillcolor_color1" : [ 0.376470588235294, 0.384313725490196, 0.4, 1.0 ], + "bgfillcolor_color2" : [ 0.290196078431373, 0.309803921568627, 0.301960784313725, 1.0 ], + "bgfillcolor_proportion" : 0.39, + "bgfillcolor_type" : "color", + "dontreplace" : 1, + "fontsize" : 16.0, + "gradient" : 1, + "id" : "obj-28", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 636.5, 227.0, 209.0, 26.0 ], + "textcolor" : [ 0.0, 0.0, 0.0, 1.0 ], + "textjustification" : 1 + } + + } +, { + "box" : { + "id" : "obj-10", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 4, + "outlettype" : [ "bang", "bang", "bang", "" ], + "patching_rect" : [ 625.5, 52.0, 135.0, 23.0 ], + "text" : "sel 0 1 2" + } + + } +, { + "box" : { + "bubble" : 1, + "bubble_bgcolor" : [ 0.796078431372549, 0.725490196078431, 0.870588235294118, 1.0 ], + "bubbleside" : 2, + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-9", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 640.5, 356.0, 134.0, 55.0 ], + "style" : "helpfile_label", + "text" : "Check the last error from the console" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 0.752941176470588, 0.752941176470588, 0.75 ], + "bubble_bgcolor" : [ 0.450980392156863, 0.294117647058824, 0.572549019607843, 1.0 ], + "fontface" : 0, + "fontsize" : 14.0, + "id" : "obj-24", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 36.0, 555.0, 163.0, 22.0 ], + "text" : "Copying objects" + } + + } +, { + "box" : { + "id" : "obj-102", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 849.5, 372.0, 71.0, 23.0 ], + "text" : "loadmess ." + } + + } +, { + "box" : { + "bgcolor" : [ 0.741176470588235, 0.164705882352941, 0.164705882352941, 1.0 ], + "bgcolor2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_angle" : 270.0, + "bgfillcolor_autogradient" : 0.0, + "bgfillcolor_color" : [ 0.741176470588235, 0.164705882352941, 0.164705882352941, 1.0 ], + "bgfillcolor_color1" : [ 0.741176470588235, 0.164705882352941, 0.164705882352941, 1.0 ], + "bgfillcolor_color2" : [ 0.2, 0.2, 0.2, 1.0 ], + "bgfillcolor_proportion" : 0.5, + "bgfillcolor_type" : "gradient", + "gradient" : 1, + "id" : "obj-100", + "linecount" : 3, + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 636.5, 416.0, 269.0, 52.0 ], + "text" : "Parse Error: Query selector index missing or invalid: This query selector must be followed by an integer index.", + "textcolor" : [ 1.0, 1.0, 1.0, 1.0 ] + } + + } +, { + "box" : { + "id" : "obj-97", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "", "" ], + "patching_rect" : [ 933.5, 372.0, 45.0, 23.0 ], + "text" : "gate 2" + } + + } +, { + "box" : { + "id" : "obj-94", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "int" ], + "patching_rect" : [ 929.5, 342.0, 53.0, 23.0 ], + "text" : "console" + } + + } +, { + "box" : { + "bubble" : 1, + "bubble_bgcolor" : [ 0.796078431372549, 0.725490196078431, 0.870588235294118, 1.0 ], + "bubbleside" : 3, + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-72", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 116.0, 243.0, 134.0, 25.0 ], + "style" : "helpfile_label", + "text" : "Responses" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 258.0, 244.0, 102.0, 23.0 ], + "text" : "print @popup 1" + } + + } +, { + "box" : { + "id" : "obj-63", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 430.0, 163.0, 105.0, 23.0 ], + "text" : "r command-copy" + } + + } +, { + "box" : { + "id" : "obj-62", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 306.0, 163.0, 115.0, 23.0 ], + "text" : "r send-object-copy" + } + + } +, { + "box" : { + "id" : "obj-49", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 220.0, 163.0, 81.0, 23.0 ], + "text" : "r query-copy" + } + + } +, { + "box" : { + "bubble" : 1, + "bubble_bgcolor" : [ 0.796078431372549, 0.725490196078431, 0.870588235294118, 1.0 ], + "bubbleside" : 3, + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.0, 90.0, 134.0, 25.0 ], + "style" : "helpfile_label", + "text" : "Turn receiving on" + } + + } +, { + "box" : { + "bubble" : 1, + "bubble_bgcolor" : [ 0.796078431372549, 0.725490196078431, 0.870588235294118, 1.0 ], + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-16", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 275.0, 90.0, 246.0, 25.0 ], + "style" : "helpfile_label", + "text" : "Connect to Analog Rytm MKII midi out" + } + + } +, { + "box" : { + "bubble" : 1, + "bubble_bgcolor" : [ 0.796078431372549, 0.725490196078431, 0.870588235294118, 1.0 ], + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-15", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 211.0, 284.0, 246.0, 25.0 ], + "style" : "helpfile_label", + "text" : "Connect to Analog Rytm MKII midi in" + } + + } +, { + "box" : { + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 152.0, 285.0, 50.0, 23.0 ], + "text" : "midiout" + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 165.0, 163.0, 45.0, 23.0 ], + "text" : "gate 0" + } + + } +, { + "box" : { + "id" : "obj-12", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "parameter_enable" : 0, + "patching_rect" : [ 165.0, 91.0, 24.0, 24.0 ] + } + + } +, { + "box" : { + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 212.0, 91.0, 52.0, 23.0 ], + "text" : "sysexin" + } + + } +, { + "box" : { + "bgcolor" : [ 0.0, 0.0, 0.0, 1.0 ], + "color" : [ 0.454901960784314, 0.407843137254902, 0.611764705882353, 1.0 ], + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-11", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "long", "", "long" ], + "patching_rect" : [ 165.0, 204.0, 112.0, 23.0 ], + "saved_object_attributes" : { + "sysex_id" : 0 + } +, + "text" : "rytm @sysex_id 0", + "varname" : "___rytm-help-more" + } + + } +, { + "box" : { + "border" : 0, + "filename" : "helpdetails.js", + "id" : "obj-1", + "ignoreclick" : 1, + "jsarguments" : [ "rytm" ], + "maxclass" : "jsui", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "parameter_enable" : 0, + "patching_rect" : [ 18.0, 18.0, 112.0, 54.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-30", 0 ], + "source" : [ "obj-10", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-31", 0 ], + "source" : [ "obj-10", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "source" : [ "obj-101", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-100", 1 ], + "order" : 1, + "source" : [ "obj-102", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 1 ], + "order" : 0, + "source" : [ "obj-102", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "source" : [ "obj-103", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-109", 0 ], + "source" : [ "obj-105", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-109", 0 ], + "source" : [ "obj-106", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-109", 0 ], + "source" : [ "obj-107", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-109", 0 ], + "source" : [ "obj-108", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 0 ], + "midpoints" : [ 267.5, 234.0, 567.0, 234.0, 567.0, 36.0, 635.0, 36.0 ], + "source" : [ "obj-11", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 0 ], + "midpoints" : [ 174.5, 236.0, 95.0, 236.0, 95.0, 278.0, 161.5, 278.0 ], + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 0 ], + "source" : [ "obj-11", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-109", 0 ], + "source" : [ "obj-110", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-124", 0 ], + "source" : [ "obj-119", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-124", 0 ], + "source" : [ "obj-120", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-124", 0 ], + "source" : [ "obj-121", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-124", 0 ], + "source" : [ "obj-122", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-124", 0 ], + "source" : [ "obj-123", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-124", 0 ], + "source" : [ "obj-125", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-130", 0 ], + "source" : [ "obj-129", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-13", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-130", 0 ], + "source" : [ "obj-131", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-134", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-50", 0 ], + "order" : 1, + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-96", 0 ], + "order" : 0, + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-25", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-26", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "source" : [ "obj-28", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-32", 0 ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-35", 0 ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-33", 0 ], + "source" : [ "obj-30", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-34", 0 ], + "source" : [ "obj-31", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 1 ], + "source" : [ "obj-32", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "source" : [ "obj-32", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-99", 0 ], + "source" : [ "obj-32", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-101", 0 ], + "source" : [ "obj-33", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 1 ], + "source" : [ "obj-33", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "source" : [ "obj-33", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-103", 0 ], + "source" : [ "obj-34", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 1 ], + "source" : [ "obj-34", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "source" : [ "obj-34", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "source" : [ "obj-35", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-45", 0 ], + "source" : [ "obj-43", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-45", 0 ], + "source" : [ "obj-44", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-45", 0 ], + "source" : [ "obj-46", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-49", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "source" : [ "obj-50", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-62", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-63", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-76", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 1 ], + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-81", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-82", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "source" : [ "obj-83", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-45", 0 ], + "source" : [ "obj-84", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-97", 0 ], + "source" : [ "obj-94", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-97", 1 ], + "source" : [ "obj-94", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 0 ], + "source" : [ "obj-95", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "midpoints" : [ 659.0, 332.5 ], + "source" : [ "obj-96", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-100", 1 ], + "source" : [ "obj-97", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 1 ], + "source" : [ "obj-97", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-109", 0 ], + "source" : [ "obj-98", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-28", 0 ], + "source" : [ "obj-99", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 124.0, 127.0, 44.0, 22.0 ], + "presentation_linecount" : 2, + "saved_object_attributes" : { + "description" : "", + "digest" : "", + "fontsize" : 13.0, + "globalpatchername" : "", + "tags" : "" + } +, + "text" : "p copy", + "varname" : "basic_tab[4]" + } + + } +, { "box" : { "fontname" : "Arial", "fontsize" : 12.0, @@ -89,6 +1975,35 @@ "showontab" : 1, "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "bubble" : 1, + "bubble_bgcolor" : [ 0.796078431372549, 0.725490196078431, 0.870588235294118, 1.0 ], + "bubbleside" : 2, + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-106", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 591.0, 76.0, 134.0, 40.0 ], + "style" : "helpfile_label", + "text" : "Reset to default state" + } + + } +, { + "box" : { + "id" : "obj-105", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 640.0, 119.0, 37.0, 23.0 ], + "text" : "reset" + } + + } +, { "box" : { "id" : "obj-97", "maxclass" : "newobj", @@ -1114,6 +3029,13 @@ "source" : [ "obj-10", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-90", 0 ], + "source" : [ "obj-105", 0 ] + } + } , { "patchline" : { @@ -1798,8 +3720,7 @@ ] } , - "patching_rect" : [ 132.0, 127.0, 43.0, 22.0 ], - "presentation_linecount" : 2, + "patching_rect" : [ 180.0, 125.0, 43.0, 22.0 ], "saved_object_attributes" : { "description" : "", "digest" : "", @@ -1862,6 +3783,35 @@ "showontab" : 1, "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "bubble" : 1, + "bubble_bgcolor" : [ 0.796078431372549, 0.725490196078431, 0.870588235294118, 1.0 ], + "bubbleside" : 2, + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-106", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.0, 139.5, 134.0, 40.0 ], + "style" : "helpfile_label", + "text" : "Reset to default state" + } + + } +, { + "box" : { + "id" : "obj-105", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 67.0, 182.5, 37.0, 23.0 ], + "text" : "reset" + } + + } +, { "box" : { "id" : "obj-5", "maxclass" : "newobj", @@ -2597,12 +4547,13 @@ "bgfillcolor_type" : "gradient", "gradient" : 1, "id" : "obj-21", + "linecount" : 6, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 907.5, 416.0, 266.0, 23.0 ], - "text" : ".", + "patching_rect" : [ 907.5, 416.0, 266.0, 96.0 ], + "text" : "Warning: Unsupported action. Rytm will currently ignore this command. Reason: Currently copy command is not supported for global object. If you need this badly please open an issue and implementation will be considered.", "textcolor" : [ 1.0, 1.0, 1.0, 1.0 ] } @@ -2862,12 +4813,13 @@ "bgfillcolor_type" : "gradient", "gradient" : 1, "id" : "obj-100", + "linecount" : 3, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 636.5, 416.0, 269.0, 23.0 ], - "text" : "Short read on sysex message", + "patching_rect" : [ 636.5, 416.0, 269.0, 52.0 ], + "text" : "Parse Error: Query selector index missing or invalid: This query selector must be followed by an integer index.", "textcolor" : [ 1.0, 1.0, 1.0, 1.0 ] } @@ -3181,6 +5133,13 @@ "source" : [ "obj-103", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-105", 0 ] + } + } , { "patchline" : { @@ -3694,6 +5653,35 @@ "showontab" : 1, "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "bubble" : 1, + "bubble_bgcolor" : [ 0.796078431372549, 0.725490196078431, 0.870588235294118, 1.0 ], + "bubbleside" : 2, + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-106", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.0, 140.0, 134.0, 40.0 ], + "style" : "helpfile_label", + "text" : "Reset to default state" + } + + } +, { + "box" : { + "id" : "obj-105", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 67.0, 183.0, 37.0, 23.0 ], + "text" : "reset" + } + + } +, { "box" : { "id" : "obj-23", "maxclass" : "newobj", @@ -3917,12 +5905,13 @@ "bgfillcolor_type" : "gradient", "gradient" : 1, "id" : "obj-21", + "linecount" : 6, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 893.0, 432.0, 266.0, 23.0 ], - "text" : ".", + "patching_rect" : [ 893.0, 432.0, 266.0, 96.0 ], + "text" : "Warning: Unsupported action. Rytm will currently ignore this command. Reason: Currently copy command is not supported for global object. If you need this badly please open an issue and implementation will be considered.", "textcolor" : [ 1.0, 1.0, 1.0, 1.0 ] } @@ -4213,12 +6202,13 @@ "bgfillcolor_type" : "gradient", "gradient" : 1, "id" : "obj-100", + "linecount" : 3, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 622.0, 432.0, 269.0, 23.0 ], - "text" : "Short read on sysex message", + "patching_rect" : [ 622.0, 432.0, 269.0, 52.0 ], + "text" : "Parse Error: Query selector index missing or invalid: This query selector must be followed by an integer index.", "textcolor" : [ 1.0, 1.0, 1.0, 1.0 ] } @@ -4668,6 +6658,13 @@ "source" : [ "obj-103", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-11", 0 ], + "source" : [ "obj-105", 0 ] + } + } , { "patchline" : { @@ -5088,6 +7085,35 @@ "showontab" : 1, "assistshowspatchername" : 0, "boxes" : [ { + "box" : { + "bubble" : 1, + "bubble_bgcolor" : [ 0.796078431372549, 0.725490196078431, 0.870588235294118, 1.0 ], + "bubbleside" : 2, + "fontname" : "Arial", + "fontsize" : 13.0, + "id" : "obj-106", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 12.0, 275.5, 134.0, 40.0 ], + "style" : "helpfile_label", + "text" : "Reset to default state" + } + + } +, { + "box" : { + "id" : "obj-105", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 60.5, 319.0, 37.0, 23.0 ], + "text" : "reset" + } + + } +, { "box" : { "id" : "obj-95", "maxclass" : "newobj", @@ -5141,7 +7167,6 @@ "numinlets" : 1, "numoutlets" : 0, "patching_rect" : [ 1070.0, 39.0, 246.0, 55.0 ], - "presentation_linecount" : 2, "style" : "helpfile_label", "text" : "Press to set the port if not set automatically." } @@ -5162,7 +7187,7 @@ , { "box" : { "id" : "obj-18", - "items" : [ "AU DLS Synth 1", ",", "Elektron Analog Rytm MKII", ",", "from Max 1", ",", "from Max 2" ], + "items" : [ "AU DLS Synth 1", ",", "from Max 1", ",", "from Max 2" ], "maxclass" : "umenu", "numinlets" : 1, "numoutlets" : 3, @@ -5450,7 +7475,7 @@ "bgcolor2" : [ 0.376470588235294, 0.384313725490196, 0.4, 1.0 ], "bgfillcolor_angle" : 270.0, "bgfillcolor_autogradient" : 0.0, - "bgfillcolor_color" : [ 0, 0, 0, 1 ], + "bgfillcolor_color" : [ 1, 0, 0, 1 ], "bgfillcolor_color1" : [ 0.376470588235294, 0.384313725490196, 0.4, 1.0 ], "bgfillcolor_color2" : [ 0.290196078431373, 0.309803921568627, 0.301960784313725, 1.0 ], "bgfillcolor_proportion" : 0.39, @@ -5464,6 +7489,7 @@ "numoutlets" : 1, "outlettype" : [ "" ], "patching_rect" : [ 585.0, 412.0, 209.0, 26.0 ], + "text" : "error", "textcolor" : [ 0.0, 0.0, 0.0, 1.0 ], "textjustification" : 1 } @@ -5600,12 +7626,13 @@ "bgfillcolor_type" : "gradient", "gradient" : 1, "id" : "obj-100", + "linecount" : 6, "maxclass" : "message", "numinlets" : 2, "numoutlets" : 1, "outlettype" : [ "" ], - "patching_rect" : [ 795.5, 781.0, 269.0, 23.0 ], - "text" : "Short read on sysex message", + "patching_rect" : [ 795.5, 781.0, 269.0, 96.0 ], + "text" : "Warning: Unsupported action. Rytm will currently ignore this command. Reason: Currently copy command is not supported for global object. If you need this badly please open an issue and implementation will be considered.", "textcolor" : [ 1.0, 1.0, 1.0, 1.0 ] } @@ -6535,6 +8562,13 @@ "source" : [ "obj-103", 0 ] } + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "source" : [ "obj-105", 0 ] + } + } , { "patchline" : { @@ -7063,7 +9097,7 @@ , { "patchline" : { "destination" : [ "obj-8", 0 ], - "midpoints" : [ 214.0, 211.0 ], + "midpoints" : [ 215.5, 211.0 ], "source" : [ "obj-93", 0 ] }