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

Anchor sound #52

Open
wants to merge 31 commits into
base: anchor
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c8b5cb9
Correct overlay-xy examples
dwoos Sep 9, 2019
122fd57
Merge pull request #51 from dwoos/patch-1
jpolitz Sep 9, 2019
2677c31
add index entry for spies
jpolitz Sep 11, 2019
e424ebf
setup
Nov 6, 2019
c92eb57
draft
Nov 17, 2019
db29183
change camlcase to hyphen-case
Nov 25, 2019
19d1a57
deploy test
Nov 25, 2019
04749f5
test
Nov 25, 2019
8a23ba8
test
Nov 25, 2019
390b402
Edits to sound doc
soumyamahalakshmi Nov 29, 2019
1e5144e
small fix
Dec 2, 2019
b4d60d9
Merge branch 'anchor-sound' of github.com:h454482/pyret-docs into anc…
Dec 2, 2019
72fca97
Adding tutorial and additional enhancements on sound docs including s…
soumyamahalakshmi Dec 6, 2019
d4a2f26
Merge branch 'anchor-sound' of https://github.com/h454482/pyret-docs …
soumyamahalakshmi Dec 6, 2019
626a62e
png add
soumyamahalakshmi Dec 6, 2019
59f5531
PNG edits
soumyamahalakshmi Dec 6, 2019
d39c185
added code examples to sound doc
soumyamahalakshmi Dec 9, 2019
a8f0ed6
minor change
Dec 9, 2019
0843338
Including new functions into Doc, Correcting errors
soumyamahalakshmi Dec 9, 2019
d5cc9fb
Merge branch 'anchor-sound' of https://github.com/h454482/pyret-docs …
soumyamahalakshmi Dec 9, 2019
f8282a8
get-note correction
soumyamahalakshmi Dec 9, 2019
eb47e97
Tutorial updation to reflect new functions
soumyamahalakshmi Dec 12, 2019
fc498a4
docs update
Dec 12, 2019
c4b9fb3
Merge branch 'anchor-sound' of github.com:h454482/pyret-docs into anc…
Dec 12, 2019
24a4398
fix
Dec 12, 2019
e224285
fix
Dec 12, 2019
6c8cc83
fix bug
Dec 13, 2019
0ae937e
resizing
Dec 13, 2019
d3c6f0b
Delete ragged_rkt.dep
h454482 Dec 13, 2019
c0ce1c5
Delete scribble-helpers_rkt.dep
h454482 Dec 13, 2019
a2ae758
rm compiled
Dec 13, 2019
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
45 changes: 17 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ python:
- '3.4'
branches:
only:
- horizon
- master
- anchor-sound
env:
global:
- GH_REF: github.com/brownplt/pyret-docs.git
- GH_REF: github.com/h454482/pyret-docs.git
- RACKET_DIR: "~/racket"
- RACKET_VERSION: '7.1'
- secure: tkOgKmY5brk6wSTluhgKaFiUiVVXnf1HefE1v56LOUlNHcieMLjRAgXc5LsdezI5ymtf59tZBVAdv7zWG+2Co/nMgIVE20FLpT2UeZCyBu+669lDPZG5zJcsq3Yp52EyE3pSzBRc5H5c9Ni3AZWunV/OxV8xUn3TMkTz9ian/j1AiyDK6z/s5TyFVuRITUOriyuE84e5HJvSYdCjMH2jZE3vCp+lBO9xK/+7IAyoXM7LBFIxz2qBbfzeGbDUzMiFujJZ0/cJu8Qfjlz/AEzW13BWhzhrI9FWUaawKJX1xU6gv9uhRgmsQqQjOMe2CdDuUiUoFP11WjbSnSsN7/B3oklqSiHNHFnOCbxYqunpEpI4EOltL0SpEFHZYl5JgtsLJTbqZvAJ0AaT88F8HBJEFthxyz6MhbBZ9CewOpFY50qY7yvsLr6JEEzCEnTk2EtIv6r2Ux5Xad+K2AXfpEPR1VvfRl6J4U7JGKHHspNVJmpdZSnJdYTzS2siHknV4LQ5Zrl1uwhTjTc4H6bshDKQfcXFkkc4edV78jrJiPDP5hpPVaqLH5MTLV0mhsrSowHPaOyL6y3y+/mrUFG7F0Lha9qdtT4k8PvD47ldPxBCaFOh85MC+w+p65WFqf2rwFM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HyjyD4m778Aj9qThvJL1jVtERmYDIBNdzagF8YM3yJ6EA2WxLTS2ERO+T1RYgwDixucQARl5bp8SspWy/vM+dOQGUVVKyF9CSs8/Pd/07Fx84L43ELCgGAjMyEhE8hbChOHbcLnOuU1n++Ae5u/0ytSSkou1Tb1QEo5MSoYi1C9ScI3eH90Ff5GRg3THmmCPkwTui2Ou8wp3oLc6SuULDH6U/lD0+6wFu8FpGIYl1Dk0lfQo3JnW0eQoHslE0uW0AFUHRQPujws8JM8hEmARZDyjVSOCADUkHzN+28seguX5mwyNlbwgcvAgSZDuL4XYJrPeEUvpVMVxGCjdZlcmCw8XeKgYTmngxlTw=
- secure: rHmNPLTMeRyfAt8gk7HYY2PFA++hET1RYTr2AGNUOPh7v9tCe8yeukabP9xGB9p202HMmfa9eybmQ5NsOMCXgbWTYrixjpWJFGqTRCvj7IobZJt2jwX+eK4dWQMur9FG2BPd/qA9Pw1W/xeOyF50zBgHAzWAwACUP2o2E+fIapu8bT9ItZtccjjCHeEMJ216UfJdpf86K+SkZyVz97agTLeQ6Rph6OKVAQMCTxzn89zhyM4fFU0FJbVI0KqAMr5hbjLqUsfOHL/6yq2bTtrllgKa16gr+utpFtYnmmoLU5rmYgOhaY+hgoNWwWo4+iEzNDpRlWBsVxbPQWj1YnpzdFKueApWjkQaddHj990M7Ts/gTmhbHE28nKbCVVpZCPlTY6Mb+Co0BeFW5FwM+9Tnj3EAUHHRdXj0oFPylw39sFHBRjeqn1eJx8oX0M1qdKeuF83KRyQI+sRNAPoO+XPy6Ig6UI49gFQoXBtiAWZeaMPVWPA77XGloJxUP+D7pZe1Qov3gQJrATG7LycIA9hwB6hOiINuloYW6YHzFUqPHKqtCp8ZOztRYghFfOGBQJpgagxKj/nmKIWdGsLxcBlArceWO8HgjwcpHhek9NQdnYdcqLzZnFCBWjUrUaYjj1EFYjJMvtbT9oM8nZmQxsPnRQMTo4dbJ0gj/N93fnvSm4=
before_install:
- git clone https://github.com/greghendershott/travis-racket.git
- cat travis-racket/install-racket.sh | bash
Expand All @@ -20,25 +19,15 @@ script:
- npm install
- make
deploy:
- provider: s3
bucket: pyret-docs
local_dir: build/docs
upload-dir: docs/latest
skip_cleanup: true
on:
branch: master
secret_access_key:
secure: LzAA8MSvkPCydPU/Kobw4lPLiGbNicqFd9q7S1PkgOtjb9AdA+NBC1kZRf7wunV3b72UHmD7mIHRJESEqWPk4NdFuQM4tJOSIKsDjnF3RuPXO1BpmLMP5/2XUVyv8v1tPo/IgIVnRGGDc5ylUFKbvBkGP7CqWmtF15WyxsX6LFzDVEBIC79wq3TXNBfUHOVYOuiBSzJSzdwFSTABEBqdHHwqeDnFDxy9aeVogbF6FoofaMUsuN46FBZ4EHDm+QhedWaHQ1sq2Waf+tkJtYIdZk+CdafxyQA3uuBTLyztuH6gNCDeJgvYyNGXpYphGyB4nGOIuH4E6V31t9FyF53Uz16oOgidfvKmYyw+m06PYuoOnzs35Vcf+Kp0/zIuxt7BpxMx80cbmm/kpdxrQKGgGCLP3VcwJ07IPMW6YkmsFg3Ob2vAWvcBQdErj586OOoGiTi4cRZzsPeQ9AfAnD6Dq+NhguG88kV+ntRisDZ60A+zGxLsFtqGn87s3W3ieVSrgv1P2gihwYasCm0B5jTeV7AnsKVRExnDedReJORIOQfc33sToWEVQ+cGZ1e2QyasuJtaVg2qza1SB4JZ2psjhkvhWfYCBDdODeukWJ/KGUxOxYupc+nEQkg6VRtKey6oF5MDkFGL9cOSzDrX3AGhyPFq6mmFJSuNshJOncZDliE=
access_key_id:
secure: FO6FefC+VV5xqRckWkfm4BAAO+fi91xCMCG2U/cKpP/LSkrN5PBqSeSymy2II0ga9hhzu/gL3zJFSivwufCr/cQdozKyqqI9kFE3qRyfIcydfQQt3f46l6bXPpiw3n6MAI03TBYzV2M7Vlj/Y2KBYv5cpY7fUn2kDu0eHKr8GunSysltM39VpTYjWReup5C7fuyAhgJvQHnPaxWr+QTgNcXERge4IVFON+opaMadrz2ECVTvwIaC/7N4VH1xu/WB1objwyH7lfElxI21rM5e8zeyQpBVGaAmdkY97uQ8Jsx7Zzvux6DRK/9ga+O4xZSsJoTNHBf3mLtzy1lhO5eO1aJlPH6JiEG0Mb144/o9ToH1RDC8Wc/7tEDGrOq4m2z5o3NGLf9adFv6EEzjyw8QouGCkj4OgQOptmLGBJ2/ZUmNfcDeVGtdm7d9A565ElRgvc8dbWRkika982JVBwuR/2FjGwkmHAvxYDMfJ77tEninhGptpgXR1rZxt5vrVOWnQdle2iu6Tco17OvLSwidNr7B7ejq/SQBWYBGpoyZlQGF3Xp95hNEMF76aKhFajS519mRHFzTqUsBGuHkjbHVvYx+rkUaP+Zsx1n2h2Uv/A2KHHGzpLBPyM1e8zKVluHYmjh7XFdX/af+n7jmL29R9yFVlD41PjKAdcdo7u7bJw4=
- provider: s3
bucket: pyret-docs
local_dir: build/docs
upload-dir: docs/horizon
skip_cleanup: true
on:
branch: horizon
secret_access_key:
secure: LzAA8MSvkPCydPU/Kobw4lPLiGbNicqFd9q7S1PkgOtjb9AdA+NBC1kZRf7wunV3b72UHmD7mIHRJESEqWPk4NdFuQM4tJOSIKsDjnF3RuPXO1BpmLMP5/2XUVyv8v1tPo/IgIVnRGGDc5ylUFKbvBkGP7CqWmtF15WyxsX6LFzDVEBIC79wq3TXNBfUHOVYOuiBSzJSzdwFSTABEBqdHHwqeDnFDxy9aeVogbF6FoofaMUsuN46FBZ4EHDm+QhedWaHQ1sq2Waf+tkJtYIdZk+CdafxyQA3uuBTLyztuH6gNCDeJgvYyNGXpYphGyB4nGOIuH4E6V31t9FyF53Uz16oOgidfvKmYyw+m06PYuoOnzs35Vcf+Kp0/zIuxt7BpxMx80cbmm/kpdxrQKGgGCLP3VcwJ07IPMW6YkmsFg3Ob2vAWvcBQdErj586OOoGiTi4cRZzsPeQ9AfAnD6Dq+NhguG88kV+ntRisDZ60A+zGxLsFtqGn87s3W3ieVSrgv1P2gihwYasCm0B5jTeV7AnsKVRExnDedReJORIOQfc33sToWEVQ+cGZ1e2QyasuJtaVg2qza1SB4JZ2psjhkvhWfYCBDdODeukWJ/KGUxOxYupc+nEQkg6VRtKey6oF5MDkFGL9cOSzDrX3AGhyPFq6mmFJSuNshJOncZDliE=
access_key_id:
secure: FO6FefC+VV5xqRckWkfm4BAAO+fi91xCMCG2U/cKpP/LSkrN5PBqSeSymy2II0ga9hhzu/gL3zJFSivwufCr/cQdozKyqqI9kFE3qRyfIcydfQQt3f46l6bXPpiw3n6MAI03TBYzV2M7Vlj/Y2KBYv5cpY7fUn2kDu0eHKr8GunSysltM39VpTYjWReup5C7fuyAhgJvQHnPaxWr+QTgNcXERge4IVFON+opaMadrz2ECVTvwIaC/7N4VH1xu/WB1objwyH7lfElxI21rM5e8zeyQpBVGaAmdkY97uQ8Jsx7Zzvux6DRK/9ga+O4xZSsJoTNHBf3mLtzy1lhO5eO1aJlPH6JiEG0Mb144/o9ToH1RDC8Wc/7tEDGrOq4m2z5o3NGLf9adFv6EEzjyw8QouGCkj4OgQOptmLGBJ2/ZUmNfcDeVGtdm7d9A565ElRgvc8dbWRkika982JVBwuR/2FjGwkmHAvxYDMfJ77tEninhGptpgXR1rZxt5vrVOWnQdle2iu6Tco17OvLSwidNr7B7ejq/SQBWYBGpoyZlQGF3Xp95hNEMF76aKhFajS519mRHFzTqUsBGuHkjbHVvYx+rkUaP+Zsx1n2h2Uv/A2KHHGzpLBPyM1e8zKVluHYmjh7XFdX/af+n7jmL29R9yFVlD41PjKAdcdo7u7bJw4=
- provider: s3
acl: public_read
bucket: pyret-docs-sound
local_dir: build/docs
upload-dir: docs
skip_cleanup: true
on:
branch: anchor-sound
secret_access_key:
secure: UaWXrI496sOqBvLbwf+Xibs3yLwXxIcXAyG3dRkwufIUYdF1s71NxN62ZBrgaaFOoaa1tmgZ5EwLvsYB1vSu8nB69sIfAzJv1dJF48QXUISWAvoTy7hbUyK9eHjf3XkLFJgxNDI5ENGZ4r7dY4gbU5fxhwPVomIf87qOoVF05R6259+w6oqWIFdUX52bIB4VA+GyLCUeFW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TMyKMN1vmP2d+XLrnw8FWH35WVGCcphh55ctht465ufstvM+C2TgIDFhsmAmSuaqM7HWRl3hxYdVXX3Xhz7UCoc=
129 changes: 129 additions & 0 deletions src/Pyret-Tutorial/jingleBells.scrbl
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#lang scribble/base

@(define (version . t)
(apply section "Version: " t))

@require{lib.rkt}

@title{Tutorial: Your First Song - Jingle Bells}

@(table-of-contents)

@section{Introduction}

In this tutorial we're going to write a program that constructs and plays the song -
Jingle Bells on Pyret. The tutorial is built to facilitate the simple construction of a
single line, but it'll have all the elements you need to build much sounds of your own.

@section{About the Pyret Sound Library}

The Pyret Sound Library is responsible for the creation and manipulation of various types of sounds.

A sound file can be visualized as a set of channels, each corresponding to a sound wave. Depending on the
construction and framework, these channels serve varying purposes. In some cases, they may refer to the
left and right stereo sound stream. In others, each channel may correspond to a different instrument. In
many cases, a set of channels may contain very similar sounds that have been overlaid together to improve
quality. This library is supported by an underlying infrastructure of the WebAudioAPI. Therefore, it is
equipped to handle only .wav files for uploads and downloads.

A sound wave can be represented in a numeric form as a set of amplitudes whose values can range from -1
to +1. As a consequence, each sound in this library is characterized by a two-dimensional float array,
where each row corresponds to the sound wave in a given channel.

The sound library is equipped with a widget that possesses media-player capabilities. Any object of the
type 'sound', will automatically invoke the widget.

@section{Preliminaries}

To begin with, we should inform Pyret that we plan to make use of the
sound library. Additionally we require the List and Global libraries.
@pydisp{
import global as G
import sound as S
import list as L
}
This tells Pyret to load to these three libraries and bind the results
to the corresponding names, @pyin{G}, @pyin{S} and @pyin{L}. Thus, all sound
operations are obtained from @pyin{S} and list operations from
@pyin{L}.

@section{Constructing the sound}
In this case, each note in the song can be visualized as pressing an octave key on a piano.
Once we have the individual notes, we can then append them together to construct the sound.
However, one would have to be cognizant of the pauses in the song, and insert appropriate
gaps of silence in between notes. One we have the song, we could further add in additional
instrument backgrounds using overlaying, and also fad the final output towards the end,
like a typical song.

@subsection{Creating notes}

We will use the get-note funstion of the Sound library to create a note. This constructs
a sound note of an octave of the given key, such as A4, C8 etc, with a tangible silence in the end.
Hence, it works like a typical press of a piano key. Concatenation of several notes will result in a melody akin to playing notes on a piano.
Consider the following code that creates a note of keys A3, A1 and C3:

@pydisp{
a = S.get-note("A3", 1, 1.25)
b = S.get-note("A1", 1, 1.25)
c = S.get-note("C3", 1, 1.25)
}

@subsection{Concatenating notes}

Now we're ready to draw append these notes together, to create a line of music. For this,
we will use the concatList function of the Sound library. This function concatenates different
sounds together as one long sound. The function requires a list of sound objects in the order
in which they need to be concatenated. It then returns the result as a new sound.
Hence, we need to construct a list of the above notes in the right order to create our first line.
@pydisp{
l1 = [G.raw-array: a,a,a,b,a,a,a]

l2 = [G.raw-array: c,c,c,b,c,c,c]

r = S.concat-list(l1)

q = S.concat-list(l2)
}

@subsection{Overlaying two sounds}
The reason for the creation of two sounds for the same line is to add a layer dimensionality,
which makes the sound more profound and interesting. We can combine these two sounds to play a
single line by overlaying them using the overlay function. Overlay places one sound over another,
and is the equivalent of an addition operation between the amplitudes of a set of sounds.
The Overlay function requires two sound objects that need to be overlayed, and returns the
result as a new sound.
@pydisp{
p = S.overlay(r,q)
}

@exercise{
Are you happy with the resulting sound? Do you find anything amiss? If so, what can we do to
modify the sound, so that it sounds similar to the original?
}

@subsection{Increasing the Tempo}
We can increase the tempo of a sound to our required speed using the adjust-playback-speed function in
the Sound library. This function Constructs a sound that plays at the new rate given by the playback
speed, such as 2X, 3X etc. It takes a sound object and an integer number that specifies the factor by
which the sound needs to be sped up or slowed down. It then returns a resultant new sound object.
@pydisp{
t = S.adjust-playback-speed(p, 8)
}

That's it! We've created our very first line of music using Pyret's sound library!

@exercise{
Now that we have constructed our very first line, can you think about how to similarly construct the
entire song? You can use the following resource for note reference -
@show-url{https://www.streetdirectory.com/travel_guide/31508/music/learn_to_play_jingle_bells_without_sheet_music.html}
}

@subsection{Fading a sound}

Have you ever noticed how the ending of a song has a gradual fade? You can implement that functionality
to your very own rendition of Jingle Bells that you have constructed above. We use the fade-out function from
the Pyret Sound library for this purpose. The function progressively fades / softens a given sound towards the end
and returns the result as a new sound.
@pydisp{
m = S.fade-out(t)
}
Binary file added src/builtin/concated.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/fadein.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/fadeinindex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/fadeintime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/fadeout.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/fadeoutindex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/fadeouttime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/getnote.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/multiarray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/multichannel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/overlayed.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/overlayone.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/overlaytwo.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/soundwave.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/builtin/urlsound.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/getting-started.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ that you can follow to build up a simple animated game:

@include-section["tour.scrbl"]
@include-section["Pyret-Tutorial/lander.scrbl"]
@include-section["Pyret-Tutorial/jingleBells.scrbl"]
12 changes: 12 additions & 0 deletions src/lang/spies.scrbl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#lang scribble/base

@(require
scribble/core
racket/list
racket/file
(only-in racket/string string-join)
Expand All @@ -9,6 +10,17 @@
"../../scribble-api.rkt"
"../../ragged.rkt")

@(define (spy-index-tag opname)
(define tag (make-generated-tag))
(define index-tags (list (pyret opname) "spies"))
(make-index-element #f
(list (make-target-element #f '() `(idx ,tag)))
`(idx ,tag)
(cons opname (list "spies"))
index-tags
#f))

@(spy-index-tag "spy")
@title[#:tag "s:spies"]{Spies}

Spies are used for convenient display of values for print-style debugging. See
Expand Down
1 change: 1 addition & 0 deletions src/libraries.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This section contains information on libraries that come with Pyret.

@include-section["trove/image-structs.js.rkt"]
@include-section["trove/image.js.rkt"]
@include-section["trove/sound.js.rkt"]
@include-section["trove/world.js.rkt"]
@include-section["trove/gdrive-sheets.scrbl"]
@include-section["trove/data-source.scrbl"]
Expand Down
15 changes: 9 additions & 6 deletions src/trove/image.js.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -721,14 +721,17 @@
by @pyret{dx} pixels, and then down by @pyret{dy} pixels.
}
@repl-examples[
`(@{overlay-xy(0, 0,
square(30, "solid", "bisque"), square(50, "solid", "dark-green"))}
`(@{overlay-xy(square(30, "solid", "bisque"),
0, 0,
square(50, "solid", "dark-green"))}
,(overlay/xy (square 30 "solid" "bisque") 0 0 (square 50 "solid" "darkgreen")))
`(@{overlay-xy(30, 20, # Move green square right 30 and down 20
square(30, "solid", "bisque"), square(50, "solid", "dark-green"))}
`(@{overlay-xy(square(30, "solid", "bisque"),
30, 20, # Move green square right 30 and down 20
square(50, "solid", "dark-green"))}
,(overlay/xy (square 30 "solid" "bisque") 30 20 (square 50 "solid" "darkgreen")))
`(@{overlay-xy(-10, -20, # Move green square left 10 and up 20
square(30, "solid", "bisque"), square(50, "solid", "dark-green"))}
`(@{overlay-xy(square(30, "solid", "bisque"),
-10, -20, # Move green square left 10 and up 20
square(50, "solid", "dark-green"))}
,(overlay/xy (square 30 "solid" "bisque") -10 -20 (square 50 "solid" "darkgreen")))
]
@function[
Expand Down
Loading