Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@
"CopyGc"
]
},
"curves": {
"curve": {
"tabs": [
"Curves"
"Curve"
]
},
"mark_sweep": {
"tabs": [
"MarkSweep"
]
},
"sounds": {
"sound": {
"tabs": [
"Sounds"
"Sound"
]
},
"stereo_sounds": {
"stereo_sound": {
"tabs": [
"StereoSounds"
"StereoSound"
]
}

}
8 changes: 5 additions & 3 deletions scripts/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ Source is a family of languages, designed for the textbook [Structure and Interp

The Source Academy comes with the following external libraries:

- [binary_trees](https://source-academy.github.io/modules/documentation/modules/binary_trees.html)
- [repeat](https://source-academy.github.io/modules/documentation/modules/repeat.html)
- [binary_tree](https://source-academy.github.io/modules/documentation/modules/binary_tree.html)
- [curve](https://source-academy.github.io/modules/documentation/modules/curve.html)
- [pix_n_flix](https://source-academy.github.io/modules/documentation/modules/pix_n_flix.html)
- [curves](https://source-academy.github.io/modules/documentation/modules/curves.html)
- [repeat](https://source-academy.github.io/modules/documentation/modules/repeat.html)
- [sound](https://source-academy.github.io/modules/documentation/modules/sound.html)
- [stereo_sound](https://source-academy.github.io/modules/documentation/modules/stereo_sound.html)

## Style Guide

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* shown in the Source Academy in the tab with the "Curves Canvas" icon (image).
* Examples of drawer functions are `draw_points_on` and `draw_connected`.
*
* @module curves
* @module curve
* @author Lee Zheng Han
* @author Ng Yong Xiang
*/
Expand Down
File renamed without changes.
File renamed without changes.
44 changes: 22 additions & 22 deletions src/bundles/sounds/functions.ts → src/bundles/sound/functions.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/no-use-before-define, @typescript-eslint/no-unused-vars */
import {
Wave,
Sound,
SoundProducer,
SoundTransformer,
List,
AudioPlayed,
} from './types';
import {
pair,
head,
tail,
list,
length,
is_null,
is_pair,
accumulate,
} from './list';
import { RIFFWAVE } from './riffwave';

/**
* The sounds library provides functions for constructing and playing sounds.
*
Expand All @@ -40,11 +19,32 @@ import { RIFFWAVE } from './riffwave';
* Finally, the provided `play` function takes in a Sound and plays it using your
* computer's sound system.
*
* @module sounds
* @module sound
* @author Koh Shang Hui
* @author Samyukta Sounderraman
*/

/* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/no-use-before-define, @typescript-eslint/no-unused-vars */
import {
Wave,
Sound,
SoundProducer,
SoundTransformer,
List,
AudioPlayed,
} from './types';
import {
pair,
head,
tail,
list,
length,
is_null,
is_pair,
accumulate,
} from './list';
import { RIFFWAVE } from './riffwave';

// Global Constants and Variables
let audioElement: HTMLAudioElement;
const FS: number = 44100; // Output sample rate
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
/**
*
* The stereo sounds library build on the sounds library by accommodating stereo sounds.
* Within this library, all sounds are represented in stereo, with two waves, left and right.
*
* A Stereo Sound is a `pair(pair(left_wave, right_wave), duration)` where duration is the length of the sound in seconds.
* The constructor `make_stereo_sound` and accessors `get_left_wave`, `get_right_wave`, and `get_duration` are provided.
* The `make_sound` constructor from sounds is syntatic sugar for `make_stereo_sounds` with equal waves.
*
* @module stereo_sound
* @author Koh Shang Hui
* @author Samyukta Sounderraman
*/

/* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/no-use-before-define, @typescript-eslint/no-unused-vars */
import {
Wave,
Expand All @@ -19,20 +33,6 @@ import {
} from './list';
import { RIFFWAVE } from './riffwave';

/**
*
* The stereo sounds library build on the sounds library by accommodating stereo sounds.
* Within this library, all sounds are represented in stereo, with two waves, left and right.
*
* A Stereo Sound is a `pair(pair(left_wave, right_wave), duration)` where duration is the length of the sound in seconds.
* The constructor `make_stereo_sound` and accessors `get_left_wave`, `get_right_wave`, and `get_duration` are provided.
* The `make_sound` constructor from sounds is syntatic sugar for `make_stereo_sounds` with equal waves.
*
* @module stereosounds
* @author Koh Shang Hui
* @author Samyukta Sounderraman
*/

// Global Constants and Variables

const FS: number = 44100; // Output sample rate
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/tabs/Curves/index.tsx → src/tabs/Curve/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, Icon, Slider } from '@blueprintjs/core';
import React from 'react';
import { ShapeDrawn } from '../../bundles/curves/types';
import { ShapeDrawn } from '../../bundles/curve/types';

/**
* Currently used for rendering HTML canvas element for curves.
Expand Down Expand Up @@ -204,6 +204,6 @@ export default {
return isValidFunction(context.result.value);
},
body: (context: any) => <WebGLCanvas context={context} />,
label: 'Curves Canvas',
label: 'Curve Canvas',
iconName: 'media', // See https://blueprintjs.com/docs/#icons for more options
};
2 changes: 1 addition & 1 deletion src/tabs/Sounds/index.tsx → src/tabs/Sound/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars, jsx-a11y/media-has-caption */
import React from 'react';
import { AudioPlayed } from '../../bundles/sounds/types';
import { AudioPlayed } from '../../bundles/sound/types';
// import sounds from '../../bundles/sounds';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars, jsx-a11y/media-has-caption */
import { FILE_UPLOAD_INPUT_CUSTOM_TEXT } from '@blueprintjs/core/lib/esm/common/classes';
import React from 'react';
import { AudioPlayed } from '../../bundles/stereo_sounds/types';
import { AudioPlayed } from '../../bundles/stereo_sound/types';

/**
* Tab for Source Academy Sounds Module
Expand Down