# Soulver X Series

## What is the Soulver X Series?

In 2024, we embarked on a multi-year R\&D project whose mission is to:

* Explore cool new ideas for Soulver
* Seek out new forms & new workflows
* Boldly go where no notepad calculator has gone before 🖖

We intend to release a major new X series version every year.

### Soulver X Series Sponsorship

If you're a long time user (or Soulver mega-fan), and are excited by this work, you might consider [sponsoring our mission on GitHub](https://soulver.app/sponsor).

Also, as a sponsor, you'll get access to the latest X series prototype (X3, X4, etc) with more never-before-seen features in the notepad calculator domain.

Our (very) small team would appreciate the support, and we'll be able to dedicate more resources to this kind of advanced notepad calculator R\&D.

## Soulver X2 (2025)

### Subsheets

* A subsheet is a separate sheet that lives inside a single token.
  * Create a subsheet from the + button in the tab bar.
  * Double-click the purple token to open the subsheet editor.
* Subsheets can reference variables from the mother sheet (provided the variables are declared above the subsheet's line).

### Slider Tokens with Ranges

* A slider token allows you to specify the range for a scrubbable slider
  * Create a slider from the + button in the tab bar.
  * Double-click the green token to open the slider popup.

### Divider Lines

* Type dash (-) three times to insert a divider line.
* Use divider lines to create more visual separation between different parts of your sheet.

## Soulver X1 (2024)

X1 includes implementations of Soulver's top feature requests, including:

* [Custom function support](https://soulver.app/feedback) (*including* *natural language functions)*
* [Sharing variables across sheets](https://soulver.app/feedback) (*via the new "header" sheet)*
* [Connecting to Web APIs](https://soulver.app/feedback) (*with just a paste and a couple of clicks)*

### Tabs

<figure><img src="https://1915029247-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf0gWBnuB8M1SitWhyk%2Fuploads%2FSLD9GT2AbQINDQAw2vK7%2Fimage.png?alt=media&#x26;token=098ea8fb-178d-469c-b2de-80fbfcdaae3c" alt=""><figcaption><p>Multiple tabs in Soulver X1</p></figcaption></figure>

Documents in Soulver X1 start with a single tab, and you can add more by clicking the + button in the right of the tab bar.

**Renaming tabs**

Double click on the title of a tab to give it an alternative name. Alternatively, control-click on the tab and choose "Rename".

**Deleting tabs**

When you hover over a tab, click the x button to delete. Alternatively, control-click on the tab and choose "Delete"

{% hint style="warning" %}
Tabs are a work in progress feature.

You cannot rearrange tabs (yet), and adding too many tabs in a single document does not work correctly.
{% endhint %}

### The header sheet

The header is a dedicated sheet for defining variables, units, functions, and web values that can be used across all tabs in your document.

<figure><img src="https://1915029247-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf0gWBnuB8M1SitWhyk%2Fuploads%2FhabF0y84rR9JJpGob0HM%2FScreenshot%202024-05-24%20at%202.11.42%E2%80%AFPM.png?alt=media&#x26;token=35bded1b-394c-4cf1-9d3e-3a50f194535a" alt="" width="375"><figcaption></figcaption></figure>

### **Cross-tab variables**

Declare variables for your document in the header the same way you would declare local variables.

For example:

```
my variable = 123
```

`my variable` will be available across all your sheets

{% hint style="info" %}
Your tabs can only reference variables, but cannot modify their definition such that it will apply to other sheets in the document.
{% endhint %}

### **Equivalence units**

An equivalence unit is defined in terms of an existing unit.

Define a new equivalence unit in the header using (for example):

```
1 watermelon = 10 lb
```

<figure><img src="https://1915029247-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf0gWBnuB8M1SitWhyk%2Fuploads%2Fdfrh1vBWg0NLJzHlDK0B%2Fimage.png?alt=media&#x26;token=8a073677-814a-4903-b192-96b79fb39189" alt=""><figcaption><p>Declaring a new unit of mass in Soulver X1</p></figcaption></figure>

The `watermelon` can now be used as a unit of mass across your tabs.

<figure><img src="https://1915029247-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf0gWBnuB8M1SitWhyk%2Fuploads%2FbHsxXl2erSJCneDJqPHu%2Fimage.png?alt=media&#x26;token=772fcc15-13a0-4bf5-8b57-b092f343b136" alt=""><figcaption><p>Using a custom equivalence unit in Soulver X1</p></figcaption></figure>

{% hint style="info" %}
Soulver X1 automatically pluralises your new unit for you (in English).

So in this example, both "watermelons" will be recognized as a valid unit name, even though the definition was "watermelon".
{% endhint %}

### **Generic units**

An equivalence unit is an entirely new unit type, not defined in terms of an existing unit.

Define a new generic unit in the header using (for example):

```
operation = new unit
```

<figure><img src="https://1915029247-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf0gWBnuB8M1SitWhyk%2Fuploads%2FKxJemzqutB0pzz31G7FO%2Fimage.png?alt=media&#x26;token=5cc5751c-5dc0-4769-a5b7-335be12a9525" alt=""><figcaption><p>Declaring a generic unit type in Soulver X1</p></figcaption></figure>

The `operation` unit can now be used across your tabs (including in rates):

<figure><img src="https://1915029247-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf0gWBnuB8M1SitWhyk%2Fuploads%2FVCzURXEZjVQvyRMHIwIv%2Fimage.png?alt=media&#x26;token=3103a567-296d-470a-8177-13d8fc3b0c4d" alt=""><figcaption><p>Using a generic unit in Soulver X1</p></figcaption></figure>

### **Custom functions**

**Introduction**

A function is a handy phrase that takes an input and returns an output. In Soulver X1, you can use (almost) any syntax for a function, including:

C-style: `doSomething(123)`

Swift-style: `doSomething(with: 123)`

Natural language: `do something with 123`

**To create a new custom function (in the header)**

* Click `Define New` > `Function`

**Choosing a function name:**

<figure><img src="https://1915029247-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf0gWBnuB8M1SitWhyk%2Fuploads%2FFyD4prZFFSRX8xKOyRF4%2Fimage.png?alt=media&#x26;token=c36aad88-c502-4bf5-a802-e052d4e36257" alt=""><figcaption><p>Declaring a new function in Soulver X1</p></figcaption></figure>

* Define your function using an example of how you might use the function in practice.
* Choose any parameters (so long as they match the "type" of parameter that you expect for your implementation, like money, time, plain decimal numbers, etc).

**Implementing your function:**

<figure><img src="https://1915029247-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf0gWBnuB8M1SitWhyk%2Fuploads%2FZs4YC9KTPb2FUkk8NGHS%2Fimage.png?alt=media&#x26;token=7a21ad55-dd53-44cd-8c18-6320e398b309" alt=""><figcaption><p>Writing a function to calculate how much sales tax there is in a certain amount</p></figcaption></figure>

* Implement the function in a dedicated Soulver sheet. Any parameters will be injected as yellow tokens.
* Hover over a parameter token to see what parameter it refers to in the declaration.
* The last line of the implementation sheet will be returned as the function's final value.

**Using your function**

<figure><img src="https://1915029247-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf0gWBnuB8M1SitWhyk%2Fuploads%2FCUdSIfvWO5rvkAonnR86%2Fimage.png?alt=media&#x26;token=02fd2c0c-2756-4d91-a18b-b0a0a261d7d0" alt=""><figcaption></figcaption></figure>

Use your function with other input values across all of your sheets

### **Web values (connecting to JSON APIs)**

#### **To create a new web value (in the header)**

* Click `Define New` > `Web Value`

#### **To connect to a particular data point in a JSON data feed**

<figure><img src="https://1915029247-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lf0gWBnuB8M1SitWhyk%2Fuploads%2FadHsOAOfeDeJKCrhC2bD%2Fimage.png?alt=media&#x26;token=312c55d5-1115-4142-bf69-3f5e666fa5fe" alt=""><figcaption><p>Connecting to a remote data feed in Soulver X1</p></figcaption></figure>

* Paste in a URL to a JSON data feed, and then simply click on the data point you wish to connect to

#### **Using a web value**

* Your web value will be assigned a variable name (by default, matching its description in the JSON feed)
* You're welcome to change the variable name to something else

#### **Updating a web value**

* Your web value will be automatically updated in the background with the frequency that you specified during setup

#### **Editing a web value**

* Double-click the yellow web value token in the header to specify a different data point, or change the update frequency

## Soulver X Series File Type

{% hint style="warning" %}
Soulver X series apps use a different document type (.slvrx) from Soulver.

This is to support the new features we're building and experimenting with.

Soulver X (.slvrx) files cannot be edited by Soulver 3 for Mac, iOS & iPad.
{% endhint %}
