Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging dev branch with new features #225

Merged
merged 22 commits into from
Jun 11, 2023
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b169547
Fixing a few inconsistencies with SPL
Bubobubobubobubo Jun 8, 2023
3956c7d
Limiting octave up and octave down operators
Bubobubobubobubo Jun 8, 2023
f144396
Adding internal variables to the Sardine Pattern Language
Bubobubobubobubo Jun 8, 2023
3fde803
Inverting . and _
Bubobubobubobubo Jun 8, 2023
647001e
Moving content in the documentation
Bubobubobubobubo Jun 8, 2023
c73dbcb
Global Scale + Scale Function
Bubobubobubobubo Jun 9, 2023
db72276
Without bugfixes
Bubobubobubobubo Jun 9, 2023
415ad2c
Scale patterning ?
Bubobubobubobubo Jun 9, 2023
f4dff06
Adding real euclidian rhythms
Bubobubobubobubo Jun 9, 2023
f4d9b88
Fixing composition bug with ultri, ulsaw and ulrect
Bubobubobubobubo Jun 10, 2023
03dfc4b
Adding a binary shift rhythm generator
Bubobubobubobubo Jun 11, 2023
baf3f9e
fix bug with unit conversion on the br algorithm
Bubobubobubobubo Jun 11, 2023
041851f
Adding the variant bl function
Bubobubobubobubo Jun 11, 2023
58fd86f
Remove "Editor" option in Sardine Config (unused)
Bubobubobubobubo Jun 11, 2023
d0d9984
Add some conditionals for color display and more
Bubobubobubobubo Jun 11, 2023
d8be7db
Refactor documentation
Bubobubobubobubo Jun 11, 2023
0fb459c
Reworking Function Library Section
Bubobubobubobubo Jun 11, 2023
3d84e07
Fixing some forgotten things with Math Functions
Bubobubobubobubo Jun 11, 2023
321d33e
The gigantic cleanup continues
Bubobubobubobubo Jun 11, 2023
88a9e81
Documentation falling from the sky
Bubobubobubobubo Jun 11, 2023
1405a13
Trying to do something with combinatorics functions
Bubobubobubobubo Jun 11, 2023
49742e1
fix rogue space
Bubobubobubobubo Jun 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Moving content in the documentation
Time operators are now functions
Bubobubobubobubo committed Jun 8, 2023
commit 647001e884396e031f6f85dfa8b7efe4cdf8cd17
1 change: 1 addition & 0 deletions docs/sardine_doc/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -61,6 +61,7 @@
- [Extend](pattern_languages/sardine/extend.md)
- [Extend-Repeat](pattern_languages/sardine/extend_repeat.md)
- [Function Library](pattern_languages/sardine/function_library.md)
- [Time Functions](pattern_languages/sardine/time_functions.md)
- [Mathematical](pattern_languages/sardine/math_functions.md)
- [Euclidian](pattern_languages/sardine/euclidian_functions.md)
- [Voice Leading](pattern_languages/sardine/voice_leading.md)
39 changes: 0 additions & 39 deletions docs/sardine_doc/src/pattern_languages/sardine/numbers.md
Original file line number Diff line number Diff line change
@@ -25,45 +25,6 @@ def number(p=0.5, i=0):

Many things can be safely considered as numbers such as **notes**. Internally, a **note** is also a number.

## Time-dependant numbers

```python
@swim
def number(p=0.5, i=0):
# We print time-dependant values
print(P('$ $.p $.m', i))
again(number, p=0.5, i=i+1)
```

Some number tokens are clock-time dependant (based on **Sardine** clock time). Depending on the moment your loop/operation takes place, you might see some values recurring because you are not polling time continuously but at predictible rhythmic moments of time. Read that sentence twice, then read it again, **please**!
- `$`: **beat**, the current beat, with floating point precision.
- `$.p`: **phase**, a number between `0` and `1` denoting where you are in the beat.
- `$.m`: **measure**, the measure since the clock started.

```python
@swim
def number(p=0.5, i=0):
print(P('$ $.m $.p', i))
again(number, p=0.5, i=i+1)
```
Some other number tokens are based on **absolute time**. They are not dependent on the clock. Use them for long-running sequences for introducing randomization. You will notice that they are all prefixed by `T`. `T` is a symbol very often associated with **time** in **Sardine**, while `$` denotes the clock time.

```python
@swim
def wow(p=0.5, i=0):
print(P('T.U T.Y T.M T.D T.h T.m T.s T.µ', i))
gain(wow, p=0.5, i=i+1)
```

- `T.U`: Unix Time, the current Unix Time.
- `T.Y`: year, the current year.
- `T.M`: month, the current month.
- `T.D`: day, the current day.
- `T.h`: hour, the current hour.
- `T.m`: minute, the current minute.
- `T.s`: second, the current second.
- `T.µ`: microsecond, the current microsecond.

## Random numbers

- You can write random numbers by using the word `rand`.
66 changes: 66 additions & 0 deletions docs/sardine_doc/src/pattern_languages/sardine/time_functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Time Functions

Some functions can return information about the Sardine clock. The information will be updated everytime you evaluate an expression. Depending on the moment when your loop takes place, you might see some values recurring because you are not polling time continuously but at predictible rythmic moments.

<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">

<colgroup>

<col class="org-left" />

<col class="org-left" />

<col class="org-left" />

<col class="org-left" />
</colgroup>
<tbody>
<tr>
<td class="org-left">Function name</td>
<td class="org-left"> Arguments</td>
<td class="org-left">Description</td>
<td class="org-left">Return type</td>
</tr>


<tr>
<td class="org-left">time</td>
<td class="org-left">year month day hour minute second micro</td>
<td class="org-left">Return information about wall clock time. No argument will return current Sardine internal time.</td>
<td class="org-left">int</td>
</tr>


<tr>
<td class="org-left">bar</td>
<td class="org-left"></td>
<td class="org-left">Current bar</td>
<td class="org-left">int</td>
</tr>


<tr>
<td class="org-left">phase</td>
<td class="org-left"></td>
<td class="org-left">Current phase</td>
<td class="org-left">float</td>
</tr>


<tr>
<td class="org-left">beat</td>
<td class="org-left"></td>
<td class="org-left">Current beat</td>
<td class="org-left">float</td>
</tr>


<tr>
<td class="org-left">unix</td>
<td class="org-left"></td>
<td class="org-left">Current Unix Time</td>
<td class="org-left">int</td>
</tr>

</tbody>
</table>