linking updates

This commit is contained in:
2026-06-01 20:38:04 -07:00
parent 1f20fcab20
commit e903196639
70 changed files with 195 additions and 9596 deletions
+1 -1
View File
@@ -188,7 +188,7 @@ If you also edit the Claude agent definitions or skills (maintainers working in
## Questions
Architecture / threading questions: [`ARCHITECTURE.md`](ARCHITECTURE.md). Generator authoring: [`docs/protocols/writing-generators.md`](docs/protocols/writing-generators.md). Extension packages: [`docs/extension-authors-guide.md`](docs/extension-authors-guide.md). Everything else: the task→doc map in [`CLAUDE.md`](CLAUDE.md).
Architecture / threading questions: [`ARCHITECTURE.md`](ARCHITECTURE.md). Generator authoring: [`docs/protocols/writing-generators.md`](docs/protocols/writing-generators.md). Extension packages: [`docs/extension-authors-guide.md`](docs/extension-authors-guide.md). Dev/release workflow (dev remote vs release remote, dogfood vs consumer projects, the static/dynamic product split): [`docs/DEVELOPMENT_AND_RELEASE.md`](docs/DEVELOPMENT_AND_RELEASE.md). Everything else: the task→doc map in [`CLAUDE.md`](CLAUDE.md).
---
+4 -9
View File
@@ -46,7 +46,7 @@ The package vends three products:
| Product | Kind | Use |
|---|---|---|
| `Lyrebird` | dynamic library | Core framework — Generators, Synthesizers, engine, drivers. |
| `Lyrebird` | library (static) | Core framework — Generators, Synthesizers, engine, drivers. |
| `LyrebirdUI` | library | SwiftUI parameter controls (`ParameterKnob`, scope/envelope views, `LyrebirdWindow`). |
| `LyrebirdCLI` | executable | The `lyrebird` command-line tool (scaffolding, REPL). |
@@ -64,16 +64,11 @@ To build against a local clone instead of the remote, use a path dependency:
The scaffolder (below) does this automatically with `--lyrebird-path`.
### The dynamic-library note
### Linkage note
`Lyrebird` is declared `type: .dynamic` in `Package.swift`. This is a deliberate workaround for an Xcode 26 SwiftPM regression and will revert to `.static` once that is fixed. If you hit `dyld: Library not loaded` under a hardened runtime (sandboxed app or AUv3 extension), add to your entitlements:
The consumer-facing `Lyrebird` product uses **automatic linkage** — SwiftPM/Xcode link it **statically** into your target. No dynamic framework is produced, so adding Lyrebird needs **no special build settings**: no `disable-library-validation` entitlement, no `SWIFT_USE_INTEGRATED_DRIVER` override. It just links.
```xml
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
```
then clean-build (⇧⌘K). The generated Xcode-project templates already do this; the workspace also sets `SWIFT_USE_INTEGRATED_DRIVER = NO` and `parallelizeBuildables = NO`.
> Internally the package also vends a second product, `LyrebirdDynamic` (`type: .dynamic`), used **only** by the bundled `LiveCompile/` live-coding sub-package — it needs a shared dylib so live-compiled snippets and the host resolve to one copy of every class. You never reference `LyrebirdDynamic` as an external consumer; ignore it.
---
-57
View File
@@ -1,57 +0,0 @@
# Lyrebird
Lyrebird is a native macOS audio synthesis framework written in Swift. Users write Swift code that implements the `Generator` and `Synthesizer` protocols against the Lyrebird engine — there is no separate scripting language. The framework handles Core Audio I/O, a pre-allocated bus memory system, and a node tree for ordering signal evaluation. The design is informed by 20+ years of SuperCollider practice, adapted to Swift idioms and a single-process architecture.
Development follows an interpret-then-compile workflow: sketch and perform in the Swift REPL with Lyrebird loaded, then graduate working code to a Swift Package project for compiled, optimized execution.
## Locked Decisions
| Decision | Choice |
|---|---|
| Implementation language | Swift |
| Platform | macOS 15+ (requires `Synchronization.Atomic` for SPSCQueue) |
| Swift tools version | 6.0 (required for macOS 15 platform target) |
| Audio I/O | Direct Core Audio (`kAudioUnitSubType_HALOutput`) — no AVAudioEngine |
| NRT rendering | `NRTDriver` — fixed-duration tight loop, `ExtAudioFile` AIFF/WAV output; event-driven stop is a stretch goal |
| Execution model | Interpreted (REPL) → compiled (Swift Package) |
| Bus system | Pre-allocated, SC convention (128 audio / 4096 control) |
| Block size | Configurable at engine init |
| Testing | Swift Testing framework — no Xcode Playgrounds |
| REPL | Swift REPL + LineNoise |
| Hot reload | Interpret-then-compile |
| Inter-file modularity | Swift Package module system |
| Package targets | `Lyrebird` (library), `LyrebirdDemo` (executable smoke test), `LyrebirdTests` (test) |
## SuperCollider Lineage
The designer has 20+ years of SC experience. SC concepts map to Lyrebird as follows:
| SuperCollider | Lyrebird |
|---|---|
| UGen | `Generator` protocol |
| SynthDef / Synth | `Synthesizer` protocol |
| Group | `Group` (node tree ordering) |
| Audio/control bus | Pre-allocated bus memory |
| `In` / `Out` UGen | `In` / `Out` generators |
| sclang | Swift |
| scsynth | `SynthesisEngine` |
## Document Index
| Doc | Topic |
|---|---|
| `docs/00-working-order.md` | Phased implementation sequence |
| `docs/engine/synthesis-engine.md` | SynthesisEngine, Core Audio AUHAL |
| `docs/engine/bus-system.md` | Bus memory model, In/Out |
| `docs/engine/scheduling.md` | Sample-accurate scheduling, SPSCQueue, sub-block splitting |
| `docs/protocols/generator.md` | Generator protocol hierarchy |
| `docs/protocols/synthesizer.md` | Synthesizer protocol, node tree |
| `docs/signal-flow/signal-flow.md` | DAG evaluation, block processing |
| `docs/tooling/repl.md` | REPL, LineNoise, hot-swap |
| `docs/tooling/project-system.md` | Swift Package model, CLI |
| `docs/stdlib/generators.md` | Built-in generator library |
| `docs/ui/gui-system.md` | Native SwiftUI GUI, parameter binding, control windows |
## Legacy Reference
`legacy/Lyrebird/LyrebirdSynth/Lyrebird/` — a working prototype from ~10 years ago. Good source for: `ValidGeneratorInput` protocol pattern, operator overloading approach, sine table oscillator, envelope curve math, delay interpolation. Do not copy verbatim — modernize to Swift concurrency, add Core Audio integration, expand test coverage.
+190
View File
@@ -0,0 +1,190 @@
# Development & Release Workflow
How Lyrebird is developed, dogfooded, and released. Two git remotes with
different roles, two consumer projects with different linkage paths, and a
defined promotion path between them.
---
## Two remotes, two roles
| Remote | Role | Cadence |
|---|---|---|
| **Bitbucket** (`origin`) | Active development — fine-grained commits, experiments, in-progress branches, frequent pushes. | Continuous. Whatever your working rhythm is. |
| **Gitea** (`realizedsound.mooo.com/josh/Lyrebird`) | Release / distribution — the repo external consumers pull as a SwiftPM dependency. | Deliberate. Only when a coherent set of features is ready. |
The two are **not** mirrors. Bitbucket holds the full granular history; Gitea
receives **consolidated** promotions when a feature set is release-ready.
### Promoting from Bitbucket to Gitea
When development on Bitbucket reaches a point where the new work is ready for
consumers:
1. Make sure Bitbucket `main` is green — `swift test --no-parallel`, LiveCompile
`(cd LiveCompile && swift test --no-parallel)`, and a consumer smoke test
(below).
2. Decide the version bump (see **Versioning**). Update
`Sources/LyrebirdCLI/Version.swift` to match.
3. Run `/lyrebird_review` and resolve any blocking findings.
4. Push to Gitea as a single consolidated step. Two options:
- **Squash-merge** the development range into one release commit, then push
that commit to Gitea `main`. Keeps Gitea history coarse and readable.
- **Fast-forward** the whole range if you want Gitea to carry the same
history as Bitbucket. (Coarser is usually better for a distribution repo.)
5. Tag the release on Gitea and push the tag:
```bash
git tag -a vX.Y.Z -m "Lyrebird X.Y.Z — <summary>"
git push <gitea> main
git push <gitea> vX.Y.Z
```
Consumers pin a version range (`from: "X.Y.Z"`), so nothing they have breaks
until they choose to resolve to a newer tag. Bitbucket churn never reaches them.
> The remotes can have **different commit SHAs** for the same content (e.g. a
> squashed release commit). That's expected — consumers resolve by **tag**, not
> by SHA, so the SHA divergence is invisible to them.
---
## Two consumer projects, two linkage paths
These exercise the two ways someone depends on Lyrebird. Keep both working.
### Quartet — local-path dogfood (the robust example)
`/Users/josh/Documents/CurrentMusic/Quartet` depends on Lyrebird via a
**local-path** SwiftPM reference (`XCLocalSwiftPackageReference` →
`/Users/josh/Documents/LyrebirdII`), so it tracks your **working tree live** —
no push, no tag, no resolve. Edit Lyrebird, ⌘B Quartet, hear the change. This is
the fast real-world feedback loop.
- Quartet source uses `import LyrebirdSynth` + `import LyrebirdUI`.
- Whatever branch `/Users/josh/Documents/LyrebirdII` is checked out to is what
Quartet builds against. Keep it on the branch whose API Quartet expects
(normally `main`).
- Because it links the **static** `Lyrebird` product, Quartet needs no
`disable-library-validation` for the *library itself* — but Quartet enables
App Sandbox + Hardened Runtime for its own reasons and carries a
`Quartet.entitlements`. (Left in place; harmless.)
### Test — remote consumer simulation (the stranger's view)
`/Users/josh/Desktop/Test` depends on Lyrebird via the **remote Gitea URL**
(`XCRemoteSwiftPackageReference`), pinned to a version. This mimics exactly what
an external user gets: resolve from Gitea, link the published product.
- Use Test to validate that a **fresh pull builds with zero manual build
settings**. If Test needs a workaround, an external consumer would too — that
is a release bug, not a Test bug.
- After promoting to Gitea, bump Test's pin (or **File ▸ Packages ▸ Update to
Latest Package Versions**) and confirm a clean build.
### Consumer smoke test (CI-style, no Xcode)
Before any Gitea promotion, sanity-check that an external SPM consumer links the
static product cleanly:
```bash
cd /tmp && rm -rf consumer-sim && mkdir consumer-sim && cd consumer-sim
mkdir -p Sources/ConsumerSim
cat > Package.swift <<'PKG'
// swift-tools-version: 6.0
import PackageDescription
let package = Package(
name: "ConsumerSim",
platforms: [.macOS(.v15)],
dependencies: [ .package(name: "Lyrebird", path: "/Users/josh/Documents/LyrebirdII") ],
targets: [ .executableTarget(name: "ConsumerSim", dependencies: [
.product(name: "Lyrebird", package: "Lyrebird"),
.product(name: "LyrebirdUI", package: "Lyrebird"),
]) ]
)
PKG
cat > Sources/ConsumerSim/main.swift <<'SRC'
import Foundation
import LyrebirdSynth
import LyrebirdUI
let engine = SynthesisEngine(blockSize: 512, sampleRate: 48_000,
numOutputChannels: 2, numInputChannels: 0,
driver: NRTDriver(outputURL: URL(fileURLWithPath: "/tmp/cs.caf"), duration: 0.1))
final class Tone: SynthesizerBase { override func build() { output(bus: 0, source: OscSin.Audio(freq: 440) * 0.2) } }
do { try engine.add(Tone()); try engine.start(); print("CONSUMER-SIM OK") } catch { print("ERR \(error)") }
SRC
swift run # expect: CONSUMER-SIM OK
ls .build/debug/*.dylib 2>/dev/null | grep -i lyrebird && echo "WARN: dylib present" || echo "static link OK"
```
`CONSUMER-SIM OK` + no Lyrebird dylib = the package is consumer-clean.
---
## Linkage model — why two products
`Package.swift` vends the same `LyrebirdSynth` target through **two** products:
| Product | Linkage | Audience |
|---|---|---|
| `Lyrebird` | automatic → **static** | External consumers + Quartet + Test. No dynamic framework → immune to the Xcode 26 `PackageFrameworks/*.framework` regression → **zero build-setting workarounds**. |
| `LyrebirdDynamic` | `.dynamic` | **Internal only.** Consumed by the nested `LiveCompile/` sub-package, which needs a single shared `libLyrebirdDynamic.dylib` so the host and each live-compiled snippet dylib resolve to one copy of every class (the Phase 167 ObjC double-registration fix). |
The product name `Lyrebird` deliberately differs from the target/module name
`LyrebirdSynth`. A forced-`.dynamic` product cannot share a name with its target
when a downstream graph also static-links it, so the rename + two-product split
is what lets consumers stay static while LiveCompile stays dynamic.
**Rule:** never point an external consumer (or Quartet, or Test) at
`LyrebirdDynamic`. Only `LiveCompile/Package.swift` references it.
### The demo workspace & AUv3 are the exception
`Lyrebird.xcworkspace` (the six bundled demos) and the AUv3 sample link the
**dynamic** path for live-coding, so *those* projects carry the
`disable-library-validation` entitlement and the `SWIFT_USE_INTEGRATED_DRIVER=NO`
/ `parallelizeBuildables=NO` settings. That is internal-developer scaffolding,
**not** something external consumers inherit. (See
`MEMORY → project_dynamic_library_workaround.md`.)
---
## Versioning
SwiftPM resolves by **git tag** (semver) — there is no version field in
`Package.swift`. `Sources/LyrebirdCLI/Version.swift` carries a display string
that should be kept in sync with the tag.
- **Patch** (`X.Y.Z+1`) — bug fixes, no API change.
- **Minor** (`X.Y+1.0`) — additive: new Generators, new public API, no breakage.
- **Major** (`X+1.0.0`) — source-breaking change (renamed/removed public symbol,
changed signatures, **module rename**).
Tag format: `vX.Y.Z` (the `v` is conventional; SwiftPM strips it).
> Note: the `Lyrebird` → `LyrebirdSynth` **module** rename was source-breaking
> (`import Lyrebird` → `import LyrebirdSynth`). Because 1.0.0 was never
> distributed before the rename, it shipped *as* 1.0.0. A comparable rename
> after a public release would be a major bump.
---
## Quick reference
```bash
# Local dev (Bitbucket)
git push origin <branch> # frequent, granular
# Pre-release gate
swift test --no-parallel # core
(cd LiveCompile && swift test --no-parallel) # live-compile
# + consumer smoke test above
/lyrebird_review # blocking findings must clear
# Promote to Gitea (release)
# - bump Version.swift
# - squash/ff to a release commit
git push <gitea> main
git tag -a vX.Y.Z -m "..." && git push <gitea> vX.Y.Z
# Consumers then resolve the new tag at their leisure.
```
-202
View File
@@ -1,202 +0,0 @@
The Artistic License 2.0
Copyright (c) 2000-2006, The Perl Foundation.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
This license establishes the terms under which a given free software
Package may be copied, modified, distributed, and/or redistributed.
The intent is that the Copyright Holder maintains some artistic
control over the development of that Package while still keeping the
Package available as open source and free software.
You are always permitted to make arrangements wholly outside of this
license directly with the Copyright Holder of a given Package. If the
terms of this license do not permit the full use that you propose to
make of the Package, you should contact the Copyright Holder and seek
a different licensing arrangement.
Definitions
"Copyright Holder" means the individual(s) or organization(s)
named in the copyright notice for the entire Package.
"Contributor" means any party that has contributed code or other
material to the Package, in accordance with the Copyright Holder's
procedures.
"You" and "your" means any person who would like to copy,
distribute, or modify the Package.
"Package" means the collection of files distributed by the
Copyright Holder, and derivatives of that collection and/or of
those files. A given Package may consist of either the Standard
Version, or a Modified Version.
"Distribute" means providing a copy of the Package or making it
accessible to anyone else, or in the case of a company or
organization, to others outside of your company or organization.
"Distributor Fee" means any fee that you charge for Distributing
this Package or providing support for this Package to another
party. It does not mean licensing fees.
"Standard Version" refers to the Package if it has not been
modified, or has been modified only in ways explicitly requested
by the Copyright Holder.
"Modified Version" means the Package, if it has been changed, and
such changes were not explicitly requested by the Copyright
Holder.
"Original License" means this Artistic License as Distributed with
the Standard Version of the Package, in its current version or as
it may be modified by The Perl Foundation in the future.
"Source" form means the source code, documentation source, and
configuration files for the Package.
"Compiled" form means the compiled bytecode, object code, binary,
or any other form resulting from mechanical transformation or
translation of the Source form.
Permission for Use and Modification Without Distribution
(1) You are permitted to use the Standard Version and create and use
Modified Versions for any purpose without restriction, provided that
you do not Distribute the Modified Version.
Permissions for Redistribution of the Standard Version
(2) You may Distribute verbatim copies of the Source form of the
Standard Version of this Package in any medium without restriction,
either gratis or for a Distributor Fee, provided that you duplicate
all of the original copyright notices and associated disclaimers. At
your discretion, such verbatim copies may or may not include a
Compiled form of the Package.
(3) You may apply any bug fixes, portability changes, and other
modifications made available from the Copyright Holder. The resulting
Package will still be considered the Standard Version, and as such
will be subject to the Original License.
Distribution of Modified Versions of the Package as Source
(4) You may Distribute your Modified Version as Source (either gratis
or for a Distributor Fee, and with or without a Compiled form of the
Modified Version) provided that you clearly document how it differs
from the Standard Version, including, but not limited to, documenting
any non-standard features, executables, or modules, and provided that
you do at least ONE of the following:
(a) make the Modified Version available to the Copyright Holder
of the Standard Version, under the Original License, so that the
Copyright Holder may include your modifications in the Standard
Version.
(b) ensure that installation of your Modified Version does not
prevent the user installing or running the Standard Version. In
addition, the Modified Version must bear a name that is different
from the name of the Standard Version.
(c) allow anyone who receives a copy of the Modified Version to
make the Source form of the Modified Version available to others
under
(i) the Original License or
(ii) a license that permits the licensee to freely copy,
modify and redistribute the Modified Version using the same
licensing terms that apply to the copy that the licensee
received, and requires that the Source form of the Modified
Version, and of any works derived from it, be made freely
available in that license fees are prohibited but Distributor
Fees are allowed.
Distribution of Compiled Forms of the Standard Version
or Modified Versions without the Source
(5) You may Distribute Compiled forms of the Standard Version without
the Source, provided that you include complete instructions on how to
get the Source of the Standard Version. Such instructions must be
valid at the time of your distribution. If these instructions, at any
time while you are carrying out such distribution, become invalid, you
must provide new instructions on demand or cease further distribution.
If you provide valid instructions or cease distribution within thirty
days after you become aware that the instructions are invalid, then
you do not forfeit any of your rights under this license.
(6) You may Distribute a Modified Version in Compiled form without
the Source, provided that you comply with Section 4 with respect to
the Source of the Modified Version.
Aggregating or Linking the Package
(7) You may aggregate the Package (either the Standard Version or
Modified Version) with other packages and Distribute the resulting
aggregation provided that you do not charge a licensing fee for the
Package. Distributor Fees are permitted, and licensing fees for other
components in the aggregation are permitted. The terms of this license
apply to the use and Distribution of the Standard or Modified Versions
as included in the aggregation.
(8) You are permitted to link Modified and Standard Versions with
other works, to embed the Package in a larger work of your own, or to
build stand-alone binary or bytecode versions of applications that
include the Package, and Distribute the result without restriction,
provided the result does not expose a direct interface to the Package.
Items That are Not Considered Part of a Modified Version
(9) Works (including, but not limited to, modules and scripts) that
merely extend or make use of the Package, do not, by themselves, cause
the Package to be a Modified Version. In addition, such works are not
considered parts of the Package itself, and are not subject to the
terms of this license.
General Provisions
(10) Any use, modification, and distribution of the Standard or
Modified Versions is governed by this Artistic License. By using,
modifying or distributing the Package, you accept this license. Do not
use, modify, or distribute the Package, if you do not accept this
license.
(11) If your Modified Version has been derived from a Modified
Version made by someone other than you, you are nevertheless required
to ensure that your Modified Version complies with the requirements of
this license.
(12) This license does not grant you the right to use any trademark,
service mark, tradename, or logo of the Copyright Holder.
(13) This license includes the non-exclusive, worldwide,
free-of-charge patent license to make, have made, use, offer to sell,
sell, import and otherwise transfer the Package with respect to any
patent claims licensable by the Copyright Holder that are necessarily
infringed by the Package. If you institute patent litigation
(including a cross-claim or counterclaim) against any party alleging
that the Package constitutes direct or contributory patent
infringement, then this Artistic License to you shall terminate on the
date that such litigation is filed.
(14) Disclaimer of Warranty:
THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,32 +0,0 @@
//
// AppDelegate.swift
// LyrebirdLang
//
// Created by Joshua Parmenter on 5/1/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
///var audioSample: AudioSampleApp = AudioSampleApp()
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
// audioSample.runSample()
LyrebirdTestSynthesizer.sharedSynth.play()
}
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}
}
@@ -1,58 +0,0 @@
{
"images" : [
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -1,170 +0,0 @@
//
// AudioSampleApp.swift
// LyrebirdSynthLang
//
// Created by Joshua Parmenter on 5/14/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
import Cocoa
import Lyrebird
import AVFoundation
import AudioToolbox
// The maximum number of audio buffers in flight. Setting to two allows one
// buffer to be played while the next is being written.
private let kInFlightAudioBuffers: Int = 2
// The number of audio samples per buffer. A lower value reduces latency for
// changes but requires more processing but increases the risk of being unable
// to fill the buffers in time. A setting of 1024 represents about 23ms of
// samples.
private let kSamplesPerBuffer: AVAudioFrameCount = 1024
open class LyrebirdTestSynthesizer {
public static let sharedSynth: LyrebirdTestSynthesizer = LyrebirdTestSynthesizer()
// The audio engine manages the sound system.
fileprivate let engine: AVAudioEngine = AVAudioEngine()
// The player node schedules the playback of the audio buffers.
fileprivate let playerNode: AVAudioPlayerNode = AVAudioPlayerNode()
// Use standard non-interleaved PCM audio.
var audioFormat : AVAudioFormat = AVAudioFormat(standardFormatWithSampleRate: 44100.0, channels: 2)!
// A circular queue of audio buffers.
fileprivate var audioBuffers: [AVAudioPCMBuffer] = [AVAudioPCMBuffer]()
// The index of the next buffer to fill.
fileprivate var bufferIndex: Int = 0
// The dispatch queue to render audio samples.
fileprivate let audioQueue: DispatchQueue = DispatchQueue(label: "LyrebirdQueue", attributes: [])
// A semaphore to gate the number of buffers processed.
fileprivate let audioSemaphore: DispatchSemaphore = DispatchSemaphore(value: kInFlightAudioBuffers)
fileprivate let lyrebird: Lyrebird = Lyrebird()
fileprivate var demo: LyrebirdDemo? = nil
fileprivate var inputChannels: [[LyrebirdFloat]] = [[LyrebirdFloat](repeating: 0.0, count: Int(kSamplesPerBuffer)), [LyrebirdFloat](repeating: 0.0, count: Int(kSamplesPerBuffer))]
// inits the CoreAudio engine, sets up Lyrebird and references our demo class
fileprivate init() {
// Create a pool of audio buffers.
audioFormat = engine.inputNode.outputFormat(forBus: 0)
for _ in 0 ..< kInFlightAudioBuffers {
let audioBuffer = AVAudioPCMBuffer(pcmFormat: audioFormat, frameCapacity: kSamplesPerBuffer)!
audioBuffers.append(audioBuffer)
}
// Attach and connect the player node.
engine.attach(playerNode)
// engine.connect(engine.inputNode!, to: playerNode, format: audioFormat)
engine.connect(playerNode, to: engine.outputNode, format: audioFormat)
let inputNode: AVAudioInputNode = engine.inputNode
inputNode.installTap(onBus: 0, bufferSize: kSamplesPerBuffer, format: audioFormat, block: { (buffer: AVAudioPCMBuffer, time: AVAudioTime) in
// print("buffer channel \(buffer.format.settings)")
if let leftChannelData = buffer.floatChannelData?[0] {
if let rightChannelData = buffer.floatChannelData?[1] {
for idx: Int in 0 ..< Int(kSamplesPerBuffer) {
self.inputChannels[0][idx] = LyrebirdFloat(leftChannelData[idx])
self.inputChannels[1][idx] = LyrebirdFloat(rightChannelData[idx])
}
}
}
})
do {
try engine.start()
} catch _ {
}
playerNode.play()
NotificationCenter.default.addObserver(self, selector: #selector(LyrebirdTestSynthesizer.audioEngineConfigurationChange(_:)), name: NSNotification.Name.AVAudioEngineConfigurationChange, object: engine)
demo = LyrebirdDemo(lyrebird: lyrebird)
demo?.runDemo()
}
open func play(){
let blockSize = Int(lyrebird.blockSize)
let numCycles = Int(kSamplesPerBuffer) / blockSize
audioQueue.async {
while true {
// Wait for a buffer to become available.
self.audioSemaphore.wait(timeout: DispatchTime.distantFuture)
// Fill the buffer with new samples.
let audioBuffer = self.audioBuffers[self.bufferIndex]
let leftChannel = audioBuffer.floatChannelData?[0]
let rightChannel = audioBuffer.floatChannelData?[1]
let leftInAudio = self.inputChannels[0]
let rightInAudio = self.inputChannels[1]
for cycle in 0 ..< numCycles {
let offset = Int(cycle) * blockSize
let audioBlocks = self.lyrebird.audioBlocks()
let leftInput = audioBlocks[2]
let rightInput = audioBlocks[3]
for idx: Int in 0 ..< blockSize {
leftInput.currentValues[idx] = LyrebirdFloat(leftInAudio[(blockSize * cycle) + idx])
rightInput.currentValues[idx] = LyrebirdFloat(rightInAudio[(blockSize * cycle) + idx])
}
self.lyrebird.processWithInputChannels(inputChannels: [])
let left = audioBlocks[0]
let right = audioBlocks[1]
let outputLeft = left.currentValues.map({Float($0)})
let outputRight = right.currentValues.map({Float($0)})
if let leftChannel = leftChannel, let rightChannel = rightChannel {
for idx in 0 ..< blockSize {
leftChannel[offset + idx] = outputLeft[idx]
rightChannel[offset + idx] = outputRight[idx]
}
}
}
audioBuffer.frameLength = kSamplesPerBuffer
self.bufferIndex = (self.bufferIndex + 1) % self.audioBuffers.count
// Schedule the buffer for playback and release it for reuse after
// playback has finished.
self.playerNode.scheduleBuffer(audioBuffer) {
self.audioSemaphore.signal()
return
}
}
}
}
@objc func audioEngineConfigurationChange(_ notification: Notification) -> Void {
NSLog("Audio engine configuration change: \(notification)")
}
}
@@ -1,145 +0,0 @@
//
// AudioSampleGraphs.swift
// LyrebirdSynthLang
//
// Created by Joshua Parmenter on 5/15/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
import Cocoa
import Lyrebird
struct LyrebirdTestGraphs {
var graphs: [String: LyrebirdGraph] = [:]
// closure should refer to the graph, assign children and refer to args
mutating func setupDemoGraphs(){
let noiseSweepGraph = LyrebirdGraph()
noiseSweepGraph.build { () in
let noise: NoiseWhite = NoiseWhite(rate: .audio)
let out = noise * 0.2
let theta = ((OscSin(rate: .audio, freq: 0.25, phase: 0.0) * 0.4) + 0.6) * M_PI
let rho = (OscSin(rate: .audio, freq: 0.25, phase: 0.0) * 0.199) + 0.8
let b1 = 2.0 * rho * Cos(rate: .audio, input: theta)
let srho = Squared(rate: .audio, input: rho)
let b2 = Negative(rate: .audio, input: srho)
let sos = SecondOrderSection(rate: .audio, input: out, a0: 1.0, a1: 0.0, a2: 0.0, b1: b1, b2: b2)
_ = Output(rate: .audio, index: "Output", output: sos)
}
graphs["noiseSweep"] = noiseSweepGraph
let fmGraph = LyrebirdGraph()
// "Freq" and "Output" can be passed in as parameters at run time
fmGraph.build { () in
let mod: OscSin = OscSin(rate: .audio, freq: 110, phase: 0.0)
let modMul = 3412.0 * mod - "Freq"
let sin: OscSin = OscSin(rate: .audio, freq: modMul, phase: 0.0)
_ = Output(rate: .audio, index: "Output", output: sin * "Amp")
}
// parameter defaults
fmGraph.parameters["Freq"] = 440.0
fmGraph.parameters["Output"] = 0
fmGraph.parameters["Amp"] = 0.2
graphs["fm"] = fmGraph
let impulseGraph = LyrebirdGraph()
impulseGraph.build {
let white = RandWhite()
let trigger: Impulse = Impulse(rate: .audio, freq: "Freq", initPhase: 0.0)
let freq: TriggerWithBlock = TriggerWithBlock(rate: .audio, trigger: trigger, triggerBlock: { (triggerValue, counter) -> LyrebirdFloat in
return 440.0 * LyrebirdFloat(counter) * white.next().numberValue()
})
let sin: OscSin = OscSin(rate: .audio, freq: freq, phase: 0.0)
let envelope: Envelope = Envelope(levels: [0, 1, 1, 0], duration: 1, curves: [5, 0, -5])
let out = sin * EnvelopeGen(rate: .audio, envelope: envelope, levelScale: LyrebirdFunctions.db_linamp(db: -24.0), levelBias: 0.0, timeScale: 1.0, releaseSegment: -1, doneAction: EnvelopeGenDoneAction.freeNode)
_ = Output(rate: .audio, index: "Output", output: out )
}
impulseGraph.parameters["Output"] = 0
impulseGraph.parameters["Freq"] = 4
graphs["impulse"] = impulseGraph
let noiseLineGraph = LyrebirdGraph()
noiseLineGraph.parameters["Output"] = 0
noiseLineGraph.parameters["Seed"] = 125
noiseLineGraph.build {
let freq = NoiseLFLine(rate: .audio, freq: 10, seed: "Seed")
let freqRange = freq * 440.0 + 440.0
let sin = OscSin(rate: .audio, freq: freqRange, phase: 0.0)
_ = Output(rate: .audio, index: "Output", output: sin * LyrebirdFunctions.db_linamp(db: -24.0))
}
graphs["noiseLine"] = noiseLineGraph
let noiseLineGraphDelay = LyrebirdGraph()
noiseLineGraphDelay.build {
let freq = NoiseLFLine(rate: .audio, freq: 1, seed: 123)
let freqRange = freq * 440.0 + 440.0
let sin = OscSin(rate: .audio, freq: freqRange, phase: 0.0)
let delTime = 0.2
let delay = DelayLineFeedback(rate: .audio, input: sin, delayTime: delTime, decayTime: 20.0, maxDelayTime: 1.0, interpolation: .cubic)
_ = Output(rate: .audio, index: "Output", output: sin * LyrebirdFunctions.db_linamp(db: -24.0))
_ = Output(rate: .audio, index: "OutputTwo", output: delay * LyrebirdFunctions.db_linamp(db: -24.0))
}
noiseLineGraphDelay.parameters["Output"] = 0
noiseLineGraphDelay.parameters["OutputTwo"] = 1
graphs["noiseLineDelay"] = noiseLineGraphDelay
let filterTests = LyrebirdGraph()
filterTests.build {
let noise: NoiseWhite = NoiseWhite(rate: .audio)
let out = noise // * 0.2
let freq = NoiseLFLine(rate: .audio, freq: 10, seed: "Seed")
let freqRange = Range(rate: .audio, input: freq, low: 1000, high: 1440.0);
let bandpass = FilterRBJBandPass(rate: .audio, input: out, freq: freqRange, bandwidth: 0.01)
_ = Output(rate: .audio, index: "Output", output: bandpass)
}
filterTests.parameters["Seed"] = 123
filterTests.parameters["Output"] = 0
graphs["filterTests"] = filterTests
}
}
/*
note?.outputOffsetSamples = 0
note?.updateParameter("StartFreq", value: keynum_hz(69.0))
let risingFreqClosure = LyrebirdFloatClosure {graph in
var freq = 0.0
if let graph = graph {
if let freqIn = graph.parameters["StartFreq"] {
freq = freqIn.floatValue(graph) + 10
graph.parameters["StartFreq"] = freq
}
}
return LyrebirdFloat(freq)
}
note?.updateParameter("Freq", value: risingFreqClosure)
note?.updateParameter("Output", value: 0)
//lyrebird.addNodeToHead(note)
let noteTwo = LyrebirdNote(graph: noiseSweep)
/*
let randomFreqClosure = LyrebirdFloatClosure {graph in
let freq = (drand48() * 80.0) + 440.0
return LyrebirdFloat(freq)
}
*/
noteTwo.updateParameter("Freq", value: 440.0)
noteTwo.updateParameter("Output", value: 1)
*/
@@ -1,667 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
<connections>
<outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="LyrebirdSynthLang" customModuleProvider="target"/>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="LyrebirdSynthLang" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="LyrebirdSynthLang" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="About LyrebirdSynthLang" id="5kV-Vb-QxS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
<menuItem title="Services" id="NMo-om-nkz">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
<menuItem title="Hide LyrebirdSynthLang" keyEquivalent="h" id="Olw-nP-bQN">
<connections>
<action selector="hide:" target="-1" id="PnN-Uc-m68"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>
</connections>
</menuItem>
<menuItem title="Show All" id="Kd2-mp-pUS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
<menuItem title="Quit LyrebirdSynthLang" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="File" id="dMs-cI-mzQ">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="File" id="bib-Uj-vzu">
<items>
<menuItem title="New" keyEquivalent="n" id="Was-JA-tGl">
<connections>
<action selector="newDocument:" target="-1" id="4Si-XN-c54"/>
</connections>
</menuItem>
<menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
<connections>
<action selector="openDocument:" target="-1" id="bVn-NM-KNZ"/>
</connections>
</menuItem>
<menuItem title="Open Recent" id="tXI-mr-wws">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ">
<items>
<menuItem title="Clear Menu" id="vNY-rz-j42">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="clearRecentDocuments:" target="-1" id="Daa-9d-B3U"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
<menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
<connections>
<action selector="performClose:" target="-1" id="HmO-Ls-i7Q"/>
</connections>
</menuItem>
<menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV">
<connections>
<action selector="saveDocument:" target="-1" id="teZ-XB-qJY"/>
</connections>
</menuItem>
<menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A">
<connections>
<action selector="saveDocumentAs:" target="-1" id="mDf-zr-I0C"/>
</connections>
</menuItem>
<menuItem title="Revert to Saved" id="KaW-ft-85H">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="revertDocumentToSaved:" target="-1" id="iJ3-Pv-kwq"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="aJh-i4-bef"/>
<menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="runPageLayout:" target="-1" id="Din-rz-gC5"/>
</connections>
</menuItem>
<menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
<connections>
<action selector="printDocument:" target="-1" id="qaZ-4w-aoO"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Edit" id="5QF-Oa-p0T">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Edit" id="W48-6f-4Dl">
<items>
<menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
<connections>
<action selector="undo:" target="-1" id="M6e-cu-g7V"/>
</connections>
</menuItem>
<menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
<connections>
<action selector="redo:" target="-1" id="oIA-Rs-6OD"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
<menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
<connections>
<action selector="cut:" target="-1" id="YJe-68-I9s"/>
</connections>
</menuItem>
<menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
<connections>
<action selector="copy:" target="-1" id="G1f-GL-Joy"/>
</connections>
</menuItem>
<menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
<connections>
<action selector="paste:" target="-1" id="UvS-8e-Qdg"/>
</connections>
</menuItem>
<menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteAsPlainText:" target="-1" id="cEh-KX-wJQ"/>
</connections>
</menuItem>
<menuItem title="Delete" id="pa3-QI-u2k">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="delete:" target="-1" id="0Mk-Ml-PaM"/>
</connections>
</menuItem>
<menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
<connections>
<action selector="selectAll:" target="-1" id="VNm-Mi-diN"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
<menuItem title="Find" id="4EN-yA-p0u">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Find" id="1b7-l0-nxx">
<items>
<menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
<connections>
<action selector="performFindPanelAction:" target="-1" id="cD7-Qs-BN4"/>
</connections>
</menuItem>
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="performFindPanelAction:" target="-1" id="WD3-Gg-5AJ"/>
</connections>
</menuItem>
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
<connections>
<action selector="performFindPanelAction:" target="-1" id="NDo-RZ-v9R"/>
</connections>
</menuItem>
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
<connections>
<action selector="performFindPanelAction:" target="-1" id="HOh-sY-3ay"/>
</connections>
</menuItem>
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
<connections>
<action selector="performFindPanelAction:" target="-1" id="U76-nv-p5D"/>
</connections>
</menuItem>
<menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
<connections>
<action selector="centerSelectionInVisibleArea:" target="-1" id="IOG-6D-g5B"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
<items>
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
<connections>
<action selector="showGuessPanel:" target="-1" id="vFj-Ks-hy3"/>
</connections>
</menuItem>
<menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
<connections>
<action selector="checkSpelling:" target="-1" id="fz7-VC-reM"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
<menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleContinuousSpellChecking:" target="-1" id="7w6-Qz-0kB"/>
</connections>
</menuItem>
<menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleGrammarChecking:" target="-1" id="muD-Qn-j4w"/>
</connections>
</menuItem>
<menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticSpellingCorrection:" target="-1" id="2lM-Qi-WAP"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Substitutions" id="9ic-FL-obx">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
<items>
<menuItem title="Show Substitutions" id="z6F-FW-3nz">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontSubstitutionsPanel:" target="-1" id="oku-mr-iSq"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
<menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleSmartInsertDelete:" target="-1" id="3IJ-Se-DZD"/>
</connections>
</menuItem>
<menuItem title="Smart Quotes" id="hQb-2v-fYv">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="ptq-xd-QOA"/>
</connections>
</menuItem>
<menuItem title="Smart Dashes" id="rgM-f4-ycn">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticDashSubstitution:" target="-1" id="oCt-pO-9gS"/>
</connections>
</menuItem>
<menuItem title="Smart Links" id="cwL-P1-jid">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticLinkDetection:" target="-1" id="Gip-E3-Fov"/>
</connections>
</menuItem>
<menuItem title="Data Detectors" id="tRr-pd-1PS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticDataDetection:" target="-1" id="R1I-Nq-Kbl"/>
</connections>
</menuItem>
<menuItem title="Text Replacement" id="HFQ-gK-NFA">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticTextReplacement:" target="-1" id="DvP-Fe-Py6"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Transformations" id="2oI-Rn-ZJC">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Transformations" id="c8a-y6-VQd">
<items>
<menuItem title="Make Upper Case" id="vmV-6d-7jI">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="uppercaseWord:" target="-1" id="sPh-Tk-edu"/>
</connections>
</menuItem>
<menuItem title="Make Lower Case" id="d9M-CD-aMd">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowercaseWord:" target="-1" id="iUZ-b5-hil"/>
</connections>
</menuItem>
<menuItem title="Capitalize" id="UEZ-Bs-lqG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="capitalizeWord:" target="-1" id="26H-TL-nsh"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Speech" id="xrE-MZ-jX0">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Speech" id="3rS-ZA-NoH">
<items>
<menuItem title="Start Speaking" id="Ynk-f8-cLZ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/>
</connections>
</menuItem>
<menuItem title="Stop Speaking" id="Oyz-dy-DGm">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Format" id="jxT-CU-nIS">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Format" id="GEO-Iw-cKr">
<items>
<menuItem title="Font" id="Gi5-1S-RQB">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq">
<items>
<menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq">
<connections>
<action selector="orderFrontFontPanel:" target="YLy-65-1bz" id="WHr-nq-2xA"/>
</connections>
</menuItem>
<menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27">
<connections>
<action selector="addFontTrait:" target="YLy-65-1bz" id="hqk-hr-sYV"/>
</connections>
</menuItem>
<menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq">
<connections>
<action selector="addFontTrait:" target="YLy-65-1bz" id="IHV-OB-c03"/>
</connections>
</menuItem>
<menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S">
<connections>
<action selector="underline:" target="-1" id="FYS-2b-JAY"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/>
<menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL">
<connections>
<action selector="modifyFont:" target="YLy-65-1bz" id="Uc7-di-UnL"/>
</connections>
</menuItem>
<menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST">
<connections>
<action selector="modifyFont:" target="YLy-65-1bz" id="HcX-Lf-eNd"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/>
<menuItem title="Kern" id="jBQ-r6-VK2">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Kern" id="tlD-Oa-oAM">
<items>
<menuItem title="Use Default" id="GUa-eO-cwY">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useStandardKerning:" target="-1" id="6dk-9l-Ckg"/>
</connections>
</menuItem>
<menuItem title="Use None" id="cDB-IK-hbR">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="turnOffKerning:" target="-1" id="U8a-gz-Maa"/>
</connections>
</menuItem>
<menuItem title="Tighten" id="46P-cB-AYj">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="tightenKerning:" target="-1" id="hr7-Nz-8ro"/>
</connections>
</menuItem>
<menuItem title="Loosen" id="ogc-rX-tC1">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="loosenKerning:" target="-1" id="8i4-f9-FKE"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Ligatures" id="o6e-r0-MWq">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Ligatures" id="w0m-vy-SC9">
<items>
<menuItem title="Use Default" id="agt-UL-0e3">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useStandardLigatures:" target="-1" id="7uR-wd-Dx6"/>
</connections>
</menuItem>
<menuItem title="Use None" id="J7y-lM-qPV">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="turnOffLigatures:" target="-1" id="iX2-gA-Ilz"/>
</connections>
</menuItem>
<menuItem title="Use All" id="xQD-1f-W4t">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useAllLigatures:" target="-1" id="KcB-kA-TuK"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Baseline" id="OaQ-X3-Vso">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Baseline" id="ijk-EB-dga">
<items>
<menuItem title="Use Default" id="3Om-Ey-2VK">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unscript:" target="-1" id="0vZ-95-Ywn"/>
</connections>
</menuItem>
<menuItem title="Superscript" id="Rqc-34-cIF">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="superscript:" target="-1" id="3qV-fo-wpU"/>
</connections>
</menuItem>
<menuItem title="Subscript" id="I0S-gh-46l">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="subscript:" target="-1" id="Q6W-4W-IGz"/>
</connections>
</menuItem>
<menuItem title="Raise" id="2h7-ER-AoG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="raiseBaseline:" target="-1" id="4sk-31-7Q9"/>
</connections>
</menuItem>
<menuItem title="Lower" id="1tx-W0-xDw">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowerBaseline:" target="-1" id="OF1-bc-KW4"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/>
<menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk">
<connections>
<action selector="orderFrontColorPanel:" target="-1" id="mSX-Xz-DV3"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/>
<menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="copyFont:" target="-1" id="GJO-xA-L4q"/>
</connections>
</menuItem>
<menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteFont:" target="-1" id="JfD-CL-leO"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Text" id="Fal-I4-PZk">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Text" id="d9c-me-L2H">
<items>
<menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1">
<connections>
<action selector="alignLeft:" target="-1" id="zUv-R1-uAa"/>
</connections>
</menuItem>
<menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb">
<connections>
<action selector="alignCenter:" target="-1" id="spX-mk-kcS"/>
</connections>
</menuItem>
<menuItem title="Justify" id="J5U-5w-g23">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="alignJustified:" target="-1" id="ljL-7U-jND"/>
</connections>
</menuItem>
<menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4">
<connections>
<action selector="alignRight:" target="-1" id="r48-bG-YeY"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/>
<menuItem title="Writing Direction" id="H1b-Si-o9J">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd">
<items>
<menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem id="YGs-j5-SAR">
<string key="title"> Default</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionNatural:" target="-1" id="qtV-5e-UBP"/>
</connections>
</menuItem>
<menuItem id="Lbh-J2-qVU">
<string key="title"> Left to Right</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionLeftToRight:" target="-1" id="S0X-9S-QSf"/>
</connections>
</menuItem>
<menuItem id="jFq-tB-4Kx">
<string key="title"> Right to Left</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionRightToLeft:" target="-1" id="5fk-qB-AqJ"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="swp-gr-a21"/>
<menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem id="Nop-cj-93Q">
<string key="title"> Default</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionNatural:" target="-1" id="lPI-Se-ZHp"/>
</connections>
</menuItem>
<menuItem id="BgM-ve-c93">
<string key="title"> Left to Right</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionLeftToRight:" target="-1" id="caW-Bv-w94"/>
</connections>
</menuItem>
<menuItem id="RB4-Sm-HuC">
<string key="title"> Right to Left</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionRightToLeft:" target="-1" id="EXD-6r-ZUu"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/>
<menuItem title="Show Ruler" id="vLm-3I-IUL">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleRuler:" target="-1" id="FOx-HJ-KwY"/>
</connections>
</menuItem>
<menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="copyRuler:" target="-1" id="71i-fW-3W2"/>
</connections>
</menuItem>
<menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="pasteRuler:" target="-1" id="cSh-wd-qM2"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="View" id="H8h-7b-M4v">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="View" id="HyV-fh-RgO">
<items>
<menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="toggleToolbarShown:" target="-1" id="BXY-wc-z0C"/>
</connections>
</menuItem>
<menuItem title="Customize Toolbar…" id="1UK-8n-QPP">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="runToolbarCustomizationPalette:" target="-1" id="pQI-g3-MTW"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Window" id="aUF-d1-5bR">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
<items>
<menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
<connections>
<action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/>
</connections>
</menuItem>
<menuItem title="Zoom" id="R4o-n2-Eq4">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="performZoom:" target="-1" id="DIl-cC-cCs"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="wpr-3q-Mcd">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
<items>
<menuItem title="LyrebirdSynthLang Help" keyEquivalent="?" id="FKE-Sm-Kum">
<connections>
<action selector="showHelp:" target="-1" id="y7X-2Q-9no"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</objects>
</document>
@@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>oui</string>
</array>
<key>CFBundleTypeIconFile</key>
<string></string>
<key>CFBundleTypeName</key>
<string>DocumentType</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>????</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.music</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Op133Studios. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
@@ -1,100 +0,0 @@
//
// LyrebirdDemo.swift
// LyrebirdSynthLang
//
// Created by Joshua Parmenter on 5/19/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
import Cocoa
import Lyrebird
class LyrebirdDemo: NSObject {
let lyrebird: Lyrebird!
var timer: LyrebirdTimer? = nil
var graphs: LyrebirdTestGraphs = LyrebirdTestGraphs()
required init(lyrebird: Lyrebird){
self.lyrebird = lyrebird
super.init()
}
func runDemo(){
graphs.setupDemoGraphs()
let impulse = graphs.graphs["impulse"]
let impulseNote : LyrebirdNote = LyrebirdNote(graph: impulse)
impulseNote.updateParameter(key: "Freq", value: 1.0)
impulseNote.updateParameter(key: "Output", value: 0)
impulseNote.finishBlock = {(node) -> Void in
print("DONE!!!!")
}
let noiseLine = graphs.graphs["noiseLineDelay"]
var noiseLineNote: LyrebirdNote? = LyrebirdNote(graph: noiseLine)
noiseLineNote?.updateParameter(key: "Output", value: 0)
noiseLineNote?.updateParameter(key: "OutputTwo", value: 1)
let filter = graphs.graphs["filterTests"]
var filterNote: LyrebirdNote? = LyrebirdNote(graph: filter)
filterNote?.updateParameter(key: "Output", value: 0)
var filterNote2: LyrebirdNote? = LyrebirdNote(graph: filter)
filterNote2?.updateParameter(key: "Output", value: 1)
filterNote2?.updateParameter(key: "Seed", value: 456)
/* // some sample benchmark code for testing
let start = NSDate.timeIntervalSinceReferenceDate()
let white = LyrebirdRandomNumberGenerator()
for _ in 0 ..< 10000 {
feedbackCoef(0.1, decayTime: 10.0, targetAmp: white.next())
}
let end = NSDate.timeIntervalSinceReferenceDate()
print("time to run: \(end-start)")
*/
let secondGroup: LyrebirdParallelGroup = lyrebird.createParallelGroup()
self.timer = LyrebirdTimer()
if let timer = self.timer {
var counter: LyrebirdInt = 0
/*
self.lyrebird.addNodeToHead(noiseNote!)
lyrebird.addNodeToHead(fmNote!)
*/
//lyrebird.addNodeToHead(impulseNote)
lyrebird.addNodeToHead(node: filterNote)
secondGroup.rootGroup.addNodeToHead(node: filterNote2)
filterNote2?.updateParameter(key: "Output", value: 1)
filterNote2?.updateParameter(key: "Seed", value: 456)
let block: LyrebirdTimerBlock = {(curTime: LyrebirdFloat, inc: LyrebirdInt) in
counter = counter + 1
print("Hello \(curTime) \(inc)")
if counter == 19 {
filterNote?.free()
filterNote = nil
}
if counter < 20 {
return 0.4
}
self.timer = nil
return nil
}
timer.block = block
let finalBlock: LyrebirdTimerFinalizerBlock = {(curTime: LyrebirdFloat) in
print("Final \(curTime)")
}
timer.finalizerBlock = finalBlock
timer.run()
}
}
}
@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
@@ -1,36 +0,0 @@
//
// LyrebirdLangTests.swift
// LyrebirdLangTests
//
// Created by Joshua Parmenter on 5/1/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
import XCTest
@testable import LyrebirdLang
class LyrebirdLangTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
@@ -1,342 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
031408431CFD595F00D3BDDA /* AVKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 031408421CFD595F00D3BDDA /* AVKit.framework */; };
031408451CFD596B00D3BDDA /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 031408441CFD596B00D3BDDA /* AudioToolbox.framework */; };
036956311CF56B2900F2CC6B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 036956261CF56B2900F2CC6B /* AppDelegate.swift */; };
036956321CF56B2900F2CC6B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 036956271CF56B2900F2CC6B /* Assets.xcassets */; };
036956331CF56B2900F2CC6B /* AudioSampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 036956281CF56B2900F2CC6B /* AudioSampleApp.swift */; };
036956341CF56B2900F2CC6B /* AudioSampleGraphs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 036956291CF56B2900F2CC6B /* AudioSampleGraphs.swift */; };
036956351CF56B2900F2CC6B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0369562A1CF56B2900F2CC6B /* MainMenu.xib */; };
036956361CF56B2900F2CC6B /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 0369562C1CF56B2900F2CC6B /* Info.plist */; };
036956371CF56B2900F2CC6B /* LyrebirdDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0369562D1CF56B2900F2CC6B /* LyrebirdDemo.swift */; };
03AE39861CE7F9B3008B2E83 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03AE39851CE7F9B3008B2E83 /* AVFoundation.framework */; };
03C77F171CD9AC44003A753B /* Lyrebird.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03C77F151CD9AC23003A753B /* Lyrebird.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
031408421CFD595F00D3BDDA /* AVKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVKit.framework; path = System/Library/Frameworks/AVKit.framework; sourceTree = SDKROOT; };
031408441CFD596B00D3BDDA /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
0336EC901CE0E82900279E2B /* MyPlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = MyPlayground.playground; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
036956261CF56B2900F2CC6B /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
036956271CF56B2900F2CC6B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
036956281CF56B2900F2CC6B /* AudioSampleApp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioSampleApp.swift; sourceTree = "<group>"; };
036956291CF56B2900F2CC6B /* AudioSampleGraphs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AudioSampleGraphs.swift; sourceTree = "<group>"; };
0369562B1CF56B2900F2CC6B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
0369562C1CF56B2900F2CC6B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
0369562D1CF56B2900F2CC6B /* LyrebirdDemo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdDemo.swift; sourceTree = "<group>"; };
0369562F1CF56B2900F2CC6B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
036956301CF56B2900F2CC6B /* LyrebirdLangTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdLangTests.swift; sourceTree = "<group>"; };
03AE39851CE7F9B3008B2E83 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
03C77EC51CD6F50D003A753B /* LyrebirdSynthLang.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LyrebirdSynthLang.app; sourceTree = BUILT_PRODUCTS_DIR; };
03C77F151CD9AC23003A753B /* Lyrebird.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Lyrebird.framework; path = "../../../Library/Developer/Xcode/DerivedData/SoundServerTests-dytvjpwcamvyjdalfbnevopalrmo/Build/Products/Debug/Lyrebird.framework"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
03C77EC21CD6F50D003A753B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
031408451CFD596B00D3BDDA /* AudioToolbox.framework in Frameworks */,
031408431CFD595F00D3BDDA /* AVKit.framework in Frameworks */,
03AE39861CE7F9B3008B2E83 /* AVFoundation.framework in Frameworks */,
03C77F171CD9AC44003A753B /* Lyrebird.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
036956241CF56AF000F2CC6B /* Frameworks */ = {
isa = PBXGroup;
children = (
031408441CFD596B00D3BDDA /* AudioToolbox.framework */,
031408421CFD595F00D3BDDA /* AVKit.framework */,
03AE39851CE7F9B3008B2E83 /* AVFoundation.framework */,
03C77F151CD9AC23003A753B /* Lyrebird.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
036956251CF56B2900F2CC6B /* LyrebirdLang */ = {
isa = PBXGroup;
children = (
036956261CF56B2900F2CC6B /* AppDelegate.swift */,
036956271CF56B2900F2CC6B /* Assets.xcassets */,
036956281CF56B2900F2CC6B /* AudioSampleApp.swift */,
036956291CF56B2900F2CC6B /* AudioSampleGraphs.swift */,
0369562A1CF56B2900F2CC6B /* MainMenu.xib */,
0369562C1CF56B2900F2CC6B /* Info.plist */,
0369562D1CF56B2900F2CC6B /* LyrebirdDemo.swift */,
);
path = LyrebirdLang;
sourceTree = "<group>";
};
0369562E1CF56B2900F2CC6B /* LyrebirdLangTests */ = {
isa = PBXGroup;
children = (
0369562F1CF56B2900F2CC6B /* Info.plist */,
036956301CF56B2900F2CC6B /* LyrebirdLangTests.swift */,
);
path = LyrebirdLangTests;
sourceTree = "<group>";
};
03C77EBC1CD6F50D003A753B = {
isa = PBXGroup;
children = (
036956241CF56AF000F2CC6B /* Frameworks */,
0336EC901CE0E82900279E2B /* MyPlayground.playground */,
03C77EC61CD6F50D003A753B /* Products */,
036956251CF56B2900F2CC6B /* LyrebirdLang */,
0369562E1CF56B2900F2CC6B /* LyrebirdLangTests */,
);
sourceTree = "<group>";
};
03C77EC61CD6F50D003A753B /* Products */ = {
isa = PBXGroup;
children = (
03C77EC51CD6F50D003A753B /* LyrebirdSynthLang.app */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
03C77EC41CD6F50D003A753B /* LyrebirdSynthLang */ = {
isa = PBXNativeTarget;
buildConfigurationList = 03C77EE21CD6F50D003A753B /* Build configuration list for PBXNativeTarget "LyrebirdSynthLang" */;
buildPhases = (
03C77EC11CD6F50D003A753B /* Sources */,
03C77EC21CD6F50D003A753B /* Frameworks */,
03C77EC31CD6F50D003A753B /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = LyrebirdSynthLang;
productName = SwiftSynthLang;
productReference = 03C77EC51CD6F50D003A753B /* LyrebirdSynthLang.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
03C77EBD1CD6F50D003A753B /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = Op133Studios;
TargetAttributes = {
03C77EC41CD6F50D003A753B = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0820;
};
};
};
buildConfigurationList = 03C77EC01CD6F50D003A753B /* Build configuration list for PBXProject "LyrebirdSynthLang" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
mainGroup = 03C77EBC1CD6F50D003A753B;
productRefGroup = 03C77EC61CD6F50D003A753B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
03C77EC41CD6F50D003A753B /* LyrebirdSynthLang */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
03C77EC31CD6F50D003A753B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
036956321CF56B2900F2CC6B /* Assets.xcassets in Resources */,
036956361CF56B2900F2CC6B /* Info.plist in Resources */,
036956351CF56B2900F2CC6B /* MainMenu.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
03C77EC11CD6F50D003A753B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
036956331CF56B2900F2CC6B /* AudioSampleApp.swift in Sources */,
036956311CF56B2900F2CC6B /* AppDelegate.swift in Sources */,
036956341CF56B2900F2CC6B /* AudioSampleGraphs.swift in Sources */,
036956371CF56B2900F2CC6B /* LyrebirdDemo.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
0369562A1CF56B2900F2CC6B /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (
0369562B1CF56B2900F2CC6B /* Base */,
);
name = MainMenu.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
03C77EE01CD6F50D003A753B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
03C77EE11CD6F50D003A753B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
};
name = Release;
};
03C77EE31CD6F50D003A753B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
INFOPLIST_FILE = LyrebirdLang/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 15.0;
PRODUCT_BUNDLE_IDENTIFIER = com.op133studios.LyrebirdLang;
PRODUCT_NAME = LyrebirdSynthLang;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
03C77EE41CD6F50D003A753B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_OPTIMIZATION_LEVEL = 3;
INFOPLIST_FILE = LyrebirdLang/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 15.0;
PRODUCT_BUNDLE_IDENTIFIER = com.op133studios.LyrebirdLang;
PRODUCT_NAME = LyrebirdSynthLang;
SWIFT_VERSION = 5.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
03C77EC01CD6F50D003A753B /* Build configuration list for PBXProject "LyrebirdSynthLang" */ = {
isa = XCConfigurationList;
buildConfigurations = (
03C77EE01CD6F50D003A753B /* Debug */,
03C77EE11CD6F50D003A753B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
03C77EE21CD6F50D003A753B /* Build configuration list for PBXNativeTarget "LyrebirdSynthLang" */ = {
isa = XCConfigurationList;
buildConfigurations = (
03C77EE31CD6F50D003A753B /* Debug */,
03C77EE41CD6F50D003A753B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 03C77EBD1CD6F50D003A753B /* Project object */;
}
@@ -1,91 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77EC41CD6F50D003A753B"
BuildableName = "LyrebirdSynthLang.app"
BlueprintName = "LyrebirdSynthLang"
ReferencedContainer = "container:LyrebirdSynthLang.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77EC41CD6F50D003A753B"
BuildableName = "LyrebirdSynthLang.app"
BlueprintName = "LyrebirdSynthLang"
ReferencedContainer = "container:LyrebirdSynthLang.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77EC41CD6F50D003A753B"
BuildableName = "LyrebirdSynthLang.app"
BlueprintName = "LyrebirdSynthLang"
ReferencedContainer = "container:LyrebirdSynthLang.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77EC41CD6F50D003A753B"
BuildableName = "LyrebirdSynthLang.app"
BlueprintName = "LyrebirdSynthLang"
ReferencedContainer = "container:LyrebirdSynthLang.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,101 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77EC41CD6F50D003A753B"
BuildableName = "LyrebirdSynthLang.app"
BlueprintName = "LyrebirdSynthLang"
ReferencedContainer = "container:LyrebirdSynthLang.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77ED81CD6F50D003A753B"
BuildableName = "LyrebirdSynthLang.xctest"
BlueprintName = "LyrebirdSynthLangTests"
ReferencedContainer = "container:LyrebirdSynthLang.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77EC41CD6F50D003A753B"
BuildableName = "LyrebirdSynthLang.app"
BlueprintName = "LyrebirdSynthLang"
ReferencedContainer = "container:LyrebirdSynthLang.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77EC41CD6F50D003A753B"
BuildableName = "LyrebirdSynthLang.app"
BlueprintName = "LyrebirdSynthLang"
ReferencedContainer = "container:LyrebirdSynthLang.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77EC41CD6F50D003A753B"
BuildableName = "LyrebirdSynthLang.app"
BlueprintName = "LyrebirdSynthLang"
ReferencedContainer = "container:LyrebirdSynthLang.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,32 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>LyrebirdSynthLang Release.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>LyrebirdSynthLang.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>03C77EC41CD6F50D003A753B</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>03C77ED81CD6F50D003A753B</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
@@ -1,207 +0,0 @@
//: Playground - noun: a place where people can play
import Cocoa
import Lyrebird
exp((log( 0.001 ) * 0.2) / 1.0)
LyrebirdFunctions.isPowerOfTwo(value: 127)
LyrebirdFunctions.nextPowerOfTwo(value: 128)
LyrebirdFunctions.cubicInterp(ym1: 10.0, y0: 2.0, y1: 0.0, y2: 1.0, pct: 0.0)
let a = LyrebirdInt(80)
80.floatValue(graph: nil)
LyrebirdFunctions.keynum_hz(keynum: 69.1)
LyrebirdFunctions.hz_keynum(hz: 440)
LyrebirdFunctions.db_linamp(db: 0)
LyrebirdFunctions.linamp_db(linamp: 2.0)
LyrebirdFunctions.db_linamp(db: -12.0)
LyrebirdFunctions.midi_ratio(midi: 12.0)
LyrebirdFunctions.ratio_midi(ratio: 0.5)
LyrebirdFunctions.sig_sqrt(value: -4.0)
var array = [1, 2, 3]
var array2 = array
array2[2] = 300
print("\(array, array2)")
var list = LoopingSequence(list: [0.0, 1.1, 2.2, 3.3], repeats: 1)
list.next()
list.next()
list.next()
list.next()
list.next()
list.next()
list.reset()
list.next()
list.next()
list.next()
list.next()
list.next()
list.next()
list.next()
list.next()
list.next()
var arrayToShuffle = [1, 2, 3, 4, 5, 6];
for (index, value) in arrayToShuffle.enumerated() {
print("\(value)")
}
var z = LyrebirdRandomNumberGenerator(initSeed: 123)
z.next()
var scheduler = LyrebirdScheduler()
let event = LyrebirdScheduledEvent(startTime: 2.0) { (curTime, iteration) -> LyrebirdFloat? in
print("\(curTime, iteration)")
if iteration < 10 {
return 1.0
}
return nil
}
scheduler.addEventToQueue(event: event)
//scheduler.queue
scheduler.updateCurTime(newCurTime: 1.0)
scheduler.updateCurTime(newCurTime: 2.001)
scheduler.updateCurTime(newCurTime: 3.001)
scheduler.updateCurTime(newCurTime: 3.001)
scheduler.updateCurTime(newCurTime: 3.001)
event.iteration
struct TestMe {
var array: [Int]
init(array: [Int]){
self.array = array
}
mutating func updateArray(){
var newArray: [Int] = []
for val: Int in array {
newArray.append(val + 2)
}
array = newArray
}
}
var testMe: TestMe = TestMe(array: [0, 1, 2, 3])
testMe.array
testMe.updateArray()
testMe.array
testMe.updateArray()
testMe.array
var testMe2: TestMe = TestMe(array: testMe.array)
testMe.array
testMe2.array
testMe2.updateArray()
testMe.array
testMe2.array
testMe2.updateArray()
testMe2.array
var testMe3 = testMe2
testMe2.updateArray()
testMe2.array
testMe3.array
var testUGen = NoiseWhite(rate: LyrebirdUGenRate.audio)
var start = Date.timeIntervalSinceReferenceDate
for _ in 0 ..< 1000 {
testUGen.next(numSamples: 64)
}
var end = Date.timeIntervalSinceReferenceDate
end-start
let white = RandWhite(initSeed: 123)
white.next()
white.next()
white.next()
white.next()
white.next()
white.next()
let segment = Segment(start: 0.0, end: 1.0, curve: 0.0, duration: 1)
start = NSDate.timeIntervalSinceReferenceDate
for _ in 0 ..< 1000 {
segment.poll(atTime: 0.5)
}
end = NSDate.timeIntervalSinceReferenceDate
end-start
start = NSDate.timeIntervalSinceReferenceDate
let env = Envelope(levels: [2.0, 0.0, 4.0], durations: [1.0, 2.0, 20.0], curve: 0.0)
env.poll(atTime: 2)
LyrebirdFunctions.feedbackCoef(delayTime: 0.1, decayTime: 10.0, targetAmp: 0.001)
LyrebirdFunctions.feedbackCoef(delayTime: 0.1, decayTime: 10.0, targetDB: -60.0)
end = NSDate.timeIntervalSinceReferenceDate
end-start
let seg = Segment(start: 2.0, end: 4.0, curve: 10.0, duration: 1.0)
seg.poll(atTime: 0.99)
for (index, val) in (1 ... 10).enumerated() {
if val > 5 {
break
}
print("\(index, val)")
}
//
//enum LyrebirdValue {
// case Integer(value: LyrebirdInt)
// case Float(value: LyrebirdFloat)
// case Key(value: LyrebirdKey)
//
// func floatValue() -> LyrebirdFloat{
// switch(self){
// case let .Integer(value):
// return LyrebirdFloat(value)
// case let .Float(value):
// return value
// case let .Key(value):
// return 0.0
// }
// }
//
//}
//
//var anInt = LyrebirdValue.Integer(value: 10)
//let test = anInt.floatValue()
//anInt = LyrebirdValue.Float(value: 100.0)
@@ -1,355 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
0317A3B01CDAC3DB009C28D6 /* LyrebirdSynthUgen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0317A3AF1CDAC3DB009C28D6 /* LyrebirdSynthUgen.swift */; };
0317A3B21CDAC460009C28D6 /* LyrebirdSynthWire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0317A3B11CDAC460009C28D6 /* LyrebirdSynthWire.swift */; };
0317A3B41CDB0BA8009C28D6 /* LyrebirdSynthConsts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0317A3B31CDB0BA8009C28D6 /* LyrebirdSynthConsts.swift */; };
0317A3B61CDB0FF4009C28D6 /* LyrebirdSynthFunctions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0317A3B51CDB0FF4009C28D6 /* LyrebirdSynthFunctions.swift */; };
03C77F071CD9A99C003A753B /* LyrebirdSynth.h in Headers */ = {isa = PBXBuildFile; fileRef = 03C77EFC1CD9A99C003A753B /* LyrebirdSynth.h */; };
03C77F081CD9A99C003A753B /* LyrebirdSynthAudioChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77EFD1CD9A99C003A753B /* LyrebirdSynthAudioChannel.swift */; };
03C77F091CD9A99C003A753B /* LyrebirdSynthControlChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77EFE1CD9A99C003A753B /* LyrebirdSynthControlChannel.swift */; };
03C77F0A1CD9A99C003A753B /* LyrebirdSynthEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77EFF1CD9A99C003A753B /* LyrebirdSynthEngine.swift */; };
03C77F0B1CD9A99C003A753B /* LyrebirdSynthMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77F001CD9A99C003A753B /* LyrebirdSynthMain.swift */; };
03C77F0C1CD9A99C003A753B /* LyrebirdSynthNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77F011CD9A99C003A753B /* LyrebirdSynthNode.swift */; };
03C77F0D1CD9A99C003A753B /* LyrebirdSynthTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77F021CD9A99C003A753B /* LyrebirdSynthTypes.swift */; };
03C77F121CD9AB0E003A753B /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 03C77F041CD9A99C003A753B /* Info.plist */; };
03C77F191CD9AE42003A753B /* LyrebirdSynthRawAudioChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77F181CD9AE42003A753B /* LyrebirdSynthRawAudioChannel.swift */; };
03C77F1B1CD9BAB3003A753B /* LyrebirdSynthGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77F1A1CD9BAB3003A753B /* LyrebirdSynthGraph.swift */; };
03EBC3251CDBF5C90097F7AF /* OscSin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EBC3241CDBF5C90097F7AF /* OscSin.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
0317A3AF1CDAC3DB009C28D6 /* LyrebirdSynthUgen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthUgen.swift; sourceTree = "<group>"; };
0317A3B11CDAC460009C28D6 /* LyrebirdSynthWire.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthWire.swift; sourceTree = "<group>"; };
0317A3B31CDB0BA8009C28D6 /* LyrebirdSynthConsts.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthConsts.swift; sourceTree = "<group>"; };
0317A3B51CDB0FF4009C28D6 /* LyrebirdSynthFunctions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthFunctions.swift; sourceTree = "<group>"; };
03C77EA01CD6B20B003A753B /* Lyrebird.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Lyrebird.framework; sourceTree = BUILT_PRODUCTS_DIR; };
03C77EFB1CD9A99C003A753B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
03C77EFC1CD9A99C003A753B /* LyrebirdSynth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LyrebirdSynth.h; sourceTree = "<group>"; };
03C77EFD1CD9A99C003A753B /* LyrebirdSynthAudioChannel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthAudioChannel.swift; sourceTree = "<group>"; };
03C77EFE1CD9A99C003A753B /* LyrebirdSynthControlChannel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthControlChannel.swift; sourceTree = "<group>"; };
03C77EFF1CD9A99C003A753B /* LyrebirdSynthEngine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthEngine.swift; sourceTree = "<group>"; };
03C77F001CD9A99C003A753B /* LyrebirdSynthMain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthMain.swift; sourceTree = "<group>"; };
03C77F011CD9A99C003A753B /* LyrebirdSynthNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthNode.swift; sourceTree = "<group>"; };
03C77F021CD9A99C003A753B /* LyrebirdSynthTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthTypes.swift; sourceTree = "<group>"; };
03C77F041CD9A99C003A753B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
03C77F181CD9AE42003A753B /* LyrebirdSynthRawAudioChannel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthRawAudioChannel.swift; sourceTree = "<group>"; };
03C77F1A1CD9BAB3003A753B /* LyrebirdSynthGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthGraph.swift; sourceTree = "<group>"; };
03EBC3241CDBF5C90097F7AF /* OscSin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OscSin.swift; path = UGens/OscSin.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
03C77E9C1CD6B20B003A753B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
03C77E961CD6B20B003A753B = {
isa = PBXGroup;
children = (
03C77EFA1CD9A99C003A753B /* LyrebirdSynth */,
03C77F031CD9A99C003A753B /* LyrebirdSynthTests */,
03C77EA11CD6B20B003A753B /* Products */,
);
sourceTree = "<group>";
};
03C77EA11CD6B20B003A753B /* Products */ = {
isa = PBXGroup;
children = (
03C77EA01CD6B20B003A753B /* Lyrebird.framework */,
);
name = Products;
sourceTree = "<group>";
};
03C77EFA1CD9A99C003A753B /* LyrebirdSynth */ = {
isa = PBXGroup;
children = (
03C77EFB1CD9A99C003A753B /* Info.plist */,
03C77EFC1CD9A99C003A753B /* LyrebirdSynth.h */,
03C77EFD1CD9A99C003A753B /* LyrebirdSynthAudioChannel.swift */,
03C77F181CD9AE42003A753B /* LyrebirdSynthRawAudioChannel.swift */,
03C77EFE1CD9A99C003A753B /* LyrebirdSynthControlChannel.swift */,
03C77EFF1CD9A99C003A753B /* LyrebirdSynthEngine.swift */,
03C77F001CD9A99C003A753B /* LyrebirdSynthMain.swift */,
03C77F011CD9A99C003A753B /* LyrebirdSynthNode.swift */,
03C77F021CD9A99C003A753B /* LyrebirdSynthTypes.swift */,
0317A3B31CDB0BA8009C28D6 /* LyrebirdSynthConsts.swift */,
0317A3B51CDB0FF4009C28D6 /* LyrebirdSynthFunctions.swift */,
03C77F1A1CD9BAB3003A753B /* LyrebirdSynthGraph.swift */,
0317A3AF1CDAC3DB009C28D6 /* LyrebirdSynthUgen.swift */,
0317A3B11CDAC460009C28D6 /* LyrebirdSynthWire.swift */,
03EBC3241CDBF5C90097F7AF /* OscSin.swift */,
);
path = LyrebirdSynth;
sourceTree = "<group>";
};
03C77F031CD9A99C003A753B /* LyrebirdSynthTests */ = {
isa = PBXGroup;
children = (
03C77F041CD9A99C003A753B /* Info.plist */,
);
path = LyrebirdSynthTests;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
03C77E9D1CD6B20B003A753B /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
03C77F071CD9A99C003A753B /* LyrebirdSynth.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
03C77E9F1CD6B20B003A753B /* Lyrebird */ = {
isa = PBXNativeTarget;
buildConfigurationList = 03C77EB41CD6B20B003A753B /* Build configuration list for PBXNativeTarget "Lyrebird" */;
buildPhases = (
03C77E9B1CD6B20B003A753B /* Sources */,
03C77E9C1CD6B20B003A753B /* Frameworks */,
03C77E9D1CD6B20B003A753B /* Headers */,
03C77E9E1CD6B20B003A753B /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Lyrebird;
productName = SwiftSynth;
productReference = 03C77EA01CD6B20B003A753B /* Lyrebird.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
03C77E971CD6B20B003A753B /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = Op133Studios;
TargetAttributes = {
03C77E9F1CD6B20B003A753B = {
CreatedOnToolsVersion = 7.3;
};
};
};
buildConfigurationList = 03C77E9A1CD6B20B003A753B /* Build configuration list for PBXProject "Lyrebird" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 03C77E961CD6B20B003A753B;
productRefGroup = 03C77EA11CD6B20B003A753B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
03C77E9F1CD6B20B003A753B /* Lyrebird */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
03C77E9E1CD6B20B003A753B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
03C77F121CD9AB0E003A753B /* Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
03C77E9B1CD6B20B003A753B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0317A3B01CDAC3DB009C28D6 /* LyrebirdSynthUgen.swift in Sources */,
03C77F1B1CD9BAB3003A753B /* LyrebirdSynthGraph.swift in Sources */,
03C77F0A1CD9A99C003A753B /* LyrebirdSynthEngine.swift in Sources */,
0317A3B41CDB0BA8009C28D6 /* LyrebirdSynthConsts.swift in Sources */,
03C77F081CD9A99C003A753B /* LyrebirdSynthAudioChannel.swift in Sources */,
03C77F191CD9AE42003A753B /* LyrebirdSynthRawAudioChannel.swift in Sources */,
03C77F0B1CD9A99C003A753B /* LyrebirdSynthMain.swift in Sources */,
03EBC3251CDBF5C90097F7AF /* OscSin.swift in Sources */,
0317A3B61CDB0FF4009C28D6 /* LyrebirdSynthFunctions.swift in Sources */,
03C77F091CD9A99C003A753B /* LyrebirdSynthControlChannel.swift in Sources */,
03C77F0C1CD9A99C003A753B /* LyrebirdSynthNode.swift in Sources */,
0317A3B21CDAC460009C28D6 /* LyrebirdSynthWire.swift in Sources */,
03C77F0D1CD9A99C003A753B /* LyrebirdSynthTypes.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
03C77EB21CD6B20B003A753B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
03C77EB31CD6B20B003A753B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
03C77EB51CD6B20B003A753B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = LyrebirdSynth/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.op133studios.LyrebirdSynth;
PRODUCT_NAME = Lyrebird;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
03C77EB61CD6B20B003A753B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = LyrebirdSynth/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.op133studios.LyrebirdSynth;
PRODUCT_NAME = Lyrebird;
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
03C77E9A1CD6B20B003A753B /* Build configuration list for PBXProject "Lyrebird" */ = {
isa = XCConfigurationList;
buildConfigurations = (
03C77EB21CD6B20B003A753B /* Debug */,
03C77EB31CD6B20B003A753B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
03C77EB41CD6B20B003A753B /* Build configuration list for PBXNativeTarget "Lyrebird" */ = {
isa = XCConfigurationList;
buildConfigurations = (
03C77EB51CD6B20B003A753B /* Debug */,
03C77EB61CD6B20B003A753B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 03C77E971CD6B20B003A753B /* Project object */;
}
@@ -1,99 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77E9F1CD6B20B003A753B"
BuildableName = "Lyrebird.framework"
BlueprintName = "Lyrebird"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77EA91CD6B20B003A753B"
BuildableName = "Lyrebird.xctest"
BlueprintName = "LyrebirdTests"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77E9F1CD6B20B003A753B"
BuildableName = "Lyrebird.framework"
BlueprintName = "Lyrebird"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77E9F1CD6B20B003A753B"
BuildableName = "Lyrebird.framework"
BlueprintName = "Lyrebird"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77E9F1CD6B20B003A753B"
BuildableName = "Lyrebird.framework"
BlueprintName = "Lyrebird"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>LyrebirdSynth.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>03C77E9F1CD6B20B003A753B</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>03C77EA91CD6B20B003A753B</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' display-mode='raw' last-migration='0800'>
<timeline fileName='timeline.xctimeline'/>
</playground>
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildLocationStyle</key>
<string>UseAppPreferences</string>
<key>CustomBuildLocationType</key>
<string>RelativeToDerivedData</string>
<key>DerivedDataLocationStyle</key>
<string>Default</string>
<key>IssueFilterStyle</key>
<string>ShowActiveSchemeOnly</string>
<key>LiveSourceIssuesEnabled</key>
<true/>
</dict>
</plist>
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Timeline
version = "3.0">
<TimelineItems>
<LoggerValueHistoryTimelineItem
documentLocation = "file:///Users/josh/src/Lyrebird/LyrebirdLang/MyPlayground.playground#CharacterRangeLen=34&amp;CharacterRangeLoc=2495&amp;EndingLineNumber=131&amp;StartingLineNumber=131&amp;Timestamp=501970155.39466"
selectedRepresentationIndex = "0"
shouldTrackSuperviewWidth = "NO">
</LoggerValueHistoryTimelineItem>
<LoggerValueHistoryTimelineItem
documentLocation = "file:///Users/josh/src/Lyrebird/LyrebirdLang/MyPlayground.playground#CharacterRangeLen=0&amp;CharacterRangeLoc=3310&amp;EndingLineNumber=171&amp;StartingLineNumber=171&amp;Timestamp=508373603.698336"
selectedRepresentationIndex = "0"
shouldTrackSuperviewWidth = "NO">
</LoggerValueHistoryTimelineItem>
</TimelineItems>
</Timeline>
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:LyrebirdLang/LyrebirdSynthLang.xcodeproj">
</FileRef>
<FileRef
location = "group:LyrebirdSynth/Lyrebird.xcodeproj">
</FileRef>
</Workspace>
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -1,424 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
0307E5681CFFC347002E5582 /* NoiseUGens.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0307E5671CFFC347002E5582 /* NoiseUGens.swift */; };
0307E56A1CFFF219002E5582 /* LyrebirdRandomGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0307E5691CFFF219002E5582 /* LyrebirdRandomGenerator.swift */; };
0307E56C1D014C7E002E5582 /* FilterUGens.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0307E56B1D014C7E002E5582 /* FilterUGens.swift */; };
031122BE1CE3868900D657CB /* Lyrebird.h in Headers */ = {isa = PBXBuildFile; fileRef = 031122AD1CE3868900D657CB /* Lyrebird.h */; settings = {ATTRIBUTES = (Public, ); }; };
031122BF1CE3868900D657CB /* LyrebirdAudioChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122AE1CE3868900D657CB /* LyrebirdAudioChannel.swift */; };
031122C01CE3868900D657CB /* LyrebirdConsts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122AF1CE3868900D657CB /* LyrebirdConsts.swift */; };
031122C11CE3868900D657CB /* LyrebirdControlChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122B01CE3868900D657CB /* LyrebirdControlChannel.swift */; };
031122C21CE3868900D657CB /* LyrebirdEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122B11CE3868900D657CB /* LyrebirdEngine.swift */; };
031122C31CE3868900D657CB /* LyrebirdFunctions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122B21CE3868900D657CB /* LyrebirdFunctions.swift */; };
031122C41CE3868900D657CB /* LyrebirdGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122B31CE3868900D657CB /* LyrebirdGraph.swift */; };
031122C51CE3868900D657CB /* LyrebirdMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122B41CE3868900D657CB /* LyrebirdMain.swift */; };
031122C61CE3868900D657CB /* LyrebirdNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122B51CE3868900D657CB /* LyrebirdNode.swift */; };
031122C71CE3868900D657CB /* LyrebirdRawAudioChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122B61CE3868900D657CB /* LyrebirdRawAudioChannel.swift */; };
031122C81CE3868900D657CB /* LyrebirdTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122B71CE3868900D657CB /* LyrebirdTypes.swift */; };
031122C91CE3868900D657CB /* LyrebirdUgen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122B81CE3868900D657CB /* LyrebirdUgen.swift */; };
031122CB1CE3868900D657CB /* OscUGens.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122BB1CE3868900D657CB /* OscUGens.swift */; };
031122CD1CE386FF00D657CB /* ControlUGens.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031122CC1CE386FF00D657CB /* ControlUGens.swift */; };
0333C59E1D353CB600372C4B /* EnvelopeUGens.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0333C59D1D353CB600372C4B /* EnvelopeUGens.swift */; };
0333C5A01D36897500372C4B /* LyrebirdEnvelope.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0333C59F1D36897500372C4B /* LyrebirdEnvelope.swift */; };
0333C5A21D3B5DDD00372C4B /* DelayUGens.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0333C5A11D3B5DDD00372C4B /* DelayUGens.swift */; };
0352B36E1CEE15820014775A /* MathUGens.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0352B36D1CEE15820014775A /* MathUGens.swift */; };
038DF6451E5F2AE0003078A3 /* LyrebirdControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038DF6441E5F2AE0003078A3 /* LyrebirdControl.swift */; };
03A68E051D053A50004ED24F /* LyrebirdTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03A68E041D053A50004ED24F /* LyrebirdTimer.swift */; };
03A68E071D07E29D004ED24F /* LyrebirdListStream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03A68E061D07E29D004ED24F /* LyrebirdListStream.swift */; };
03AE398A1CE93C0D008B2E83 /* IOUgens.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03AE39891CE93C0D008B2E83 /* IOUgens.swift */; };
03CB1BFA1D2420C500B996EB /* TriggerUGens.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03CB1BF91D2420C500B996EB /* TriggerUGens.swift */; };
03D248951D0B0D8F009D3D87 /* LyrebirdClock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D248941D0B0D8F009D3D87 /* LyrebirdClock.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
0307E5671CFFC347002E5582 /* NoiseUGens.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NoiseUGens.swift; sourceTree = "<group>"; };
0307E5691CFFF219002E5582 /* LyrebirdRandomGenerator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdRandomGenerator.swift; sourceTree = "<group>"; };
0307E56B1D014C7E002E5582 /* FilterUGens.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterUGens.swift; sourceTree = "<group>"; };
031122AC1CE3868900D657CB /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
031122AD1CE3868900D657CB /* Lyrebird.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Lyrebird.h; sourceTree = "<group>"; };
031122AE1CE3868900D657CB /* LyrebirdAudioChannel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdAudioChannel.swift; sourceTree = "<group>"; };
031122AF1CE3868900D657CB /* LyrebirdConsts.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdConsts.swift; sourceTree = "<group>"; };
031122B01CE3868900D657CB /* LyrebirdControlChannel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdControlChannel.swift; sourceTree = "<group>"; };
031122B11CE3868900D657CB /* LyrebirdEngine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdEngine.swift; sourceTree = "<group>"; };
031122B21CE3868900D657CB /* LyrebirdFunctions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdFunctions.swift; sourceTree = "<group>"; };
031122B31CE3868900D657CB /* LyrebirdGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdGraph.swift; sourceTree = "<group>"; };
031122B41CE3868900D657CB /* LyrebirdMain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdMain.swift; sourceTree = "<group>"; };
031122B51CE3868900D657CB /* LyrebirdNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdNode.swift; sourceTree = "<group>"; };
031122B61CE3868900D657CB /* LyrebirdRawAudioChannel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdRawAudioChannel.swift; sourceTree = "<group>"; };
031122B71CE3868900D657CB /* LyrebirdTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdTypes.swift; sourceTree = "<group>"; };
031122B81CE3868900D657CB /* LyrebirdUgen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdUgen.swift; sourceTree = "<group>"; };
031122BB1CE3868900D657CB /* OscUGens.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OscUGens.swift; sourceTree = "<group>"; };
031122CC1CE386FF00D657CB /* ControlUGens.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ControlUGens.swift; sourceTree = "<group>"; };
0333C59D1D353CB600372C4B /* EnvelopeUGens.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EnvelopeUGens.swift; sourceTree = "<group>"; };
0333C59F1D36897500372C4B /* LyrebirdEnvelope.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdEnvelope.swift; sourceTree = "<group>"; };
0333C5A11D3B5DDD00372C4B /* DelayUGens.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DelayUGens.swift; sourceTree = "<group>"; };
0352B36D1CEE15820014775A /* MathUGens.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MathUGens.swift; sourceTree = "<group>"; };
038DF6441E5F2AE0003078A3 /* LyrebirdControl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdControl.swift; sourceTree = "<group>"; };
03A68E041D053A50004ED24F /* LyrebirdTimer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdTimer.swift; sourceTree = "<group>"; };
03A68E061D07E29D004ED24F /* LyrebirdListStream.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdListStream.swift; sourceTree = "<group>"; };
03AE39891CE93C0D008B2E83 /* IOUgens.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IOUgens.swift; sourceTree = "<group>"; };
03C77EA01CD6B20B003A753B /* Lyrebird.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Lyrebird.framework; sourceTree = BUILT_PRODUCTS_DIR; };
03C77F041CD9A99C003A753B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
03CB1BF91D2420C500B996EB /* TriggerUGens.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TriggerUGens.swift; sourceTree = "<group>"; };
03D248941D0B0D8F009D3D87 /* LyrebirdClock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdClock.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
03C77E9C1CD6B20B003A753B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
031122AA1CE3868900D657CB /* Lyrebird */ = {
isa = PBXGroup;
children = (
031122AC1CE3868900D657CB /* Info.plist */,
031122AD1CE3868900D657CB /* Lyrebird.h */,
031122AE1CE3868900D657CB /* LyrebirdAudioChannel.swift */,
03D248941D0B0D8F009D3D87 /* LyrebirdClock.swift */,
031122AF1CE3868900D657CB /* LyrebirdConsts.swift */,
038DF6441E5F2AE0003078A3 /* LyrebirdControl.swift */,
031122B01CE3868900D657CB /* LyrebirdControlChannel.swift */,
031122B11CE3868900D657CB /* LyrebirdEngine.swift */,
0333C59F1D36897500372C4B /* LyrebirdEnvelope.swift */,
031122B21CE3868900D657CB /* LyrebirdFunctions.swift */,
031122B31CE3868900D657CB /* LyrebirdGraph.swift */,
03A68E061D07E29D004ED24F /* LyrebirdListStream.swift */,
031122B41CE3868900D657CB /* LyrebirdMain.swift */,
031122B51CE3868900D657CB /* LyrebirdNode.swift */,
0307E5691CFFF219002E5582 /* LyrebirdRandomGenerator.swift */,
031122B61CE3868900D657CB /* LyrebirdRawAudioChannel.swift */,
03A68E041D053A50004ED24F /* LyrebirdTimer.swift */,
031122B71CE3868900D657CB /* LyrebirdTypes.swift */,
031122B81CE3868900D657CB /* LyrebirdUgen.swift */,
031122BA1CE3868900D657CB /* UGens */,
);
path = Lyrebird;
sourceTree = "<group>";
};
031122BA1CE3868900D657CB /* UGens */ = {
isa = PBXGroup;
children = (
031122CC1CE386FF00D657CB /* ControlUGens.swift */,
0307E56B1D014C7E002E5582 /* FilterUGens.swift */,
03AE39891CE93C0D008B2E83 /* IOUgens.swift */,
0352B36D1CEE15820014775A /* MathUGens.swift */,
0307E5671CFFC347002E5582 /* NoiseUGens.swift */,
031122BB1CE3868900D657CB /* OscUGens.swift */,
03CB1BF91D2420C500B996EB /* TriggerUGens.swift */,
0333C59D1D353CB600372C4B /* EnvelopeUGens.swift */,
0333C5A11D3B5DDD00372C4B /* DelayUGens.swift */,
);
path = UGens;
sourceTree = "<group>";
};
03C77E961CD6B20B003A753B = {
isa = PBXGroup;
children = (
031122AA1CE3868900D657CB /* Lyrebird */,
03C77F031CD9A99C003A753B /* LyrebirdSynthTests */,
03C77EA11CD6B20B003A753B /* Products */,
);
sourceTree = "<group>";
};
03C77EA11CD6B20B003A753B /* Products */ = {
isa = PBXGroup;
children = (
03C77EA01CD6B20B003A753B /* Lyrebird.framework */,
);
name = Products;
sourceTree = "<group>";
};
03C77F031CD9A99C003A753B /* LyrebirdSynthTests */ = {
isa = PBXGroup;
children = (
03C77F041CD9A99C003A753B /* Info.plist */,
);
path = LyrebirdSynthTests;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
03C77E9D1CD6B20B003A753B /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
031122BE1CE3868900D657CB /* Lyrebird.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
03C77E9F1CD6B20B003A753B /* Lyrebird */ = {
isa = PBXNativeTarget;
buildConfigurationList = 03C77EB41CD6B20B003A753B /* Build configuration list for PBXNativeTarget "Lyrebird" */;
buildPhases = (
03C77E9B1CD6B20B003A753B /* Sources */,
03C77E9C1CD6B20B003A753B /* Frameworks */,
03C77E9D1CD6B20B003A753B /* Headers */,
03C77E9E1CD6B20B003A753B /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Lyrebird;
productName = SwiftSynth;
productReference = 03C77EA01CD6B20B003A753B /* Lyrebird.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
03C77E971CD6B20B003A753B /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = Op133Studios;
TargetAttributes = {
03C77E9F1CD6B20B003A753B = {
CreatedOnToolsVersion = 7.3;
LastSwiftMigration = 0820;
};
};
};
buildConfigurationList = 03C77E9A1CD6B20B003A753B /* Build configuration list for PBXProject "Lyrebird" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 03C77E961CD6B20B003A753B;
productRefGroup = 03C77EA11CD6B20B003A753B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
03C77E9F1CD6B20B003A753B /* Lyrebird */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
03C77E9E1CD6B20B003A753B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
03C77E9B1CD6B20B003A753B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0333C59E1D353CB600372C4B /* EnvelopeUGens.swift in Sources */,
031122C81CE3868900D657CB /* LyrebirdTypes.swift in Sources */,
0307E56A1CFFF219002E5582 /* LyrebirdRandomGenerator.swift in Sources */,
031122C71CE3868900D657CB /* LyrebirdRawAudioChannel.swift in Sources */,
0333C5A01D36897500372C4B /* LyrebirdEnvelope.swift in Sources */,
0333C5A21D3B5DDD00372C4B /* DelayUGens.swift in Sources */,
031122CB1CE3868900D657CB /* OscUGens.swift in Sources */,
031122C21CE3868900D657CB /* LyrebirdEngine.swift in Sources */,
031122BF1CE3868900D657CB /* LyrebirdAudioChannel.swift in Sources */,
0352B36E1CEE15820014775A /* MathUGens.swift in Sources */,
031122CD1CE386FF00D657CB /* ControlUGens.swift in Sources */,
03D248951D0B0D8F009D3D87 /* LyrebirdClock.swift in Sources */,
0307E5681CFFC347002E5582 /* NoiseUGens.swift in Sources */,
031122C11CE3868900D657CB /* LyrebirdControlChannel.swift in Sources */,
03AE398A1CE93C0D008B2E83 /* IOUgens.swift in Sources */,
03A68E051D053A50004ED24F /* LyrebirdTimer.swift in Sources */,
038DF6451E5F2AE0003078A3 /* LyrebirdControl.swift in Sources */,
03CB1BFA1D2420C500B996EB /* TriggerUGens.swift in Sources */,
031122C41CE3868900D657CB /* LyrebirdGraph.swift in Sources */,
031122C31CE3868900D657CB /* LyrebirdFunctions.swift in Sources */,
031122C01CE3868900D657CB /* LyrebirdConsts.swift in Sources */,
031122C91CE3868900D657CB /* LyrebirdUgen.swift in Sources */,
03A68E071D07E29D004ED24F /* LyrebirdListStream.swift in Sources */,
031122C51CE3868900D657CB /* LyrebirdMain.swift in Sources */,
0307E56C1D014C7E002E5582 /* FilterUGens.swift in Sources */,
031122C61CE3868900D657CB /* LyrebirdNode.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
03C77EB21CD6B20B003A753B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
03C77EB31CD6B20B003A753B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
03C77EB51CD6B20B003A753B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
GCC_UNROLL_LOOPS = NO;
INFOPLIST_FILE = Lyrebird/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 15.0;
PRODUCT_BUNDLE_IDENTIFIER = com.op133studios.Lyrebird;
PRODUCT_NAME = Lyrebird;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
03C77EB61CD6B20B003A753B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_UNROLL_LOOPS = NO;
INFOPLIST_FILE = Lyrebird/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 15.0;
PRODUCT_BUNDLE_IDENTIFIER = com.op133studios.Lyrebird;
PRODUCT_NAME = Lyrebird;
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
03C77E9A1CD6B20B003A753B /* Build configuration list for PBXProject "Lyrebird" */ = {
isa = XCConfigurationList;
buildConfigurations = (
03C77EB21CD6B20B003A753B /* Debug */,
03C77EB31CD6B20B003A753B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
03C77EB41CD6B20B003A753B /* Build configuration list for PBXNativeTarget "Lyrebird" */ = {
isa = XCConfigurationList;
buildConfigurations = (
03C77EB51CD6B20B003A753B /* Debug */,
03C77EB61CD6B20B003A753B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 03C77E971CD6B20B003A753B /* Project object */;
}
@@ -1,99 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77E9F1CD6B20B003A753B"
BuildableName = "Lyrebird.framework"
BlueprintName = "Lyrebird"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77EA91CD6B20B003A753B"
BuildableName = "Lyrebird.xctest"
BlueprintName = "LyrebirdTests"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77E9F1CD6B20B003A753B"
BuildableName = "Lyrebird.framework"
BlueprintName = "Lyrebird"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77E9F1CD6B20B003A753B"
BuildableName = "Lyrebird.framework"
BlueprintName = "Lyrebird"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77E9F1CD6B20B003A753B"
BuildableName = "Lyrebird.framework"
BlueprintName = "Lyrebird"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>LyrebirdSynth.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>03C77E9F1CD6B20B003A753B</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>03C77EA91CD6B20B003A753B</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Op133Studios. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -1,18 +0,0 @@
//
// Lyrebird.h
// Lyrebird
//
// Created by Joshua Parmenter on 5/1/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for Lyrebird.
FOUNDATION_EXPORT double LyrebirdVersionNumber;
//! Project version string for Lyrebird.
FOUNDATION_EXPORT const unsigned char LyrebirdVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <Lyrebird/PublicHeader.h>
@@ -1,35 +0,0 @@
//
// LyrebirdAudioChannel.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/2/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
open class LyrebirdAudioChannel {
static var zeroedValues: [LyrebirdFloat] = []
fileprivate (set) open var index: LyrebirdInt = 0
open var currentValues: [LyrebirdFloat] = []
var touched: Bool = false
public required init(index: LyrebirdInt, blockSize: LyrebirdInt){
self.index = index
let count: LyrebirdInt = blockSize
if count != LyrebirdAudioChannel.zeroedValues.count {
LyrebirdAudioChannel.zeroedValues = [LyrebirdFloat](repeating: 0.0, count: Int(count))
}
touched = true
self.zeroValues()
}
public convenience init() {
self.init(index: 0, blockSize: 1024)
}
open func zeroValues(){
if touched {
currentValues = LyrebirdAudioChannel.zeroedValues
touched = false
}
}
}
@@ -1,66 +0,0 @@
//
// LyrebirdClock.swift
// Lyrebird
//
// Created by Joshua Parmenter on 6/10/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
public let LyrebirdDefaultClockResolution: LyrebirdFloat = 0.01
public struct LyrebirdScheduler {
var curTime: LyrebirdFloat
public var queue: [LyrebirdScheduledEvent]
public init(){
curTime = 0.0
queue = []
}
public mutating func updateCurTime(newCurTime: LyrebirdFloat) {
curTime = newCurTime
var indiciesToRemove: [Int] = []
if queue.count > 0 {
for index in 0 ..< queue.count {
var event = queue[index]
if curTime > event.startTime! {
event.run(curTime: curTime)
if let nextTime = event.nextTime {
event.startTime = curTime + nextTime
} else {
indiciesToRemove.append(index)
}
}
}
for index in indiciesToRemove {
queue.remove(at: index)
}
}
//print("\(queue)")
}
public mutating func addEventToQueue(event: LyrebirdScheduledEvent) {
queue.append(event)
}
}
public typealias LyrebirdEventBlock = (_ curTime: LyrebirdFloat, _ iteration: LyrebirdInt) -> LyrebirdFloat?
public struct LyrebirdScheduledEvent {
public var startTime: LyrebirdFloat?
var nextTime: LyrebirdFloat?
var eventBlock: LyrebirdEventBlock
public var iteration: LyrebirdInt
public init(startTime: LyrebirdFloat, eventBlock: @escaping LyrebirdEventBlock){
iteration = 0
self.startTime = startTime
self.eventBlock = eventBlock
}
mutating func run(curTime: LyrebirdFloat){
nextTime = eventBlock(curTime, iteration)
iteration = iteration + 1
}
}
@@ -1,12 +0,0 @@
//
// LyrebirdConsts.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/4/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
import Foundation
let M_TWOPI : LyrebirdFloat = M_PI * 2.0
let M_RTWOPI : LyrebirdFloat = 1.0 / (M_TWOPI)
@@ -1,50 +0,0 @@
//
// LyrebirdControl.swift
// Lyrebird
//
// Created by Joshua Parmenter on 2/23/17.
// Copyright © 2017 Op133Studios. All rights reserved.
//
class LyrebirdControl {
var currentValue: LyrebirdFloat = 0.0
fileprivate var lastValue: LyrebirdFloat = 0.0
var needsInterpolation: Bool = false
private var currentSamples: [LyrebirdFloat] = []
}
extension LyrebirdControl : LyrebirdValidUGenInput {
func calculatedSamples(graph: LyrebirdGraph?) -> [[LyrebirdFloat]] {
return [self.sampleBlock(graph: graph, previousValue: lastValue)]
}
func floatValue(graph: LyrebirdGraph?) -> LyrebirdFloat {
return currentValue
}
func intValue(graph: LyrebirdGraph?) -> LyrebirdInt {
return LyrebirdInt(currentValue)
}
// func needsInterpolation() -> Bool {
// return needsInterpolation
// }
func sampleBlock(graph: LyrebirdGraph?, previousValue: LyrebirdFloat) -> [LyrebirdFloat] {
let blockSize: Int = LyrebirdEngine.engine.blockSize
if lastValue == currentValue {
return Array<LyrebirdFloat>(repeatElement(currentValue, count: blockSize))
}
let step: LyrebirdFloat = (currentValue - lastValue) * LyrebirdEngine.engine.iBlockSize
var samples: [LyrebirdFloat] = Array<LyrebirdFloat>(repeatElement(currentValue, count: blockSize))
var interpValue: LyrebirdFloat = lastValue
for idx in 0 ... blockSize {
interpValue = interpValue + step
samples[idx] = interpValue
}
needsInterpolation = false
return samples
}
}
@@ -1,24 +0,0 @@
//
// LyrebirdControlChannel.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/2/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
open class LyrebirdControlChannel {
fileprivate (set) open var index: LyrebirdInt = 0
fileprivate var iBlockSize: LyrebirdFloat = 0.0
fileprivate (set) open var currentValues: LyrebirdFloat = 0.0
// use inverse of block size to make interpolation internally easier later
public required init(index: LyrebirdInt, iBlockSize: LyrebirdFloat){
self.index = index
self.iBlockSize = iBlockSize
}
public convenience init() {
// default iBlockSize of 1/64
self.init(index: 0, iBlockSize: 0.015625)
}
}
@@ -1,94 +0,0 @@
//
// LyrebirdEngine.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/1/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
protocol LyrebirdEngineDelegate {
func synthEngineHasStarted(engine: LyrebirdEngine)
func synthEngineHasStopped(engine: LyrebirdEngine)
}
typealias LyrebirdResultOutputBlock = (_ finished: Bool) -> Void
class LyrebirdEngine {
// initial default engine. This should act as a singleton however! Every init of LyrebirdEngine will overwrite this instance.
static var engine: LyrebirdEngine = LyrebirdEngine()
var delegate: LyrebirdEngineDelegate?
var isRunning : Bool = false
var numberOfAudioChannels : LyrebirdInt = 128
var numberOfControlChannels : LyrebirdInt = 2048
var blockSize : LyrebirdInt = 1024 {
didSet {
if(self.blockSize > 0){
self.iBlockSize = 1.0 / LyrebirdFloat(self.blockSize)
}
}
}
var sampleRate : LyrebirdFloat = 44100.0 {
didSet {
if(self.sampleRate > 0.0){
self.iSampleRate = 1.0 / sampleRate
}
}
}
var iBlockSize : LyrebirdFloat = 0.015625
var iSampleRate : LyrebirdFloat = 0.000022676
var audioBlock : [LyrebirdAudioChannel] = []
var controlBlock : [LyrebirdControlChannel] = []
var tree : LyrebirdNodeTree = LyrebirdNodeTree()
// need to
func start(){
if(!isRunning){
// allocate our memory
for idx: Int in 0 ..< numberOfAudioChannels {
let channel: LyrebirdAudioChannel = LyrebirdAudioChannel(index: idx, blockSize: blockSize)
self.audioBlock.append(channel)
}
for idx: Int in 0 ..< numberOfControlChannels-1 {
let channel: LyrebirdControlChannel = LyrebirdControlChannel(index: idx, iBlockSize: iBlockSize)
self.controlBlock.append(channel)
}
LyrebirdUGenInterface.initInterface()
isRunning = true
self.delegate?.synthEngineHasStarted(engine: self)
}
}
func stop(){
if(isRunning){
isRunning = false
self.delegate?.synthEngineHasStopped(engine: self)
}
}
func clearAll(){
tree = LyrebirdNodeTree()
}
func processWithInputChannels(inputChannels: [LyrebirdAudioChannel]){
for audioChannel: LyrebirdAudioChannel in self.audioBlock {
audioChannel.zeroValues()
}
// add input channels to the audio block
do {
try tree.processTree { (nodeTree, finished) in
// write to outputs
}
} catch LyrebirdTreeError.alreadyProcessing {
print("Already Processing")
} catch _ {
print("Throw on some Bootsy Collins, because something funky happened.")
}
}
func runTests(){
}
}
@@ -1,137 +0,0 @@
//
// LyrebirdEnvelope.swift
// Lyrebird
//
// Created by Joshua Parmenter on 7/13/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
public struct Segment {
let start: LyrebirdFloat
let end: LyrebirdFloat
let curve: LyrebirdFloat
let duration: LyrebirdFloat
// inverse of duration to avoid the divide later!
fileprivate let iDuration: LyrebirdFloat
fileprivate let isLine: Bool
public init(start: LyrebirdFloat, end: LyrebirdFloat, curve: LyrebirdFloat, duration: LyrebirdFloat = 0.0){
self.start = start
self.end = end
self.curve = curve
self.duration = duration
if(duration >= 0.0){
iDuration = 1.0 / duration
} else {
iDuration = 1.0
}
isLine = self.curve == 0.0
}
public func poll(atTime time: LyrebirdFloat) -> LyrebirdFloat {
if duration <= 0 || time <= 0.0 {
return start
}
if time >= duration {
return end
}
let timeRatio: LyrebirdFloat = (time * iDuration)
if isLine {
return ((end - start) * timeRatio) + start
}
let denom: LyrebirdFloat = 1.0 - exp(curve)
let numer: LyrebirdFloat = 1.0 - exp(timeRatio * curve)
let level: LyrebirdFloat = start + ((end - start) * (numer/denom))
return level
}
}
public struct Envelope {
let segments: [Segment]
fileprivate let segmentStarts: [LyrebirdFloat]
fileprivate let segmentEnds: [LyrebirdFloat]
public init (segments: [Segment]){
self.segments = segments
var localStarts: [LyrebirdFloat] = []
var localEnds: [LyrebirdFloat] = []
var curTime = 0.0
for segment in self.segments {
localStarts.append(curTime)
curTime = curTime + segment.duration
localEnds.append(curTime)
}
segmentStarts = localStarts
segmentEnds = localEnds
}
public init (levels: [LyrebirdFloat], durations: [LyrebirdFloat], curves: [LyrebirdFloat]){
// levels should have one more value than durations and curves
var localSegments: [Segment] = []
let levelsCount = levels.count
let durAndCurvesNeededSize = levelsCount - 1
let durationCount = durations.count
let curvesCount = curves.count
var durationsCopy = durations
// first some checks ...
let neededDurationValues = durAndCurvesNeededSize - durationCount
if neededDurationValues > 0 {
let lastValue: LyrebirdFloat = durations.last ?? 1.0
for _ in 0 ... neededDurationValues {
durationsCopy.append(lastValue)
}
}
var curvesCopy = curves
let neededCurvesValue = durAndCurvesNeededSize - curvesCount
if neededCurvesValue > 0 {
let lastValue: LyrebirdFloat = curves.last ?? 0.0
for _ in 0 ... neededCurvesValue {
curvesCopy.append(lastValue)
}
}
for endIdx in 1 ..< levels.count {
let idx = endIdx - 1
let start = levels[idx]
let end = levels[endIdx]
let duration = durationsCopy[idx]
let curve = curvesCopy[idx]
let segment = Segment(start: start, end: end, curve: curve, duration: duration)
localSegments.append(segment)
}
self.init(segments: localSegments)
}
public init (levels: [LyrebirdFloat], duration: LyrebirdFloat, curves: [LyrebirdFloat]){
self.init(levels: levels, durations: [duration], curves: curves)
}
public init (levels: [LyrebirdFloat], durations: [LyrebirdFloat], curve: LyrebirdFloat){
self.init(levels: levels, durations: durations, curves: [curve])
}
public init (levels: [LyrebirdFloat], duration: LyrebirdFloat, curve: LyrebirdFloat){
self.init(levels: levels, durations: [duration], curves: [curve])
}
public func poll(atTime time: LyrebirdFloat) -> LyrebirdFloat {
if segments.count < 1 {
return 0.0
}
var localTime = time
var lastSegment: Segment?
var lastDuration = 0.0
for segment in segments {
localTime = localTime - lastDuration
lastSegment = segment
if localTime > segment.duration {
lastDuration = segment.duration
} else {
break
}
}
return lastSegment?.poll(atTime: localTime) ?? 0.0
}
}
@@ -1,131 +0,0 @@
//
// LyrebirdFunctions.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/4/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
import Foundation
public class LyrebirdFunctions {
public static func linearInterp(x1: LyrebirdFloat, x2: LyrebirdFloat, pct: LyrebirdFloat) -> LyrebirdFloat {
return x1 + ((x2 - x1) * pct)
}
// returns a value for a point between y0 and y1
public static func cubicInterp(ym1: LyrebirdFloat, y0: LyrebirdFloat, y1: LyrebirdFloat, y2: LyrebirdFloat, pct: LyrebirdFloat) -> LyrebirdFloat
{
let c0 = y0;
let c1 = (0.5 * (y1 - ym1));
let c2 = ym1 - (2.5 * y0) + (2.0 * y1) - (0.5 * y2);
let c3 = (0.5 * (y2 - ym1)) + (1.5 * (y0 - y1));
return (((((c3 * pct) + c2) * pct) + c1) * pct) + c0;
}
public static func calcSlope(startValue: LyrebirdFloat, endValue: LyrebirdFloat) -> LyrebirdFloat {
return (endValue - startValue) * Lyrebird.engine.iBlockSize
}
public static func calcSlope(startValue: LyrebirdFloat, endValue: LyrebirdFloat, numSamples: LyrebirdFloat) -> LyrebirdFloat {
if numSamples != 0.0 {
return (endValue - startValue) / numSamples
} else {
return 0.0
}
}
public static func interpolatedSampleBlock(startValue: LyrebirdFloat, endValue: LyrebirdFloat) -> [LyrebirdFloat] {
var start: LyrebirdFloat = startValue
let blockSize: LyrebirdInt = Lyrebird.engine.blockSize
if(startValue == endValue){
let block: [LyrebirdFloat] = [LyrebirdFloat](repeating: startValue, count: blockSize )
return block
}
var block: [LyrebirdFloat] = [LyrebirdFloat](repeating: 0.0, count: blockSize )
let slope = calcSlope(startValue: startValue, endValue: endValue)
for idx in 0 ..< blockSize {
start = start + slope
block[idx] = start
}
return block
}
public static func sineLookup(sampleIdx: LyrebirdFloat, mask: LyrebirdInt, table: [LyrebirdFloat]) -> LyrebirdFloat {
let floorIdx: LyrebirdFloat = floor( sampleIdx)
let iIndexOne: LyrebirdInt = LyrebirdInt( floorIdx ) & mask
let iIndexTwo: LyrebirdInt = LyrebirdInt( ceil( sampleIdx) ) & mask
let pct: LyrebirdFloat = sampleIdx - floorIdx
let valOne = table[iIndexOne]
let valTwo = table[iIndexTwo]
let returnVal = LyrebirdFunctions.linearInterp(x1: valOne, x2: valTwo, pct: pct)
return returnVal
}
public static func db_linamp(db: LyrebirdFloat) -> LyrebirdFloat {
return pow(10.0, db * 0.05)
}
public static func linamp_db(linamp: LyrebirdFloat) -> LyrebirdFloat {
return log10(linamp) * 20.0
}
public static func keynum_hz(keynum: LyrebirdFloat) -> LyrebirdFloat {
return 440.0 * pow(2.0, (keynum - 69.0) * 0.08333333333333333333333333)
}
public static func hz_keynum(hz: LyrebirdFloat) -> LyrebirdFloat {
return (log2(hz * 0.002272727272727272727272727) * 12.0) + 69.0;
}
public static func midi_ratio(midi: LyrebirdFloat) -> LyrebirdFloat {
return pow(2.0, midi * 0.08333333333333333333333333);
}
public static func ratio_midi(ratio: LyrebirdFloat) -> LyrebirdFloat {
return 12.0 * log2(ratio)
}
public static func reciprocal(value: LyrebirdFloat) -> LyrebirdFloat {
return 1.0 / value
}
public static func isPowerOfTwo(value: LyrebirdInt) -> Bool {
let nextPowTwo = nextPowerOfTwo(value: value)
return value == nextPowTwo
}
public static func nextPowerOfTwo(value: LyrebirdInt) -> LyrebirdInt {
let n = LyrebirdFloat(value)
let nextPowTwo = pow(2, ceil(log2(n)))
return LyrebirdInt(nextPowTwo)
}
// MARK: functions to work on audio values and signals (retain sign for negative values)
public static func sig_sqrt(value: LyrebirdFloat) -> LyrebirdFloat {
if value >= 0.0 {
return sqrt(value)
} else {
return -sqrt(-value)
}
}
public static func feedbackCoef(delayTime: LyrebirdFloat, decayTime: LyrebirdFloat, targetDB: LyrebirdFloat = -60.0) -> LyrebirdFloat {
let targetAmp = LyrebirdFunctions.db_linamp(db: targetDB)
return feedbackCoef(delayTime: delayTime, decayTime: decayTime, targetAmp: targetAmp)
}
public static func feedbackCoef(delayTime: LyrebirdFloat, decayTime: LyrebirdFloat, targetAmp: LyrebirdFloat = 0.001) -> LyrebirdFloat {
if decayTime == 0.0 {
return 0.0
}
return exp((log(targetAmp) * delayTime) / decayTime)
}
}
@@ -1,80 +0,0 @@
//
// LyrebirdGraph.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/3/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
import Foundation
public typealias LyrebirdGraphConstructionClosure = () -> Void
/**
Represents a single model for a synthesis graph. Create LyrebirdNotes to play an instance of a graph
*/
open class LyrebirdGraph {
static var currentBuildingGraph: LyrebirdGraph? = nil
/// ---
/// the graph's children.
///
/// graphs will iterate over their children in order to calculate samples
open var children : [LyrebirdUGen] = []
// parameters act as arguments that can vary for each instance of a graph
open var parameters : [String: LyrebirdValidUGenInput] = [:]
private var parameterControls : [String : LyrebirdControl] = [:]
// private var previousParameters: [String: LyrebirdValidUGenInput] = [:]
// private var currentParameterValues: [String : [LyrebirdValidUGenInput]] = [:]
open var buildClosure : LyrebirdGraphConstructionClosure?
open var shouldRemoveFromTree: Bool = false
open weak var note: LyrebirdNote?
public init(){
}
func next(numSamples: LyrebirdInt){
// currentParameterValues.removeAll()
for ugen: LyrebirdUGen in children {
ugen.nextBlock(numSamples: numSamples, graph: self)
}
// set up for next run
prepareChildren()
if( shouldRemoveFromTree ){
note?.shouldFree = true
}
}
fileprivate func prepareChildren() {
for child: LyrebirdUGen in children {
child.needsCalc = true
}
}
internal func addChild(child: LyrebirdUGen){
children.append(child)
//child.graph = self
}
// closure should refer to the graph, assign children and refer to args
// TODO:: but a lock on currentGraphBuilding
open func build (closure: @escaping LyrebirdGraphConstructionClosure) {
buildClosure = closure
LyrebirdGraph.currentBuildingGraph = self
closure()
LyrebirdGraph.currentBuildingGraph = nil
}
open func copyGraph() -> LyrebirdGraph {
let copy: LyrebirdGraph = LyrebirdGraph()
if let buildClosure: LyrebirdGraphConstructionClosure = buildClosure {
copy.build(closure: buildClosure)
}
return copy
}
}
@@ -1,90 +0,0 @@
//
// LyrebirdListStream.swift
// Lyrebird
//
// Created by Joshua Parmenter on 6/7/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
open class LyrebirdStream {
var finished: Bool = false
open func reset() {
finished = false
}
}
open class LyrebirdListStream : LyrebirdStream {
let list: [LyrebirdNumber]
fileprivate (set) open var offset: LyrebirdInt
fileprivate let listSize: LyrebirdInt
fileprivate let initialOffset: LyrebirdInt
open override func reset(){
super.reset()
offset = initialOffset
}
public init(list: [LyrebirdNumber] = [], offset: LyrebirdInt = 0){
self.list = list
self.offset = offset
self.initialOffset = offset
self.listSize = list.count
super.init()
}
/*
public override convenience init(){
self.init(list: [], offset: 0)
}
*/
open func next() -> LyrebirdNumber? {
if offset >= listSize {
finished = true
return nil
}
let returnValue = list[offset]
offset = (offset + 1)
return returnValue
}
}
open class Sequence : LyrebirdListStream {
}
open class LyrebirdRepeatableListStream : LyrebirdListStream {
let repeats: LyrebirdInt
fileprivate var repetition: LyrebirdInt = 0
public init(list: [LyrebirdNumber] = [], repeats: LyrebirdInt = 0, offset: LyrebirdInt = 0){
self.repeats = repeats
super.init(list: list, offset: offset)
}
open override func reset(){
super.reset()
repetition = 0
}
open override func next() -> LyrebirdNumber? {
guard !finished else {
return nil
}
if repetition > repeats {
finished = true
return nil
}
let returnValue = list[offset]
offset = (offset + 1) % listSize
if offset == initialOffset {
repetition = repetition + 1
}
return returnValue
}
}
open class LoopingSequence : LyrebirdRepeatableListStream {
}
@@ -1,191 +0,0 @@
//
// Lyrebird.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/1/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
open class Lyrebird {
/// ---
/// The number of audio channels (physical and internal) to support
///
/// - Warning: keep these values as powers of 2 for efficiency reasons!
fileprivate (set) open var numberOfAudioChannels : LyrebirdInt
/// ---
/// number of physical input channels to account for
///
fileprivate (set) open var numberOfInputChannels : LyrebirdInt
/// ---
/// number of physical output channels to account for
///
fileprivate (set) open var numberOfOutputChannels : LyrebirdInt
/// ---
/// The number of control channels to support
///
/// - Warning: keep these values as powers of 2 for efficiency reasons!
fileprivate (set) open var numberOfControlChannels : LyrebirdInt
/// ---
/// The number of wires for Graph audio communication
///
/// - Warning: keep these values as powers of 2 for efficiency reasons!
fileprivate (set) open var numberOfWires : LyrebirdInt
/// ---
/// The size of the internal control block
///
/// - Warning: keep these values as powers of 2 for efficiency reasons!
/// - Warning: this is NOT the size of the system callback size. This is internal only
fileprivate (set) open var blockSize : LyrebirdInt {
didSet {
self.iBlockSize = 1.0 / LyrebirdFloat(blockSize)
}
}
/// ---
/// A scaler for calculating steps for interpolation across control periods
///
fileprivate var iBlockSize : LyrebirdFloat = 1.0
/// ---
/// The audio sample rate, in HZ, the system is running at shuld be used for internal calculations
///
fileprivate (set) open var sampleRate : LyrebirdFloat = 44100.0
fileprivate (set) open var iSampleRate : LyrebirdFloat = 0.000022676
/// ---
/// The processing engine
///
static let engine : LyrebirdEngine = LyrebirdEngine.engine
/**
Designated initializer for the main synth environment.
- parameter numberOfAudioChannels: the number of audio channels to allocate memory for
- parameter numberOfInputChannels: the number of physical input channels to reserve space for
- parameter numberOfOutputChannels: the number of physical output channels to reserve space for
- parameter numberOfControlChannels: the number of control channels to allocate
- parameter numberOfWires: the number of audio wires to allocate, which is the limit for the number of interconnects in a graph
- parameter internalMemoryPoolSize: the size of the preallocated internal memory pool for fast allocation
- parameter controlBlockSize: the internal
- Returns:
- Throws:
*/
public required init(numberOfAudioChannels: LyrebirdInt,
numberOfInputChannels: LyrebirdInt,
numberOfOutputChannels: LyrebirdInt,
numberOfControlChannels: LyrebirdInt,
sampleRate: LyrebirdFloat,
numberOfWires: LyrebirdInt,
blockSize: LyrebirdInt
){
self.numberOfAudioChannels = numberOfAudioChannels
self.numberOfInputChannels = numberOfInputChannels
self.numberOfOutputChannels = numberOfOutputChannels
self.numberOfControlChannels = numberOfControlChannels
self.numberOfWires = numberOfWires
self.blockSize = blockSize
self.sampleRate = sampleRate
self.iSampleRate = 1.0 / sampleRate
self.iBlockSize = 1.0 / LyrebirdFloat(self.blockSize)
Lyrebird.engine.numberOfAudioChannels = self.numberOfAudioChannels
Lyrebird.engine.numberOfControlChannels = self.numberOfControlChannels
Lyrebird.engine.blockSize = self.blockSize
Lyrebird.engine.iBlockSize = self.iBlockSize
startEngine()
}
public convenience init() {
self.init(numberOfAudioChannels: 128,
numberOfInputChannels: 2,
numberOfOutputChannels: 2,
numberOfControlChannels: 256,
sampleRate: 44100.0,
numberOfWires: 256,
blockSize: 64)
}
open func startEngine(){
Lyrebird.engine.delegate = self
Lyrebird.engine.start()
}
open func stopEngine(){
Lyrebird.engine.delegate = self
Lyrebird.engine.stop()
}
open func runTests(){
Lyrebird.engine.runTests()
}
open func addNodeToHead(node: LyrebirdNode?){
if let node = node {
Lyrebird.engine.tree.defaultGroup.addNodeToHead(node: node)
}
}
open func addNodeToTail(node: LyrebirdNode?){
if let node = node {
Lyrebird.engine.tree.defaultGroup.addNodeToTail(node: node)
}
}
open func createParallelGroup() -> LyrebirdParallelGroup {
let group = LyrebirdParallelGroup()
Lyrebird.engine.tree.addParallelGroup(parallelGroup: group)
return group
}
open func removeParallelGroup(parallelGroup: LyrebirdParallelGroup){
Lyrebird.engine.tree.removeParallelGroup(parallelGroup: parallelGroup)
}
open func freeAll(){
Lyrebird.engine.tree.freeAll()
}
open func processWithInputChannels(inputChannels: [LyrebirdAudioChannel]){
Lyrebird.engine.processWithInputChannels(inputChannels: inputChannels)
}
open func audioBlocks() -> [LyrebirdAudioChannel] {
return Lyrebird.engine.audioBlock
}
}
extension Lyrebird: LyrebirdEngineDelegate {
func synthEngineHasStarted(engine: LyrebirdEngine) {
print("Engine started!")
// if let inputChannels : [LyrebirdAudioChannel] = audioBlock[0 ..< 1] as? [LyrebirdAudioChannel] {
// engine.processWithInputChannels(inputChannels) { (finished) in
// print("\(finished)")
// }
// }
}
func synthEngineHasStopped(engine: LyrebirdEngine) {
print("Engine quit!")
}
}
@@ -1,327 +0,0 @@
//
// LyrebirdNode.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/2/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
public enum LyrebirdTreeError : Error {
case alreadyProcessing
}
public typealias LyrebirdNodeTreeCompletionBlock = (_ nodeTree: LyrebirdNodeTree, _ finished: Bool) -> Void
typealias LyrebirdParallelGroupCompletionBlock = () -> Void
typealias LyrebirdInternalTreeCompletionBlock = () -> Void
/**
LyrebirdNodeTree handles the main interaction with order of execution, and signal processing
*/
open class LyrebirdNodeTree {
/// ---
/// The single Node in the system which contains any parallel groups of nodes to be processed
///
/// This node can be replaced with a new LyrebirdRootNode to completely clear all processing!
fileprivate var root: LyrebirdRootNode = LyrebirdRootNode() {
didSet {
defaultGroup = root.parallelGroups[0].rootGroup
}
}
//TODO:: make this a group that can only add head or tail - all other groups can have groups or nodes placed before or after them
/// ---
/// Stores a reference to a default group that can be quickly accessed
///
/// For many applications, adding notes to the head of the defaultGroup should do what you need. If you don't add any ParallelGroups, build your tree by adding nodes into this group
open var defaultGroup: LyrebirdGroup
/// ---
/// prevents the tree from being processed twice at the same time
fileprivate var processing: Bool = false
public init(){
defaultGroup = root.parallelGroups[0].rootGroup
}
/**
Processes all ParallelGroups, and their children
- parameter completion: a block to execute when the control period has finished processing
*/
open func processTree(completion: @escaping LyrebirdNodeTreeCompletionBlock) throws {
if !processing {
processing = true
root.processTree(completion: {
self.processing = false
completion(self, true)
})
} else {
throw LyrebirdTreeError.alreadyProcessing
}
}
/**
Removes ALL groups and nodes from the processing chain.
- Warning: Seriously - this invalidates all references to notes, groups and nodes you previously had. Use it if you mean it.
*/
open func freeAll(){
root = LyrebirdRootNode()
}
/**
Adds a new ParallelGroup to the processing chain
- parameter parallelGroup:
*/
open func addParallelGroup(parallelGroup: LyrebirdParallelGroup){
root.addParallelGroup(parallelGroup: parallelGroup)
}
/**
removes a new ParallelGroup from the processing chain
- parameter parallelGroup:
*/
open func removeParallelGroup(parallelGroup: LyrebirdParallelGroup){
root.removeParallelGroup(parallelGroup: parallelGroup)
}
}
class LyrebirdRootNode {
fileprivate var parallelGroups : [LyrebirdParallelGroup] = [LyrebirdParallelGroup()]
func addParallelGroup(parallelGroup: LyrebirdParallelGroup){
parallelGroups.append(parallelGroup)
}
func removeParallelGroup(parallelGroup: LyrebirdParallelGroup){
// if let index: Int = parallelGroups.indexOf(parallelGroup) {
// parallelGroups.removeAtIndex(index)
// }
}
func processTree(completion: @escaping LyrebirdInternalTreeCompletionBlock ){
for parallelGroup: LyrebirdParallelGroup in parallelGroups {
parallelGroup.processParallelGroup(completion: {
let allDone: Bool = self.isFinished()
if allDone {
completion()
}
})
}
}
fileprivate func isFinished() -> Bool {
var allDone: Bool = true
for parallelGroup: LyrebirdParallelGroup in parallelGroups {
if !parallelGroup.finished {
allDone = false
break
}
}
return allDone
}
}
// represents a thread independent node of values to process
open class LyrebirdParallelGroup {
static var index: Int = 0
var finished : Bool = true
open var rootGroup : LyrebirdGroup = LyrebirdGroup()
lazy var queue : DispatchQueue = {
let name = "Lyrebird dispatch \(LyrebirdParallelGroup.index)"
LyrebirdParallelGroup.index = LyrebirdParallelGroup.index + 1
return DispatchQueue(label: "Lyrebird dispatch")
}()
func processParallelGroup(completion: @escaping LyrebirdParallelGroupCompletionBlock){
queue.sync {
self.rootGroup.processChildren()
completion()
}
}
}
public typealias LyrebirdNodeFinishBlock = (_ node: LyrebirdNode) -> Void
open class LyrebirdNode {
var nextNode : LyrebirdNode?
var previousNode : LyrebirdNode?
var parent : LyrebirdGroup?
open var finishBlock : LyrebirdNodeFinishBlock?
open func addNodeAfter(node: LyrebirdNode?){
if let node = node {
if let nextNode: LyrebirdNode = node.nextNode {
node.nextNode = nextNode
nextNode.previousNode = node
}
self.nextNode = node
node.previousNode = node
node.parent = self.parent
}
}
open func addNodeBefore(node: LyrebirdNode?){
if let node = node {
if let previousNode: LyrebirdNode = self.previousNode {
node.previousNode = previousNode
previousNode.nextNode = node
}
node.nextNode = self
self.previousNode = node
node.parent = self.parent
}
}
open func next(numSamples: LyrebirdInt){
}
open func free(){
if let previousNode = previousNode {
previousNode.nextNode = nextNode
} else {
parent?.nextNode = nextNode
}
finishBlock?(self)
}
}
open class LyrebirdGroup: LyrebirdNode {
open func addNodeToHead(node: LyrebirdNode?){
if let node = node {
node.nextNode = nextNode
nextNode?.previousNode = node
nextNode = node
node.parent = self
}
}
open func addNodeToTail(node: LyrebirdNode?){
if let node = node {
if var finalNode: LyrebirdNode = nextNode {
while finalNode.nextNode != nil {
finalNode = finalNode.nextNode!
}
finalNode.nextNode = node
node.previousNode = finalNode
return
}
nextNode = node
node.parent = self
}
}
open func processChildren(){
var node: LyrebirdNode? = nextNode
let blockSize = Lyrebird.engine.blockSize
while node != nil {
// get the CURRENT next node
let tmp = node?.nextNode
node?.next(numSamples: blockSize)
node = tmp
}
}
}
/**
A note represents an instance of a graph. When the node tree is traversed, the next function is called on the graph AFTER parameters are updated (if any need to be)
*/
open class LyrebirdNote: LyrebirdNode {
/// ---
/// The graph representing this note
///
/// - Warning: a COPY of the graph you supply is used for each note. Any values that change in the parameter for the graph will update only for that instance
open var graph : LyrebirdGraph
/// ---
/// by default, nodes that are added to the node tree will calculate samples
///
/// setting 'running' to false can keep the node in the tree, but keep if from calculating its samples
var running : Bool = true
fileprivate var processing : Bool = false
fileprivate var queuedParameterChanges : [String: LyrebirdValidUGenInput] = [:]
fileprivate var hasQueuedChanges : Bool = false
open var outputOffsetSamples : LyrebirdInt = 0
open var shouldFree : Bool = false
public required init(graph: LyrebirdGraph?){
if let graphCopy: LyrebirdGraph = graph?.copyGraph() {
self.graph = graphCopy
} else {
self.graph = LyrebirdGraph()
}
super.init()
self.graph.note = self
}
public override convenience init(){
self.init(graph: LyrebirdGraph())
}
open func updateParameter(key: LyrebirdKey, value: LyrebirdValidUGenInput){
if !processing {
self.graph.parameters[key] = value
} else {
hasQueuedChanges = true
queuedParameterChanges[key] = value
}
}
override open func next(numSamples: LyrebirdInt){
if running {
// prevent processing if, for some reason, it already is
if !processing {
if outputOffsetSamples > numSamples {
outputOffsetSamples = outputOffsetSamples - numSamples
return
}
processing = true
if (outputOffsetSamples > 0){
let sampleCount = numSamples - outputOffsetSamples
outputOffsetSamples = 0
self.graph.next(numSamples: sampleCount)
} else {
self.graph.next(numSamples: numSamples)
}
processing = false
if hasQueuedChanges {
for (key, value) in queuedParameterChanges {
self.updateParameter(key: key, value: value)
}
hasQueuedChanges = false
queuedParameterChanges.removeAll()
}
// shouldFree can be set by a notes processing function internally
// such as after envelopes finish
if shouldFree {
self.free()
}
}
}
}
}
@@ -1,56 +0,0 @@
//
// LyrebirdRandomGenerator.swift
// Lyrebird
//
// Created by Joshua Parmenter on 6/1/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
open class LyrebirdRandomNumberGenerator {
open var seed: UInt32 = 0 {
didSet {
updateSeedGen()
}
}
fileprivate var seedGen: [UInt16] = [0, 0, 0]
fileprivate func updateSeedGen(){
var seedArr: [UInt16] = [0, 0, 0]
for idx in 0...1 {
seedArr[2 - idx] = UInt16(0x000FFF & seed >> UInt32(idx * 8))
}
seedGen = seedArr
}
public init(initSeed: UInt32? = nil){
//Int.random(in: <#T##ClosedRange<Int>#>)
seed = initSeed ?? UInt32(Date.timeIntervalSinceReferenceDate)
updateSeedGen()
}
open func next() -> LyrebirdFloat {
return erand48(&seedGen)
}
open func bipolarNext() -> LyrebirdFloat {
return (erand48(&seedGen) * 2.0) - 1.0
}
}
open class RandWhite {
fileprivate var randGen: LyrebirdRandomNumberGenerator
var lower: LyrebirdNumber
var upper: LyrebirdNumber
var difference: LyrebirdFloat
public init(initSeed: UInt32? = nil, lower: LyrebirdNumber = 0.0, upper: LyrebirdNumber = 1.0){
randGen = LyrebirdRandomNumberGenerator(initSeed: initSeed)
self.lower = lower
self.upper = upper
self.difference = (upper.numberValue() - lower.numberValue())
}
open func next() -> LyrebirdNumber {
return (randGen.next() * difference) + lower.numberValue()
}
}
@@ -1,12 +0,0 @@
//
// LyrebirdRawAudioChannel.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/3/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
class LyrebirdRawAudioChannel {
}
@@ -1,165 +0,0 @@
//
// LyrebirdTimer.swift
// Lyrebird
//
// Created by Joshua Parmenter on 6/5/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
/**
A function wrapper for queued delays
- parameter delay: in Seconds
- parameter queue: the dispatch queue to schedule on
- parameter closure: the block to evaluate
- Returns: nothing
*/
func delay(delay: Double, queue: DispatchQueue, closure: @escaping ()->()) {
queue.asyncAfter(
deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC),
execute: closure
)
}
/**
The block structure used for LyrebirdTimer's repeated function.
Well, crap, this needs to be clock independant - so it can be scheduled on RT and NRT fashions. crap crap crap
- parameter curTime: The current time, in seconds, since execution of the timer began
- parameter inc: The number of times (0 based) that the timer has executed this block
- Returns: Optional LyrebirdFloat in seconds. If the block returns a value greater than 0.0, execution of the block is scheduled for repeition
*/
public typealias LyrebirdTimerBlock = (_ curTime: LyrebirdFloat, _ inc: LyrebirdInt) -> LyrebirdFloat?
/**
The block structure used for LyrebirdTimer's finalizer function. This block is fired once and only once as the LyrebirdTimerBlock either returns nil or <= 0.0 for repeptiion, or when the block is removed
- parameter curTime: The current time, in seconds, since execution of the timer began
- Returns: Nothing
*/
public typealias LyrebirdTimerFinalizerBlock = (_ curTime: LyrebirdFloat) -> Void
/**
The base class for handling timed and repeated execution of a block
*/
public final class LyrebirdTimer {
/// ---
/// the closure the execute every time the timer runs. If the optional return is a float > 0.0, repeition is scheduled for that time in seconds
///
public var block: LyrebirdTimerBlock? = nil
/// ---
/// a closure to be executed when no repetitions are scheduled OR if the block has been removed from this instance of a LyrebirdTimer
///
public var finalizerBlock: LyrebirdTimerFinalizerBlock? = nil
/// ---
/// The time in seconds to delay the start of the timer execution.
///
/// Note: This time is NOT included in the curTime value passed in to a LyrebirdTimerBlock
public var delayStartTime: LyrebirdFloat = 0.0
/// ---
/// The internal start time for the execution of the first iteration of the block
///
fileprivate var startTime: LyrebirdFloat = -1.0
/// ---
/// The name of this instance's thread that is visible in stack traces and debugging
///
fileprivate var idString: String = "LyrebirdTimer"
/// ---
/// The queue for this thread.
///
/// Note: LyrebirdTimer threads are concurrent.
fileprivate var queue: DispatchQueue
/// ---
/// Internal keeper for the number of iterations of the block that have been performed.
///
/// Note: The incrementer is zero based
fileprivate var inc: LyrebirdInt = 0
/// ---
/// A time stamp to compare to actual execution time. Differences between this and actual time will be removed during scheduling of the next repeition
///
fileprivate var nextExpectedTime: LyrebirdFloat = 0.0
/**
Convenience init that uses a 0.0 delay time and a default idString
- parameter none:
*/
public convenience init(){
self.init(delayStartTime: 0.0, idString: "LyrebirdTimer")
}
/**
Custom init that uses a given delay time and a custom idString
- parameter delayStartTime: in seconds, the initial amount of time to wait before performing blocks
- parameter idString: a custom identifier that helps find a thread in debugging tools or stack traces
Note: the delayStartTime is NOT included in the curTime values passed into the blocks that are run. curTime starts at 0.0
*/
public required init(delayStartTime: LyrebirdFloat, idString: String){
self.idString = idString
self.delayStartTime = delayStartTime
queue = DispatchQueue(label: self.idString, attributes: DispatchQueue.Attributes.concurrent)
let q: DispatchQueue = DispatchQueue.global(priority: DispatchQueue.GlobalQueuePriority.low)
//queue.setTarget(queue: q)
}
/**
Starts execution of the timer. The first block will be performed after any delayStartTime
- parameter none:
*/
public final func run() {
delay(delay: self.delayStartTime, queue: queue) {
if (self.startTime < 0.0) {
self.startTime = Date.timeIntervalSinceReferenceDate
self.nextExpectedTime = 0.0
}
self.next()
}
}
/**
The internal method that the internal thread fires over again. If a block returns a float greater than 0.0, the thread is scheduled for another execution. Because of execution time of the block and other timing considerations, the next function also tries to figure out how much error there is between the expected run time of a block, and compensates for it on the next iteration.
- parameter none:
*/
fileprivate final func next() {
let curTime = Date.timeIntervalSinceReferenceDate - self.startTime
let error = self.nextExpectedTime - curTime
if let block = block {
let nextTime: LyrebirdFloat? = block(curTime, self.inc)
if let nextTime = nextTime {
self.inc = self.inc + 1
self.nextExpectedTime = self.nextExpectedTime + nextTime
let now = Date.timeIntervalSinceReferenceDate - self.startTime
let delayTime = (nextTime - (now - curTime)) + error
delay(delay: delayTime, queue: queue, closure: { self.next() })
} else {
finalizerBlock?(curTime)
}
} else {
finalizerBlock?(0.0)
}
}
}
@@ -1,235 +0,0 @@
//
// LyrebirdTypes.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/2/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
public typealias LyrebirdInt = Int
public typealias LyrebirdFloat = Double
public typealias LyrebirdKey = String
public typealias LyrebirdFloatClosureBody = (_ graph: LyrebirdGraph?, _ currentPoint: LyrebirdFloat?) -> LyrebirdFloat
struct LyrebirdValue {
}
public protocol LyrebirdNumber {
func numberValue(graph: LyrebirdGraph?) -> LyrebirdFloat
func numberValue() -> LyrebirdFloat
func valueAtPoint(graph: LyrebirdGraph?, point: LyrebirdNumber) -> LyrebirdFloat
func valueAtPoint(point: LyrebirdNumber) -> LyrebirdFloat
}
extension LyrebirdNumber {
public func valueAtPoint(graph: LyrebirdGraph?, point: LyrebirdNumber) -> LyrebirdFloat {
//var currentPoint = point.numberValue(graph)
return self.numberValue(graph: graph)
}
public func valueAtPoint(point: LyrebirdNumber) -> LyrebirdFloat {
return self.valueAtPoint(graph: nil, point: point)
}
public func numberValue() -> LyrebirdFloat {
return self.numberValue(graph: nil)
}
}
protocol LyrebirdFloatUGenValue {
}
public struct LyrebirdFloatClosure {
public var closure : LyrebirdFloatClosureBody?
public init(closure: @escaping LyrebirdFloatClosureBody){
self.closure = closure
}
}
extension LyrebirdFloatClosure : LyrebirdValidUGenInput {
public func calculatedSamples(graph: LyrebirdGraph?) -> [[LyrebirdFloat]] {
let float = closure?(graph, nil) ?? 0.0
let returnValues = [LyrebirdFloat](repeating: LyrebirdFloat(float), count: Lyrebird.engine.blockSize)
return [returnValues]
}
public func floatValue(graph: LyrebirdGraph?) -> LyrebirdFloat {
let float = closure?(graph, nil) ?? 0.0
return LyrebirdFloat(float)
}
public func intValue(graph: LyrebirdGraph?) -> LyrebirdInt {
let int = closure?(graph, nil) ?? 0
return LyrebirdInt(int)
}
}
extension LyrebirdFloatClosure : LyrebirdFloatUGenValue {
}
extension LyrebirdFloatClosure : LyrebirdNumber {
public func valueAtPoint(graph: LyrebirdGraph?, point: LyrebirdNumber) -> LyrebirdFloat {
let currentPoint = point.numberValue()
return closure?(graph, currentPoint) ?? 0.0
}
public func numberValue(graph: LyrebirdGraph?) -> LyrebirdFloat {
return self.floatValue(graph: graph)
}
}
extension LyrebirdInt : LyrebirdValidUGenInput {
public func calculatedSamples(graph: LyrebirdGraph?) -> [[LyrebirdFloat]] {
let returnValues = [LyrebirdFloat](repeating: LyrebirdFloat(self), count: Lyrebird.engine.blockSize)
return [returnValues]
}
public func floatValue(graph: LyrebirdGraph?) -> LyrebirdFloat {
return LyrebirdFloat(self)
}
public func intValue(graph: LyrebirdGraph?) -> LyrebirdInt {
return self
}
}
extension LyrebirdInt : LyrebirdNumber {
public func numberValue(graph: LyrebirdGraph?) -> LyrebirdFloat {
return self.floatValue(graph: graph)
}
}
extension LyrebirdInt : LyrebirdFloatUGenValue {
}
extension LyrebirdFloat : LyrebirdValidUGenInput {
public func intValue(graph: LyrebirdGraph?) -> LyrebirdInt {
//var selfCopy = round(self)
return LyrebirdInt(self)
}
public func calculatedSamples(graph: LyrebirdGraph?) -> [[LyrebirdFloat]] {
let returnValues = [LyrebirdFloat](repeating: self, count: Lyrebird.engine.blockSize)
return [returnValues]
}
public func floatValue(graph: LyrebirdGraph?) -> LyrebirdFloat {
return self
}
//
// public mutating func intValue(_ graph: LyrebirdGraph?) -> LyrebirdInt {
// return LyrebirdInt(round(self))
// }
}
extension LyrebirdFloat : LyrebirdNumber {
public func numberValue(graph: LyrebirdGraph?) -> LyrebirdFloat {
return self.floatValue(graph: graph)
}
}
extension LyrebirdFloat : LyrebirdFloatUGenValue {
}
// TODO:: right now, accessing a key that doesn't exist returns zeroes. However, once mapped, that key is valid. Do we want this?
extension LyrebirdKey : LyrebirdValidUGenInput {
public func calculatedSamples(graph: LyrebirdGraph?) -> [[LyrebirdFloat]] {
if let graph: LyrebirdGraph = graph {
if let parameter = graph.parameters[self] {
return parameter.calculatedSamples(graph: graph)
}
}
let returnValues = [LyrebirdFloat](repeating: LyrebirdFloat(0.0), count: Lyrebird.engine.blockSize)
return [returnValues]
}
public func floatValue(graph: LyrebirdGraph?) -> LyrebirdFloat {
if let graph: LyrebirdGraph = graph {
if let parameter = graph.parameters[self] {
return parameter.floatValue(graph: graph)
}
}
return 0.0
}
public func intValue(graph: LyrebirdGraph?) -> LyrebirdInt {
if let graph: LyrebirdGraph = graph {
if let parameter = graph.parameters[self] {
return parameter.intValue(graph: graph)
}
}
return 0
}
}
extension LyrebirdKey : LyrebirdFloatUGenValue {
}
extension LyrebirdKey : LyrebirdNumber {
public func numberValue(graph: LyrebirdGraph?) -> LyrebirdFloat {
return self.floatValue(graph: graph)
}
}
/**
LyrebirdPollable is a class that keeps track of how values can change over time
Timekeeping is internal to its methods and accessible from currentTime(). With the first time currentTime() or every time start() is called (if allowsRestart is true), the timekeeping begins
*/
open class LyrebirdPollable {
var startTime: LyrebirdFloat = -1.0
var currentValue: LyrebirdFloat
open var allowsRestart: Bool = false
fileprivate var hasStarted: Bool = false
public required init(currentValue: LyrebirdFloat = 0.0){
self.currentValue = currentValue
}
public convenience init(){
self.init(currentValue: 0.0)
}
open func currentTime() -> LyrebirdFloat {
if startTime < 0.0 {
start()
return 0.0
}
let currentTime = Date.timeIntervalSinceReferenceDate
return currentTime - startTime
}
open func start() {
if !hasStarted || allowsRestart {
hasStarted = true
startTime = Date.timeIntervalSinceReferenceDate
}
}
}
extension LyrebirdPollable : LyrebirdNumber {
public func numberValue(graph: LyrebirdGraph?) -> LyrebirdFloat {
return currentValue
}
}
enum LyrebirdError : Error {
case notEnoughWires
}
@@ -1,209 +0,0 @@
//
// LyrebirdUGen.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/4/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
/**
Holds basic preallocated data that all UGens can access.
*/
class LyrebirdUGenInterface {
/// ---
/// number of samples in sine table
static var sineTableSize: LyrebirdInt = 32768
static var iSineTableSize: LyrebirdFloat = 1.0 / 32768.0
/// ---
/// for bit masking an index into the table
static var sineTableMask: LyrebirdInt = sineTableSize - 1
/// ---
/// the table holding a single cycle of a sine wave
static var sineTable: [LyrebirdFloat] = [LyrebirdFloat](repeating: 0.0, count: sineTableSize)
/**
Initializes all memory for the Interface
- parameters none:
*/
static func initInterface(){
let oneOverTableSize: LyrebirdFloat = 1.0 / LyrebirdFloat(sineTableSize)
for idx: Int in 0 ..< sineTableSize {
let val = LyrebirdFloat(idx) * oneOverTableSize * M_TWOPI
sineTable[idx] = sin(val)
}
}
}
/**
each UGen should be able to run at a specified rate.
Audio calculates samples at the audio rate
Control calculates one sample per control period
Spectral has a rate at an integer multiple of the control rate
*/
public enum LyrebirdUGenRate {
case audio
case control
case spectral
case demand
}
enum LyrebirdUGenInputType {
case ugen
case controlScaler
case initializedScaler
}
enum LyrebirdUGenOutputRange {
case bipolar
case unipolar
}
public protocol LyrebirdValidUGenInput {
func calculatedSamples(graph: LyrebirdGraph?) -> [[LyrebirdFloat]]
func floatValue(graph: LyrebirdGraph?) -> LyrebirdFloat
func intValue(graph: LyrebirdGraph?) -> LyrebirdInt
func needsInterpolation() -> Bool
func sampleBlock(graph: LyrebirdGraph?, previousValue: LyrebirdFloat) -> [LyrebirdFloat]
}
extension LyrebirdValidUGenInput {
public func needsInterpolation() -> Bool {
return true
}
public func sampleBlock(graph: LyrebirdGraph?, previousValue: LyrebirdFloat) -> [LyrebirdFloat] {
let newValue = self.floatValue(graph: graph)
return LyrebirdFunctions.interpolatedSampleBlock(startValue: previousValue, endValue: newValue)
}
}
/**
The base class for all UGens
*/
typealias NextBlock = (_ numSamples: Int) -> Void
open class LyrebirdUGen {
static let zeroedSamples : [LyrebirdFloat] = [LyrebirdFloat](repeating: 0.0, count: Lyrebird.engine.blockSize)
fileprivate (set) open var rate: LyrebirdUGenRate
final var samples: [LyrebirdFloat]
fileprivate (set) open var outputIndexes: [LyrebirdInt] = []
fileprivate var ready: Bool = false
var needsCalc: Bool = true
var graph: LyrebirdGraph?
var sampleOffset: LyrebirdInt = 0
// default to Bipolar
var outputRange: LyrebirdUGenOutputRange = .bipolar
public init(rate: LyrebirdUGenRate){
// TODO:: make this work with num outputs
samples = LyrebirdUGen.zeroedSamples
self.graph = LyrebirdGraph.currentBuildingGraph
self.rate = rate
self.graph?.addChild(child: self)
let numOutputs = self.numberOfOutputs()
ready = true
}
public convenience init(){
self.init(rate: LyrebirdUGenRate.control)
}
/**
Tells the Engine the number of outputs to expect from a UGen
- parameter none:
- Returns: an Integer. 1 is the base return, override in your UGen if more are returned
If your UGen only outputs one, you may access your wire with outputWires[0]
- Warning: If you override this method, your next function MUST check for the correct output wires!!!
*/
func numberOfOutputs() -> LyrebirdInt {
return 1
}
/**
The default next function.
- parameter numSamples: the number of samples to caluclate
- Return: Bool for whether or not to continue calculation
- Warning: in your implementation, do not call super.next up to the base UGen class. This is here to help developers realize that their method may not be implemented.
- Warning: Your next function must return immediately if 'super.next' returns false!!!
all subclassed next functions should begin with:
public override func next(numSamples: LyrebirdInt) -> Bool {
let run: Bool = super.next(numSamples: numSamples)
guard run else {
return run
}
...
*/
open func nextBlock(numSamples: LyrebirdInt, graph: LyrebirdGraph) {
if(ready && needsCalc){
next(numSamples: numSamples)
}
needsCalc = false
}
open func next(numSamples: LyrebirdInt) {
// empty implementation
}
}
extension LyrebirdUGen : LyrebirdValidUGenInput {
public func calculatedSamples(graph: LyrebirdGraph?) -> [[LyrebirdFloat]]{
var sampleArray: [[LyrebirdFloat]] = []
sampleArray.append(self.samples)
return sampleArray
}
// TODO:: handle this better - right now this grabs the current samples from the 0th wire.
// there should be a better way to do this
public func floatValue(graph: LyrebirdGraph?) -> LyrebirdFloat {
if let returnValue = samples.last {
return returnValue
}
return 0.0
}
public func intValue(graph: LyrebirdGraph?) -> LyrebirdInt {
if let returnValue = samples.last {
return LyrebirdInt(round(returnValue))
}
return 0
}
public func needsInterpolation() -> Bool {
return false
}
public func sampleBlock(graph: LyrebirdGraph?, previousValue: LyrebirdFloat) -> [LyrebirdFloat] {
return self.calculatedSamples(graph: graph)[0]
}
}
@@ -1,72 +0,0 @@
//
// ControlUGens.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/11/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
/**
Control rate interpolated values
use the currentValue property to set new values
for UGens that only need a single value, the currentValue property can also be used
*/
open class Control: LyrebirdUGen {
/// ---
/// The current value of the control
///
/// This is the value that should be updated
var currentValue: LyrebirdValidUGenInput = 0.0
/// ---
/// holds the last value set
///
/// only updated AFTER a control period interpolating to the currentValue has been run
fileprivate var previousValue: LyrebirdFloat = 0.0
/**
init method for Control values that aren't 0.0
- parameter rate: Lyrebird UGen rate - should be control
- parameter currentValue: The initial value for the control's output
*/
public required init(rate: LyrebirdUGenRate, currentValue: LyrebirdValidUGenInput){
super.init(rate: rate)
self.currentValue = currentValue
self.previousValue = currentValue.floatValue(graph: graph)
}
/**
overridden next function for LyrebirdControlUGen
- parameter numSamples: the number of samples to calculate
fills wire with interpolated data between last value and current value
if these are the same, an output buffer of the same value is returned
*/
override final public func next(numSamples: LyrebirdInt) {
let currentValueIn: LyrebirdFloat = currentValue.floatValue(graph: graph)
if previousValue == currentValueIn {
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
samples[sampleIdx] = currentValueIn
}
} else {
let step: LyrebirdFloat = LyrebirdFunctions.calcSlope(startValue: previousValue, endValue: currentValueIn)
var curSample: LyrebirdFloat = previousValue
// end at currentValue - last block lands at lastValue, step on from there
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
curSample = curSample + step
samples[sampleIdx] = curSample
}
}
previousValue = currentValueIn
}
}
@@ -1,238 +0,0 @@
//
// DelayUGens.swift
// Lyrebird
//
// Created by Joshua Parmenter on 7/16/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
public enum DelayInterpolationType {
case none, linear, cubic
}
open class DelayLine: LyrebirdUGen {
fileprivate final var buffer: [LyrebirdFloat]
fileprivate final let bufferSize: LyrebirdInt // should be a power of 2
fileprivate final let mask: LyrebirdInt
fileprivate final var readHead: LyrebirdFloat = 0.0
fileprivate final var writeHead: LyrebirdInt = 0
public final var interpolation: DelayInterpolationType
public final var delayTime: LyrebirdValidUGenInput
fileprivate final var lastDelayTime: LyrebirdFloat = 0.0
public final var input: LyrebirdValidUGenInput
public required init(rate: LyrebirdUGenRate, input: LyrebirdValidUGenInput, delayTime: LyrebirdValidUGenInput, maxDelayTime: LyrebirdFloat = 1.0, interpolation: DelayInterpolationType = .none) {
self.input = input
self.delayTime = delayTime
self.interpolation = interpolation
self.bufferSize = LyrebirdInt(LyrebirdFunctions.nextPowerOfTwo(value: LyrebirdInt(ceil(Lyrebird.engine.sampleRate * maxDelayTime))))
self.mask = bufferSize - 1
self.buffer = [LyrebirdFloat](repeating: 0.0, count: bufferSize)
super.init(rate: rate)
self.writeHead = LyrebirdInt(Lyrebird.engine.sampleRate * delayTime.floatValue(graph: graph))
self.lastDelayTime = self.delayTime.floatValue(graph: graph)
}
public override final func next(numSamples: LyrebirdInt) {
switch self.interpolation {
case .linear:
nextLinear(numSamples: numSamples)
break
case .none:
nextNone(numSamples: numSamples)
break
case .cubic:
nextCubic(numSamples: numSamples)
break
}
while readHead > LyrebirdFloat(mask) {
readHead = readHead - LyrebirdFloat(bufferSize)
}
if writeHead > mask {
writeHead = writeHead & mask
}
}
fileprivate final func nextNone(numSamples: LyrebirdInt) {
let inputSamples = self.input.calculatedSamples(graph: graph)[0]
let delayTimes = self.delayTime.calculatedSamples(graph: graph)[0]
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
let thisDelayTime = delayTimes[sampleIdx]
let delayDiff = thisDelayTime - lastDelayTime
lastDelayTime = thisDelayTime
readHead = readHead + (delayDiff * Lyrebird.engine.sampleRate)
let fReadHead: LyrebirdFloat = floor(readHead)
let iReadHead: LyrebirdInt = LyrebirdInt(fReadHead) & mask
samples[sampleIdx] = buffer[iReadHead]
buffer[writeHead & mask] = inputSamples[sampleIdx]
readHead = readHead + 1.0
writeHead = writeHead + 1
}
}
fileprivate final func nextLinear(numSamples: LyrebirdInt) {
let inputSamples = self.input.calculatedSamples(graph: graph)[0]
let delayTimes = self.delayTime.calculatedSamples(graph: graph)[0]
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
let thisDelayTime = delayTimes[sampleIdx]
let delayDiff = thisDelayTime - lastDelayTime
lastDelayTime = thisDelayTime
readHead = readHead + (delayDiff * Lyrebird.engine.sampleRate)
let fReadHead: LyrebirdFloat = floor(readHead)
let iReadHead: LyrebirdInt = LyrebirdInt(fReadHead)
let bufferIdxPct: LyrebirdFloat = readHead - fReadHead
let bufferIdx: LyrebirdInt = iReadHead & mask
let bufferIdxP1: LyrebirdInt = (iReadHead + 1) & mask
samples[sampleIdx] = LyrebirdFunctions.linearInterp(x1: buffer[bufferIdx], x2: buffer[bufferIdxP1], pct: bufferIdxPct)
buffer[writeHead & mask] = inputSamples[sampleIdx]
readHead = readHead + 1.0
writeHead = writeHead + 1
}
}
fileprivate final func nextCubic(numSamples: LyrebirdInt) {
let inputSamples = self.input.calculatedSamples(graph: graph)[0]
let delayTimes = self.delayTime.calculatedSamples(graph: graph)[0]
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
let thisDelayTime = delayTimes[sampleIdx]
let delayDiff = thisDelayTime - lastDelayTime
lastDelayTime = thisDelayTime
readHead = readHead + (delayDiff * Lyrebird.engine.sampleRate)
let fReadHead: LyrebirdFloat = floor(readHead)
let iReadHead: LyrebirdInt = LyrebirdInt(fReadHead)
let bufferIdxPct: LyrebirdFloat = readHead - fReadHead
let bufferIdx: LyrebirdInt = iReadHead & mask
let bufferIdxM1: LyrebirdInt = (iReadHead - 1) & mask
let bufferIdxP1: LyrebirdInt = (iReadHead + 1) & mask
let bufferIdxP2: LyrebirdInt = (iReadHead + 2) & mask
samples[sampleIdx] = LyrebirdFunctions.cubicInterp(ym1: buffer[bufferIdxM1], y0: buffer[bufferIdx], y1: buffer[bufferIdxP1], y2: buffer[bufferIdxP2], pct: bufferIdxPct)
buffer[writeHead & mask] = inputSamples[sampleIdx]
readHead = readHead + 1.0
writeHead = writeHead + 1
}
}
}
open class DelayLineFeedback: LyrebirdUGen {
fileprivate final var buffer: [LyrebirdFloat]
fileprivate final let bufferSize: LyrebirdInt // should be a power of 2
fileprivate final let mask: LyrebirdInt
fileprivate final var readHead: LyrebirdFloat = 0.0
fileprivate final var writeHead: LyrebirdInt = 0
public final var interpolation: DelayInterpolationType
public final var delayTime: LyrebirdValidUGenInput
public final var decayTime: LyrebirdValidUGenInput
fileprivate final var lastDelayTime: LyrebirdFloat = 0.0
public final var input: LyrebirdValidUGenInput
public required init(rate: LyrebirdUGenRate, input: LyrebirdValidUGenInput, delayTime: LyrebirdValidUGenInput, decayTime: LyrebirdValidUGenInput = 0.0, maxDelayTime: LyrebirdFloat = 1.0, interpolation: DelayInterpolationType = .none) {
self.input = input
self.delayTime = delayTime
self.decayTime = decayTime
self.interpolation = interpolation
self.bufferSize = LyrebirdInt(LyrebirdFunctions.nextPowerOfTwo(value: LyrebirdInt(ceil(Lyrebird.engine.sampleRate * maxDelayTime))))
self.mask = bufferSize - 1
self.buffer = [LyrebirdFloat](repeating: 0.0, count: bufferSize)
super.init(rate: rate)
self.writeHead = LyrebirdInt(Lyrebird.engine.sampleRate * delayTime.floatValue(graph: graph))
self.lastDelayTime = self.delayTime.floatValue(graph: graph)
}
public override final func next(numSamples: LyrebirdInt) {
switch self.interpolation {
case .linear:
nextLinear(numSamples: numSamples)
break
case .none:
nextNone(numSamples: numSamples)
break
case .cubic:
nextCubic(numSamples: numSamples)
break
}
while readHead > LyrebirdFloat(mask) {
readHead = readHead - LyrebirdFloat(bufferSize)
}
if writeHead > mask {
writeHead = writeHead & mask
}
}
fileprivate final func nextNone( numSamples: LyrebirdInt) {
let inputSamples = input.calculatedSamples(graph: graph)[0]
let delayTimes = delayTime.calculatedSamples(graph: graph)[0]
let decayTimes = decayTime.calculatedSamples(graph: graph)[0]
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
let thisDelayTime = delayTimes[sampleIdx]
let delayDiff = thisDelayTime - lastDelayTime
lastDelayTime = thisDelayTime
readHead = readHead + (delayDiff * Lyrebird.engine.sampleRate)
let fReadHead: LyrebirdFloat = floor(readHead)
let iReadHead: LyrebirdInt = LyrebirdInt(fReadHead) & mask
samples[sampleIdx] = buffer[iReadHead]
let feedbackAmt = LyrebirdFunctions.feedbackCoef(delayTime: thisDelayTime, decayTime: decayTimes[sampleIdx], targetAmp: 0.001)
buffer[writeHead & mask] = inputSamples[sampleIdx] + (samples[sampleIdx] * feedbackAmt)
readHead = readHead + 1.0
writeHead = writeHead + 1
}
}
fileprivate final func nextLinear(numSamples: LyrebirdInt) {
let inputSamples = input.calculatedSamples(graph: graph)[0]
let delayTimes = delayTime.calculatedSamples(graph: graph)[0]
let decayTimes = decayTime.calculatedSamples(graph: graph)[0]
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
let thisDelayTime = delayTimes[sampleIdx]
let delayDiff = thisDelayTime - lastDelayTime
lastDelayTime = thisDelayTime
readHead = readHead + (delayDiff * Lyrebird.engine.sampleRate)
let fReadHead: LyrebirdFloat = floor(readHead)
let iReadHead: LyrebirdInt = LyrebirdInt(fReadHead)
let bufferIdxPct: LyrebirdFloat = readHead - fReadHead
let bufferIdx: LyrebirdInt = iReadHead & mask
let bufferIdxP1: LyrebirdInt = (iReadHead + 1) & mask
samples[sampleIdx] = LyrebirdFunctions.linearInterp(x1: buffer[bufferIdx], x2: buffer[bufferIdxP1], pct: bufferIdxPct)
let feedbackAmt = LyrebirdFunctions.feedbackCoef(delayTime: thisDelayTime, decayTime: decayTimes[sampleIdx], targetAmp: 0.001)
buffer[writeHead & mask] = inputSamples[sampleIdx] + (samples[sampleIdx] * feedbackAmt)
readHead = readHead + 1.0
writeHead = writeHead + 1
}
}
fileprivate final func nextCubic(numSamples: LyrebirdInt) {
// TODO:: optimize for non-changing values
let inputSamples = input.calculatedSamples(graph: graph)[0]
let delayTimes = delayTime.calculatedSamples(graph: graph)[0]
let decayTimes = decayTime.calculatedSamples(graph: graph)[0]
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
let thisDelayTime = delayTimes[sampleIdx]
let delayDiff = thisDelayTime - lastDelayTime
lastDelayTime = thisDelayTime
readHead = readHead + (delayDiff * Lyrebird.engine.sampleRate)
let fReadHead: LyrebirdFloat = floor(readHead)
let iReadHead: LyrebirdInt = LyrebirdInt(fReadHead)
let bufferIdxPct: LyrebirdFloat = readHead - fReadHead
let bufferIdx: LyrebirdInt = iReadHead & mask
let bufferIdxM1: LyrebirdInt = (iReadHead - 1) & mask
let bufferIdxP1: LyrebirdInt = (iReadHead + 1) & mask
let bufferIdxP2: LyrebirdInt = (iReadHead + 2) & mask
samples[sampleIdx] = LyrebirdFunctions.cubicInterp(ym1: buffer[bufferIdxM1], y0: buffer[bufferIdx], y1: buffer[bufferIdxP1], y2: buffer[bufferIdxP2], pct: bufferIdxPct)
let feedbackAmt = LyrebirdFunctions.feedbackCoef(delayTime: thisDelayTime, decayTime: decayTimes[sampleIdx], targetAmp: 0.001)
buffer[writeHead & mask] = inputSamples[sampleIdx] + (samples[sampleIdx] * feedbackAmt)
readHead = readHead + 1.0
writeHead = writeHead + 1
}
}
}
@@ -1,73 +0,0 @@
//
// EnvelopeUGens.swift
// Lyrebird
//
// Created by Joshua Parmenter on 7/12/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
public enum EnvelopeGenDoneAction: Int {
case nothing, freeNode, loop
}
open class EnvelopeGen : LyrebirdUGen {
let envelope: Envelope
var gate: Bool = false
var doneAction: EnvelopeGenDoneAction
let releaseSegment: LyrebirdInt
let levelScale: LyrebirdFloat
let levelBias: LyrebirdFloat
let timeScale: LyrebirdFloat
let totalDur: LyrebirdFloat
fileprivate var timeKeeper: LyrebirdFloat = 0.0
fileprivate let timeInc: LyrebirdFloat
fileprivate let gateTime: LyrebirdFloat
public required init(rate: LyrebirdUGenRate, envelope: Envelope, levelScale: LyrebirdFloat = 1.0, levelBias: LyrebirdFloat = 0.0, timeScale: LyrebirdFloat = 1.0, releaseSegment: LyrebirdInt = -1, doneAction: EnvelopeGenDoneAction = .nothing){
self.envelope = envelope
self.levelScale = levelScale
self.levelBias = levelBias
self.timeScale = timeScale
self.releaseSegment = releaseSegment
var timeInc = Lyrebird.engine.iSampleRate
var gateTime = -1.0
if releaseSegment >= 0 {
gateTime = 0.0
for (index, segment) in envelope.segments.enumerated() {
if index <= releaseSegment {
gateTime = gateTime + segment.duration
} else {
break
}
}
}
var totalDur: LyrebirdFloat = 0.0
for (index, segment) in envelope.segments.enumerated() {
totalDur = totalDur + segment.duration
}
self.gateTime = gateTime
if timeScale != 1.0 && timeScale > 0.0 {
totalDur = totalDur * timeScale
timeInc = timeInc / timeScale
}
self.totalDur = totalDur
self.doneAction = doneAction
self.timeInc = timeInc
super.init(rate: rate)
}
override final public func next(numSamples: LyrebirdInt) {
for sampleIdx in 0 ..< numSamples {
samples[sampleIdx] = (envelope.poll(atTime: timeKeeper) * levelScale) + levelBias
timeKeeper = timeKeeper + timeInc
// test release
if (timeKeeper > totalDur) && (doneAction == .loop) {
timeKeeper = 0.0
}
}
if (timeKeeper > totalDur) && (doneAction == .freeNode) {
self.graph?.shouldRemoveFromTree = true
}
}
}
@@ -1,246 +0,0 @@
//
// FilterUGens.swift
// Lyrebird
//
// Created by Joshua Parmenter on 6/2/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
// out(i) = (a0 * in(i)) + (a1 * in(i-1)) + (b1 * out(i-1))
public final class FirstOrderSection : LyrebirdUGen {
fileprivate var a0: LyrebirdValidUGenInput
fileprivate var a1: LyrebirdValidUGenInput
fileprivate var b1: LyrebirdValidUGenInput
fileprivate var input: LyrebirdValidUGenInput
fileprivate var lastA0: LyrebirdFloat = 0.0
fileprivate var lastA1: LyrebirdFloat = 0.0
fileprivate var lastB1: LyrebirdFloat = 0.0
fileprivate var input1: LyrebirdFloat = 0.0
public required init(rate: LyrebirdUGenRate, input: LyrebirdValidUGenInput, a0: LyrebirdValidUGenInput, a1: LyrebirdValidUGenInput, b1: LyrebirdValidUGenInput) {
self.a0 = a0
self.a1 = a1
self.b1 = b1
self.input = input
super.init(rate: rate)
self.lastA0 = self.a0.floatValue(graph: graph)
self.lastA1 = self.a1.floatValue(graph: graph)
self.lastB1 = self.b1.floatValue(graph: graph)
}
override public final func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.sampleBlock(graph: graph, previousValue: 0.0)
var input1: LyrebirdFloat = self.input1
var currentIn: LyrebirdFloat = 0.0
let newA0 = a0.floatValue(graph: graph)
let newA1 = a1.floatValue(graph: graph)
let newB1 = b1.floatValue(graph: graph)
// try to avoid the interpolation
if newA0 == lastA0 &&
newA1 == lastA1 &&
newB1 == lastB1 {
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
currentIn = inputSamples[sampleIdx] +
(lastB1 * input1)
samples[sampleIdx] = (lastA0 * currentIn) +
(lastA1 * input1)
input1 = currentIn
}
} else {
let a0Samps: [LyrebirdFloat] = a0.sampleBlock(graph: graph, previousValue: lastA0)
let a1Samps: [LyrebirdFloat] = a1.sampleBlock(graph: graph, previousValue: lastA1)
let b1Samps: [LyrebirdFloat] = b1.sampleBlock(graph: graph, previousValue: lastB1)
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
currentIn = inputSamples[sampleIdx] +
(b1Samps[sampleIdx] * input1)
samples[sampleIdx] = (a0Samps[sampleIdx] * currentIn) +
(a1Samps[sampleIdx] * input1)
input1 = currentIn
}
lastA0 = a0Samps.last ?? 0.0
lastA1 = a1Samps.last ?? 0.0
lastB1 = b1Samps.last ?? 0.0
}
self.input1 = input1
}
}
// out(i) = (a0 * in(i)) + (a1 * in(i-1)) + (a2 * in(i-2)) + (b1 * out(i-1)) + (b2 * out(i-2))
public final class SecondOrderSection : LyrebirdUGen {
fileprivate var a0: LyrebirdValidUGenInput
fileprivate var a1: LyrebirdValidUGenInput
fileprivate var a2: LyrebirdValidUGenInput
fileprivate var b1: LyrebirdValidUGenInput
fileprivate var b2: LyrebirdValidUGenInput
fileprivate var input: LyrebirdValidUGenInput
fileprivate var lastA0: LyrebirdFloat = 0.0
fileprivate var lastA1: LyrebirdFloat = 0.0
fileprivate var lastA2: LyrebirdFloat = 0.0
fileprivate var lastB1: LyrebirdFloat = 0.0
fileprivate var lastB2: LyrebirdFloat = 0.0
fileprivate var input1: LyrebirdFloat = 0.0
fileprivate var input2: LyrebirdFloat = 0.0
public required init(rate: LyrebirdUGenRate, input: LyrebirdValidUGenInput, a0: LyrebirdValidUGenInput, a1: LyrebirdValidUGenInput, a2: LyrebirdValidUGenInput, b1: LyrebirdValidUGenInput, b2: LyrebirdValidUGenInput) {
self.a0 = a0
self.a1 = a1
self.a2 = a2
self.b1 = b1
self.b2 = b2
self.input = input
super.init(rate: rate)
self.lastA0 = self.a0.floatValue(graph: graph)
self.lastA1 = self.a1.floatValue(graph: graph)
self.lastA2 = self.a2.floatValue(graph: graph)
self.lastB1 = self.b1.floatValue(graph: graph)
self.lastB2 = self.b2.floatValue(graph: graph)
}
override public final func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.sampleBlock(graph: graph, previousValue: 0.0)
var input1: LyrebirdFloat = self.input1
var input2: LyrebirdFloat = self.input2
var currentIn: LyrebirdFloat = 0.0
let newA0 = a0.floatValue(graph: graph)
let newA1 = a1.floatValue(graph: graph)
let newA2 = a2.floatValue(graph: graph)
let newB1 = b1.floatValue(graph: graph)
let newB2 = b2.floatValue(graph: graph)
// try to avoid the interpolation
if (newA0 == lastA0) &&
(newA1 == lastA1) &&
(newA2 == lastA2) &&
(newB1 == lastB1) &&
(newB2 == lastB2) {
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
currentIn = inputSamples[sampleIdx] +
(newB1 * input1) +
(newB2 * input2)
samples[sampleIdx] = (newA0 * currentIn) +
(newA1 * input1) +
(newA2 * input2)
input2 = input1
input1 = currentIn
}
} else {
let a0Samps: [LyrebirdFloat] = a0.sampleBlock(graph: graph, previousValue: lastA0)
let a1Samps: [LyrebirdFloat] = a1.sampleBlock(graph: graph, previousValue: lastA1)
let a2Samps: [LyrebirdFloat] = a2.sampleBlock(graph: graph, previousValue: lastA2)
let b1Samps: [LyrebirdFloat] = b1.sampleBlock(graph: graph, previousValue: lastB1)
let b2Samps: [LyrebirdFloat] = b2.sampleBlock(graph: graph, previousValue: lastB2)
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
currentIn = inputSamples[sampleIdx] +
(b1Samps[sampleIdx] * input1) +
(b2Samps[sampleIdx] * input2)
samples[sampleIdx] = (a0Samps[sampleIdx] * currentIn) +
(a1Samps[sampleIdx] * input1) +
(a2Samps[sampleIdx] * input2)
input2 = input1
input1 = currentIn
}
lastA0 = a0Samps.last ?? 0.0
lastA1 = a1Samps.last ?? 0.0
lastA2 = a2Samps.last ?? 0.0
lastB1 = b1Samps.last ?? 0.0
lastB2 = b2Samps.last ?? 0.0
}
self.input1 = input1
self.input2 = input2
}
}
/**
Bristow-Johnson SOS Cookbook
*/
open class FliterRBJ : LyrebirdUGen {
internal var input: LyrebirdValidUGenInput
internal var sos: SecondOrderSection?
internal var a0: LyrebirdValidUGenInput = 0.0
internal var a1: LyrebirdValidUGenInput = 0.0
internal var a2: LyrebirdValidUGenInput = 0.0
internal var b1: LyrebirdValidUGenInput = 0.0
internal var b2: LyrebirdValidUGenInput = 0.0
public init(rate: LyrebirdUGenRate, input: LyrebirdValidUGenInput){
self.input = input
super.init(rate: rate)
calculateCoefs()
self.sos = SecondOrderSection(rate: rate, input: self.input, a0: self.a0, a1: self.a1, a2: self.a2, b1: self.b1, b2: self.b2)
}
internal func calculateCoefs(){
}
override public final func next(numSamples: LyrebirdInt) {
calculateCoefs()
if let sos = self.sos {
self.samples = sos.samples
}
}
}
public final class FilterRBJBandPass : FliterRBJ {
fileprivate var freq: LyrebirdValidUGenInput
fileprivate var bandwidth: LyrebirdValidUGenInput
fileprivate var lastFreq: LyrebirdFloat = 0.0
fileprivate var lastBandwidth: LyrebirdFloat = 0.0
public required init(rate: LyrebirdUGenRate, input: LyrebirdValidUGenInput, freq: LyrebirdValidUGenInput, bandwidth: LyrebirdValidUGenInput) {
self.freq = freq
self.bandwidth = bandwidth
super.init(rate: rate, input: input)
self.lastFreq = freq.floatValue(graph: graph)
self.lastBandwidth = bandwidth.floatValue(graph: graph)
}
override internal final func calculateCoefs(){
super.calculateCoefs()
let curFreq = freq.floatValue(graph: graph)
let curBandwidth = bandwidth.floatValue(graph: graph)
if curFreq > 0.0 {
if (curFreq != lastFreq) ||
(curBandwidth != lastBandwidth) {
let sampleRate = Lyrebird.engine.sampleRate
let sampleDur = Lyrebird.engine.iSampleRate
let w0 = M_TWOPI * freq.floatValue(graph: graph) * sampleDur
let sin_w0 = sin(w0)
let alpha = sin_w0 * sinh(((0.34657359027997 * bandwidth.floatValue(graph: graph) * w0)) / sin_w0);
let b0rz = 1.0 / (1.0 + alpha)
if let sos = sos {
sos.a0 = alpha * b0rz;
sos.b1 = cos(w0) * 2.0 * b0rz;
sos.b2 = (1.0 - alpha) * (b0rz * -1.0);
sos.a1 = 0.0
sos.a2 = a0 * -1.0
}
lastFreq = curFreq
lastBandwidth = curBandwidth
}
} else {
lastFreq = curFreq
a0 = 0.0
b1 = 0.0
b2 = 0.0
a1 = 0.0
a2 = 0.0
}
}
}
@@ -1,73 +0,0 @@
//
// IOUgens.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/15/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
public final class Output : LyrebirdUGen {
var index: LyrebirdValidUGenInput
var output: LyrebirdValidUGenInput
fileprivate var channel: LyrebirdAudioChannel? = nil
public required init(rate: LyrebirdUGenRate, index: LyrebirdValidUGenInput, output: LyrebirdValidUGenInput){
self.index = index
self.output = output
super.init(rate: rate)
let channels: [LyrebirdAudioChannel] = Lyrebird.engine.audioBlock
if(index.intValue(graph: graph) < channels.count){
channel = channels[index.intValue(graph: graph)]
}
}
override public final func next(numSamples: LyrebirdInt) {
// get the audio wire to output
let channels: [LyrebirdAudioChannel] = Lyrebird.engine.audioBlock
if(index.intValue(graph: graph) < channels.count){
channel = channels[index.intValue(graph: graph)]
}
let sampleChannels: [[LyrebirdFloat]] = output.calculatedSamples(graph: graph)
// assume mono for now
let outputChannel: [LyrebirdFloat] = sampleChannels[0]
// Wires always write their output to the first indexes of their array
// however, when an offset if needed, Output UGens must account for this when they write
let blockSize = Lyrebird.engine.blockSize
let offset = blockSize - numSamples
if let channel = self.channel {
channel.touched = true
for index in offset ..< Lyrebird.engine.blockSize {
channel.currentValues[index] = channel.currentValues[index] + outputChannel[index]
}
}
}
}
public final class Input : LyrebirdUGen {
var index: LyrebirdValidUGenInput
fileprivate var channel: LyrebirdAudioChannel? = nil
public required init(rate: LyrebirdUGenRate, index: LyrebirdValidUGenInput){
self.index = index
super.init(rate: rate)
let channels: [LyrebirdAudioChannel] = Lyrebird.engine.audioBlock
if(index.intValue(graph: graph) < channels.count){
channel = channels[self.index.intValue(graph: graph)]
}
}
override public final func next(numSamples: LyrebirdInt) {
// get the audio wire to output
guard let channel: LyrebirdAudioChannel = self.channel else {
return
}
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
samples[sampleIdx] = channel.currentValues[sampleIdx]
}
}
}
@@ -1,466 +0,0 @@
//
// MathUGens.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/19/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
/**
The basic UGen used for binary math operations on other UGens. Since math on UGens needs to operate on the samples in a wire, special UGens for accessing the samples or interpolating for changing values across control periods is needed
*/
open class BinaryOpUGen : LyrebirdUGen {
/// ---
/// The left hand side of the operation
///
let lhs: LyrebirdValidUGenInput
/// ---
/// The right hand side of the operation
///
let rhs: LyrebirdValidUGenInput
/**
init for all BinaryOpUGens
- parameter rate: LyrebirdUGenRate to run the unit at
- parameter lhs: left hand side of the operation
- parameter rhs: right hand side of the operation
- Returns: An instance of a BinaryOpUGen - the result of the operation is stored in the UGen's wire
*/
public required init(rate: LyrebirdUGenRate, lhs: LyrebirdValidUGenInput, rhs: LyrebirdValidUGenInput){
self.lhs = lhs
self.rhs = rhs
super.init(rate: rate)
}
// public required convenience init(rate: LyrebirdUGenRate){
// self.init(rate: rate, lhs: 0.0, rhs: 0.0)
// }
}
/**
multiply function that translates the '*' operator into a Binary Op UGen
- parameter lhs: left hand side of the operation
- parameter rhs: right hand side of the operation
- Returns: The resulting MulOpUGen
*/
public func * (lhs: LyrebirdValidUGenInput, rhs: LyrebirdValidUGenInput) -> BinaryOpUGen {
return MulOpUGen(rate: LyrebirdUGenRate.audio, lhs: lhs, rhs: rhs)
}
/**
addition function that translates the '+' operator into a Binary Op UGen
- parameter lhs: left hand side of the operation
- parameter rhs: right hand side of the operation
- Returns: The resulting MulOpUGen
*/
public func + (lhs: LyrebirdValidUGenInput, rhs: LyrebirdValidUGenInput) -> BinaryOpUGen {
return AddOpUGen(rate: LyrebirdUGenRate.audio, lhs: lhs, rhs: rhs)
}
/**
division function that translates the '/' operator into a Binary Op UGen
- parameter lhs: left hand side of the operation
- parameter rhs: right hand side of the operation
- Returns: The resulting MulOpUGen
*/
public func / (lhs: LyrebirdValidUGenInput, rhs: LyrebirdValidUGenInput) -> BinaryOpUGen {
return DivOpUGen(rate: LyrebirdUGenRate.audio, lhs: lhs, rhs: rhs)
}
/**
subtraction function that translates the '-' operator into a Binary Op UGen
- parameter lhs: left hand side of the operation
- parameter rhs: right hand side of the operation
- Returns: The resulting MulOpUGen
*/
public func - (lhs: LyrebirdValidUGenInput, rhs: LyrebirdValidUGenInput) -> BinaryOpUGen {
return SubOpUGen(rate: LyrebirdUGenRate.audio, lhs: lhs, rhs: rhs)
}
/**
The multiply implementation for UGen math operations
*/
public final class MulOpUGen : BinaryOpUGen {
/**
MulOpUGen next that calculates a new wire with the result of the input's wires values for this operation
- parameter numSamples: the number of samples to calculate
- Returns: boolean with success
*/
public override final func next(numSamples: LyrebirdInt) {
let lhsSamples: [LyrebirdFloat] = lhs.calculatedSamples(graph: graph)[0]
let rhsSamples: [LyrebirdFloat] = rhs.calculatedSamples(graph: graph)[0]
for index in 0 ..< lhsSamples.count {
samples[index] = lhsSamples[index] * rhsSamples[index]
}
}
}
/**
The division implementation for UGen math operations
*/
open class DivOpUGen : BinaryOpUGen {
/**
DivOpUGen next that calculates a new wire with the result of the input's wires values for this operation
- parameter numSamples: the number of samples to calculate
- Returns: boolean with success
*/
open override func next(numSamples: LyrebirdInt) {
let lhsSamples: [LyrebirdFloat] = lhs.calculatedSamples(graph: graph)[0]
let rhsSamples: [LyrebirdFloat] = rhs.calculatedSamples(graph: graph)[0]
for index in 0 ..< lhsSamples.count {
let divisor = rhsSamples[index]
if divisor != 0.0 {
samples[index] = lhsSamples[index] / rhsSamples[index]
} else {
samples[index] = 0.0
}
}
}
}
/**
The addition implementation for UGen math operations
*/
open class AddOpUGen : BinaryOpUGen {
/**
AddOpUGen next that calculates a new wire with the result of the input's wires values for this operation
- parameter numSamples: the number of samples to calculate
- Returns: boolean with success
*/
open override func next(numSamples: LyrebirdInt) {
let lhsSamples: [LyrebirdFloat] = lhs.calculatedSamples(graph: graph)[0]
let rhsSamples: [LyrebirdFloat] = rhs.calculatedSamples(graph: graph)[0]
for index in 0 ..< lhsSamples.count {
samples[index] = lhsSamples[index] + rhsSamples[index]
}
}
}
/**
The subtraction implementation for UGen math operations
*/
open class SubOpUGen : BinaryOpUGen {
/**
SubOpUGen next that calculates a new wire with the result of the input's wires values for this operation
- parameter numSamples: the number of samples to calculate
- Returns: boolean with success
*/
open override func next(numSamples: LyrebirdInt) {
let lhsSamples: [LyrebirdFloat] = lhs.calculatedSamples(graph: graph)[0]
let rhsSamples: [LyrebirdFloat] = rhs.calculatedSamples(graph: graph)[0]
for index in 0 ..< lhsSamples.count {
samples[index] = lhsSamples[index] - rhsSamples[index]
}
}
}
/**
The basic UGen used for unary math operations on other UGens. Since math on UGens needs to operate on the samples in a wire, special UGens for accessing the samples or interpolating for changing values across control periods is needed
*/
open class UnaryOpUGen : LyrebirdUGen {
/// ---
/// The LyrebirdValidUGenInput input to operate on
///
let input: LyrebirdValidUGenInput
/**
init for all BinaryOpUGens
- parameter rate: LyrebirdUGenRate to run the unit at
- parameter input: The UGen to get values from
- Returns: An instance of a BinaryOpUGen - the result of the operation is stored in the UGen's wire
*/
public required init(rate: LyrebirdUGenRate, input: LyrebirdValidUGenInput){
self.input = input
super.init(rate: rate)
}
}
/**
The absolute value implementation for UGen math operations
*/
open class Abs : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
samples[index] = fabs(inputSamples[index])
}
}
}
/**
The negation operation (value * -1) implementation for UGen math operations
*/
open class Negative : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
samples[index] = -inputSamples[index]
}
}
}
/**
The sin(x) implementation for UGen math operations
*/
open class Sin : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
samples[index] = sin(inputSamples[index])
}
}
}
/**
The cos(x) implementation for UGen math operations
*/
open class Cos : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
samples[index] = cos(inputSamples[index])
}
}
}
/**
The tan(x) implementation for UGen math operations
*/
open class Tan : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
samples[index] = tan(inputSamples[index])
}
}
}
/**
The atan(x) (arc tan) implementation for UGen math operations
*/
open class Atan : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
samples[index] = atan(inputSamples[index])
}
}
}
/**
The asin(x) (arc sine) implementation for UGen math operations
*/
open class Asin : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
samples[index] = asin(inputSamples[index])
}
}
}
/**
The acos(x) (arc cosine) implementation for UGen math operations
*/
open class Acos : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
samples[index] = acos(inputSamples[index])
}
}
}
/**
The sinh(x) (hyperbolic sine) implementation for UGen math operations
*/
open class Sinh : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
samples[index] = sinh(inputSamples[index])
}
}
}
/**
The cosh(x) (hyperbolic cosine) implementation for UGen math operations
*/
open class Cosh : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
samples[index] = cosh(inputSamples[index])
}
}
}
/**
The tanh(x) (hyperbolic tan) implementation for UGen math operations
*/
open class Tanh : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
samples[index] = tanh(inputSamples[index])
}
}
}
/**
The squaring implementation for UGen math operations
*/
open class Squared : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
let val = inputSamples[index]
samples[index] = val * val
}
}
}
/**
The squaring implementation for UGen math operations where sign is retained
*/
open class SigSquared : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
let val = inputSamples[index]
let sign: LyrebirdFloat = val < 0.0 ? -1.0 : 1.0
samples[index] = (val * val) * sign
}
}
}
/**
The cubing implementation for UGen math operations where sign is retained
*/
open class Cubed : UnaryOpUGen {
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
let val = inputSamples[index]
samples[index] = val * val * val
}
}
}
open class Range : LyrebirdUGen {
let input: LyrebirdValidUGenInput
var low: LyrebirdValidUGenInput
fileprivate var lastLow: LyrebirdFloat = 0.0
var high: LyrebirdValidUGenInput
fileprivate var lastHigh: LyrebirdFloat = 0.0
public required init(rate: LyrebirdUGenRate, input: LyrebirdValidUGenInput, low: LyrebirdValidUGenInput, high: LyrebirdValidUGenInput){
self.input = input
self.low = low
self.high = high
super.init(rate: rate)
self.lastLow = low.floatValue(graph: graph)
self.lastHigh = high.floatValue(graph: graph)
}
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
let highSamples = high.calculatedSamples(graph: graph)[0]
let lowSamples = low.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
let val = inputSamples[index]
let newHigh = highSamples[index]
let newLow = lowSamples[index]
let scaler = (newHigh - newLow) * 0.5 // TODO:: assuming bipolar
let offset = newLow;
samples[index] = (val * scaler) + offset
}
}
}
open class MulAdd : LyrebirdUGen {
let input: LyrebirdValidUGenInput
var mul: LyrebirdValidUGenInput
var add: LyrebirdValidUGenInput
public required init(rate: LyrebirdUGenRate, input: LyrebirdValidUGenInput, mul: LyrebirdValidUGenInput, add: LyrebirdValidUGenInput){
self.input = input
self.mul = mul
self.add = add
super.init(rate: rate)
}
open override func next(numSamples: LyrebirdInt) {
let inputSamples: [LyrebirdFloat] = input.calculatedSamples(graph: graph)[0]
let mulSamples = mul.calculatedSamples(graph: graph)[0]
let addSamples = add.calculatedSamples(graph: graph)[0]
for index in 0 ..< numSamples {
let val = inputSamples[index]
let scaler = mulSamples[index]
let offset = addSamples[index]
samples[index] = (val * scaler) + offset
}
}
}
@@ -1,157 +0,0 @@
//
// NoiseUGens.swift
// Lyrebird
//
// Created by Joshua Parmenter on 6/1/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
open class NoiseGen : LyrebirdUGen {
fileprivate var ranGen: LyrebirdRandomNumberGenerator = LyrebirdRandomNumberGenerator(initSeed: 0)
open var seed: LyrebirdValidUGenInput = 0 {
didSet {
let newSeedInt = seed.intValue(graph: graph)
ranGen.seed = UInt32(newSeedInt)
lastSeedInt = newSeedInt
}
}
open var lastSeedInt: LyrebirdInt = 0
public required init(rate: LyrebirdUGenRate, seed: LyrebirdValidUGenInput?){
super.init(rate: rate)
self.seed = seed?.intValue(graph: graph) ?? NoiseGen.dateSeed()
}
public convenience override init(rate: LyrebirdUGenRate) {
self.init(rate: rate, seed: NoiseGen.dateSeed())
}
static func dateSeed() -> LyrebirdInt {
return LyrebirdInt(Date.timeIntervalSinceReferenceDate)
}
fileprivate func checkSeed(){
if lastSeedInt != seed.intValue(graph: graph) {
seed = LyrebirdInt(lastSeedInt)
}
}
}
public final class NoiseWhite: NoiseGen {
override public final func next(numSamples: LyrebirdInt) {
checkSeed()
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
samples[sampleIdx] = (ranGen.next() * 2.0) - 1.0
}
}
}
open class NoiseLFBase: NoiseGen {
var freq: LyrebirdValidUGenInput
internal var currentOutput: LyrebirdFloat = 0.0
internal var samplesUntilNextValue: LyrebirdInt = 0
public required init(rate: LyrebirdUGenRate, freq: LyrebirdValidUGenInput, seed: LyrebirdValidUGenInput){
self.freq = freq
super.init(rate: rate, seed: seed)
}
public convenience init(rate: LyrebirdUGenRate, freq: LyrebirdValidUGenInput) {
self.init(rate: rate, freq: freq, seed: NoiseGen.dateSeed())
}
public required init(rate: LyrebirdUGenRate, seed: LyrebirdValidUGenInput?) {
self.freq = 0
super.init(rate: rate, seed: seed)
}
override open func next(numSamples: LyrebirdInt) {
assert(false, "NoiseLFBase should not be used in a SynthGraph, or have its next function called")
}
}
public final class NoiseLFStep: NoiseLFBase {
override public final func next(numSamples: LyrebirdInt) {
checkSeed()
if (samplesUntilNextValue > numSamples) || (samplesUntilNextValue <= -1) {
samplesUntilNextValue = samplesUntilNextValue - numSamples
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
samples[sampleIdx] = currentOutput
}
} else {
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
samplesUntilNextValue = samplesUntilNextValue - 1
if(samplesUntilNextValue == 0){
let curFreq = freq.floatValue(graph: graph)
if curFreq <= 0 {
samplesUntilNextValue = -1
} else {
samplesUntilNextValue = LyrebirdInt(round(Lyrebird.engine.iSampleRate / curFreq))
if samplesUntilNextValue < 1 {
samplesUntilNextValue = 1
}
self.currentOutput = ranGen.bipolarNext()
}
}
samples[sampleIdx] = currentOutput
}
}
}
}
public final class NoiseLFLine: NoiseLFBase {
internal var prevOutputValue: LyrebirdFloat = 0.0
fileprivate var step: LyrebirdFloat = 0.0
public required init(rate: LyrebirdUGenRate, freq: LyrebirdValidUGenInput, seed: LyrebirdValidUGenInput){
super.init(rate: rate, freq: freq, seed: seed)
self.seed = seed
self.prevOutputValue = ranGen.bipolarNext()
}
public required init(rate: LyrebirdUGenRate, seed: LyrebirdValidUGenInput?) {
super.init(rate: rate, freq: 0, seed: seed ?? NoiseGen.dateSeed())
self.prevOutputValue = ranGen.bipolarNext()
}
override public final func next(numSamples: LyrebirdInt) {
checkSeed()
var currentValue = currentOutput
if (samplesUntilNextValue > numSamples) || (samplesUntilNextValue <= -1) {
samplesUntilNextValue = samplesUntilNextValue - numSamples
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
currentValue = currentValue + step
samples[sampleIdx] = currentValue
}
} else {
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
samplesUntilNextValue = samplesUntilNextValue - 1
if(samplesUntilNextValue > 0){
currentValue = currentValue + step
samples[sampleIdx] = currentValue
} else {
let curFreq = freq.floatValue(graph: graph)
if curFreq <= 0 {
samplesUntilNextValue = -1
step = 0
} else {
samplesUntilNextValue = LyrebirdInt(round( Lyrebird.engine.sampleRate / curFreq))
if samplesUntilNextValue < 1 {
samplesUntilNextValue = 1
}
let nextValue: LyrebirdFloat = ranGen.bipolarNext()
step = LyrebirdFunctions.calcSlope(startValue: prevOutputValue, endValue: nextValue, numSamples: LyrebirdFloat(samplesUntilNextValue))
currentValue = prevOutputValue
prevOutputValue = nextValue
}
samples[sampleIdx] = currentValue
}
}
}
currentOutput = currentValue
}
}
@@ -1,210 +0,0 @@
//
// OscSin.swift
// Lyrebird
//
// Created by Joshua Parmenter on 5/5/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
enum OscSinState: Int {
case ugenUgen, ugenFloat, floatUgen, floatFloat
}
public final class OscSin: LyrebirdUGen {
var freq : LyrebirdValidUGenInput
var phase : LyrebirdValidUGenInput
fileprivate var lastFreq : LyrebirdFloat = 0.0
fileprivate var lastPhase : LyrebirdFloat = 0.0
fileprivate var internalPhase : LyrebirdFloat = 0.0
fileprivate var state : OscSinState = .floatFloat
fileprivate var samplingIncrement : LyrebirdFloat = 0.0
fileprivate let mask : LyrebirdInt = LyrebirdUGenInterface.sineTableMask
fileprivate let table : [LyrebirdFloat] = LyrebirdUGenInterface.sineTable
fileprivate let tableCount : LyrebirdFloat
public required init(rate: LyrebirdUGenRate, freq: LyrebirdValidUGenInput, phase: LyrebirdValidUGenInput){
self.freq = freq
self.phase = phase
self.tableCount = LyrebirdFloat(table.count)
super.init(rate: rate)
checkState()
internalPhase = phase.floatValue(graph: graph)
let initialFreq = freq.floatValue(graph: graph)
self.lastFreq = initialFreq
self.lastPhase = internalPhase
self.samplingIncrement = self.lastFreq * LyrebirdFloat(table.count) * Lyrebird.engine.iSampleRate
}
fileprivate final func checkState(){
if freq is LyrebirdFloatUGenValue {
if phase is LyrebirdFloat {
state = .floatFloat
return
} else {
state = .floatUgen
return
}
} else {
if phase is LyrebirdFloatUGenValue {
state = .ugenFloat
return
} else {
state = .ugenUgen
}
}
}
override public final func next(numSamples: LyrebirdInt) {
switch state {
case .ugenUgen:
let u_freq: LyrebirdUGen = freq as! LyrebirdUGen
let u_phase: LyrebirdUGen = phase as! LyrebirdUGen
next(numSamples: numSamples, u_freq: u_freq, u_phase: u_phase)
break
case .ugenFloat:
let u_freq: LyrebirdUGen = freq as! LyrebirdUGen
let f_phase: LyrebirdFloat = phase.floatValue(graph: graph)
next(numSamples: numSamples, u_freq: u_freq, f_phase: f_phase)
lastPhase = f_phase
break
case .floatUgen:
let f_freq: LyrebirdFloat = freq.floatValue(graph: graph)
let u_phase: LyrebirdUGen = phase as! LyrebirdUGen
next(numSamples: numSamples, f_freq: f_freq, u_phase: u_phase)
lastFreq = f_freq
break
case .floatFloat:
let f_freq: LyrebirdFloat = freq.floatValue(graph: graph)
let f_phase: LyrebirdFloat = phase.floatValue(graph: graph)
next(numSamples: numSamples, f_freq: f_freq, f_phase: f_phase)
lastFreq = f_freq
lastPhase = f_phase
break
}
internalPhase = internalPhase.truncatingRemainder(dividingBy: tableCount)
}
fileprivate final func next(numSamples: LyrebirdInt, u_freq: LyrebirdUGen, u_phase: LyrebirdUGen) {
let freqSamples: [LyrebirdFloat] = u_freq.sampleBlock(graph: graph, previousValue: 0.0)
var f_freq: LyrebirdFloat = 0.0
let phaseSamples: [LyrebirdFloat] = u_phase.sampleBlock(graph: graph, previousValue: 0.0)
var f_phase: LyrebirdFloat = 0.0
let incrementScaler = LyrebirdFloat(table.count) * Lyrebird.engine.iSampleRate
let tableCountTimesTwoPI = M_RTWOPI * tableCount
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
f_freq = freqSamples[sampleIdx]
f_phase = phaseSamples[sampleIdx]
let phaseOffsetDiff = (f_phase - lastPhase) * tableCountTimesTwoPI
samplingIncrement = (f_freq * incrementScaler) + phaseOffsetDiff
samples[sampleIdx] = LyrebirdFunctions.sineLookup(sampleIdx: internalPhase, mask: mask, table: table)
internalPhase = internalPhase + samplingIncrement
lastPhase = f_phase
}
}
fileprivate final func next(numSamples: LyrebirdInt, f_freq: LyrebirdFloat, u_phase: LyrebirdUGen) {
var freqSlope: LyrebirdFloat = 0.0
var freq: LyrebirdFloat = lastFreq
if lastFreq != f_freq {
freqSlope = LyrebirdFunctions.calcSlope(startValue: lastFreq, endValue: f_freq)
}
let phaseSamples: [LyrebirdFloat] = u_phase.sampleBlock(graph: graph, previousValue: 0.0)
var f_phase: LyrebirdFloat = 0.0
let incrementScaler = LyrebirdFloat(table.count) * Lyrebird.engine.iSampleRate
let tableCountTimesTwoPI = M_RTWOPI * tableCount
var phaseOffsetDiff = 0.0
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
f_phase = phaseSamples[sampleIdx]
phaseOffsetDiff = (f_phase - lastPhase) * tableCountTimesTwoPI
samplingIncrement = (freq * incrementScaler) + phaseOffsetDiff
samples[sampleIdx] = LyrebirdFunctions.sineLookup(sampleIdx: internalPhase, mask: mask, table: table)
internalPhase = internalPhase + samplingIncrement
lastPhase = f_phase
freq = freq + freqSlope
}
}
fileprivate final func next(numSamples: LyrebirdInt, u_freq: LyrebirdUGen, f_phase: LyrebirdFloat) {
let freqSamples: [LyrebirdFloat] = u_freq.sampleBlock(graph: graph, previousValue: 0.0)
var f_freq: LyrebirdFloat = 0.0
var phaseSlope: LyrebirdFloat = 0.0
let tableCountTimesTwoPI = M_RTWOPI * tableCount
if lastPhase != f_phase {
phaseSlope = LyrebirdFunctions.calcSlope(startValue: lastPhase, endValue: f_phase)
phaseSlope = phaseSlope * tableCountTimesTwoPI
}
let incrementScaler = LyrebirdFloat(table.count) * Lyrebird.engine.iSampleRate
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
f_freq = freqSamples[sampleIdx]
samplingIncrement = (f_freq * incrementScaler) + phaseSlope
samples[sampleIdx] = LyrebirdFunctions.sineLookup(sampleIdx: internalPhase, mask: mask, table: table)
internalPhase = internalPhase + samplingIncrement
}
}
fileprivate final func next(numSamples: LyrebirdInt, f_freq: LyrebirdFloat, f_phase: LyrebirdFloat) {
var sampleIncSlope: LyrebirdFloat = 0.0
if lastFreq != f_freq || lastPhase != f_phase {
samplingIncrement = f_freq * LyrebirdFloat(table.count) * Lyrebird.engine.iSampleRate
let phaseOffsetDiff = (f_phase - lastPhase) * M_RTWOPI * tableCount
let nextSamplingIncrement = (f_freq * LyrebirdFloat(table.count) * Lyrebird.engine.iSampleRate) + phaseOffsetDiff
sampleIncSlope = LyrebirdFunctions.calcSlope(startValue: samplingIncrement, endValue: nextSamplingIncrement)
}
let phaseSlope = lastPhase != f_phase ? LyrebirdFunctions.calcSlope(startValue: lastPhase, endValue: f_phase) : 0.0
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
samples[sampleIdx] = LyrebirdFunctions.sineLookup(sampleIdx: internalPhase, mask: mask, table: table)
internalPhase = internalPhase + samplingIncrement + sampleIncSlope + phaseSlope
}
}
}
public final class Impulse : LyrebirdUGen {
var samplesRemain: LyrebirdInt = 0
var freq: LyrebirdValidUGenInput
// phase values between 0.0 and 1.0
public required init(rate: LyrebirdUGenRate, freq: LyrebirdValidUGenInput = 0.0, initPhase: LyrebirdValidUGenInput = 0.0){
self.freq = freq
super.init(rate: rate)
let phase: LyrebirdFloat = initPhase.floatValue(graph: graph).truncatingRemainder(dividingBy: 1.0)
if(phase > 0.0){
self.calcNextImpulse()
samplesRemain = LyrebirdInt(round(LyrebirdFloat(samplesRemain) * (1.0 - phase)))
} else {
samplesRemain = 0
}
}
fileprivate final func calcNextImpulse(){
let f_freq = freq.floatValue(graph: graph)
if(f_freq > 0.0){
samplesRemain = LyrebirdInt(round(Lyrebird.engine.sampleRate / f_freq))
if samplesRemain < 1 {
samplesRemain = 1
}
} else {
samplesRemain = -1
}
}
public final override func next(numSamples: LyrebirdInt) {
if(samplesRemain > numSamples){
samplesRemain = samplesRemain - numSamples
samples = LyrebirdUGen.zeroedSamples
}
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
if samplesRemain != 0 {
samples[sampleIdx] = 0.0
samplesRemain = samplesRemain - 1
} else {
samples[sampleIdx] = 1.0
calcNextImpulse()
}
}
}
}
@@ -1,62 +0,0 @@
//
// TriggerUGens.swift
// Lyrebird
//
// Created by Joshua Parmenter on 6/29/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
public typealias LyrebirdTriggerValueBlock = (_ triggerValue: LyrebirdFloat, _ counter: LyrebirdInt) -> LyrebirdFloat
open class TriggerUGens: LyrebirdUGen {
var currentTriggerValue: LyrebirdFloat = 0.0
var currentOutput: LyrebirdFloat = 0.0
internal var trigger: LyrebirdValidUGenInput
internal var counter: LyrebirdInt = 0
public required init(rate: LyrebirdUGenRate, trigger: LyrebirdValidUGenInput = 0.0){
self.trigger = trigger
super.init(rate: rate)
}
internal func checkForTriggerSamples() -> [LyrebirdFloat]? {
let triggerSampleArray = trigger.calculatedSamples(graph: graph)
guard triggerSampleArray.count > 0 else {
return nil
}
return triggerSampleArray[0] // TODO: fix up for multi-channel
}
}
open class TriggerWithBlock: TriggerUGens {
var triggerBlock: LyrebirdTriggerValueBlock?
public required init(rate: LyrebirdUGenRate, trigger: LyrebirdValidUGenInput = 0.0, triggerBlock: LyrebirdTriggerValueBlock?) {
super.init(rate: rate, trigger: trigger)
self.triggerBlock = triggerBlock
self.currentTriggerValue = trigger.floatValue(graph: graph)
}
public required convenience init(rate: LyrebirdUGenRate, trigger: LyrebirdValidUGenInput) {
self.init(rate: rate, trigger: trigger, triggerBlock: nil)
}
override open func next(numSamples: LyrebirdInt) {
if let triggerSamples = checkForTriggerSamples() {
for sampleIdx: LyrebirdInt in 0 ..< numSamples {
let nextTriggerSample = triggerSamples[sampleIdx]
if currentTriggerValue <= 0 {
if nextTriggerSample > 0.0 {
currentTriggerValue = nextTriggerSample
if let triggerBlock = self.triggerBlock {
currentOutput = triggerBlock(currentTriggerValue, counter)
counter = counter + 1 // watch for overflow!
}
}
}
currentTriggerValue = nextTriggerSample
samples[sampleIdx] = currentOutput
}
}
}
}
@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
@@ -1,36 +0,0 @@
//
// LyrebirdSynthTests.swift
// LyrebirdSynthTests
//
// Created by Joshua Parmenter on 5/1/16.
// Copyright © 2016 Op133Studios. All rights reserved.
//
import XCTest
@testable import LyrebirdSynth
class LyrebirdSynthTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock {
// Put the code you want to measure the time of here.
}
}
}
@@ -1,9 +0,0 @@
//: Playground - noun: a place where people can play
import Cocoa
var str = "Hello, playground"
var test: Int8 = 10
test = 127
@@ -1,355 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
0317A3B01CDAC3DB009C28D6 /* LyrebirdSynthUgen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0317A3AF1CDAC3DB009C28D6 /* LyrebirdSynthUgen.swift */; };
0317A3B21CDAC460009C28D6 /* LyrebirdSynthWire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0317A3B11CDAC460009C28D6 /* LyrebirdSynthWire.swift */; };
0317A3B41CDB0BA8009C28D6 /* LyrebirdSynthConsts.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0317A3B31CDB0BA8009C28D6 /* LyrebirdSynthConsts.swift */; };
0317A3B61CDB0FF4009C28D6 /* LyrebirdSynthFunctions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0317A3B51CDB0FF4009C28D6 /* LyrebirdSynthFunctions.swift */; };
03C77F071CD9A99C003A753B /* LyrebirdSynth.h in Headers */ = {isa = PBXBuildFile; fileRef = 03C77EFC1CD9A99C003A753B /* LyrebirdSynth.h */; };
03C77F081CD9A99C003A753B /* LyrebirdSynthAudioChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77EFD1CD9A99C003A753B /* LyrebirdSynthAudioChannel.swift */; };
03C77F091CD9A99C003A753B /* LyrebirdSynthControlChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77EFE1CD9A99C003A753B /* LyrebirdSynthControlChannel.swift */; };
03C77F0A1CD9A99C003A753B /* LyrebirdSynthEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77EFF1CD9A99C003A753B /* LyrebirdSynthEngine.swift */; };
03C77F0B1CD9A99C003A753B /* LyrebirdSynthMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77F001CD9A99C003A753B /* LyrebirdSynthMain.swift */; };
03C77F0C1CD9A99C003A753B /* LyrebirdSynthNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77F011CD9A99C003A753B /* LyrebirdSynthNode.swift */; };
03C77F0D1CD9A99C003A753B /* LyrebirdSynthTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77F021CD9A99C003A753B /* LyrebirdSynthTypes.swift */; };
03C77F121CD9AB0E003A753B /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 03C77F041CD9A99C003A753B /* Info.plist */; };
03C77F191CD9AE42003A753B /* LyrebirdSynthRawAudioChannel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77F181CD9AE42003A753B /* LyrebirdSynthRawAudioChannel.swift */; };
03C77F1B1CD9BAB3003A753B /* LyrebirdSynthGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03C77F1A1CD9BAB3003A753B /* LyrebirdSynthGraph.swift */; };
03EBC3251CDBF5C90097F7AF /* OscSin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EBC3241CDBF5C90097F7AF /* OscSin.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
0317A3AF1CDAC3DB009C28D6 /* LyrebirdSynthUgen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthUgen.swift; sourceTree = "<group>"; };
0317A3B11CDAC460009C28D6 /* LyrebirdSynthWire.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthWire.swift; sourceTree = "<group>"; };
0317A3B31CDB0BA8009C28D6 /* LyrebirdSynthConsts.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthConsts.swift; sourceTree = "<group>"; };
0317A3B51CDB0FF4009C28D6 /* LyrebirdSynthFunctions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthFunctions.swift; sourceTree = "<group>"; };
03C77EA01CD6B20B003A753B /* Lyrebird.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Lyrebird.framework; sourceTree = BUILT_PRODUCTS_DIR; };
03C77EFB1CD9A99C003A753B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
03C77EFC1CD9A99C003A753B /* LyrebirdSynth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LyrebirdSynth.h; sourceTree = "<group>"; };
03C77EFD1CD9A99C003A753B /* LyrebirdSynthAudioChannel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthAudioChannel.swift; sourceTree = "<group>"; };
03C77EFE1CD9A99C003A753B /* LyrebirdSynthControlChannel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthControlChannel.swift; sourceTree = "<group>"; };
03C77EFF1CD9A99C003A753B /* LyrebirdSynthEngine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthEngine.swift; sourceTree = "<group>"; };
03C77F001CD9A99C003A753B /* LyrebirdSynthMain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthMain.swift; sourceTree = "<group>"; };
03C77F011CD9A99C003A753B /* LyrebirdSynthNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthNode.swift; sourceTree = "<group>"; };
03C77F021CD9A99C003A753B /* LyrebirdSynthTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthTypes.swift; sourceTree = "<group>"; };
03C77F041CD9A99C003A753B /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
03C77F181CD9AE42003A753B /* LyrebirdSynthRawAudioChannel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthRawAudioChannel.swift; sourceTree = "<group>"; };
03C77F1A1CD9BAB3003A753B /* LyrebirdSynthGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LyrebirdSynthGraph.swift; sourceTree = "<group>"; };
03EBC3241CDBF5C90097F7AF /* OscSin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OscSin.swift; path = UGens/OscSin.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
03C77E9C1CD6B20B003A753B /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
03C77E961CD6B20B003A753B = {
isa = PBXGroup;
children = (
03C77EFA1CD9A99C003A753B /* LyrebirdSynth */,
03C77F031CD9A99C003A753B /* LyrebirdSynthTests */,
03C77EA11CD6B20B003A753B /* Products */,
);
sourceTree = "<group>";
};
03C77EA11CD6B20B003A753B /* Products */ = {
isa = PBXGroup;
children = (
03C77EA01CD6B20B003A753B /* Lyrebird.framework */,
);
name = Products;
sourceTree = "<group>";
};
03C77EFA1CD9A99C003A753B /* LyrebirdSynth */ = {
isa = PBXGroup;
children = (
03C77EFB1CD9A99C003A753B /* Info.plist */,
03C77EFC1CD9A99C003A753B /* LyrebirdSynth.h */,
03C77EFD1CD9A99C003A753B /* LyrebirdSynthAudioChannel.swift */,
03C77F181CD9AE42003A753B /* LyrebirdSynthRawAudioChannel.swift */,
03C77EFE1CD9A99C003A753B /* LyrebirdSynthControlChannel.swift */,
03C77EFF1CD9A99C003A753B /* LyrebirdSynthEngine.swift */,
03C77F001CD9A99C003A753B /* LyrebirdSynthMain.swift */,
03C77F011CD9A99C003A753B /* LyrebirdSynthNode.swift */,
03C77F021CD9A99C003A753B /* LyrebirdSynthTypes.swift */,
0317A3B31CDB0BA8009C28D6 /* LyrebirdSynthConsts.swift */,
0317A3B51CDB0FF4009C28D6 /* LyrebirdSynthFunctions.swift */,
03C77F1A1CD9BAB3003A753B /* LyrebirdSynthGraph.swift */,
0317A3AF1CDAC3DB009C28D6 /* LyrebirdSynthUgen.swift */,
0317A3B11CDAC460009C28D6 /* LyrebirdSynthWire.swift */,
03EBC3241CDBF5C90097F7AF /* OscSin.swift */,
);
path = LyrebirdSynth;
sourceTree = "<group>";
};
03C77F031CD9A99C003A753B /* LyrebirdSynthTests */ = {
isa = PBXGroup;
children = (
03C77F041CD9A99C003A753B /* Info.plist */,
);
path = LyrebirdSynthTests;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
03C77E9D1CD6B20B003A753B /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
03C77F071CD9A99C003A753B /* LyrebirdSynth.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
03C77E9F1CD6B20B003A753B /* Lyrebird */ = {
isa = PBXNativeTarget;
buildConfigurationList = 03C77EB41CD6B20B003A753B /* Build configuration list for PBXNativeTarget "Lyrebird" */;
buildPhases = (
03C77E9B1CD6B20B003A753B /* Sources */,
03C77E9C1CD6B20B003A753B /* Frameworks */,
03C77E9D1CD6B20B003A753B /* Headers */,
03C77E9E1CD6B20B003A753B /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = Lyrebird;
productName = SwiftSynth;
productReference = 03C77EA01CD6B20B003A753B /* Lyrebird.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
03C77E971CD6B20B003A753B /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = Op133Studios;
TargetAttributes = {
03C77E9F1CD6B20B003A753B = {
CreatedOnToolsVersion = 7.3;
};
};
};
buildConfigurationList = 03C77E9A1CD6B20B003A753B /* Build configuration list for PBXProject "Lyrebird" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 03C77E961CD6B20B003A753B;
productRefGroup = 03C77EA11CD6B20B003A753B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
03C77E9F1CD6B20B003A753B /* Lyrebird */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
03C77E9E1CD6B20B003A753B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
03C77F121CD9AB0E003A753B /* Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
03C77E9B1CD6B20B003A753B /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0317A3B01CDAC3DB009C28D6 /* LyrebirdSynthUgen.swift in Sources */,
03C77F1B1CD9BAB3003A753B /* LyrebirdSynthGraph.swift in Sources */,
03C77F0A1CD9A99C003A753B /* LyrebirdSynthEngine.swift in Sources */,
0317A3B41CDB0BA8009C28D6 /* LyrebirdSynthConsts.swift in Sources */,
03C77F081CD9A99C003A753B /* LyrebirdSynthAudioChannel.swift in Sources */,
03C77F191CD9AE42003A753B /* LyrebirdSynthRawAudioChannel.swift in Sources */,
03C77F0B1CD9A99C003A753B /* LyrebirdSynthMain.swift in Sources */,
03EBC3251CDBF5C90097F7AF /* OscSin.swift in Sources */,
0317A3B61CDB0FF4009C28D6 /* LyrebirdSynthFunctions.swift in Sources */,
03C77F091CD9A99C003A753B /* LyrebirdSynthControlChannel.swift in Sources */,
03C77F0C1CD9A99C003A753B /* LyrebirdSynthNode.swift in Sources */,
0317A3B21CDAC460009C28D6 /* LyrebirdSynthWire.swift in Sources */,
03C77F0D1CD9A99C003A753B /* LyrebirdSynthTypes.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
03C77EB21CD6B20B003A753B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
03C77EB31CD6B20B003A753B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
03C77EB51CD6B20B003A753B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = LyrebirdSynth/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.op133studios.LyrebirdSynth;
PRODUCT_NAME = Lyrebird;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
03C77EB61CD6B20B003A753B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = LyrebirdSynth/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.op133studios.LyrebirdSynth;
PRODUCT_NAME = Lyrebird;
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
03C77E9A1CD6B20B003A753B /* Build configuration list for PBXProject "Lyrebird" */ = {
isa = XCConfigurationList;
buildConfigurations = (
03C77EB21CD6B20B003A753B /* Debug */,
03C77EB31CD6B20B003A753B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
03C77EB41CD6B20B003A753B /* Build configuration list for PBXNativeTarget "Lyrebird" */ = {
isa = XCConfigurationList;
buildConfigurations = (
03C77EB51CD6B20B003A753B /* Debug */,
03C77EB61CD6B20B003A753B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 03C77E971CD6B20B003A753B /* Project object */;
}
@@ -1,99 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77E9F1CD6B20B003A753B"
BuildableName = "Lyrebird.framework"
BlueprintName = "Lyrebird"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77EA91CD6B20B003A753B"
BuildableName = "Lyrebird.xctest"
BlueprintName = "LyrebirdTests"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77E9F1CD6B20B003A753B"
BuildableName = "Lyrebird.framework"
BlueprintName = "Lyrebird"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77E9F1CD6B20B003A753B"
BuildableName = "Lyrebird.framework"
BlueprintName = "Lyrebird"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "03C77E9F1CD6B20B003A753B"
BuildableName = "Lyrebird.framework"
BlueprintName = "Lyrebird"
ReferencedContainer = "container:Lyrebird.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>LyrebirdSynth.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>03C77E9F1CD6B20B003A753B</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>03C77EA91CD6B20B003A753B</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='osx' display-mode='raw'>
<timeline fileName='timeline.xctimeline'/>
</playground>
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildLocationStyle</key>
<string>UseAppPreferences</string>
<key>CustomBuildLocationType</key>
<string>RelativeToDerivedData</string>
<key>DerivedDataLocationStyle</key>
<string>Default</string>
<key>IssueFilterStyle</key>
<string>ShowActiveSchemeOnly</string>
<key>LiveSourceIssuesEnabled</key>
<true/>
</dict>
</plist>
-1
View File
@@ -1 +0,0 @@
# Lyrebird