From d925edaa3ea2a054c80735cbdac5aab30f58917d Mon Sep 17 00:00:00 2001 From: Ali Somay Date: Sat, 23 Dec 2023 00:40:28 +0100 Subject: [PATCH] Finish first version of api docs --- API_DOCS.md | 152 +++++++++++++++++++++++-------------- Cargo.lock | 2 + Cargo.toml | 2 +- LICENCE | 21 +++++ README.md | 60 ++++++++++++--- src/action/get/global.rs | 4 +- src/action/get/kit.rs | 2 +- src/action/get/pattern.rs | 4 +- src/action/get/settings.rs | 4 +- src/action/get/sound.rs | 4 +- src/action/get/track.rs | 4 +- src/action/get/trig.rs | 4 +- 12 files changed, 179 insertions(+), 84 deletions(-) create mode 100644 LICENCE diff --git a/API_DOCS.md b/API_DOCS.md index 64d019f..fe28f76 100644 --- a/API_DOCS.md +++ b/API_DOCS.md @@ -3,17 +3,25 @@ ## How to read this documentation? Words in these wrapped with `<..>` should be read as placeholders for the actual values. + For example `` should be read as `query`, `send`, `get` or `set`. Words in these wrapped with `[]` should be read as optional values. + For example `[]` should be read as `` or nothing. Words in these wrapped with `<..>` may include attached range of values to denote the valid range of an index or a parameter. + For example `` should be read as an integer between 0 and 127. + Ranges can be inclusive or exclusive. An exclusive range is denoted with `..` and an inclusive range is denoted with `..=`. MaxMSP types will be denoted as `int`, `float`, `symbol` and `list`. +When using the following identifiers and enums with some getters and setters there could be format differences. + +For these, please follow common sense and read the errors in the max window, they will guide you to the right direction. + - `` A symbol which defines an operation. Available selectors are: - `query` Queries the device for data. - `send` Sends data to the device. @@ -65,6 +73,32 @@ Examples: The get format is used to get data from the `rytm` external. +### Output + +The default output format for identifier getters: + +` ` + +The default output format for enum getters: + +` ` + +For some getters an additional parent index is included, + +Track getter output format: + +` ..` + +Trig getter output format: + +` ..` + +For getters which includes an additional element the index of that element is included, + +Kit getter with element output format: + +` ..` + ### Pattern Accepted formats: @@ -387,9 +421,9 @@ Accepted formats: ## Enums -### Pattern +## Pattern -#### `speed:` +### `speed:` | Variants |   |   | | -------- | -------- | -------- | @@ -397,15 +431,15 @@ Accepted formats: | **2x** | **1/2x** | | | **3/2x** | **1/4x** | | -#### `timemode:` +### `timemode:` | Variants |   |   | | ---------- | ------------ | ------ | | **normal** | **advanced** | | -### Track +## Track -#### `rootnote:` +### `rootnote:` | Variants |   |   | | -------- | ------ | ------ | @@ -414,7 +448,7 @@ Accepted formats: | **d** | **f#** | **bb** | | **eb** | **g** | **b** | -#### `padscale:` +### `padscale:` | Variants |   |   | | ------------------- | ----------------------- | ----------------------- | @@ -431,7 +465,7 @@ Accepted formats: | **melodicminor** | **halfwholediminished** | **ionian25** | | **harmonicminor** | **spanish** | **locrianbb3bb7** | -#### `defaultnotelen:` +### `defaultnotelen:` | Variants |   |   | | --------- | -------- | --------- | @@ -479,9 +513,9 @@ Accepted formats: | **3.38** | **22** | **inf** | | **3.5** | **23** | **unset** | -### Trig +## Trig -#### `microtime:` +### `microtime:` | Variants |   |   | | ----------- | ---------- | ---------- | @@ -502,7 +536,7 @@ Accepted formats: | **-3/128** | **7/384** | **23/384** | | **-1/48** | **1/48** | | -#### `notelen:` +### `notelen:` | Variants |   |   | | --------- | -------- | --------- | @@ -550,7 +584,7 @@ Accepted formats: | **3.38** | **22** | **inf** | | **3.5** | **23** | **unset** | -#### `retriglen:` +### `retriglen:` | Variants |   |   | | --------- | -------- | --------- | @@ -598,7 +632,7 @@ Accepted formats: | **3.38** | **22** | **inf** | | **3.5** | **23** | **unset** | -#### `retrigrate:` +### `retrigrate:` | Variants |   |   | | -------- | -------- | -------- | @@ -609,7 +643,7 @@ Accepted formats: | **1/5** | **1/20** | **1/80** | | **1/6** | **1/24** | | -#### `trigcondition:` +### `trigcondition:` | Variants |   |   | | -------- | ----------- | --------- | @@ -636,9 +670,9 @@ Accepted formats: | **99%** | **4:5** | **8:8** | | **100%** | **5:5** | **unset** | -### Kit +## Kit -#### `controlinmod1target:` +### `controlinmod1target:` | Variants |   |   | | ------------------ | ---------------------- | ------------------- | @@ -654,7 +688,7 @@ Accepted formats: | **samplefinetune** | **filterrelease** | **ampreverbsend** | | **sampleslice** | **filterfrequency** | | -#### `controlinmod2target:` +### `controlinmod2target:` | Variants |   |   | | ------------------ | ---------------------- | ------------------- | @@ -670,7 +704,7 @@ Accepted formats: | **samplefinetune** | **filterrelease** | **ampreverbsend** | | **sampleslice** | **filterfrequency** | | -#### `fxlfodest:` +### `fxlfodest:` | Variants |   |   | | -------------------- | ---------------------- | ------------------------- | @@ -684,7 +718,7 @@ Accepted formats: | **delayreverbsend** | **reverbmixvolume** | **compressordrywetmix** | | **delaymixvolume** | **distortionamount** | **compressorvolume** | -#### `fxcompattack:` +### `fxcompattack:` | Variants |   |   | | -------- | ------ | ------ | @@ -692,7 +726,7 @@ Accepted formats: | **0.1** | **3** | | | **0.3** | **10** | | -#### `fxcomprelease:` +### `fxcomprelease:` | Variants |   |   | | -------- | ------- | ------ | @@ -700,23 +734,23 @@ Accepted formats: | **0.2** | **1** | **A2** | | **0.4** | **2** | | -#### `fxcompratio:` +### `fxcompratio:` | Variants |   |   | | -------- | ------- | ------ | | **1:2** | **1:8** | | | **1:4** | **max** | | -#### `fxcompsidechaineq:` +### `fxcompsidechaineq:` | Variants |   |   | | -------- | ------- | ------ | | **off** | **hpf** | | | **lpf** | **hit** | | -### Sound +## Sound -#### `machinetype:` +### `machinetype:` | Variants |   |   | | ------------- | -------------- | -------------- | @@ -733,7 +767,7 @@ Accepted formats: | **ohclassic** | **bdsilky** | **unset** | | **cyclassic** | **sdnatural** | | -#### `lfodest:` +### `lfodest:` | Variants |   |   | | ------------------ | ---------------------- | ------------------- | @@ -749,7 +783,7 @@ Accepted formats: | **samplefinetune** | **filterrelease** | **ampreverb_send** | | **sampleslice** | **filterfrequency** | **unset** | -#### `velmodtarget:` +### `velmodtarget:` | Variants |   |   | | ----------------- | ---------------------- | ------------------- | @@ -768,7 +802,7 @@ Accepted formats: | **syn5** | **filterdecay** | | | **syn6** | **filtersustain** | | -#### `atmodtarget:` +### `atmodtarget:` | Variants |   |   | | ----------------- | ---------------------- | ------------------- | @@ -787,7 +821,7 @@ Accepted formats: | **syn5** | **filterdecay** | | | **syn6** | **filtersustain** | | -#### `filtertype:` +### `filtertype:` | Variants |   |   | | -------- | ------- | ------ | @@ -795,7 +829,7 @@ Accepted formats: | **lp1** | **hp2** | | | **bp** | **bs** | | -#### `lfomultiplier:` +### `lfomultiplier:` | Variants |   |   | | -------- | -------- | -------- | @@ -808,7 +842,7 @@ Accepted formats: | **x64** | **.4** | **.1k** | | **x128** | **.8** | **.2k** | -#### `lfowaveform:` +### `lfowaveform:` | Variants |   |   | | -------- | ------- | ------- | @@ -816,23 +850,23 @@ Accepted formats: | **sin** | **exp** | | | **sqr** | **rmp** | | -#### `lfomode:` +### `lfomode:` | Variants |   |   | | -------- | -------- | -------- | | **free** | **hold** | **half** | | **trig** | **one** | | -#### `chromaticmode:` +### `chromaticmode:` | Variants |   |   | | -------- | ------------ | ------ | | **off** | **samp** | | | **syn** | **syn+samp** | | -### Global +## Global -#### `metronometimesig:` +### `metronometimesig:` | Variants |   |   | | -------- | -------- | --------- | @@ -864,7 +898,7 @@ Accepted formats: | **10/2** | **5/8** | **16/16** | | **11/2** | **6/8** | | -#### `autochannel:` +### `autochannel:` | Variants |   |   | | -------- | ------ | ------ | @@ -875,7 +909,7 @@ Accepted formats: | **5** | **11** | | | **6** | **12** | | -#### `trackchannels:` +### `trackchannels:` | Variants |   |   | | -------- | ------ | ------ | @@ -886,7 +920,7 @@ Accepted formats: | **5** | **11** | | | **6** | **12** | | -#### `trackfxchannel:` +### `trackfxchannel:` | Variants |   |   | | -------- | ------ | ------ | @@ -897,7 +931,7 @@ Accepted formats: | **5** | **11** | | | **6** | **12** | | -#### `pgmchangeinchannel:` +### `pgmchangeinchannel:` | Variants |   |   | | -------- | ------ | ------ | @@ -908,7 +942,7 @@ Accepted formats: | **5** | **11** | | | **6** | **12** | | -#### `pgmchangeoutchannel:` +### `pgmchangeoutchannel:` | Variants |   |   | | -------- | ------ | ------ | @@ -919,7 +953,7 @@ Accepted formats: | **5** | **11** | | | **6** | **12** | | -#### `performancechannel:` +### `performancechannel:` | Variants |   |   | | -------- | ------ | ------ | @@ -930,76 +964,76 @@ Accepted formats: | **5** | **11** | | | **6** | **12** | | -#### `outportfunction:` +### `outportfunction:` | Variants |   |   | | -------- | --------- | --------- | | **midi** | **din24** | **din48** | -#### `thruportfunction:` +### `thruportfunction:` | Variants |   |   | | -------- | --------- | --------- | | **midi** | **din24** | **din48** | -#### `inputfrom:` +### `inputfrom:` | Variants |   |   | | ------------ | ------------ | ------ | | **disabled** | **usb** | | | **midi** | **midi+usb** | | -#### `outputto:` +### `outputto:` | Variants |   |   | | ------------ | ------------ | ------ | | **disabled** | **usb** | | | **midi** | **midi+usb** | | -#### `paddest:` +### `paddest:` | Variants |   |   | | -------- | ----------- | ------- | | **int** | **int+ext** | **ext** | -#### `pressuredest:` +### `pressuredest:` | Variants |   |   | | -------- | ----------- | ------- | | **int** | **int+ext** | **ext** | -#### `encoderdest:` +### `encoderdest:` | Variants |   |   | | -------- | ----------- | ------- | | **int** | **int+ext** | **ext** | -#### `mutedest:` +### `mutedest:` | Variants |   |   | | -------- | ----------- | ------- | | **int** | **int+ext** | **ext** | -#### `usbtomaindb:` +### `usbtomaindb:` | Variants |   |   | | -------- | --------- | ------ | | **0db** | **+12db** | | | **+6db** | **+18db** | | -#### `paramoutput:` +### `paramoutput:` | Variants |   |   | | -------- | ------ | ------ | | **nrpn** | **cc** | | -#### `portsoutputchannel:` +### `portsoutputchannel:` | Variants |   |   | | -------- | --------- | ------ | | **auto** | **track** | | -#### `usbin:` +### `usbin:` | Variants |   |   | | -------------- | ---------------- | ----------------- | @@ -1026,7 +1060,7 @@ Accepted formats: | **l:2r:6** | **l:6r:7:8** | **l:11:12r:7:8** | | **l:2r:7:8** | **l:6r:9:10** | **l:11:12r:9:10** | -#### `usbout:` +### `usbout:` | Variants |   |   | | -------------- | ---------------- | ----------------- | @@ -1053,36 +1087,36 @@ Accepted formats: | **l:2r:7:8** | **l:6r:9:10** | **l:11:12r:9:10** | | **l:2r:9:10** | **l:6r:11:12** | | -### Settings +## Settings -#### `parametermenuitem:` +### `parametermenuitem:` | Variants |   |   | | -------- | -------- | ------- | | **trig** | **smpl** | **amp** | | **src** | **fltr** | **lfo** | -#### `fxparametermenuitem:` +### `fxparametermenuitem:` | Variants |   |   | | --------- | ---------- | -------- | | **trig** | **reverb** | **comp** | | **delay** | **dist** | **lfo** | -#### `sequencermode:` +### `sequencermode:` | Variants |   |   | | ---------- | --------- | -------- | | **normal** | **chain** | **song** | -#### `patternmode:` +### `patternmode:` | Variants |   |   | | --------------- | -------------- | ------ | | **sequential** | **directjump** | | | **directstart** | **tempjump** | | -#### `samplerecordersrc:` +### `samplerecordersrc:` | Variants |   |   | | ---------- | --------- | ---------- | @@ -1092,7 +1126,7 @@ Accepted formats: | **bd** | **mt/ht** | **usbr** | | **sd** | **ch/oh** | **usbl+r** | -#### `samplerecorderrecordinglen:` +### `samplerecorderrecordinglen:` | Variants |   |   | | ---------- | ----------- | ------------ | diff --git a/Cargo.lock b/Cargo.lock index b991230..73b096e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -440,6 +440,8 @@ dependencies = [ [[package]] name = "rytm-rs" version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3081164ede711a92ba46cc906b8e6676a3f8386b7e1266f3f70d0a5f1cb59c80" dependencies = [ "bitstream-io", "derivative", diff --git a/Cargo.toml b/Cargo.toml index d57754a..f89604f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib"] [dependencies] median = { git = "https://github.com/Cycling74/median" } -rytm-rs = { path = "../rytm-rs/rytm" } +rytm-rs = "0.1" thiserror = "1.0.24" lazy_static = "1.4.0" diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..49bb937 --- /dev/null +++ b/LICENCE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 - Ali Somay (alisomay@runbox.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 5f1be03..b8c6fa3 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,51 @@ # rytm-external -A MaxMSP external to communicate with Analog Rytm MKII through sysex. This external is powered by [`rytm-rs`](https://github.com/alisomay/rytm-rs) and should be currently considered as a beta software. Please report any issue you may encounter through github issues. +A MaxMSP external to communicate with Analog Rytm MKII through sysex. -`rytm` provides a rich interface to communicate with Analog Rytm MKII through sysex. It has verbose and informative error reporting, inherits all the features of `rytm-rs` and provides comprehensive documentation. +This external is powered by [`rytm-rs`](https://github.com/alisomay/rytm-rs) and should be currently considered as beta software. Please report any issue you may encounter through [github issues](https://github.com/alisomay/rytm-external/issues). + +`rytm` provides a rich interface to communicate with Analog Rytm MKII through sysex. + +It has verbose and informative error reporting, inherits all the features of `rytm-rs` and provides comprehensive documentation. All the following documentation below this section is written with the assumption of basic knowledge of the Analog Rytm drum machines and MaxMSP. ## Installation -One can obtain the builds from the [releases]() page which contains builds for major operating systems. If you want to build the external yourself, you will need to install [rust](https://www.rust-lang.org/tools/install). Then, please follow the build and install instructions from [median]() repository. +One can obtain the builds from the [releases](https://github.com/alisomay/rytm-external/releases) page which contains builds for major operating systems. + +If you want to build the external yourself, you will need to install [rust](https://www.rust-lang.org/tools/install). Then, please follow the build and install instructions from [median](https://github.com/Cycling74/median/blob/develop/median/README.md) repository. ## Preparation in your patch Once you installed the external you may instantiate it in the MaxMSP patch by writing `rytm` in an object box. + Connect the `sysexin` object to `rytm`'s inlet and `rytm`'s leftmost outlet to `midiout` object. + Set your ports for `sysexin` and `midiout` objects so they point to your device and you're ready to go. + The rightmost outlet of `rytm` object is used to respond to get and set queries. ## Context -`rytm` when instantiated contains a twin of a default project on Analog Rytm MKII. Important thing to know is this is not yet the data on your device. +`rytm` when instantiated contains a twin of a default project on Analog Rytm MKII. + +Important thing to know is this is not yet the data on your device. + We'll update parts of the `rytm` by querying the device when needed. -`rytm` is not yet an interface for `cc` or `nrpn` messages which are well documented in the manual. It is a `sysex` interface where the format is reverse engineered as a community effort see [`rytm-rs`](https://github.com/alisomay/rytm-rs) and these threads from elektronauts for details: +`rytm` is not yet an interface for `cc` or `nrpn` messages which are well documented in the manual. + +It is a `sysex` interface where the format is reverse engineered as a community effort see [`rytm-rs`](https://github.com/alisomay/rytm-rs) and these threads from [elektronauts](https://www.elektronauts.com) for details: + +- +- -- -- +`rytm` follows the devices not officially supported and undocumented `sysex` format. -`rytm` follows the devices not officially supported and undocumented `sysex` format. This means that it is not guaranteed to work with future firmware updates unless new versions of this external are released. Currently the supported firmware version is `1.70` and it is only tested on Analog Rytm MKII. +This means that it is not guaranteed to work with future firmware updates unless new versions of this external are released. + +Currently the supported firmware version is `1.70` and it is only tested on Analog Rytm MKII. ### The format and the project structure @@ -44,9 +62,11 @@ A `rytm` project is made of - Settings (a single structure for the whole project) `rytm` enables you to query all these structures from the device, edit them in great detail and send them back to the device. + If you wish you can also edit the default ones which comes with `rytm`'s instantiation and send them to the device. To work productively with `rytm` an understanding of these structures and the connection between them is necessary. + The following sections will explain the structures briefly. Note that this is a brief introduction to the structures. For more detailed and complete information please refer to the [api docs](API_DOCS.md), the source code and the community. @@ -54,12 +74,15 @@ Note that this is a brief introduction to the structures. For more detailed and #### What is the work buffer? The device has something called a "work buffer" which points to the pattern you're currently chosen, kit you're currently chosen, etc. + Think of it as a pointer to the currently selected or active structure. #### Patterns Think of patterns as the sheet music. They are a set of instructions for the sequencer. They don't contain any settings for the sounds. + This is where your notes, trigs, mutes, locks, retrigs, microtiming, etc. are stored. + Also patterns store the kit number they are associated with. #### Kits @@ -82,6 +105,7 @@ Settings contain the muted sounds, selected track, selected pattern mode and mor ### Queries Since the `rytm` contains the twin of the structures on the device we can query them and update the `rytm`'s structures with the data from the device. + This is done by starting our messages with `query` selector. For example `query pattern 1` will query the pattern 1 (2 on device) from the device and update the `rytm`'s pattern 1 with the data from the device. All indexes are 0 based so the first pattern is 0, the first kit is 0, etc. @@ -117,27 +141,37 @@ Accepted formats are: #### Getting data from `rytm` external 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](). +The details of the format and the output format are explained in the [api docs](API_DOCS.md). #### Setting data in the `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](). +The details of the format and the input format are explained in the [api docs](API_DOCS.md). #### Parameter locking -soon.. +The pattern structure holds the parameter lock pool for that pattern. + +Think of it as a pool where you can store parameter locks, set or clear them. + +You have a space of 72 different parameter locks for every trig in a pattern. + +If you exceed that the memory will be full. + +There will be detailed documentation about this in the near future about how it is handled internally and how does sound and kit structures link to a certain pattern's parameter lock pool. #### Look out Do not query or send data to the device in a perpetual way without the minimum of a 750-800 ms interval. This is not dangerous but the data is usually large and it is processed in the low priority thread of the device. The device may queue the responses or requests and may not be able to process them in time. When you send the initial `sysex` message to the device for the first time after power on it usually responds with an irrelevant message and never does it again. + This will appear as an error in the max window called "short read" you may safely ignore this error. ## Todo Setting, getting and parameter locking machine parameters is not yet implemented. + There are no technical obstacle there but it takes good amount of time due to the large amount of machines. I'll do it some time later. @@ -148,9 +182,13 @@ Saving and loading projects packed as a `sysex` file is not yet implemented. Thi ## Contributing I am aware that this is a very niche project, did by a single person and the code base is not very well documented. + On the other hand I still think that an experienced developer in the field may follow it easily. + I'm always open to contributions and I'll do my best to help you understand the code base and the project. +Rust [code of conduct](https://www.rust-lang.org/policies/code-of-conduct) applies to this project. Please be nice and respectful. + ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. diff --git a/src/action/get/global.rs b/src/action/get/global.rs index 03188c4..89eb461 100644 --- a/src/action/get/global.rs +++ b/src/action/get/global.rs @@ -96,7 +96,7 @@ pub fn handle_global_get_enum_value( let index_atom = Atom::from(AtomValue::Int(global.index() as isize)); let enum_value_atom = Atom::from(SymbolRef::try_from(value).unwrap()); - if let Err(_stack_overflow_err) = out.send(&[enum_type_atom, index_atom, enum_value_atom][..]) { + if let Err(_stack_overflow_err) = out.send(&[index_atom, enum_type_atom, enum_value_atom][..]) { // Stack overflow ignore } @@ -178,7 +178,7 @@ pub fn handle_global_get_action( let index_atom = Atom::from(AtomValue::Int(global.index() as isize)); let value_atom = Atom::from(value); - if let Err(_stack_overflow_err) = out.send(&[action_atom, index_atom, value_atom][..]) { + if let Err(_stack_overflow_err) = out.send(&[index_atom, action_atom, value_atom][..]) { // Stack overflow ignore } diff --git a/src/action/get/kit.rs b/src/action/get/kit.rs index b4a3681..4fbef87 100644 --- a/src/action/get/kit.rs +++ b/src/action/get/kit.rs @@ -209,8 +209,8 @@ pub fn handle_kit_get_kit_element( if let Err(_stack_overflow_err) = out.send( &[ kit_index_atom, - element_type_atom, element_index_atom, + element_type_atom, value_atom, ][..], ) { diff --git a/src/action/get/pattern.rs b/src/action/get/pattern.rs index 435ec32..2f688e1 100644 --- a/src/action/get/pattern.rs +++ b/src/action/get/pattern.rs @@ -61,7 +61,7 @@ pub fn handle_pattern_get_action(action: PatternGetAction) -> Result<(), RytmExt let action_atom = Atom::from(action); let index_atom = Atom::from(AtomValue::Int(pattern.index() as isize)); - if let Err(_stack_overflow_err) = out.send(&[action_atom, index_atom, value_atom][..]) { + if let Err(_stack_overflow_err) = out.send(&[index_atom, action_atom, value_atom][..]) { // Stack overflow ignore } @@ -84,7 +84,7 @@ pub fn handle_pattern_enum_get_action( let index_atom = Atom::from(AtomValue::Int(pattern.index() as isize)); let enum_value_atom = Atom::from(SymbolRef::try_from(value).unwrap()); - if let Err(_stack_overflow_err) = out.send(&[enum_type_atom, index_atom, enum_value_atom][..]) { + if let Err(_stack_overflow_err) = out.send(&[index_atom, enum_type_atom, enum_value_atom][..]) { // Stack overflow ignore } diff --git a/src/action/get/settings.rs b/src/action/get/settings.rs index 133b271..fde0c1f 100644 --- a/src/action/get/settings.rs +++ b/src/action/get/settings.rs @@ -29,7 +29,7 @@ pub fn handle_settings_get_enum_value( let enum_value_atom = Atom::from(SymbolRef::try_from(value).unwrap()); if let Err(_stack_overflow_err) = - out.send(&[enum_type_atom, Atom::from(0isize), enum_value_atom][..]) + out.send(&[Atom::from(0isize), enum_type_atom, enum_value_atom][..]) { // Stack overflow ignore } @@ -64,7 +64,7 @@ pub fn handle_settings_get_action( }; let action_atom = Atom::from(SymbolRef::from(CString::new(action).unwrap())); - if let Err(_stack_overflow_err) = out.send(&[action_atom, Atom::from(0isize), value_atom][..]) { + if let Err(_stack_overflow_err) = out.send(&[Atom::from(0isize), action_atom, value_atom][..]) { // Stack overflow ignore } diff --git a/src/action/get/sound.rs b/src/action/get/sound.rs index 4e46924..97468dd 100644 --- a/src/action/get/sound.rs +++ b/src/action/get/sound.rs @@ -62,7 +62,7 @@ pub fn handle_sound_get_enum_value( let index_atom = Atom::from(AtomValue::Int(sound.index() as isize)); let enum_value_atom = Atom::from(SymbolRef::try_from(value).unwrap()); - if let Err(_stack_overflow_err) = out.send(&[enum_type_atom, index_atom, enum_value_atom][..]) { + if let Err(_stack_overflow_err) = out.send(&[index_atom, enum_type_atom, enum_value_atom][..]) { // Stack overflow ignore } @@ -160,7 +160,7 @@ pub fn handle_sound_get_action( let action_atom = Atom::from(SymbolRef::from(CString::new(action).unwrap())); let index_atom = Atom::from(AtomValue::Int(sound.index() as isize)); - if let Err(_stack_overflow_err) = out.send(&[action_atom, index_atom, value_atom][..]) { + if let Err(_stack_overflow_err) = out.send(&[index_atom, action_atom, value_atom][..]) { // Stack overflow ignore } diff --git a/src/action/get/track.rs b/src/action/get/track.rs index bc5d167..1ce89a7 100644 --- a/src/action/get/track.rs +++ b/src/action/get/track.rs @@ -66,7 +66,7 @@ pub fn handle_track_get_action(action: TrackGetAction) -> Result<(), RytmExterna let value_atom = Atom::from(AtomValue::Int(value as isize)); if let Err(_stack_overflow_err) = - out.send(&[action_atom, pattern_index_atom, index_atom, value_atom][..]) + out.send(&[pattern_index_atom, index_atom, action_atom, value_atom][..]) { // Stack overflow ignore } @@ -94,9 +94,9 @@ pub fn handle_track_enum_get_action( if let Err(_stack_overflow_err) = out.send( &[ - enum_type_atom, pattern_index_atom, index_atom, + enum_type_atom, enum_value_atom, ][..], ) { diff --git a/src/action/get/trig.rs b/src/action/get/trig.rs index 968f171..60d81c6 100644 --- a/src/action/get/trig.rs +++ b/src/action/get/trig.rs @@ -62,7 +62,7 @@ pub fn handle_trig_get_action(action: TrigGetAction) -> Result<(), RytmExternalE let value_atom = Atom::from(AtomValue::Int(value)); if let Err(_stack_overflow_err) = - out.send(&[action_atom, track_index_atom, index_atom, value_atom][..]) + out.send(&[track_index_atom, index_atom, action_atom, value_atom][..]) { // Stack overflow ignore } @@ -92,9 +92,9 @@ pub fn handle_trig_enum_get_action( if let Err(_stack_overflow_err) = out.send( &[ - enum_type_atom, track_index_atom, index_atom, + enum_type_atom, enum_value_atom, ][..], ) {