forked from oamaok/modulate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
509 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,51 @@ | ||
.keyboard svg { | ||
.keyboard { | ||
border-radius: 3px; | ||
width: 152px; | ||
height: 60px; | ||
overflow: hidden; | ||
position: relative; | ||
} | ||
|
||
.white-key, | ||
.black-key { | ||
width: 20px; | ||
height: 100%; | ||
position: absolute; | ||
} | ||
|
||
.white-key { | ||
background: var(--background); | ||
} | ||
|
||
.black-key { | ||
background: var(--on-background); | ||
top: -50%; | ||
} | ||
|
||
.black-key::before { | ||
background: var(--on-background); | ||
content: ' '; | ||
width: 20px; | ||
height: 20px; | ||
transform: scale(0.7, 0.2) rotate(45deg); | ||
position: absolute; | ||
bottom: -10px; | ||
left: 0; | ||
} | ||
|
||
.white-key::after, | ||
.black-key::after { | ||
content: ' '; | ||
position: absolute; | ||
bottom: 5px; | ||
left: 7px; | ||
width: 6px; | ||
height: 6px; | ||
border-radius: 50%; | ||
background-color: var(--secondary); | ||
} | ||
|
||
.white-key.on::after, | ||
.black-key.on::after { | ||
background-color: var(--primary); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { h, Component } from 'kaiku' | ||
import { IModule } from '../../types' | ||
import { getAudioContext } from '../../audio' | ||
import { WorkletNode } from '../../worklets' | ||
import Socket from '../module-parts/Socket' | ||
import Module from '../module-parts/Module' | ||
import Knob from '../module-parts/Knob' | ||
import { connectKnobToParam } from '../../modules' | ||
|
||
import { ModuleInputs, ModuleOutputs } from '../module-parts/ModuleSockets' | ||
type Props = { | ||
id: string | ||
} | ||
|
||
class Delay extends Component<Props> implements IModule { | ||
node: WorkletNode<'Delay'> | ||
|
||
constructor(props: Props) { | ||
super(props) | ||
const audioContext = getAudioContext() | ||
|
||
this.node = new WorkletNode(audioContext, 'Delay', { | ||
numberOfOutputs: 2, | ||
}) | ||
|
||
const dry = this.node.parameters.get('dry') | ||
const wet = this.node.parameters.get('wet') | ||
const delayTime = this.node.parameters.get('delayTime') | ||
const feedBack = this.node.parameters.get('feedBack') | ||
|
||
connectKnobToParam(props.id, 'dry', dry) | ||
connectKnobToParam(props.id, 'wet', wet) | ||
connectKnobToParam(props.id, 'delayTime', delayTime) | ||
connectKnobToParam(props.id, 'feedBack', feedBack) | ||
} | ||
|
||
render({ id }: Props) { | ||
return ( | ||
<Module id={id} name="Delay"> | ||
<Knob moduleId={id} name="delayTime" min={0.01} max={2} initial={10} /> | ||
<Knob moduleId={id} name="feedBack" min={0} max={1} initial={0.2} /> | ||
<Knob moduleId={id} name="wet" min={0} max={1} initial={0.5} /> | ||
<Knob moduleId={id} name="dry" min={0} max={1} initial={1} /> | ||
<ModuleInputs> | ||
<Socket moduleId={id} type="input" name="In" node={this.node} /> | ||
</ModuleInputs> | ||
<ModuleOutputs> | ||
<Socket moduleId={id} type="output" name="Out" node={this.node} /> | ||
</ModuleOutputs> | ||
</Module> | ||
) | ||
} | ||
} | ||
|
||
export default Delay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.mixer { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-evenly; | ||
height: 100%; | ||
} |
Oops, something went wrong.