diff --git a/.classpath b/.classpath index 62bee98..3b31f16 100644 --- a/.classpath +++ b/.classpath @@ -1,19 +1,19 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore index c7b3c88..e512c93 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ +#gradle stuff build/ -bin/ +.gradle/ + +#idea stuff .idea/ # This is a file that is generated by one of the tutorial lessons audio/lesson_09_out.wav -target + diff --git a/.gradle/6.3/executionHistory/executionHistory.bin b/.gradle/6.3/executionHistory/executionHistory.bin new file mode 100644 index 0000000..a6578bf Binary files /dev/null and b/.gradle/6.3/executionHistory/executionHistory.bin differ diff --git a/.gradle/6.3/executionHistory/executionHistory.lock b/.gradle/6.3/executionHistory/executionHistory.lock new file mode 100644 index 0000000..71324bc Binary files /dev/null and b/.gradle/6.3/executionHistory/executionHistory.lock differ diff --git a/.gradle/6.3/fileChanges/last-build.bin b/.gradle/6.3/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/6.3/fileChanges/last-build.bin differ diff --git a/.gradle/6.3/fileContent/fileContent.lock b/.gradle/6.3/fileContent/fileContent.lock new file mode 100644 index 0000000..a5bba91 Binary files /dev/null and b/.gradle/6.3/fileContent/fileContent.lock differ diff --git a/.gradle/6.3/fileHashes/fileHashes.bin b/.gradle/6.3/fileHashes/fileHashes.bin new file mode 100644 index 0000000..fa22fa3 Binary files /dev/null and b/.gradle/6.3/fileHashes/fileHashes.bin differ diff --git a/.gradle/6.3/fileHashes/fileHashes.lock b/.gradle/6.3/fileHashes/fileHashes.lock new file mode 100644 index 0000000..876b5ea Binary files /dev/null and b/.gradle/6.3/fileHashes/fileHashes.lock differ diff --git a/.gradle/6.3/gc.properties b/.gradle/6.3/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/6.3/javaCompile/classAnalysis.bin b/.gradle/6.3/javaCompile/classAnalysis.bin new file mode 100644 index 0000000..d3577ee Binary files /dev/null and b/.gradle/6.3/javaCompile/classAnalysis.bin differ diff --git a/.gradle/6.3/javaCompile/javaCompile.lock b/.gradle/6.3/javaCompile/javaCompile.lock new file mode 100644 index 0000000..0d48ecb Binary files /dev/null and b/.gradle/6.3/javaCompile/javaCompile.lock differ diff --git a/.gradle/6.3/javaCompile/taskHistory.bin b/.gradle/6.3/javaCompile/taskHistory.bin new file mode 100644 index 0000000..deab4e2 Binary files /dev/null and b/.gradle/6.3/javaCompile/taskHistory.bin differ diff --git a/.gradle/6.4.1/executionHistory/executionHistory.bin b/.gradle/6.4.1/executionHistory/executionHistory.bin new file mode 100644 index 0000000..09b5126 Binary files /dev/null and b/.gradle/6.4.1/executionHistory/executionHistory.bin differ diff --git a/.gradle/6.4.1/executionHistory/executionHistory.lock b/.gradle/6.4.1/executionHistory/executionHistory.lock new file mode 100644 index 0000000..27e3ae9 Binary files /dev/null and b/.gradle/6.4.1/executionHistory/executionHistory.lock differ diff --git a/.gradle/6.4.1/fileChanges/last-build.bin b/.gradle/6.4.1/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/6.4.1/fileChanges/last-build.bin differ diff --git a/.gradle/6.4.1/fileContent/fileContent.lock b/.gradle/6.4.1/fileContent/fileContent.lock new file mode 100644 index 0000000..d99bc05 Binary files /dev/null and b/.gradle/6.4.1/fileContent/fileContent.lock differ diff --git a/.gradle/6.4.1/fileHashes/fileHashes.bin b/.gradle/6.4.1/fileHashes/fileHashes.bin new file mode 100644 index 0000000..bc9135d Binary files /dev/null and b/.gradle/6.4.1/fileHashes/fileHashes.bin differ diff --git a/.gradle/6.4.1/fileHashes/fileHashes.lock b/.gradle/6.4.1/fileHashes/fileHashes.lock new file mode 100644 index 0000000..37761bd Binary files /dev/null and b/.gradle/6.4.1/fileHashes/fileHashes.lock differ diff --git a/.gradle/6.4.1/fileHashes/resourceHashesCache.bin b/.gradle/6.4.1/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..4420b28 Binary files /dev/null and b/.gradle/6.4.1/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/6.4.1/gc.properties b/.gradle/6.4.1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/6.4.1/javaCompile/classAnalysis.bin b/.gradle/6.4.1/javaCompile/classAnalysis.bin new file mode 100644 index 0000000..e695476 Binary files /dev/null and b/.gradle/6.4.1/javaCompile/classAnalysis.bin differ diff --git a/.gradle/6.4.1/javaCompile/jarAnalysis.bin b/.gradle/6.4.1/javaCompile/jarAnalysis.bin new file mode 100644 index 0000000..59b5281 Binary files /dev/null and b/.gradle/6.4.1/javaCompile/jarAnalysis.bin differ diff --git a/.gradle/6.4.1/javaCompile/javaCompile.lock b/.gradle/6.4.1/javaCompile/javaCompile.lock new file mode 100644 index 0000000..aa62f7b Binary files /dev/null and b/.gradle/6.4.1/javaCompile/javaCompile.lock differ diff --git a/.gradle/6.4.1/javaCompile/taskHistory.bin b/.gradle/6.4.1/javaCompile/taskHistory.bin new file mode 100644 index 0000000..454feb7 Binary files /dev/null and b/.gradle/6.4.1/javaCompile/taskHistory.bin differ diff --git a/.gradle/6.5/executionHistory/executionHistory.bin b/.gradle/6.5/executionHistory/executionHistory.bin new file mode 100644 index 0000000..637ac17 Binary files /dev/null and b/.gradle/6.5/executionHistory/executionHistory.bin differ diff --git a/.gradle/6.5/executionHistory/executionHistory.lock b/.gradle/6.5/executionHistory/executionHistory.lock new file mode 100644 index 0000000..c4efca6 Binary files /dev/null and b/.gradle/6.5/executionHistory/executionHistory.lock differ diff --git a/.gradle/6.5/fileChanges/last-build.bin b/.gradle/6.5/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/.gradle/6.5/fileChanges/last-build.bin differ diff --git a/.gradle/6.5/fileContent/fileContent.lock b/.gradle/6.5/fileContent/fileContent.lock new file mode 100644 index 0000000..5fa329f Binary files /dev/null and b/.gradle/6.5/fileContent/fileContent.lock differ diff --git a/.gradle/6.5/fileHashes/fileHashes.bin b/.gradle/6.5/fileHashes/fileHashes.bin new file mode 100644 index 0000000..7ed05c8 Binary files /dev/null and b/.gradle/6.5/fileHashes/fileHashes.bin differ diff --git a/.gradle/6.5/fileHashes/fileHashes.lock b/.gradle/6.5/fileHashes/fileHashes.lock new file mode 100644 index 0000000..418fa6c Binary files /dev/null and b/.gradle/6.5/fileHashes/fileHashes.lock differ diff --git a/.gradle/6.5/fileHashes/resourceHashesCache.bin b/.gradle/6.5/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..0e43a7f Binary files /dev/null and b/.gradle/6.5/fileHashes/resourceHashesCache.bin differ diff --git a/.gradle/6.5/gc.properties b/.gradle/6.5/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/6.5/javaCompile/classAnalysis.bin b/.gradle/6.5/javaCompile/classAnalysis.bin new file mode 100644 index 0000000..b07af79 Binary files /dev/null and b/.gradle/6.5/javaCompile/classAnalysis.bin differ diff --git a/.gradle/6.5/javaCompile/jarAnalysis.bin b/.gradle/6.5/javaCompile/jarAnalysis.bin new file mode 100644 index 0000000..2c529e8 Binary files /dev/null and b/.gradle/6.5/javaCompile/jarAnalysis.bin differ diff --git a/.gradle/6.5/javaCompile/javaCompile.lock b/.gradle/6.5/javaCompile/javaCompile.lock new file mode 100644 index 0000000..b5832a1 Binary files /dev/null and b/.gradle/6.5/javaCompile/javaCompile.lock differ diff --git a/.gradle/6.5/javaCompile/taskHistory.bin b/.gradle/6.5/javaCompile/taskHistory.bin new file mode 100644 index 0000000..8f2d202 Binary files /dev/null and b/.gradle/6.5/javaCompile/taskHistory.bin differ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..d1ae84b Binary files /dev/null and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..d2261d9 --- /dev/null +++ b/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Fri Oct 15 15:00:37 AEDT 2021 +gradle.version=6.4.1 diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..bc43cda Binary files /dev/null and b/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/.gradle/checksums/checksums.lock b/.gradle/checksums/checksums.lock new file mode 100644 index 0000000..c1cffdc Binary files /dev/null and b/.gradle/checksums/checksums.lock differ diff --git a/.gradle/checksums/md5-checksums.bin b/.gradle/checksums/md5-checksums.bin new file mode 100644 index 0000000..42636db Binary files /dev/null and b/.gradle/checksums/md5-checksums.bin differ diff --git a/.gradle/checksums/sha1-checksums.bin b/.gradle/checksums/sha1-checksums.bin new file mode 100644 index 0000000..ea7c788 Binary files /dev/null and b/.gradle/checksums/sha1-checksums.bin differ diff --git a/.gradle/checksums/sha256-checksums.bin b/.gradle/checksums/sha256-checksums.bin new file mode 100644 index 0000000..f8b316b Binary files /dev/null and b/.gradle/checksums/sha256-checksums.bin differ diff --git a/.gradle/checksums/sha512-checksums.bin b/.gradle/checksums/sha512-checksums.bin new file mode 100644 index 0000000..1cf7697 Binary files /dev/null and b/.gradle/checksums/sha512-checksums.bin differ diff --git a/.gradle/vcs-1/gc.properties b/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/.gradle/workspace-id.txt b/.gradle/workspace-id.txt new file mode 100644 index 0000000..e75d9a2 Binary files /dev/null and b/.gradle/workspace-id.txt differ diff --git a/.gradle/workspace-id.txt.lock b/.gradle/workspace-id.txt.lock new file mode 100644 index 0000000..a10af15 Binary files /dev/null and b/.gradle/workspace-id.txt.lock differ diff --git a/.project b/.project index 4854b2d..51e9b24 100644 --- a/.project +++ b/.project @@ -1,7 +1,7 @@ - Beads - + beads + Project beads created by Buildship. @@ -10,9 +10,14 @@ + + org.eclipse.buildship.core.gradleprojectbuilder + + + org.eclipse.jdt.core.javanature - javafx.eclipse.f3editor.builder.F3Nature + org.eclipse.buildship.core.gradleprojectnature diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 0000000..e889521 --- /dev/null +++ b/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir= +eclipse.preferences.version=1 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f5396e7..0000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Fri May 14 23:02:35 EST 2010 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/Beads.iml b/Beads.iml deleted file mode 100644 index 9ea022f..0000000 --- a/Beads.iml +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5f421b5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,50 @@ +# Changelog + +## 3.2 (Release) - 22/9/2020 + +### **Added** + +* Users are now able to designate what type of data structure they want to use for storing and retrieving UGens + * ie. Choice between ArrayLists or LinkedLists + * UGens will use ArrayLists by default, if nothing is declared +* CrossFade Loop for LoopType.FINE has been added to SamplePlayer (Requires Further Testing) + * Users must set a loop start and loop end point for crossfade to work + * CrossFade available for forward, backward and alternating loops + * Crossfade length cannot be less than 0, and if the user sets a value that is too large, it will automatically use the largest allowable length +* Fast Granular Sample Player has now been added. + * This UGen provides the same base functionality as Granular Sample Player, except it trades away some automation capabilities for performance boosts. + * ie Rate, Grain Size and Grain Interval are treated as floats and any subsequent Envelope Segments will not be used. + +### **Fixed** + +* SampleManager now properly returns error messages & exceptions when failing to load a sample. +* resizeWithZero() in Sample now poperly allocates a new array while transferring over existing data and zeroes out any extra empty slots. + +### **Changed** + +* Implementation has been changed to support JAudioLibs v2 (Released 18/8/20) + * Modules effected: AudioServer Javasound & AudioServer JACK +* Licensing has been corrected: from Apache -> GPL3 +* Processing Build has now been reverted to a thin package, showing all external libraries inside the /libs folder +* Default Audio Contexts have been updated + * Refer to examples (Processing/examples or src/beads_tutorials) for how to use this. + +## 3.1 - 23/7/2020 + +### **Added** + +* Experimental CrossFade Loop has been added to SamplePlayer + * Users must set a loop start point and a loop end point for crossfade to work. +* Instructions in the README file for setting up Maven or Gradle dependencies. + +### **Fixed** + +* Build.gradle for Maven Beads Distribution (v3.1) has been fixed to properly manage and locate dependencies now. + +## 3.0 - 9/7/2020 + +### **Changed** + +* Processing library build has now been flattened +* Build.gradle can now upload subsequent releases to Sonatype OSSRH + * Credentials are stored in the .gradle folder seperate from this project. diff --git a/README.md b/README.md index e45ccc0..d00dfc3 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,103 @@ + + # The Beads Project +![](http://www.beadsproject.net/minimalismheader.jpeg) This is the Beads project, a Java library for creative realtime audio and music, which is also available as a library for Processing. -Written by Ollie Bown, with contributions from Ben Porter, Benito, Aengus Martin, Neil Smith and Evan Merz. It also uses some code from other Java projects including MEAP and JASS. +Written by Ollie Bown, with contributions from Ben Porter, Benito, Aengus Martin, Neil Smith, Evan Merz, Angelo Fraietta and Charlton Wong. It also uses some code from other Java projects including MEAP and JASS. For convenience it wraps Java dependencies Tritonus, JavaZOOM, mp3spi and JAudioLibs. The library is licensed under the Gnu Public License (GPL v3). Contact ollie at icarus.nu if you have any questions. +For examples on how to use this library, see the [tutorials.](https://github.com/orsjb/beads/tree/master/src/beads_tutorial/java) For all other information, see http://www.beadsproject.net. + + + +## How to Install + + + +Beads uses the Tritonus library found in the clojars repository.
+ + + +#### Maven \[Current Release: [3.2](https://search.maven.org/artifact/net.beadsproject/beads/3.2/jar)\] + +Add the following to pom.xml: + + + +``` + + + + clojars_repo + + https://clojars.org/repo/ + + + + + + .... + + + + + + net.beadsproject + + beads + + 3.2 + + + +``` + + + +#### Gradle + + + +Add the following to build.gradle: + + + +``` + +repositories { + + maven {url "https://clojars.org/repo"} + +} + + + +... + + + +dependencies { + + implementation 'net.beadsproject:beads:3.2' + +} + +``` + + + +#### Manual Installation + +Please visit [beadsproject.net](http://www.beadsproject.net) for beads.jar and manual installation instructions for Eclipse or Processing. + + + +## Changelog + + + +[Latest Version: 3.2](https://github.com/orsjb/beads/blob/master/CHANGELOG.md) diff --git a/audio/1234.aif b/audio/1234.aif deleted file mode 100644 index ceb7173..0000000 Binary files a/audio/1234.aif and /dev/null differ diff --git a/audio/kick_back.wav b/audio/kick_back.wav new file mode 100644 index 0000000..8b46fdc Binary files /dev/null and b/audio/kick_back.wav differ diff --git a/bin/Lesson01_AudioContext.class b/bin/Lesson01_AudioContext.class new file mode 100644 index 0000000..7b4a5a7 Binary files /dev/null and b/bin/Lesson01_AudioContext.class differ diff --git a/bin/Lesson02_EnvelopeAndWavePlayer.class b/bin/Lesson02_EnvelopeAndWavePlayer.class new file mode 100644 index 0000000..49ccc00 Binary files /dev/null and b/bin/Lesson02_EnvelopeAndWavePlayer.class differ diff --git a/bin/Lesson03_FMSynthesis$1.class b/bin/Lesson03_FMSynthesis$1.class new file mode 100644 index 0000000..e509d0f Binary files /dev/null and b/bin/Lesson03_FMSynthesis$1.class differ diff --git a/bin/Lesson03_FMSynthesis.class b/bin/Lesson03_FMSynthesis.class new file mode 100644 index 0000000..055c476 Binary files /dev/null and b/bin/Lesson03_FMSynthesis.class differ diff --git a/bin/Lesson04_SamplePlayer.class b/bin/Lesson04_SamplePlayer.class new file mode 100644 index 0000000..49419d0 Binary files /dev/null and b/bin/Lesson04_SamplePlayer.class differ diff --git a/bin/Lesson05_Clock.class b/bin/Lesson05_Clock.class new file mode 100644 index 0000000..aedc2a8 Binary files /dev/null and b/bin/Lesson05_Clock.class differ diff --git a/bin/Lesson06_Trigger$1.class b/bin/Lesson06_Trigger$1.class new file mode 100644 index 0000000..2f35798 Binary files /dev/null and b/bin/Lesson06_Trigger$1.class differ diff --git a/bin/Lesson06_Trigger.class b/bin/Lesson06_Trigger.class new file mode 100644 index 0000000..0268797 Binary files /dev/null and b/bin/Lesson06_Trigger.class differ diff --git a/bin/Lesson07_Music$1.class b/bin/Lesson07_Music$1.class new file mode 100644 index 0000000..b35a81e Binary files /dev/null and b/bin/Lesson07_Music$1.class differ diff --git a/bin/Lesson07_Music.class b/bin/Lesson07_Music.class new file mode 100644 index 0000000..fae7ead Binary files /dev/null and b/bin/Lesson07_Music.class differ diff --git a/bin/Lesson08_Granulation.class b/bin/Lesson08_Granulation.class new file mode 100644 index 0000000..9ca12a1 Binary files /dev/null and b/bin/Lesson08_Granulation.class differ diff --git a/bin/Lesson09_RecordToSample$1.class b/bin/Lesson09_RecordToSample$1.class new file mode 100644 index 0000000..09eee30 Binary files /dev/null and b/bin/Lesson09_RecordToSample$1.class differ diff --git a/bin/Lesson09_RecordToSample.class b/bin/Lesson09_RecordToSample.class new file mode 100644 index 0000000..69c662a Binary files /dev/null and b/bin/Lesson09_RecordToSample.class differ diff --git a/bin/default/.gitignore b/bin/default/.gitignore new file mode 100644 index 0000000..a3dc767 --- /dev/null +++ b/bin/default/.gitignore @@ -0,0 +1,14 @@ +/Lesson01_AudioContext.class +/Lesson02_EnvelopeAndWavePlayer.class +/Lesson03_FMSynthesis$1.class +/Lesson03_FMSynthesis.class +/Lesson04_SamplePlayer.class +/Lesson05_Clock.class +/Lesson06_Trigger$1.class +/Lesson06_Trigger.class +/Lesson07_Music$1.class +/Lesson07_Music.class +/Lesson08_Granulation.class +/Lesson09_RecordToSample$1.class +/Lesson09_RecordToSample.class +/Test_Granulation.class diff --git a/bin/default/Lesson01_AudioContext.class b/bin/default/Lesson01_AudioContext.class new file mode 100644 index 0000000..cb2c519 Binary files /dev/null and b/bin/default/Lesson01_AudioContext.class differ diff --git a/bin/default/Lesson02_EnvelopeAndWavePlayer.class b/bin/default/Lesson02_EnvelopeAndWavePlayer.class new file mode 100644 index 0000000..3a20a13 Binary files /dev/null and b/bin/default/Lesson02_EnvelopeAndWavePlayer.class differ diff --git a/bin/default/Lesson03_FMSynthesis$1.class b/bin/default/Lesson03_FMSynthesis$1.class new file mode 100644 index 0000000..bcaa156 Binary files /dev/null and b/bin/default/Lesson03_FMSynthesis$1.class differ diff --git a/bin/default/Lesson03_FMSynthesis.class b/bin/default/Lesson03_FMSynthesis.class new file mode 100644 index 0000000..8402350 Binary files /dev/null and b/bin/default/Lesson03_FMSynthesis.class differ diff --git a/bin/default/Lesson04_SamplePlayer.class b/bin/default/Lesson04_SamplePlayer.class new file mode 100644 index 0000000..020963f Binary files /dev/null and b/bin/default/Lesson04_SamplePlayer.class differ diff --git a/bin/default/Lesson05_Clock.class b/bin/default/Lesson05_Clock.class new file mode 100644 index 0000000..d3d8432 Binary files /dev/null and b/bin/default/Lesson05_Clock.class differ diff --git a/bin/default/Lesson06_Trigger$1.class b/bin/default/Lesson06_Trigger$1.class new file mode 100644 index 0000000..c506b5d Binary files /dev/null and b/bin/default/Lesson06_Trigger$1.class differ diff --git a/bin/default/Lesson06_Trigger.class b/bin/default/Lesson06_Trigger.class new file mode 100644 index 0000000..2769f17 Binary files /dev/null and b/bin/default/Lesson06_Trigger.class differ diff --git a/bin/default/Lesson07_Music$1.class b/bin/default/Lesson07_Music$1.class new file mode 100644 index 0000000..7d3710a Binary files /dev/null and b/bin/default/Lesson07_Music$1.class differ diff --git a/bin/default/Lesson07_Music.class b/bin/default/Lesson07_Music.class new file mode 100644 index 0000000..7284675 Binary files /dev/null and b/bin/default/Lesson07_Music.class differ diff --git a/bin/default/Lesson08_Granulation.class b/bin/default/Lesson08_Granulation.class new file mode 100644 index 0000000..3d57c7e Binary files /dev/null and b/bin/default/Lesson08_Granulation.class differ diff --git a/bin/default/Lesson09_RecordToSample$1.class b/bin/default/Lesson09_RecordToSample$1.class new file mode 100644 index 0000000..81307d4 Binary files /dev/null and b/bin/default/Lesson09_RecordToSample$1.class differ diff --git a/bin/default/Lesson09_RecordToSample.class b/bin/default/Lesson09_RecordToSample.class new file mode 100644 index 0000000..7690f5b Binary files /dev/null and b/bin/default/Lesson09_RecordToSample.class differ diff --git a/bin/main/.gitignore b/bin/main/.gitignore new file mode 100644 index 0000000..5da9b9d --- /dev/null +++ b/bin/main/.gitignore @@ -0,0 +1,15 @@ +/Lesson01_AudioContext.class +/Lesson02_EnvelopeAndWavePlayer.class +/Lesson03_FMSynthesis$1.class +/Lesson03_FMSynthesis.class +/Lesson04_SamplePlayer.class +/Lesson05_Clock.class +/Lesson06_Trigger$1.class +/Lesson06_Trigger.class +/Lesson07_Music$1.class +/Lesson07_Music.class +/Lesson08_Granulation.class +/Lesson09_RecordToSample$1.class +/Lesson09_RecordToSample.class +/net/ +/org/ diff --git a/bin/main/net/beadsproject/beads/analysis/Analyzer$AnalysisSettings.class b/bin/main/net/beadsproject/beads/analysis/Analyzer$AnalysisSettings.class new file mode 100644 index 0000000..9601b3c Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/Analyzer$AnalysisSettings.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/Analyzer.class b/bin/main/net/beadsproject/beads/analysis/Analyzer.class new file mode 100644 index 0000000..7fa063b Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/Analyzer.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/AudioSegmenter.class b/bin/main/net/beadsproject/beads/analysis/AudioSegmenter.class new file mode 100644 index 0000000..692a33a Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/AudioSegmenter.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/FeatureExtractor.class b/bin/main/net/beadsproject/beads/analysis/FeatureExtractor.class new file mode 100644 index 0000000..c1530f5 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/FeatureExtractor.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/FeatureFrame.class b/bin/main/net/beadsproject/beads/analysis/FeatureFrame.class new file mode 100644 index 0000000..6f8ae0c Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/FeatureFrame.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/FeatureManager.class b/bin/main/net/beadsproject/beads/analysis/FeatureManager.class new file mode 100644 index 0000000..cf1b8b9 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/FeatureManager.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/FeatureSet.class b/bin/main/net/beadsproject/beads/analysis/FeatureSet.class new file mode 100644 index 0000000..d911e6b Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/FeatureSet.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/FeatureTrack.class b/bin/main/net/beadsproject/beads/analysis/FeatureTrack.class new file mode 100644 index 0000000..7349cdd Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/FeatureTrack.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/SegmentListener.class b/bin/main/net/beadsproject/beads/analysis/SegmentListener.class new file mode 100644 index 0000000..51ec80b Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/SegmentListener.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/SegmentMaker.class b/bin/main/net/beadsproject/beads/analysis/SegmentMaker.class new file mode 100644 index 0000000..dc3a52d Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/SegmentMaker.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/BasicDataWriter.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/BasicDataWriter.class new file mode 100644 index 0000000..7c58120 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/BasicDataWriter.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/BasicTimeDataWriter.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/BasicTimeDataWriter.class new file mode 100644 index 0000000..893fa9a Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/BasicTimeDataWriter.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/FFT.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/FFT.class new file mode 100644 index 0000000..ffefea3 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/FFT.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/Frequency.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/Frequency.class new file mode 100644 index 0000000..c7d89d7 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/Frequency.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/GnuplotDataWriter.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/GnuplotDataWriter.class new file mode 100644 index 0000000..6acd1f1 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/GnuplotDataWriter.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/MFCC.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/MFCC.class new file mode 100644 index 0000000..3629808 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/MFCC.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/MelSpectrum.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/MelSpectrum.class new file mode 100644 index 0000000..e928320 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/MelSpectrum.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/PeakDetector.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/PeakDetector.class new file mode 100644 index 0000000..c9e2ec2 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/PeakDetector.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/Power.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/Power.class new file mode 100644 index 0000000..6f24855 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/Power.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/PowerSpectrum.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/PowerSpectrum.class new file mode 100644 index 0000000..74dbc5d Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/PowerSpectrum.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/ReBin.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/ReBin.class new file mode 100644 index 0000000..f767707 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/ReBin.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/SpectralCentroid.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/SpectralCentroid.class new file mode 100644 index 0000000..d739cff Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/SpectralCentroid.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/SpectralDifference$DifferenceType.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/SpectralDifference$DifferenceType.class new file mode 100644 index 0000000..f4d8c13 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/SpectralDifference$DifferenceType.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/SpectralDifference.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/SpectralDifference.class new file mode 100644 index 0000000..564de73 Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/SpectralDifference.class differ diff --git a/bin/main/net/beadsproject/beads/analysis/featureextractors/SpectralPeaks.class b/bin/main/net/beadsproject/beads/analysis/featureextractors/SpectralPeaks.class new file mode 100644 index 0000000..8dae57f Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/featureextractors/SpectralPeaks.class differ diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/package.html b/bin/main/net/beadsproject/beads/analysis/featureextractors/package.html similarity index 100% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/package.html rename to bin/main/net/beadsproject/beads/analysis/featureextractors/package.html diff --git a/src/beads_main/net/beadsproject/beads/analysis/package.html b/bin/main/net/beadsproject/beads/analysis/package.html similarity index 100% rename from src/beads_main/net/beadsproject/beads/analysis/package.html rename to bin/main/net/beadsproject/beads/analysis/package.html diff --git a/bin/main/net/beadsproject/beads/analysis/segmenters/ShortFrameSegmenter.class b/bin/main/net/beadsproject/beads/analysis/segmenters/ShortFrameSegmenter.class new file mode 100644 index 0000000..9b00ddc Binary files /dev/null and b/bin/main/net/beadsproject/beads/analysis/segmenters/ShortFrameSegmenter.class differ diff --git a/src/beads_main/net/beadsproject/beads/analysis/segmenters/package.html b/bin/main/net/beadsproject/beads/analysis/segmenters/package.html similarity index 100% rename from src/beads_main/net/beadsproject/beads/analysis/segmenters/package.html rename to bin/main/net/beadsproject/beads/analysis/segmenters/package.html diff --git a/bin/main/net/beadsproject/beads/core/AudioContext.class b/bin/main/net/beadsproject/beads/core/AudioContext.class new file mode 100644 index 0000000..4786dab Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/AudioContext.class differ diff --git a/bin/main/net/beadsproject/beads/core/AudioIO.class b/bin/main/net/beadsproject/beads/core/AudioIO.class new file mode 100644 index 0000000..aa43204 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/AudioIO.class differ diff --git a/bin/main/net/beadsproject/beads/core/AudioUtils.class b/bin/main/net/beadsproject/beads/core/AudioUtils.class new file mode 100644 index 0000000..05d5650 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/AudioUtils.class differ diff --git a/bin/main/net/beadsproject/beads/core/Bead.class b/bin/main/net/beadsproject/beads/core/Bead.class new file mode 100644 index 0000000..8b19590 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/Bead.class differ diff --git a/bin/main/net/beadsproject/beads/core/BeadArray.class b/bin/main/net/beadsproject/beads/core/BeadArray.class new file mode 100644 index 0000000..4db852d Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/BeadArray.class differ diff --git a/bin/main/net/beadsproject/beads/core/BuildVersion.class b/bin/main/net/beadsproject/beads/core/BuildVersion.class new file mode 100644 index 0000000..98e1d69 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/BuildVersion.class differ diff --git a/bin/main/net/beadsproject/beads/core/IOAudioFormat.class b/bin/main/net/beadsproject/beads/core/IOAudioFormat.class new file mode 100644 index 0000000..d627378 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/IOAudioFormat.class differ diff --git a/bin/main/net/beadsproject/beads/core/JackRemote.class b/bin/main/net/beadsproject/beads/core/JackRemote.class new file mode 100644 index 0000000..af9e719 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/JackRemote.class differ diff --git a/bin/main/net/beadsproject/beads/core/TimeStamp.class b/bin/main/net/beadsproject/beads/core/TimeStamp.class new file mode 100644 index 0000000..db0d427 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/TimeStamp.class differ diff --git a/bin/main/net/beadsproject/beads/core/UGen$1.class b/bin/main/net/beadsproject/beads/core/UGen$1.class new file mode 100644 index 0000000..35c1748 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/UGen$1.class differ diff --git a/bin/main/net/beadsproject/beads/core/UGen$BufferPointer.class b/bin/main/net/beadsproject/beads/core/UGen$BufferPointer.class new file mode 100644 index 0000000..a7d71f6 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/UGen$BufferPointer.class differ diff --git a/bin/main/net/beadsproject/beads/core/UGen$OutputInitializationRegime.class b/bin/main/net/beadsproject/beads/core/UGen$OutputInitializationRegime.class new file mode 100644 index 0000000..da61eff Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/UGen$OutputInitializationRegime.class differ diff --git a/bin/main/net/beadsproject/beads/core/UGen$OutputPauseRegime.class b/bin/main/net/beadsproject/beads/core/UGen$OutputPauseRegime.class new file mode 100644 index 0000000..ed029d1 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/UGen$OutputPauseRegime.class differ diff --git a/bin/main/net/beadsproject/beads/core/UGen$UGenStorageType.class b/bin/main/net/beadsproject/beads/core/UGen$UGenStorageType.class new file mode 100644 index 0000000..b6f78f5 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/UGen$UGenStorageType.class differ diff --git a/bin/main/net/beadsproject/beads/core/UGen.class b/bin/main/net/beadsproject/beads/core/UGen.class new file mode 100644 index 0000000..b5f921c Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/UGen.class differ diff --git a/bin/main/net/beadsproject/beads/core/UGenChain$1.class b/bin/main/net/beadsproject/beads/core/UGenChain$1.class new file mode 100644 index 0000000..e860d6f Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/UGenChain$1.class differ diff --git a/bin/main/net/beadsproject/beads/core/UGenChain$2.class b/bin/main/net/beadsproject/beads/core/UGenChain$2.class new file mode 100644 index 0000000..9daff2f Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/UGenChain$2.class differ diff --git a/bin/main/net/beadsproject/beads/core/UGenChain.class b/bin/main/net/beadsproject/beads/core/UGenChain.class new file mode 100644 index 0000000..6e4eda6 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/UGenChain.class differ diff --git a/bin/main/net/beadsproject/beads/core/io/JSTest.class b/bin/main/net/beadsproject/beads/core/io/JSTest.class new file mode 100644 index 0000000..9c043d2 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/io/JSTest.class differ diff --git a/bin/main/net/beadsproject/beads/core/io/JavaSoundAudioIO$1.class b/bin/main/net/beadsproject/beads/core/io/JavaSoundAudioIO$1.class new file mode 100644 index 0000000..48e75b6 Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/io/JavaSoundAudioIO$1.class differ diff --git a/bin/main/net/beadsproject/beads/core/io/JavaSoundAudioIO$JavaSoundRTInput.class b/bin/main/net/beadsproject/beads/core/io/JavaSoundAudioIO$JavaSoundRTInput.class new file mode 100644 index 0000000..72a55cb Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/io/JavaSoundAudioIO$JavaSoundRTInput.class differ diff --git a/bin/main/net/beadsproject/beads/core/io/JavaSoundAudioIO.class b/bin/main/net/beadsproject/beads/core/io/JavaSoundAudioIO.class new file mode 100644 index 0000000..0a8d04b Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/io/JavaSoundAudioIO.class differ diff --git a/bin/main/net/beadsproject/beads/core/io/NonrealtimeIO$ThisIsNotAnInput.class b/bin/main/net/beadsproject/beads/core/io/NonrealtimeIO$ThisIsNotAnInput.class new file mode 100644 index 0000000..33a213f Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/io/NonrealtimeIO$ThisIsNotAnInput.class differ diff --git a/bin/main/net/beadsproject/beads/core/io/NonrealtimeIO.class b/bin/main/net/beadsproject/beads/core/io/NonrealtimeIO.class new file mode 100644 index 0000000..35aa48c Binary files /dev/null and b/bin/main/net/beadsproject/beads/core/io/NonrealtimeIO.class differ diff --git a/src/beads_main/net/beadsproject/beads/core/io/package.html b/bin/main/net/beadsproject/beads/core/io/package.html similarity index 100% rename from src/beads_main/net/beadsproject/beads/core/io/package.html rename to bin/main/net/beadsproject/beads/core/io/package.html diff --git a/src/beads_main/net/beadsproject/beads/core/package.html b/bin/main/net/beadsproject/beads/core/package.html similarity index 100% rename from src/beads_main/net/beadsproject/beads/core/package.html rename to bin/main/net/beadsproject/beads/core/package.html diff --git a/bin/main/net/beadsproject/beads/data/Buffer.class b/bin/main/net/beadsproject/beads/data/Buffer.class new file mode 100644 index 0000000..06ca153 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/Buffer.class differ diff --git a/bin/main/net/beadsproject/beads/data/BufferFactory.class b/bin/main/net/beadsproject/beads/data/BufferFactory.class new file mode 100644 index 0000000..324e0ef Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/BufferFactory.class differ diff --git a/bin/main/net/beadsproject/beads/data/DataBead.class b/bin/main/net/beadsproject/beads/data/DataBead.class new file mode 100644 index 0000000..f3b5bb2 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/DataBead.class differ diff --git a/bin/main/net/beadsproject/beads/data/DataBeadReceiver.class b/bin/main/net/beadsproject/beads/data/DataBeadReceiver.class new file mode 100644 index 0000000..e3bea01 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/DataBeadReceiver.class differ diff --git a/bin/main/net/beadsproject/beads/data/Pitch.class b/bin/main/net/beadsproject/beads/data/Pitch.class new file mode 100644 index 0000000..263b955 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/Pitch.class differ diff --git a/bin/main/net/beadsproject/beads/data/Sample.class b/bin/main/net/beadsproject/beads/data/Sample.class new file mode 100644 index 0000000..d133a7d Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/Sample.class differ diff --git a/bin/main/net/beadsproject/beads/data/SampleAudioFormat.class b/bin/main/net/beadsproject/beads/data/SampleAudioFormat.class new file mode 100644 index 0000000..40abb5c Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/SampleAudioFormat.class differ diff --git a/bin/main/net/beadsproject/beads/data/SampleManager$SampleGroupListener.class b/bin/main/net/beadsproject/beads/data/SampleManager$SampleGroupListener.class new file mode 100644 index 0000000..271ad53 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/SampleManager$SampleGroupListener.class differ diff --git a/bin/main/net/beadsproject/beads/data/SampleManager.class b/bin/main/net/beadsproject/beads/data/SampleManager.class new file mode 100644 index 0000000..b5ddef0 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/SampleManager.class differ diff --git a/bin/main/net/beadsproject/beads/data/audiofile/AudioFileReader.class b/bin/main/net/beadsproject/beads/data/audiofile/AudioFileReader.class new file mode 100644 index 0000000..1627055 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/audiofile/AudioFileReader.class differ diff --git a/bin/main/net/beadsproject/beads/data/audiofile/AudioFileType.class b/bin/main/net/beadsproject/beads/data/audiofile/AudioFileType.class new file mode 100644 index 0000000..620c690 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/audiofile/AudioFileType.class differ diff --git a/bin/main/net/beadsproject/beads/data/audiofile/AudioFileWriter.class b/bin/main/net/beadsproject/beads/data/audiofile/AudioFileWriter.class new file mode 100644 index 0000000..a5ee45b Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/audiofile/AudioFileWriter.class differ diff --git a/bin/main/net/beadsproject/beads/data/audiofile/FileFormatException.class b/bin/main/net/beadsproject/beads/data/audiofile/FileFormatException.class new file mode 100644 index 0000000..4043f2d Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/audiofile/FileFormatException.class differ diff --git a/bin/main/net/beadsproject/beads/data/audiofile/JavaSoundAudioFile.class b/bin/main/net/beadsproject/beads/data/audiofile/JavaSoundAudioFile.class new file mode 100644 index 0000000..e7d0da5 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/audiofile/JavaSoundAudioFile.class differ diff --git a/bin/main/net/beadsproject/beads/data/audiofile/OperationUnsupportedException.class b/bin/main/net/beadsproject/beads/data/audiofile/OperationUnsupportedException.class new file mode 100644 index 0000000..9b344a4 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/audiofile/OperationUnsupportedException.class differ diff --git a/bin/main/net/beadsproject/beads/data/audiofile/WavFileReaderWriter$IOState.class b/bin/main/net/beadsproject/beads/data/audiofile/WavFileReaderWriter$IOState.class new file mode 100644 index 0000000..3de9a9e Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/audiofile/WavFileReaderWriter$IOState.class differ diff --git a/bin/main/net/beadsproject/beads/data/audiofile/WavFileReaderWriter.class b/bin/main/net/beadsproject/beads/data/audiofile/WavFileReaderWriter.class new file mode 100644 index 0000000..0c06c06 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/audiofile/WavFileReaderWriter.class differ diff --git a/src/beads_io/net/beadsproject/beads/data/audiofile/package.html b/bin/main/net/beadsproject/beads/data/audiofile/package.html similarity index 100% rename from src/beads_io/net/beadsproject/beads/data/audiofile/package.html rename to bin/main/net/beadsproject/beads/data/audiofile/package.html diff --git a/bin/main/net/beadsproject/beads/data/buffers/CosineWindow.class b/bin/main/net/beadsproject/beads/data/buffers/CosineWindow.class new file mode 100644 index 0000000..11b7bc5 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/CosineWindow.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/CurveBuffer.class b/bin/main/net/beadsproject/beads/data/buffers/CurveBuffer.class new file mode 100644 index 0000000..e94ea64 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/CurveBuffer.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/Exp01Buffer.class b/bin/main/net/beadsproject/beads/data/buffers/Exp01Buffer.class new file mode 100644 index 0000000..a02d134 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/Exp01Buffer.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/HanningWindow.class b/bin/main/net/beadsproject/beads/data/buffers/HanningWindow.class new file mode 100644 index 0000000..ce6a374 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/HanningWindow.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/Log01Buffer.class b/bin/main/net/beadsproject/beads/data/buffers/Log01Buffer.class new file mode 100644 index 0000000..a02d509 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/Log01Buffer.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/MeanFilter.class b/bin/main/net/beadsproject/beads/data/buffers/MeanFilter.class new file mode 100644 index 0000000..7ff2977 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/MeanFilter.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/NoiseBuffer.class b/bin/main/net/beadsproject/beads/data/buffers/NoiseBuffer.class new file mode 100644 index 0000000..e5bc292 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/NoiseBuffer.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/OneWindow.class b/bin/main/net/beadsproject/beads/data/buffers/OneWindow.class new file mode 100644 index 0000000..f81dd16 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/OneWindow.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/RampBuffer.class b/bin/main/net/beadsproject/beads/data/buffers/RampBuffer.class new file mode 100644 index 0000000..e564776 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/RampBuffer.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/SawBuffer.class b/bin/main/net/beadsproject/beads/data/buffers/SawBuffer.class new file mode 100644 index 0000000..869bad9 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/SawBuffer.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/SineBuffer.class b/bin/main/net/beadsproject/beads/data/buffers/SineBuffer.class new file mode 100644 index 0000000..41755a3 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/SineBuffer.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/SquareBuffer.class b/bin/main/net/beadsproject/beads/data/buffers/SquareBuffer.class new file mode 100644 index 0000000..e3b9795 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/SquareBuffer.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/TriangleBuffer.class b/bin/main/net/beadsproject/beads/data/buffers/TriangleBuffer.class new file mode 100644 index 0000000..4a344f1 Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/TriangleBuffer.class differ diff --git a/bin/main/net/beadsproject/beads/data/buffers/TriangularWindow.class b/bin/main/net/beadsproject/beads/data/buffers/TriangularWindow.class new file mode 100644 index 0000000..ccb31bd Binary files /dev/null and b/bin/main/net/beadsproject/beads/data/buffers/TriangularWindow.class differ diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/package.html b/bin/main/net/beadsproject/beads/data/buffers/package.html similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/package.html rename to bin/main/net/beadsproject/beads/data/buffers/package.html diff --git a/src/beads_main/net/beadsproject/beads/data/package.html b/bin/main/net/beadsproject/beads/data/package.html similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/package.html rename to bin/main/net/beadsproject/beads/data/package.html diff --git a/bin/main/net/beadsproject/beads/events/AudioContextStopTrigger.class b/bin/main/net/beadsproject/beads/events/AudioContextStopTrigger.class new file mode 100644 index 0000000..2489ce9 Binary files /dev/null and b/bin/main/net/beadsproject/beads/events/AudioContextStopTrigger.class differ diff --git a/bin/main/net/beadsproject/beads/events/FloatBead.class b/bin/main/net/beadsproject/beads/events/FloatBead.class new file mode 100644 index 0000000..8bb12d3 Binary files /dev/null and b/bin/main/net/beadsproject/beads/events/FloatBead.class differ diff --git a/bin/main/net/beadsproject/beads/events/IntegerBead.class b/bin/main/net/beadsproject/beads/events/IntegerBead.class new file mode 100644 index 0000000..25e1845 Binary files /dev/null and b/bin/main/net/beadsproject/beads/events/IntegerBead.class differ diff --git a/bin/main/net/beadsproject/beads/events/KillTrigger.class b/bin/main/net/beadsproject/beads/events/KillTrigger.class new file mode 100644 index 0000000..9d09d2f Binary files /dev/null and b/bin/main/net/beadsproject/beads/events/KillTrigger.class differ diff --git a/bin/main/net/beadsproject/beads/events/PauseTrigger.class b/bin/main/net/beadsproject/beads/events/PauseTrigger.class new file mode 100644 index 0000000..fa6b582 Binary files /dev/null and b/bin/main/net/beadsproject/beads/events/PauseTrigger.class differ diff --git a/bin/main/net/beadsproject/beads/events/SoundEvent.class b/bin/main/net/beadsproject/beads/events/SoundEvent.class new file mode 100644 index 0000000..4994f5f Binary files /dev/null and b/bin/main/net/beadsproject/beads/events/SoundEvent.class differ diff --git a/bin/main/net/beadsproject/beads/events/SoundEventManager.class b/bin/main/net/beadsproject/beads/events/SoundEventManager.class new file mode 100644 index 0000000..c41c05e Binary files /dev/null and b/bin/main/net/beadsproject/beads/events/SoundEventManager.class differ diff --git a/bin/main/net/beadsproject/beads/events/StartTrigger.class b/bin/main/net/beadsproject/beads/events/StartTrigger.class new file mode 100644 index 0000000..f1e0ca3 Binary files /dev/null and b/bin/main/net/beadsproject/beads/events/StartTrigger.class differ diff --git a/src/beads_main/net/beadsproject/beads/events/package.html b/bin/main/net/beadsproject/beads/events/package.html similarity index 100% rename from src/beads_main/net/beadsproject/beads/events/package.html rename to bin/main/net/beadsproject/beads/events/package.html diff --git a/bin/main/net/beadsproject/beads/ugens/ADSR.class b/bin/main/net/beadsproject/beads/ugens/ADSR.class new file mode 100644 index 0000000..c19bd89 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/ADSR.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Add.class b/bin/main/net/beadsproject/beads/ugens/Add.class new file mode 100644 index 0000000..28c1757 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Add.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/AllpassFilter.class b/bin/main/net/beadsproject/beads/ugens/AllpassFilter.class new file mode 100644 index 0000000..9231c34 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/AllpassFilter.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadCustomCoeffCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadCustomCoeffCalculator.class new file mode 100644 index 0000000..0aea4d6 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadCustomCoeffCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$APValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$APValCalculator.class new file mode 100644 index 0000000..e48492e Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$APValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$BPPeakValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$BPPeakValCalculator.class new file mode 100644 index 0000000..ee8a70e Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$BPPeakValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$BPSkirtValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$BPSkirtValCalculator.class new file mode 100644 index 0000000..0089f4c Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$BPSkirtValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$BesselHPValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$BesselHPValCalculator.class new file mode 100644 index 0000000..b72b547 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$BesselHPValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$BesselLPValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$BesselLPValCalculator.class new file mode 100644 index 0000000..e422f0b Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$BesselLPValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$ButterworthBPValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$ButterworthBPValCalculator.class new file mode 100644 index 0000000..b534fcb Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$ButterworthBPValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$ButterworthHPValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$ButterworthHPValCalculator.class new file mode 100644 index 0000000..4a55599 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$ButterworthHPValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$ButterworthLPValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$ButterworthLPValCalculator.class new file mode 100644 index 0000000..c8ac5d7 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$ButterworthLPValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$CustomCoeffCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$CustomCoeffCalculator.class new file mode 100644 index 0000000..6006be9 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$CustomCoeffCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$CustomValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$CustomValCalculator.class new file mode 100644 index 0000000..3bf50dc Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$CustomValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$HPValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$HPValCalculator.class new file mode 100644 index 0000000..959e5a2 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$HPValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$HighShelfValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$HighShelfValCalculator.class new file mode 100644 index 0000000..487079d Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$HighShelfValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$LPValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$LPValCalculator.class new file mode 100644 index 0000000..110d000 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$LPValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$LowShelfValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$LowShelfValCalculator.class new file mode 100644 index 0000000..8fa12af Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$LowShelfValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$NotchValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$NotchValCalculator.class new file mode 100644 index 0000000..d712199 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$NotchValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$PeakingEQValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$PeakingEQValCalculator.class new file mode 100644 index 0000000..1719259 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$PeakingEQValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$Type.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$Type.class new file mode 100644 index 0000000..b707573 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$Type.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter$ValCalculator.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$ValCalculator.class new file mode 100644 index 0000000..32fc388 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter$ValCalculator.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/BiquadFilter.class b/bin/main/net/beadsproject/beads/ugens/BiquadFilter.class new file mode 100644 index 0000000..8835dee Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/BiquadFilter.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Change.class b/bin/main/net/beadsproject/beads/ugens/Change.class new file mode 100644 index 0000000..f77cb11 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Change.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Clicker.class b/bin/main/net/beadsproject/beads/ugens/Clicker.class new file mode 100644 index 0000000..d85a8dd Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Clicker.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Clip.class b/bin/main/net/beadsproject/beads/ugens/Clip.class new file mode 100644 index 0000000..7a9116c Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Clip.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Clock.class b/bin/main/net/beadsproject/beads/ugens/Clock.class new file mode 100644 index 0000000..a19f80a Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Clock.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/CombFilter.class b/bin/main/net/beadsproject/beads/ugens/CombFilter.class new file mode 100644 index 0000000..9471243 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/CombFilter.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Compressor$1MyInputs.class b/bin/main/net/beadsproject/beads/ugens/Compressor$1MyInputs.class new file mode 100644 index 0000000..e2be593 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Compressor$1MyInputs.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Compressor.class b/bin/main/net/beadsproject/beads/ugens/Compressor.class new file mode 100644 index 0000000..048ff16 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Compressor.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/CrossFade.class b/bin/main/net/beadsproject/beads/ugens/CrossFade.class new file mode 100644 index 0000000..614f4e1 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/CrossFade.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/CrossoverFilter.class b/bin/main/net/beadsproject/beads/ugens/CrossoverFilter.class new file mode 100644 index 0000000..f0af3cf Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/CrossoverFilter.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/DelayData.class b/bin/main/net/beadsproject/beads/ugens/DelayData.class new file mode 100644 index 0000000..b5beb08 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/DelayData.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/DelayEvent.class b/bin/main/net/beadsproject/beads/ugens/DelayEvent.class new file mode 100644 index 0000000..9ad49a3 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/DelayEvent.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/DelayTrigger.class b/bin/main/net/beadsproject/beads/ugens/DelayTrigger.class new file mode 100644 index 0000000..2d06b51 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/DelayTrigger.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Delta.class b/bin/main/net/beadsproject/beads/ugens/Delta.class new file mode 100644 index 0000000..4e5c55a Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Delta.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Drain$Grain.class b/bin/main/net/beadsproject/beads/ugens/Drain$Grain.class new file mode 100644 index 0000000..9f5f919 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Drain$Grain.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Drain.class b/bin/main/net/beadsproject/beads/ugens/Drain.class new file mode 100644 index 0000000..78c116b Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Drain.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Envelope$Segment.class b/bin/main/net/beadsproject/beads/ugens/Envelope$Segment.class new file mode 100644 index 0000000..6a1ec37 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Envelope$Segment.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Envelope.class b/bin/main/net/beadsproject/beads/ugens/Envelope.class new file mode 100644 index 0000000..f494f3c Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Envelope.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Function.class b/bin/main/net/beadsproject/beads/ugens/Function.class new file mode 100644 index 0000000..b03c56c Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Function.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Gain.class b/bin/main/net/beadsproject/beads/ugens/Gain.class new file mode 100644 index 0000000..5d68af0 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Gain.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Glide.class b/bin/main/net/beadsproject/beads/ugens/Glide.class new file mode 100644 index 0000000..021cf25 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Glide.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/GranularSamplePlayer$Grain.class b/bin/main/net/beadsproject/beads/ugens/GranularSamplePlayer$Grain.class new file mode 100644 index 0000000..5d6fbf5 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/GranularSamplePlayer$Grain.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/GranularSamplePlayer.class b/bin/main/net/beadsproject/beads/ugens/GranularSamplePlayer.class new file mode 100644 index 0000000..624c4df Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/GranularSamplePlayer.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/IIRFilter$IIRFilterAnalysis.class b/bin/main/net/beadsproject/beads/ugens/IIRFilter$IIRFilterAnalysis.class new file mode 100644 index 0000000..373f5c6 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/IIRFilter$IIRFilterAnalysis.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/IIRFilter.class b/bin/main/net/beadsproject/beads/ugens/IIRFilter.class new file mode 100644 index 0000000..d44dd71 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/IIRFilter.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/LPRezFilter.class b/bin/main/net/beadsproject/beads/ugens/LPRezFilter.class new file mode 100644 index 0000000..933b4e7 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/LPRezFilter.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Maximum.class b/bin/main/net/beadsproject/beads/ugens/Maximum.class new file mode 100644 index 0000000..736320d Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Maximum.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Minimum.class b/bin/main/net/beadsproject/beads/ugens/Minimum.class new file mode 100644 index 0000000..c403762 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Minimum.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/MonoPlug.class b/bin/main/net/beadsproject/beads/ugens/MonoPlug.class new file mode 100644 index 0000000..5a88d2d Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/MonoPlug.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/MouseResponder.class b/bin/main/net/beadsproject/beads/ugens/MouseResponder.class new file mode 100644 index 0000000..bbf45d8 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/MouseResponder.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Mult.class b/bin/main/net/beadsproject/beads/ugens/Mult.class new file mode 100644 index 0000000..2542083 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Mult.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/MultiWrapper$1.class b/bin/main/net/beadsproject/beads/ugens/MultiWrapper$1.class new file mode 100644 index 0000000..c6d78ad Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/MultiWrapper$1.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/MultiWrapper.class b/bin/main/net/beadsproject/beads/ugens/MultiWrapper.class new file mode 100644 index 0000000..68f381b Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/MultiWrapper.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/NBitsConverter.class b/bin/main/net/beadsproject/beads/ugens/NBitsConverter.class new file mode 100644 index 0000000..4dffe9c Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/NBitsConverter.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Noise.class b/bin/main/net/beadsproject/beads/ugens/Noise.class new file mode 100644 index 0000000..7988a78 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Noise.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/OnePoleFilter.class b/bin/main/net/beadsproject/beads/ugens/OnePoleFilter.class new file mode 100644 index 0000000..9eee152 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/OnePoleFilter.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/OscillatorBank.class b/bin/main/net/beadsproject/beads/ugens/OscillatorBank.class new file mode 100644 index 0000000..01e97c9 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/OscillatorBank.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Panner.class b/bin/main/net/beadsproject/beads/ugens/Panner.class new file mode 100644 index 0000000..0874e0d Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Panner.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Phasor.class b/bin/main/net/beadsproject/beads/ugens/Phasor.class new file mode 100644 index 0000000..3982214 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Phasor.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Plug.class b/bin/main/net/beadsproject/beads/ugens/Plug.class new file mode 100644 index 0000000..cd90802 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Plug.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/PolyLimit.class b/bin/main/net/beadsproject/beads/ugens/PolyLimit.class new file mode 100644 index 0000000..9d40d8b Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/PolyLimit.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/RMS.class b/bin/main/net/beadsproject/beads/ugens/RMS.class new file mode 100644 index 0000000..34d20b8 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/RMS.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/RandomPWM$Mode.class b/bin/main/net/beadsproject/beads/ugens/RandomPWM$Mode.class new file mode 100644 index 0000000..51d49ff Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/RandomPWM$Mode.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/RandomPWM.class b/bin/main/net/beadsproject/beads/ugens/RandomPWM.class new file mode 100644 index 0000000..0e4e0f7 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/RandomPWM.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/RangeLimiter.class b/bin/main/net/beadsproject/beads/ugens/RangeLimiter.class new file mode 100644 index 0000000..dc39fa0 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/RangeLimiter.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/RecordToFile.class b/bin/main/net/beadsproject/beads/ugens/RecordToFile.class new file mode 100644 index 0000000..61895ba Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/RecordToFile.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/RecordToSample$Mode.class b/bin/main/net/beadsproject/beads/ugens/RecordToSample$Mode.class new file mode 100644 index 0000000..d70d5c6 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/RecordToSample$Mode.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/RecordToSample.class b/bin/main/net/beadsproject/beads/ugens/RecordToSample.class new file mode 100644 index 0000000..b81370f Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/RecordToSample.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Reverb.class b/bin/main/net/beadsproject/beads/ugens/Reverb.class new file mode 100644 index 0000000..65c073d Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Reverb.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/SamplePlayer$EnvelopeType.class b/bin/main/net/beadsproject/beads/ugens/SamplePlayer$EnvelopeType.class new file mode 100644 index 0000000..e9a6eed Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/SamplePlayer$EnvelopeType.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/SamplePlayer$InterpolationType.class b/bin/main/net/beadsproject/beads/ugens/SamplePlayer$InterpolationType.class new file mode 100644 index 0000000..1a93732 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/SamplePlayer$InterpolationType.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/SamplePlayer$LoopType.class b/bin/main/net/beadsproject/beads/ugens/SamplePlayer$LoopType.class new file mode 100644 index 0000000..420d258 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/SamplePlayer$LoopType.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/SamplePlayer.class b/bin/main/net/beadsproject/beads/ugens/SamplePlayer.class new file mode 100644 index 0000000..6ce1891 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/SamplePlayer.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/ScalingMixer.class b/bin/main/net/beadsproject/beads/ugens/ScalingMixer.class new file mode 100644 index 0000000..35eea6f Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/ScalingMixer.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/SignalReporter.class b/bin/main/net/beadsproject/beads/ugens/SignalReporter.class new file mode 100644 index 0000000..c829c18 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/SignalReporter.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Spatial$Location.class b/bin/main/net/beadsproject/beads/ugens/Spatial$Location.class new file mode 100644 index 0000000..d923cb6 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Spatial$Location.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Spatial.class b/bin/main/net/beadsproject/beads/ugens/Spatial.class new file mode 100644 index 0000000..3f24c20 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Spatial.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Static.class b/bin/main/net/beadsproject/beads/ugens/Static.class new file mode 100644 index 0000000..26d7d6e Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Static.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/TapIn.class b/bin/main/net/beadsproject/beads/ugens/TapIn.class new file mode 100644 index 0000000..13f6830 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/TapIn.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/TapOut$InterpolationType.class b/bin/main/net/beadsproject/beads/ugens/TapOut$InterpolationType.class new file mode 100644 index 0000000..c4de433 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/TapOut$InterpolationType.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/TapOut.class b/bin/main/net/beadsproject/beads/ugens/TapOut.class new file mode 100644 index 0000000..f9f2fa9 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/TapOut.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/Throughput.class b/bin/main/net/beadsproject/beads/ugens/Throughput.class new file mode 100644 index 0000000..9f33309 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/Throughput.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/TrapezoidWave.class b/bin/main/net/beadsproject/beads/ugens/TrapezoidWave.class new file mode 100644 index 0000000..8949883 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/TrapezoidWave.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/WavePlayer.class b/bin/main/net/beadsproject/beads/ugens/WavePlayer.class new file mode 100644 index 0000000..258cc04 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/WavePlayer.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/WaveShaper.class b/bin/main/net/beadsproject/beads/ugens/WaveShaper.class new file mode 100644 index 0000000..954704f Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/WaveShaper.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/ZMap.class b/bin/main/net/beadsproject/beads/ugens/ZMap.class new file mode 100644 index 0000000..4f5b684 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/ZMap.class differ diff --git a/bin/main/net/beadsproject/beads/ugens/ZeroCross.class b/bin/main/net/beadsproject/beads/ugens/ZeroCross.class new file mode 100644 index 0000000..b39eb17 Binary files /dev/null and b/bin/main/net/beadsproject/beads/ugens/ZeroCross.class differ diff --git a/src/beads_main/net/beadsproject/beads/ugens/package.html b/bin/main/net/beadsproject/beads/ugens/package.html similarity index 100% rename from src/beads_main/net/beadsproject/beads/ugens/package.html rename to bin/main/net/beadsproject/beads/ugens/package.html diff --git a/bin/main/org/jaudiolibs/beads/AudioServerIO$1.class b/bin/main/org/jaudiolibs/beads/AudioServerIO$1.class new file mode 100644 index 0000000..c6dc420 Binary files /dev/null and b/bin/main/org/jaudiolibs/beads/AudioServerIO$1.class differ diff --git a/bin/main/org/jaudiolibs/beads/AudioServerIO$Jack.class b/bin/main/org/jaudiolibs/beads/AudioServerIO$Jack.class new file mode 100644 index 0000000..9acc39b Binary files /dev/null and b/bin/main/org/jaudiolibs/beads/AudioServerIO$Jack.class differ diff --git a/bin/main/org/jaudiolibs/beads/AudioServerIO$JavaSound.class b/bin/main/org/jaudiolibs/beads/AudioServerIO$JavaSound.class new file mode 100644 index 0000000..8d43dda Binary files /dev/null and b/bin/main/org/jaudiolibs/beads/AudioServerIO$JavaSound.class differ diff --git a/bin/main/org/jaudiolibs/beads/AudioServerIO$RTInput.class b/bin/main/org/jaudiolibs/beads/AudioServerIO$RTInput.class new file mode 100644 index 0000000..ce06586 Binary files /dev/null and b/bin/main/org/jaudiolibs/beads/AudioServerIO$RTInput.class differ diff --git a/bin/main/org/jaudiolibs/beads/AudioServerIO$audioDevice.class b/bin/main/org/jaudiolibs/beads/AudioServerIO$audioDevice.class new file mode 100644 index 0000000..bc783ea Binary files /dev/null and b/bin/main/org/jaudiolibs/beads/AudioServerIO$audioDevice.class differ diff --git a/bin/main/org/jaudiolibs/beads/AudioServerIO.class b/bin/main/org/jaudiolibs/beads/AudioServerIO.class new file mode 100644 index 0000000..35f531d Binary files /dev/null and b/bin/main/org/jaudiolibs/beads/AudioServerIO.class differ diff --git a/bin/net/beadsproject/beads/analysis/Analyzer$AnalysisSettings.class b/bin/net/beadsproject/beads/analysis/Analyzer$AnalysisSettings.class new file mode 100644 index 0000000..9601b3c Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/Analyzer$AnalysisSettings.class differ diff --git a/bin/net/beadsproject/beads/analysis/Analyzer.class b/bin/net/beadsproject/beads/analysis/Analyzer.class new file mode 100644 index 0000000..7fa063b Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/Analyzer.class differ diff --git a/bin/net/beadsproject/beads/analysis/AudioSegmenter.class b/bin/net/beadsproject/beads/analysis/AudioSegmenter.class new file mode 100644 index 0000000..692a33a Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/AudioSegmenter.class differ diff --git a/bin/net/beadsproject/beads/analysis/FeatureExtractor.class b/bin/net/beadsproject/beads/analysis/FeatureExtractor.class new file mode 100644 index 0000000..c1530f5 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/FeatureExtractor.class differ diff --git a/bin/net/beadsproject/beads/analysis/FeatureFrame.class b/bin/net/beadsproject/beads/analysis/FeatureFrame.class new file mode 100644 index 0000000..6f8ae0c Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/FeatureFrame.class differ diff --git a/bin/net/beadsproject/beads/analysis/FeatureManager.class b/bin/net/beadsproject/beads/analysis/FeatureManager.class new file mode 100644 index 0000000..cf1b8b9 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/FeatureManager.class differ diff --git a/bin/net/beadsproject/beads/analysis/FeatureSet.class b/bin/net/beadsproject/beads/analysis/FeatureSet.class new file mode 100644 index 0000000..d911e6b Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/FeatureSet.class differ diff --git a/bin/net/beadsproject/beads/analysis/FeatureTrack.class b/bin/net/beadsproject/beads/analysis/FeatureTrack.class new file mode 100644 index 0000000..7349cdd Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/FeatureTrack.class differ diff --git a/bin/net/beadsproject/beads/analysis/SegmentListener.class b/bin/net/beadsproject/beads/analysis/SegmentListener.class new file mode 100644 index 0000000..51ec80b Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/SegmentListener.class differ diff --git a/bin/net/beadsproject/beads/analysis/SegmentMaker.class b/bin/net/beadsproject/beads/analysis/SegmentMaker.class new file mode 100644 index 0000000..dc3a52d Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/SegmentMaker.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/BasicDataWriter.class b/bin/net/beadsproject/beads/analysis/featureextractors/BasicDataWriter.class new file mode 100644 index 0000000..7c58120 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/BasicDataWriter.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/BasicTimeDataWriter.class b/bin/net/beadsproject/beads/analysis/featureextractors/BasicTimeDataWriter.class new file mode 100644 index 0000000..893fa9a Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/BasicTimeDataWriter.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/FFT.class b/bin/net/beadsproject/beads/analysis/featureextractors/FFT.class new file mode 100644 index 0000000..ffefea3 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/FFT.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/Frequency.class b/bin/net/beadsproject/beads/analysis/featureextractors/Frequency.class new file mode 100644 index 0000000..c7d89d7 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/Frequency.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/GnuplotDataWriter.class b/bin/net/beadsproject/beads/analysis/featureextractors/GnuplotDataWriter.class new file mode 100644 index 0000000..6acd1f1 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/GnuplotDataWriter.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/MFCC.class b/bin/net/beadsproject/beads/analysis/featureextractors/MFCC.class new file mode 100644 index 0000000..3629808 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/MFCC.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/MelSpectrum.class b/bin/net/beadsproject/beads/analysis/featureextractors/MelSpectrum.class new file mode 100644 index 0000000..e928320 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/MelSpectrum.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/PeakDetector.class b/bin/net/beadsproject/beads/analysis/featureextractors/PeakDetector.class new file mode 100644 index 0000000..c9e2ec2 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/PeakDetector.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/Power.class b/bin/net/beadsproject/beads/analysis/featureextractors/Power.class new file mode 100644 index 0000000..6f24855 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/Power.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/PowerSpectrum.class b/bin/net/beadsproject/beads/analysis/featureextractors/PowerSpectrum.class new file mode 100644 index 0000000..74dbc5d Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/PowerSpectrum.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/ReBin.class b/bin/net/beadsproject/beads/analysis/featureextractors/ReBin.class new file mode 100644 index 0000000..f767707 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/ReBin.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/SpectralCentroid.class b/bin/net/beadsproject/beads/analysis/featureextractors/SpectralCentroid.class new file mode 100644 index 0000000..d739cff Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/SpectralCentroid.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/SpectralDifference$DifferenceType.class b/bin/net/beadsproject/beads/analysis/featureextractors/SpectralDifference$DifferenceType.class new file mode 100644 index 0000000..f4d8c13 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/SpectralDifference$DifferenceType.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/SpectralDifference.class b/bin/net/beadsproject/beads/analysis/featureextractors/SpectralDifference.class new file mode 100644 index 0000000..564de73 Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/SpectralDifference.class differ diff --git a/bin/net/beadsproject/beads/analysis/featureextractors/SpectralPeaks.class b/bin/net/beadsproject/beads/analysis/featureextractors/SpectralPeaks.class new file mode 100644 index 0000000..8dae57f Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/featureextractors/SpectralPeaks.class differ diff --git a/bin/net/beadsproject/beads/analysis/segmenters/ShortFrameSegmenter.class b/bin/net/beadsproject/beads/analysis/segmenters/ShortFrameSegmenter.class new file mode 100644 index 0000000..9b00ddc Binary files /dev/null and b/bin/net/beadsproject/beads/analysis/segmenters/ShortFrameSegmenter.class differ diff --git a/bin/net/beadsproject/beads/core/AudioContext.class b/bin/net/beadsproject/beads/core/AudioContext.class new file mode 100644 index 0000000..7a596e7 Binary files /dev/null and b/bin/net/beadsproject/beads/core/AudioContext.class differ diff --git a/bin/net/beadsproject/beads/core/AudioIO.class b/bin/net/beadsproject/beads/core/AudioIO.class new file mode 100644 index 0000000..aa43204 Binary files /dev/null and b/bin/net/beadsproject/beads/core/AudioIO.class differ diff --git a/bin/net/beadsproject/beads/core/AudioUtils.class b/bin/net/beadsproject/beads/core/AudioUtils.class new file mode 100644 index 0000000..05d5650 Binary files /dev/null and b/bin/net/beadsproject/beads/core/AudioUtils.class differ diff --git a/bin/net/beadsproject/beads/core/Bead.class b/bin/net/beadsproject/beads/core/Bead.class new file mode 100644 index 0000000..8b19590 Binary files /dev/null and b/bin/net/beadsproject/beads/core/Bead.class differ diff --git a/bin/net/beadsproject/beads/core/BeadArray.class b/bin/net/beadsproject/beads/core/BeadArray.class new file mode 100644 index 0000000..4db852d Binary files /dev/null and b/bin/net/beadsproject/beads/core/BeadArray.class differ diff --git a/bin/net/beadsproject/beads/core/BuildVersion.class b/bin/net/beadsproject/beads/core/BuildVersion.class new file mode 100644 index 0000000..98e1d69 Binary files /dev/null and b/bin/net/beadsproject/beads/core/BuildVersion.class differ diff --git a/bin/net/beadsproject/beads/core/IOAudioFormat.class b/bin/net/beadsproject/beads/core/IOAudioFormat.class new file mode 100644 index 0000000..d627378 Binary files /dev/null and b/bin/net/beadsproject/beads/core/IOAudioFormat.class differ diff --git a/bin/net/beadsproject/beads/core/JackRemote.class b/bin/net/beadsproject/beads/core/JackRemote.class new file mode 100644 index 0000000..af9e719 Binary files /dev/null and b/bin/net/beadsproject/beads/core/JackRemote.class differ diff --git a/bin/net/beadsproject/beads/core/TimeStamp.class b/bin/net/beadsproject/beads/core/TimeStamp.class new file mode 100644 index 0000000..db0d427 Binary files /dev/null and b/bin/net/beadsproject/beads/core/TimeStamp.class differ diff --git a/bin/net/beadsproject/beads/core/UGen$1.class b/bin/net/beadsproject/beads/core/UGen$1.class new file mode 100644 index 0000000..d2ba342 Binary files /dev/null and b/bin/net/beadsproject/beads/core/UGen$1.class differ diff --git a/bin/net/beadsproject/beads/core/UGen$BufferPointer.class b/bin/net/beadsproject/beads/core/UGen$BufferPointer.class new file mode 100644 index 0000000..cdbf575 Binary files /dev/null and b/bin/net/beadsproject/beads/core/UGen$BufferPointer.class differ diff --git a/bin/net/beadsproject/beads/core/UGen$OutputInitializationRegime.class b/bin/net/beadsproject/beads/core/UGen$OutputInitializationRegime.class new file mode 100644 index 0000000..c7608ad Binary files /dev/null and b/bin/net/beadsproject/beads/core/UGen$OutputInitializationRegime.class differ diff --git a/bin/net/beadsproject/beads/core/UGen$OutputPauseRegime.class b/bin/net/beadsproject/beads/core/UGen$OutputPauseRegime.class new file mode 100644 index 0000000..808eae2 Binary files /dev/null and b/bin/net/beadsproject/beads/core/UGen$OutputPauseRegime.class differ diff --git a/bin/net/beadsproject/beads/core/UGen.class b/bin/net/beadsproject/beads/core/UGen.class new file mode 100644 index 0000000..a6ee1b2 Binary files /dev/null and b/bin/net/beadsproject/beads/core/UGen.class differ diff --git a/bin/net/beadsproject/beads/core/UGenChain$1.class b/bin/net/beadsproject/beads/core/UGenChain$1.class new file mode 100644 index 0000000..2f135ba Binary files /dev/null and b/bin/net/beadsproject/beads/core/UGenChain$1.class differ diff --git a/bin/net/beadsproject/beads/core/UGenChain$2.class b/bin/net/beadsproject/beads/core/UGenChain$2.class new file mode 100644 index 0000000..a3f0e24 Binary files /dev/null and b/bin/net/beadsproject/beads/core/UGenChain$2.class differ diff --git a/bin/net/beadsproject/beads/core/UGenChain.class b/bin/net/beadsproject/beads/core/UGenChain.class new file mode 100644 index 0000000..6e4eda6 Binary files /dev/null and b/bin/net/beadsproject/beads/core/UGenChain.class differ diff --git a/bin/net/beadsproject/beads/core/io/JSTest.class b/bin/net/beadsproject/beads/core/io/JSTest.class new file mode 100644 index 0000000..9c043d2 Binary files /dev/null and b/bin/net/beadsproject/beads/core/io/JSTest.class differ diff --git a/bin/net/beadsproject/beads/core/io/JavaSoundAudioIO$1.class b/bin/net/beadsproject/beads/core/io/JavaSoundAudioIO$1.class new file mode 100644 index 0000000..4532bdb Binary files /dev/null and b/bin/net/beadsproject/beads/core/io/JavaSoundAudioIO$1.class differ diff --git a/bin/net/beadsproject/beads/core/io/JavaSoundAudioIO$JavaSoundRTInput.class b/bin/net/beadsproject/beads/core/io/JavaSoundAudioIO$JavaSoundRTInput.class new file mode 100644 index 0000000..72a55cb Binary files /dev/null and b/bin/net/beadsproject/beads/core/io/JavaSoundAudioIO$JavaSoundRTInput.class differ diff --git a/bin/net/beadsproject/beads/core/io/JavaSoundAudioIO.class b/bin/net/beadsproject/beads/core/io/JavaSoundAudioIO.class new file mode 100644 index 0000000..0a8d04b Binary files /dev/null and b/bin/net/beadsproject/beads/core/io/JavaSoundAudioIO.class differ diff --git a/bin/net/beadsproject/beads/core/io/NonrealtimeIO$ThisIsNotAnInput.class b/bin/net/beadsproject/beads/core/io/NonrealtimeIO$ThisIsNotAnInput.class new file mode 100644 index 0000000..33a213f Binary files /dev/null and b/bin/net/beadsproject/beads/core/io/NonrealtimeIO$ThisIsNotAnInput.class differ diff --git a/bin/net/beadsproject/beads/core/io/NonrealtimeIO.class b/bin/net/beadsproject/beads/core/io/NonrealtimeIO.class new file mode 100644 index 0000000..35aa48c Binary files /dev/null and b/bin/net/beadsproject/beads/core/io/NonrealtimeIO.class differ diff --git a/bin/net/beadsproject/beads/data/Buffer.class b/bin/net/beadsproject/beads/data/Buffer.class new file mode 100644 index 0000000..06ca153 Binary files /dev/null and b/bin/net/beadsproject/beads/data/Buffer.class differ diff --git a/bin/net/beadsproject/beads/data/BufferFactory.class b/bin/net/beadsproject/beads/data/BufferFactory.class new file mode 100644 index 0000000..324e0ef Binary files /dev/null and b/bin/net/beadsproject/beads/data/BufferFactory.class differ diff --git a/bin/net/beadsproject/beads/data/DataBead.class b/bin/net/beadsproject/beads/data/DataBead.class new file mode 100644 index 0000000..f3b5bb2 Binary files /dev/null and b/bin/net/beadsproject/beads/data/DataBead.class differ diff --git a/bin/net/beadsproject/beads/data/DataBeadReceiver.class b/bin/net/beadsproject/beads/data/DataBeadReceiver.class new file mode 100644 index 0000000..e3bea01 Binary files /dev/null and b/bin/net/beadsproject/beads/data/DataBeadReceiver.class differ diff --git a/bin/net/beadsproject/beads/data/Pitch.class b/bin/net/beadsproject/beads/data/Pitch.class new file mode 100644 index 0000000..263b955 Binary files /dev/null and b/bin/net/beadsproject/beads/data/Pitch.class differ diff --git a/bin/net/beadsproject/beads/data/Sample.class b/bin/net/beadsproject/beads/data/Sample.class new file mode 100644 index 0000000..b263ff4 Binary files /dev/null and b/bin/net/beadsproject/beads/data/Sample.class differ diff --git a/bin/net/beadsproject/beads/data/SampleAudioFormat.class b/bin/net/beadsproject/beads/data/SampleAudioFormat.class new file mode 100644 index 0000000..40abb5c Binary files /dev/null and b/bin/net/beadsproject/beads/data/SampleAudioFormat.class differ diff --git a/bin/net/beadsproject/beads/data/SampleManager$SampleGroupListener.class b/bin/net/beadsproject/beads/data/SampleManager$SampleGroupListener.class new file mode 100644 index 0000000..271ad53 Binary files /dev/null and b/bin/net/beadsproject/beads/data/SampleManager$SampleGroupListener.class differ diff --git a/bin/net/beadsproject/beads/data/SampleManager.class b/bin/net/beadsproject/beads/data/SampleManager.class new file mode 100644 index 0000000..bc4a6f5 Binary files /dev/null and b/bin/net/beadsproject/beads/data/SampleManager.class differ diff --git a/bin/net/beadsproject/beads/data/audiofile/AudioFileReader.class b/bin/net/beadsproject/beads/data/audiofile/AudioFileReader.class new file mode 100644 index 0000000..1627055 Binary files /dev/null and b/bin/net/beadsproject/beads/data/audiofile/AudioFileReader.class differ diff --git a/bin/net/beadsproject/beads/data/audiofile/AudioFileType.class b/bin/net/beadsproject/beads/data/audiofile/AudioFileType.class new file mode 100644 index 0000000..620c690 Binary files /dev/null and b/bin/net/beadsproject/beads/data/audiofile/AudioFileType.class differ diff --git a/bin/net/beadsproject/beads/data/audiofile/AudioFileWriter.class b/bin/net/beadsproject/beads/data/audiofile/AudioFileWriter.class new file mode 100644 index 0000000..a5ee45b Binary files /dev/null and b/bin/net/beadsproject/beads/data/audiofile/AudioFileWriter.class differ diff --git a/bin/net/beadsproject/beads/data/audiofile/FileFormatException.class b/bin/net/beadsproject/beads/data/audiofile/FileFormatException.class new file mode 100644 index 0000000..4043f2d Binary files /dev/null and b/bin/net/beadsproject/beads/data/audiofile/FileFormatException.class differ diff --git a/bin/net/beadsproject/beads/data/audiofile/JavaSoundAudioFile.class b/bin/net/beadsproject/beads/data/audiofile/JavaSoundAudioFile.class new file mode 100644 index 0000000..d9c298f Binary files /dev/null and b/bin/net/beadsproject/beads/data/audiofile/JavaSoundAudioFile.class differ diff --git a/bin/net/beadsproject/beads/data/audiofile/OperationUnsupportedException.class b/bin/net/beadsproject/beads/data/audiofile/OperationUnsupportedException.class new file mode 100644 index 0000000..9b344a4 Binary files /dev/null and b/bin/net/beadsproject/beads/data/audiofile/OperationUnsupportedException.class differ diff --git a/bin/net/beadsproject/beads/data/audiofile/WavFileReaderWriter$IOState.class b/bin/net/beadsproject/beads/data/audiofile/WavFileReaderWriter$IOState.class new file mode 100644 index 0000000..3de9a9e Binary files /dev/null and b/bin/net/beadsproject/beads/data/audiofile/WavFileReaderWriter$IOState.class differ diff --git a/bin/net/beadsproject/beads/data/audiofile/WavFileReaderWriter.class b/bin/net/beadsproject/beads/data/audiofile/WavFileReaderWriter.class new file mode 100644 index 0000000..0c06c06 Binary files /dev/null and b/bin/net/beadsproject/beads/data/audiofile/WavFileReaderWriter.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/CosineWindow.class b/bin/net/beadsproject/beads/data/buffers/CosineWindow.class new file mode 100644 index 0000000..11b7bc5 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/CosineWindow.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/CurveBuffer.class b/bin/net/beadsproject/beads/data/buffers/CurveBuffer.class new file mode 100644 index 0000000..e94ea64 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/CurveBuffer.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/Exp01Buffer.class b/bin/net/beadsproject/beads/data/buffers/Exp01Buffer.class new file mode 100644 index 0000000..a02d134 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/Exp01Buffer.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/HanningWindow.class b/bin/net/beadsproject/beads/data/buffers/HanningWindow.class new file mode 100644 index 0000000..ce6a374 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/HanningWindow.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/Log01Buffer.class b/bin/net/beadsproject/beads/data/buffers/Log01Buffer.class new file mode 100644 index 0000000..a02d509 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/Log01Buffer.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/MeanFilter.class b/bin/net/beadsproject/beads/data/buffers/MeanFilter.class new file mode 100644 index 0000000..7ff2977 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/MeanFilter.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/NoiseBuffer.class b/bin/net/beadsproject/beads/data/buffers/NoiseBuffer.class new file mode 100644 index 0000000..e5bc292 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/NoiseBuffer.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/OneWindow.class b/bin/net/beadsproject/beads/data/buffers/OneWindow.class new file mode 100644 index 0000000..f81dd16 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/OneWindow.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/RampBuffer.class b/bin/net/beadsproject/beads/data/buffers/RampBuffer.class new file mode 100644 index 0000000..e564776 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/RampBuffer.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/SawBuffer.class b/bin/net/beadsproject/beads/data/buffers/SawBuffer.class new file mode 100644 index 0000000..869bad9 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/SawBuffer.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/SineBuffer.class b/bin/net/beadsproject/beads/data/buffers/SineBuffer.class new file mode 100644 index 0000000..41755a3 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/SineBuffer.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/SquareBuffer.class b/bin/net/beadsproject/beads/data/buffers/SquareBuffer.class new file mode 100644 index 0000000..e3b9795 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/SquareBuffer.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/TriangleBuffer.class b/bin/net/beadsproject/beads/data/buffers/TriangleBuffer.class new file mode 100644 index 0000000..4a344f1 Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/TriangleBuffer.class differ diff --git a/bin/net/beadsproject/beads/data/buffers/TriangularWindow.class b/bin/net/beadsproject/beads/data/buffers/TriangularWindow.class new file mode 100644 index 0000000..ccb31bd Binary files /dev/null and b/bin/net/beadsproject/beads/data/buffers/TriangularWindow.class differ diff --git a/bin/net/beadsproject/beads/events/AudioContextStopTrigger.class b/bin/net/beadsproject/beads/events/AudioContextStopTrigger.class new file mode 100644 index 0000000..2489ce9 Binary files /dev/null and b/bin/net/beadsproject/beads/events/AudioContextStopTrigger.class differ diff --git a/bin/net/beadsproject/beads/events/FloatBead.class b/bin/net/beadsproject/beads/events/FloatBead.class new file mode 100644 index 0000000..8bb12d3 Binary files /dev/null and b/bin/net/beadsproject/beads/events/FloatBead.class differ diff --git a/bin/net/beadsproject/beads/events/IntegerBead.class b/bin/net/beadsproject/beads/events/IntegerBead.class new file mode 100644 index 0000000..25e1845 Binary files /dev/null and b/bin/net/beadsproject/beads/events/IntegerBead.class differ diff --git a/bin/net/beadsproject/beads/events/KillTrigger.class b/bin/net/beadsproject/beads/events/KillTrigger.class new file mode 100644 index 0000000..9d09d2f Binary files /dev/null and b/bin/net/beadsproject/beads/events/KillTrigger.class differ diff --git a/bin/net/beadsproject/beads/events/PauseTrigger.class b/bin/net/beadsproject/beads/events/PauseTrigger.class new file mode 100644 index 0000000..fa6b582 Binary files /dev/null and b/bin/net/beadsproject/beads/events/PauseTrigger.class differ diff --git a/bin/net/beadsproject/beads/events/SoundEvent.class b/bin/net/beadsproject/beads/events/SoundEvent.class new file mode 100644 index 0000000..4994f5f Binary files /dev/null and b/bin/net/beadsproject/beads/events/SoundEvent.class differ diff --git a/bin/net/beadsproject/beads/events/SoundEventManager.class b/bin/net/beadsproject/beads/events/SoundEventManager.class new file mode 100644 index 0000000..c41c05e Binary files /dev/null and b/bin/net/beadsproject/beads/events/SoundEventManager.class differ diff --git a/bin/net/beadsproject/beads/events/StartTrigger.class b/bin/net/beadsproject/beads/events/StartTrigger.class new file mode 100644 index 0000000..f1e0ca3 Binary files /dev/null and b/bin/net/beadsproject/beads/events/StartTrigger.class differ diff --git a/bin/net/beadsproject/beads/ugens/ADSR.class b/bin/net/beadsproject/beads/ugens/ADSR.class new file mode 100644 index 0000000..c19bd89 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/ADSR.class differ diff --git a/bin/net/beadsproject/beads/ugens/Add.class b/bin/net/beadsproject/beads/ugens/Add.class new file mode 100644 index 0000000..28c1757 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Add.class differ diff --git a/bin/net/beadsproject/beads/ugens/AllpassFilter.class b/bin/net/beadsproject/beads/ugens/AllpassFilter.class new file mode 100644 index 0000000..9231c34 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/AllpassFilter.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadCustomCoeffCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadCustomCoeffCalculator.class new file mode 100644 index 0000000..0aea4d6 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadCustomCoeffCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$APValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$APValCalculator.class new file mode 100644 index 0000000..e48492e Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$APValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$BPPeakValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$BPPeakValCalculator.class new file mode 100644 index 0000000..ee8a70e Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$BPPeakValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$BPSkirtValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$BPSkirtValCalculator.class new file mode 100644 index 0000000..0089f4c Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$BPSkirtValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$BesselHPValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$BesselHPValCalculator.class new file mode 100644 index 0000000..b72b547 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$BesselHPValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$BesselLPValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$BesselLPValCalculator.class new file mode 100644 index 0000000..e422f0b Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$BesselLPValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$ButterworthBPValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$ButterworthBPValCalculator.class new file mode 100644 index 0000000..b534fcb Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$ButterworthBPValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$ButterworthHPValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$ButterworthHPValCalculator.class new file mode 100644 index 0000000..4a55599 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$ButterworthHPValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$ButterworthLPValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$ButterworthLPValCalculator.class new file mode 100644 index 0000000..c8ac5d7 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$ButterworthLPValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$CustomCoeffCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$CustomCoeffCalculator.class new file mode 100644 index 0000000..6006be9 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$CustomCoeffCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$CustomValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$CustomValCalculator.class new file mode 100644 index 0000000..3bf50dc Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$CustomValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$HPValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$HPValCalculator.class new file mode 100644 index 0000000..959e5a2 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$HPValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$HighShelfValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$HighShelfValCalculator.class new file mode 100644 index 0000000..487079d Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$HighShelfValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$LPValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$LPValCalculator.class new file mode 100644 index 0000000..110d000 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$LPValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$LowShelfValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$LowShelfValCalculator.class new file mode 100644 index 0000000..8fa12af Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$LowShelfValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$NotchValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$NotchValCalculator.class new file mode 100644 index 0000000..d712199 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$NotchValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$PeakingEQValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$PeakingEQValCalculator.class new file mode 100644 index 0000000..1719259 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$PeakingEQValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$Type.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$Type.class new file mode 100644 index 0000000..b707573 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$Type.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter$ValCalculator.class b/bin/net/beadsproject/beads/ugens/BiquadFilter$ValCalculator.class new file mode 100644 index 0000000..32fc388 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter$ValCalculator.class differ diff --git a/bin/net/beadsproject/beads/ugens/BiquadFilter.class b/bin/net/beadsproject/beads/ugens/BiquadFilter.class new file mode 100644 index 0000000..8835dee Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/BiquadFilter.class differ diff --git a/bin/net/beadsproject/beads/ugens/Change.class b/bin/net/beadsproject/beads/ugens/Change.class new file mode 100644 index 0000000..f77cb11 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Change.class differ diff --git a/bin/net/beadsproject/beads/ugens/Clicker.class b/bin/net/beadsproject/beads/ugens/Clicker.class new file mode 100644 index 0000000..d85a8dd Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Clicker.class differ diff --git a/bin/net/beadsproject/beads/ugens/Clip.class b/bin/net/beadsproject/beads/ugens/Clip.class new file mode 100644 index 0000000..7a9116c Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Clip.class differ diff --git a/bin/net/beadsproject/beads/ugens/Clock.class b/bin/net/beadsproject/beads/ugens/Clock.class new file mode 100644 index 0000000..a19f80a Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Clock.class differ diff --git a/bin/net/beadsproject/beads/ugens/CombFilter.class b/bin/net/beadsproject/beads/ugens/CombFilter.class new file mode 100644 index 0000000..9471243 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/CombFilter.class differ diff --git a/bin/net/beadsproject/beads/ugens/Compressor$1MyInputs.class b/bin/net/beadsproject/beads/ugens/Compressor$1MyInputs.class new file mode 100644 index 0000000..e2be593 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Compressor$1MyInputs.class differ diff --git a/bin/net/beadsproject/beads/ugens/Compressor.class b/bin/net/beadsproject/beads/ugens/Compressor.class new file mode 100644 index 0000000..048ff16 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Compressor.class differ diff --git a/bin/net/beadsproject/beads/ugens/CrossFade.class b/bin/net/beadsproject/beads/ugens/CrossFade.class new file mode 100644 index 0000000..614f4e1 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/CrossFade.class differ diff --git a/bin/net/beadsproject/beads/ugens/CrossoverFilter.class b/bin/net/beadsproject/beads/ugens/CrossoverFilter.class new file mode 100644 index 0000000..f0af3cf Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/CrossoverFilter.class differ diff --git a/bin/net/beadsproject/beads/ugens/DelayData.class b/bin/net/beadsproject/beads/ugens/DelayData.class new file mode 100644 index 0000000..b5beb08 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/DelayData.class differ diff --git a/bin/net/beadsproject/beads/ugens/DelayEvent.class b/bin/net/beadsproject/beads/ugens/DelayEvent.class new file mode 100644 index 0000000..9ad49a3 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/DelayEvent.class differ diff --git a/bin/net/beadsproject/beads/ugens/DelayTrigger.class b/bin/net/beadsproject/beads/ugens/DelayTrigger.class new file mode 100644 index 0000000..2d06b51 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/DelayTrigger.class differ diff --git a/bin/net/beadsproject/beads/ugens/Delta.class b/bin/net/beadsproject/beads/ugens/Delta.class new file mode 100644 index 0000000..4e5c55a Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Delta.class differ diff --git a/bin/net/beadsproject/beads/ugens/Drain$Grain.class b/bin/net/beadsproject/beads/ugens/Drain$Grain.class new file mode 100644 index 0000000..9f5f919 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Drain$Grain.class differ diff --git a/bin/net/beadsproject/beads/ugens/Drain.class b/bin/net/beadsproject/beads/ugens/Drain.class new file mode 100644 index 0000000..78c116b Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Drain.class differ diff --git a/bin/net/beadsproject/beads/ugens/Envelope$Segment.class b/bin/net/beadsproject/beads/ugens/Envelope$Segment.class new file mode 100644 index 0000000..6a1ec37 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Envelope$Segment.class differ diff --git a/bin/net/beadsproject/beads/ugens/Envelope.class b/bin/net/beadsproject/beads/ugens/Envelope.class new file mode 100644 index 0000000..f494f3c Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Envelope.class differ diff --git a/bin/net/beadsproject/beads/ugens/Function.class b/bin/net/beadsproject/beads/ugens/Function.class new file mode 100644 index 0000000..b03c56c Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Function.class differ diff --git a/bin/net/beadsproject/beads/ugens/Gain.class b/bin/net/beadsproject/beads/ugens/Gain.class new file mode 100644 index 0000000..5d68af0 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Gain.class differ diff --git a/bin/net/beadsproject/beads/ugens/Glide.class b/bin/net/beadsproject/beads/ugens/Glide.class new file mode 100644 index 0000000..021cf25 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Glide.class differ diff --git a/bin/net/beadsproject/beads/ugens/GranularSamplePlayer$Grain.class b/bin/net/beadsproject/beads/ugens/GranularSamplePlayer$Grain.class new file mode 100644 index 0000000..5d6fbf5 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/GranularSamplePlayer$Grain.class differ diff --git a/bin/net/beadsproject/beads/ugens/GranularSamplePlayer.class b/bin/net/beadsproject/beads/ugens/GranularSamplePlayer.class new file mode 100644 index 0000000..5d0dfa8 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/GranularSamplePlayer.class differ diff --git a/bin/net/beadsproject/beads/ugens/IIRFilter$IIRFilterAnalysis.class b/bin/net/beadsproject/beads/ugens/IIRFilter$IIRFilterAnalysis.class new file mode 100644 index 0000000..373f5c6 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/IIRFilter$IIRFilterAnalysis.class differ diff --git a/bin/net/beadsproject/beads/ugens/IIRFilter.class b/bin/net/beadsproject/beads/ugens/IIRFilter.class new file mode 100644 index 0000000..d44dd71 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/IIRFilter.class differ diff --git a/bin/net/beadsproject/beads/ugens/LPRezFilter.class b/bin/net/beadsproject/beads/ugens/LPRezFilter.class new file mode 100644 index 0000000..933b4e7 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/LPRezFilter.class differ diff --git a/bin/net/beadsproject/beads/ugens/Maximum.class b/bin/net/beadsproject/beads/ugens/Maximum.class new file mode 100644 index 0000000..736320d Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Maximum.class differ diff --git a/bin/net/beadsproject/beads/ugens/Minimum.class b/bin/net/beadsproject/beads/ugens/Minimum.class new file mode 100644 index 0000000..c403762 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Minimum.class differ diff --git a/bin/net/beadsproject/beads/ugens/MonoPlug.class b/bin/net/beadsproject/beads/ugens/MonoPlug.class new file mode 100644 index 0000000..5a88d2d Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/MonoPlug.class differ diff --git a/bin/net/beadsproject/beads/ugens/MouseResponder.class b/bin/net/beadsproject/beads/ugens/MouseResponder.class new file mode 100644 index 0000000..bbf45d8 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/MouseResponder.class differ diff --git a/bin/net/beadsproject/beads/ugens/Mult.class b/bin/net/beadsproject/beads/ugens/Mult.class new file mode 100644 index 0000000..2542083 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Mult.class differ diff --git a/bin/net/beadsproject/beads/ugens/MultiWrapper$1.class b/bin/net/beadsproject/beads/ugens/MultiWrapper$1.class new file mode 100644 index 0000000..8e5eb13 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/MultiWrapper$1.class differ diff --git a/bin/net/beadsproject/beads/ugens/MultiWrapper.class b/bin/net/beadsproject/beads/ugens/MultiWrapper.class new file mode 100644 index 0000000..68f381b Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/MultiWrapper.class differ diff --git a/bin/net/beadsproject/beads/ugens/NBitsConverter.class b/bin/net/beadsproject/beads/ugens/NBitsConverter.class new file mode 100644 index 0000000..4dffe9c Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/NBitsConverter.class differ diff --git a/bin/net/beadsproject/beads/ugens/Noise.class b/bin/net/beadsproject/beads/ugens/Noise.class new file mode 100644 index 0000000..7988a78 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Noise.class differ diff --git a/bin/net/beadsproject/beads/ugens/OnePoleFilter.class b/bin/net/beadsproject/beads/ugens/OnePoleFilter.class new file mode 100644 index 0000000..9eee152 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/OnePoleFilter.class differ diff --git a/bin/net/beadsproject/beads/ugens/OscillatorBank.class b/bin/net/beadsproject/beads/ugens/OscillatorBank.class new file mode 100644 index 0000000..01e97c9 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/OscillatorBank.class differ diff --git a/bin/net/beadsproject/beads/ugens/Panner.class b/bin/net/beadsproject/beads/ugens/Panner.class new file mode 100644 index 0000000..0874e0d Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Panner.class differ diff --git a/bin/net/beadsproject/beads/ugens/Phasor.class b/bin/net/beadsproject/beads/ugens/Phasor.class new file mode 100644 index 0000000..3982214 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Phasor.class differ diff --git a/bin/net/beadsproject/beads/ugens/Plug.class b/bin/net/beadsproject/beads/ugens/Plug.class new file mode 100644 index 0000000..cd90802 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Plug.class differ diff --git a/bin/net/beadsproject/beads/ugens/PolyLimit.class b/bin/net/beadsproject/beads/ugens/PolyLimit.class new file mode 100644 index 0000000..9d40d8b Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/PolyLimit.class differ diff --git a/bin/net/beadsproject/beads/ugens/RMS.class b/bin/net/beadsproject/beads/ugens/RMS.class new file mode 100644 index 0000000..34d20b8 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/RMS.class differ diff --git a/bin/net/beadsproject/beads/ugens/RandomPWM$Mode.class b/bin/net/beadsproject/beads/ugens/RandomPWM$Mode.class new file mode 100644 index 0000000..51d49ff Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/RandomPWM$Mode.class differ diff --git a/bin/net/beadsproject/beads/ugens/RandomPWM.class b/bin/net/beadsproject/beads/ugens/RandomPWM.class new file mode 100644 index 0000000..0e4e0f7 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/RandomPWM.class differ diff --git a/bin/net/beadsproject/beads/ugens/RangeLimiter.class b/bin/net/beadsproject/beads/ugens/RangeLimiter.class new file mode 100644 index 0000000..dc39fa0 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/RangeLimiter.class differ diff --git a/bin/net/beadsproject/beads/ugens/RecordToFile.class b/bin/net/beadsproject/beads/ugens/RecordToFile.class new file mode 100644 index 0000000..61895ba Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/RecordToFile.class differ diff --git a/bin/net/beadsproject/beads/ugens/RecordToSample$Mode.class b/bin/net/beadsproject/beads/ugens/RecordToSample$Mode.class new file mode 100644 index 0000000..d70d5c6 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/RecordToSample$Mode.class differ diff --git a/bin/net/beadsproject/beads/ugens/RecordToSample.class b/bin/net/beadsproject/beads/ugens/RecordToSample.class new file mode 100644 index 0000000..b81370f Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/RecordToSample.class differ diff --git a/bin/net/beadsproject/beads/ugens/Reverb.class b/bin/net/beadsproject/beads/ugens/Reverb.class new file mode 100644 index 0000000..65c073d Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Reverb.class differ diff --git a/bin/net/beadsproject/beads/ugens/SamplePlayer$EnvelopeType.class b/bin/net/beadsproject/beads/ugens/SamplePlayer$EnvelopeType.class new file mode 100644 index 0000000..8e26aba Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/SamplePlayer$EnvelopeType.class differ diff --git a/bin/net/beadsproject/beads/ugens/SamplePlayer$InterpolationType.class b/bin/net/beadsproject/beads/ugens/SamplePlayer$InterpolationType.class new file mode 100644 index 0000000..4b60f06 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/SamplePlayer$InterpolationType.class differ diff --git a/bin/net/beadsproject/beads/ugens/SamplePlayer$LoopType.class b/bin/net/beadsproject/beads/ugens/SamplePlayer$LoopType.class new file mode 100644 index 0000000..8f412ed Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/SamplePlayer$LoopType.class differ diff --git a/bin/net/beadsproject/beads/ugens/SamplePlayer.class b/bin/net/beadsproject/beads/ugens/SamplePlayer.class new file mode 100644 index 0000000..0a97b4a Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/SamplePlayer.class differ diff --git a/bin/net/beadsproject/beads/ugens/ScalingMixer.class b/bin/net/beadsproject/beads/ugens/ScalingMixer.class new file mode 100644 index 0000000..35eea6f Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/ScalingMixer.class differ diff --git a/bin/net/beadsproject/beads/ugens/SignalReporter.class b/bin/net/beadsproject/beads/ugens/SignalReporter.class new file mode 100644 index 0000000..c829c18 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/SignalReporter.class differ diff --git a/bin/net/beadsproject/beads/ugens/Spatial$Location.class b/bin/net/beadsproject/beads/ugens/Spatial$Location.class new file mode 100644 index 0000000..d923cb6 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Spatial$Location.class differ diff --git a/bin/net/beadsproject/beads/ugens/Spatial.class b/bin/net/beadsproject/beads/ugens/Spatial.class new file mode 100644 index 0000000..3f24c20 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Spatial.class differ diff --git a/bin/net/beadsproject/beads/ugens/Static.class b/bin/net/beadsproject/beads/ugens/Static.class new file mode 100644 index 0000000..f613e4d Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Static.class differ diff --git a/bin/net/beadsproject/beads/ugens/TapIn.class b/bin/net/beadsproject/beads/ugens/TapIn.class new file mode 100644 index 0000000..13f6830 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/TapIn.class differ diff --git a/bin/net/beadsproject/beads/ugens/TapOut$InterpolationType.class b/bin/net/beadsproject/beads/ugens/TapOut$InterpolationType.class new file mode 100644 index 0000000..c4de433 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/TapOut$InterpolationType.class differ diff --git a/bin/net/beadsproject/beads/ugens/TapOut.class b/bin/net/beadsproject/beads/ugens/TapOut.class new file mode 100644 index 0000000..f9f2fa9 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/TapOut.class differ diff --git a/bin/net/beadsproject/beads/ugens/Throughput.class b/bin/net/beadsproject/beads/ugens/Throughput.class new file mode 100644 index 0000000..9f33309 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/Throughput.class differ diff --git a/bin/net/beadsproject/beads/ugens/TrapezoidWave.class b/bin/net/beadsproject/beads/ugens/TrapezoidWave.class new file mode 100644 index 0000000..8949883 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/TrapezoidWave.class differ diff --git a/bin/net/beadsproject/beads/ugens/WavePlayer.class b/bin/net/beadsproject/beads/ugens/WavePlayer.class new file mode 100644 index 0000000..a1991f7 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/WavePlayer.class differ diff --git a/bin/net/beadsproject/beads/ugens/WaveShaper.class b/bin/net/beadsproject/beads/ugens/WaveShaper.class new file mode 100644 index 0000000..954704f Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/WaveShaper.class differ diff --git a/bin/net/beadsproject/beads/ugens/ZMap.class b/bin/net/beadsproject/beads/ugens/ZMap.class new file mode 100644 index 0000000..4f5b684 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/ZMap.class differ diff --git a/bin/net/beadsproject/beads/ugens/ZeroCross.class b/bin/net/beadsproject/beads/ugens/ZeroCross.class new file mode 100644 index 0000000..b39eb17 Binary files /dev/null and b/bin/net/beadsproject/beads/ugens/ZeroCross.class differ diff --git a/bin/org/jaudiolibs/beads/AudioServerIO$1.class b/bin/org/jaudiolibs/beads/AudioServerIO$1.class new file mode 100644 index 0000000..befaa4b Binary files /dev/null and b/bin/org/jaudiolibs/beads/AudioServerIO$1.class differ diff --git a/bin/org/jaudiolibs/beads/AudioServerIO$Jack.class b/bin/org/jaudiolibs/beads/AudioServerIO$Jack.class new file mode 100644 index 0000000..93396a2 Binary files /dev/null and b/bin/org/jaudiolibs/beads/AudioServerIO$Jack.class differ diff --git a/bin/org/jaudiolibs/beads/AudioServerIO$JavaSound.class b/bin/org/jaudiolibs/beads/AudioServerIO$JavaSound.class new file mode 100644 index 0000000..319f850 Binary files /dev/null and b/bin/org/jaudiolibs/beads/AudioServerIO$JavaSound.class differ diff --git a/bin/org/jaudiolibs/beads/AudioServerIO$RTInput.class b/bin/org/jaudiolibs/beads/AudioServerIO$RTInput.class new file mode 100644 index 0000000..d0e43fa Binary files /dev/null and b/bin/org/jaudiolibs/beads/AudioServerIO$RTInput.class differ diff --git a/bin/org/jaudiolibs/beads/AudioServerIO.class b/bin/org/jaudiolibs/beads/AudioServerIO.class new file mode 100644 index 0000000..2e1ca19 Binary files /dev/null and b/bin/org/jaudiolibs/beads/AudioServerIO.class differ diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..a7f87d2 --- /dev/null +++ b/build.gradle @@ -0,0 +1,221 @@ +//gradle build file for Beads + +buildscript { + repositories { + jcenter() + + } + dependencies { + classpath 'com.github.jengelman.gradle.plugins:shadow:6.0.0' + } +} + +repositories { + mavenCentral() + maven { url "https://clojars.org/repo" } +} + +apply plugin: 'com.github.johnrengelman.shadow' +apply plugin: 'java-library' +apply plugin: 'maven' +apply plugin: 'signing' + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + +version="4.1" // Add '-SNAPSHOT' at the end for non-release uploads +group='net.beadsproject' +archivesBaseName = "beads" + +sourceSets { + main { + java { + srcDirs = ['src/beads_main/java', 'src/beads_io/java'] + } + } +} + +dependencies { + //implementation fileTree(dir: 'libs', include: '*.jar') // - Thin Jar + //compile fileTree(dir: 'libs', include: '*.jar') // - Fat Jar + + implementation 'javazoom:jlayer:1.0.1' + implementation 'com.googlecode.soundlibs:mp3spi:1.9.5.4' + implementation 'org.clojars.automata:tritonus-aos:1.0.0' + implementation 'org.clojars.automata:tritonus-share:1.0.0' + implementation 'org.jaudiolibs:audioservers-javasound:2.0.0' + implementation 'org.jaudiolibs:audioservers-jack:2.0.0' + implementation 'org.jaudiolibs:jnajack:1.4.0' +} + +shadowJar { + baseName = 'beads' + classifier = null + version = null +} + +javadoc { + failOnError(false) +} + +//Add javadocs and sourceJars as artifact +task javadocJar(type: Jar) { + classifier = 'javadoc' + from javadoc +} + +task sourcesJar(type: Jar) { + classifier = 'sources' + from sourceSets.main.allSource +} + +artifacts { + archives javadocJar, sourcesJar +} + +signing { + sign configurations.archives +} + +// Import ShadowJar plugin and create custom shadowJar task +// to flatten package structure for Processing +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +task flattenShadowJar (type: ShadowJar, dependsOn: 'shadowJar') { + from sourceSets.main.output + configurations = [project.configurations.runtime] + + classifier = 'flat' + version = null + + relocate 'org.jaudiolibs.beads', 'beads' + + //Flatten hierarchical structure, starting from leaves + relocate 'net.beadsproject.beads.analysis.featureextractors', 'beads' + relocate 'net.beadsproject.beads.analysis.segmenters', 'beads' + relocate 'net.beadsproject.beads.analysis', 'beads' + + relocate 'net.beadsproject.beads.core.io', 'beads' + relocate 'net.beadsproject.beads.core', 'beads' + + relocate 'net.beadsproject.beads.data.audiofile', 'beads' + relocate 'net.beadsproject.beads.data.buffers', 'beads' + relocate 'net.beadsproject.beads.data', 'beads' + + relocate 'net.beadsproject.beads.events', 'beads' + relocate 'net.beadsproject.beads.ugens', 'beads' +} + +task generateProcessingLibrary(dependsOn: ['javadoc','flattenShadowJar']) { + doLast { + copy { + from("${buildDir}/docs/javadoc") + into("${buildDir}/processing/beads/reference") + } + copy { + from("packages/Processing/examples") + into("${buildDir}/processing/beads/examples") + } + copy { + from("src") + into("${buildDir}/processing/beads/src") + } + // Transfer flat .jar to Processing folder + copy { + from("${buildDir}/libs/beads-flat.jar") + into("${buildDir}/processing/beads/library") + rename('beads-flat.jar', 'beads.jar') + } + // Copy all dependencies over to Processing + copy { + from configurations.compileClasspath + into("${buildDir}/libs") + } + copy { + from configurations.compileClasspath + into("${buildDir}/processing/beads/library") + } + copy { + from("packages/Processing/library.properties") + into("${buildDir}/processing/beads") + } + } + + task zipProcessingLibrary(type: Zip, dependsOn: 'generateProcessingLibrary') { + from("${buildDir}/processing/") + exclude("*.DS_Store") + archiveName("beads.zip") + destinationDir(file("${buildDir}")) + } + + // Delete leftover original flat .jar file, as only Processing will need it + task deleteTemporaryFiles(type: Delete, dependsOn: 'generateProcessingLibrary') { + delete("${buildDir}/libs/beads-flat.jar") + } +} + +task deployJarAndJavaDocToHappyBrackets (dependsOn: ['javadoc', 'shadowJar']) { + copy { + from 'build/docs/javadoc/net/beadsproject' + into '../HappyBrackets/HappyBrackets/libs/docs/net/beadsproject' + } + + copy { + from 'build/libs/' + into '../HappyBrackets/HappyBrackets/libs' + } + + println "copied jars" +} + +// Add POM metadata to artifact for Central Maven upload +// NOTE: You will need a gradle.properties file with the following: +// - signing.keyId=pubkey ID, signing.password=privkey passphrase, signing.secretKeyRingFile= /path/to/SecretKeyringFile.gpg +// - ossrhUsername=user, ossrhPassword=pass +uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + + pom.project { + name 'Beads' + packaging 'jar' + // optionally artifactId can be defined here + description 'A software library written in Java for realtime audio.' + url 'http://www.beadsproject.net' + + scm { + connection 'scm:git:git://github.com/orsjb/beads.git' + developerConnection 'scm:git:git@github.com:orsjb/beads.git' + url 'https://github.com/orsjb/beads/' + } + + licenses { + license { + name 'GNU General Public License, Version 3' + url 'https://www.gnu.org/licenses/gpl-3.0.txt' + } + } + + developers { + developer { + id 'orsjb' + name 'Ollie Bown' + email 'ollie@icarus.nu' + } + } + } + } + } +} + +task deploy(dependsOn: ['zipProcessingLibrary', 'deleteTemporaryFiles']) + +task fullDeploy(dependsOn: ['zipProcessingLibrary', 'deleteTemporaryFiles', 'uploadArchives']) diff --git a/build.xml b/build.xml deleted file mode 100644 index c0f6aba..0000000 --- a/build.xml +++ /dev/null @@ -1,300 +0,0 @@ - - - - - Beads - a computer music and sound art library for Java. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..f3d88b1 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..21e622d --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100755 index 0000000..2fe81a7 --- /dev/null +++ b/gradlew @@ -0,0 +1,183 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..9109989 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,103 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/dependencies/jarjar-1.0.jar b/libs/jarjar-1.0.jar similarity index 100% rename from dependencies/jarjar-1.0.jar rename to libs/jarjar-1.0.jar diff --git a/dependencies/jl1.0.1.jar b/libs/jl1.0.1.jar similarity index 100% rename from dependencies/jl1.0.1.jar rename to libs/jl1.0.1.jar diff --git a/dependencies/jna.jar b/libs/jna.jar similarity index 100% rename from dependencies/jna.jar rename to libs/jna.jar diff --git a/dependencies/mp3spi1.9.4.jar b/libs/mp3spi1.9.4.jar similarity index 100% rename from dependencies/mp3spi1.9.4.jar rename to libs/mp3spi1.9.4.jar diff --git a/dependencies/org-jaudiolibs-audioservers-jack.jar b/libs/org-jaudiolibs-audioservers-jack.jar similarity index 100% rename from dependencies/org-jaudiolibs-audioservers-jack.jar rename to libs/org-jaudiolibs-audioservers-jack.jar diff --git a/dependencies/org-jaudiolibs-audioservers-javasound.jar b/libs/org-jaudiolibs-audioservers-javasound.jar similarity index 100% rename from dependencies/org-jaudiolibs-audioservers-javasound.jar rename to libs/org-jaudiolibs-audioservers-javasound.jar diff --git a/dependencies/org-jaudiolibs-audioservers.jar b/libs/org-jaudiolibs-audioservers.jar similarity index 100% rename from dependencies/org-jaudiolibs-audioservers.jar rename to libs/org-jaudiolibs-audioservers.jar diff --git a/dependencies/org-jaudiolibs-jnajack.jar b/libs/org-jaudiolibs-jnajack.jar similarity index 100% rename from dependencies/org-jaudiolibs-jnajack.jar rename to libs/org-jaudiolibs-jnajack.jar diff --git a/dependencies/tools.jar b/libs/tools.jar similarity index 100% rename from dependencies/tools.jar rename to libs/tools.jar diff --git a/dependencies/tritonus_aos-0.3.6.jar b/libs/tritonus_aos-0.3.6.jar similarity index 100% rename from dependencies/tritonus_aos-0.3.6.jar rename to libs/tritonus_aos-0.3.6.jar diff --git a/dependencies/tritonus_share.jar b/libs/tritonus_share.jar similarity index 100% rename from dependencies/tritonus_share.jar rename to libs/tritonus_share.jar diff --git a/packages/Beads/.classpath b/packages/Beads/.classpath deleted file mode 100644 index 525c40e..0000000 --- a/packages/Beads/.classpath +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/packages/Beads/.gitignore b/packages/Beads/.gitignore deleted file mode 100644 index 5e56e04..0000000 --- a/packages/Beads/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bin diff --git a/packages/Beads/.project b/packages/Beads/.project deleted file mode 100644 index 35148b1..0000000 --- a/packages/Beads/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - Beads Tutorial Project - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/packages/Beads/README.txt b/packages/Beads/README.txt deleted file mode 100644 index 8dbf97f..0000000 --- a/packages/Beads/README.txt +++ /dev/null @@ -1,4 +0,0 @@ -Beads - a computer music and sound art library for Java. -http://www.beadsproject.net. - -This is the Beads Library. See library for jar files, doc for JavaDoc files or import this folder into Eclipse where you can run the tutorial code. Enjoy! \ No newline at end of file diff --git a/packages/Processing/README.txt b/packages/Processing/README.txt deleted file mode 100644 index 92c82bf..0000000 --- a/packages/Processing/README.txt +++ /dev/null @@ -1,16 +0,0 @@ -Beads - a computer music and sound art library for Java. -http://www.beadsproject.net. - -This is the Beads library for Processing. Follow these instructions to get started... - --- 1. Download and install Processing -- - -Go to http://processing.org/download/ and download and install Processing for your platform. - --- 2. Copy the Beads library into the Processing libraries directory -- - -Processing has a directory that contains 3rd party libraries. This is a directory called "libraries" inside the Processing sketchbook directory. Look in Processing's preferences to see where the sketchbook directory is, or change it. Move the "beads" directory from the "beads_processing" directory into the libraries folder. Restart Processing. From the "Sketch" menu you should be able to see the "beads" library in the list of libraries that are available for import. - --- 3. Work through the examples -- - -Now work through the tutorials in the tutorial folder. Each tutorial is a Processing sketch and should open automatically in Processing when double-clicked. \ No newline at end of file diff --git a/packages/Processing/tutorial/Lesson01_AudioContext/Lesson01_AudioContext.pde b/packages/Processing/examples/Lesson01_AudioContext/Lesson01_AudioContext.pde similarity index 77% rename from packages/Processing/tutorial/Lesson01_AudioContext/Lesson01_AudioContext.pde rename to packages/Processing/examples/Lesson01_AudioContext/Lesson01_AudioContext.pde index 6afdffe..9a5fa65 100644 --- a/packages/Processing/tutorial/Lesson01_AudioContext/Lesson01_AudioContext.pde +++ b/packages/Processing/examples/Lesson01_AudioContext/Lesson01_AudioContext.pde @@ -16,6 +16,10 @@ void setup() { * audio processing. It also connects the the JavaSound system and * provides you with an output device. */ + + /* UPDATE: As of Beads (v3.2), Default Audio Contexts (defaultcontext) + * can now be used. Please see below for more details. + */ ac = new AudioContext(); /* * Make a noise-making object. Noise is a type of Class known as a @@ -48,6 +52,19 @@ void setup() { * Finally, start things running. */ ac.start(); + + /* + * UPDATE: As of Beads v3.2, all UGens have a shared default Audio + * Context in them that can be accessed through AudioContext.getDefaultContext(). + * You will no longer need to explicitly create AudioContext ac and insert this + * when making new UGen objects. Defaultcontext will provide the same effects + * as creating a new AudioContext without any parameters. If you want to specify + * particular information such as the device or AudioIO to be used, you will + * need to make your own AudioContext object, as shown in lesson_01. + * + * Lesson02_EnvelopeAndWavePlayer onwards will instead be using the + * defaultcontext. + */ } /* @@ -79,4 +96,4 @@ void draw() { pixels[vOffset * width + i] = fore; } updatePixels(); -} \ No newline at end of file +} diff --git a/packages/Processing/tutorial/Lesson02_EnvelopeAndWavePlayer/Lesson02_EnvelopeAndWavePlayer.pde b/packages/Processing/examples/Lesson02_EnvelopeAndWavePlayer/Lesson02_EnvelopeAndWavePlayer.pde similarity index 69% rename from packages/Processing/tutorial/Lesson02_EnvelopeAndWavePlayer/Lesson02_EnvelopeAndWavePlayer.pde rename to packages/Processing/examples/Lesson02_EnvelopeAndWavePlayer/Lesson02_EnvelopeAndWavePlayer.pde index 1c05555..5a755a6 100644 --- a/packages/Processing/tutorial/Lesson02_EnvelopeAndWavePlayer/Lesson02_EnvelopeAndWavePlayer.pde +++ b/packages/Processing/examples/Lesson02_EnvelopeAndWavePlayer/Lesson02_EnvelopeAndWavePlayer.pde @@ -5,20 +5,32 @@ AudioContext ac; void setup() { size(300,300); - ac = new AudioContext(); + + /* + * As we are using the defaultcontext, there is no longer + * a need to create an AudioContext object. For simplicity's sake, + * we'll just give the defaultcontext a local name, and access it + * it using 'ac'. + */ + ac = AudioContext.getDefaultContext(); /* * This is an Envelope. It can be used to modify * the behaviour of other UGen object. We need to * do this to get precise control of certain parameters * at an audio rate. + * + * When using defaultcontexts, we no longer need to pass + * in an explicit AudioContext when constructing new UGens. + * Note that if you use a custom AudioContext, you will need + * pass it into the constructor of each UGen. */ - Envelope freqEnv = new Envelope(ac, 500); + Envelope freqEnv = new Envelope(500); /* * This is a WavePlayer. Here we've set it up using * the above Envelope, and a SineBuffer. We'll use * the Envelope to modify the freqency below. */ - WavePlayer wp = new WavePlayer(ac, freqEnv, Buffer.SINE); + WavePlayer wp = new WavePlayer(freqEnv, Buffer.SINE); /* * So now that the WavePlayer is set up with the * frequency Envelope, do stuff with the frequency @@ -32,8 +44,14 @@ void setup() { /* * Connect it all together as before. */ - Gain g = new Gain(ac, 1, 0.1); + Gain g = new Gain(1, 0.1); g.addInput(wp); + + /* + * We will still need to attach all the UGens to the output + * of the defaultcontext and make it start running in order + * for audio to play. We can do this the same way as before. + */ ac.out.addInput(g); ac.start(); } @@ -67,4 +85,4 @@ void draw() { pixels[vOffset * width + i] = fore; } updatePixels(); -} \ No newline at end of file +} diff --git a/packages/Processing/tutorial/Lesson03_FMSynthesis/Lesson03_FMSynthesis.pde b/packages/Processing/examples/Lesson03_FMSynthesis/Lesson03_FMSynthesis.pde similarity index 91% rename from packages/Processing/tutorial/Lesson03_FMSynthesis/Lesson03_FMSynthesis.pde rename to packages/Processing/examples/Lesson03_FMSynthesis/Lesson03_FMSynthesis.pde index e97fde1..c21b0a7 100644 --- a/packages/Processing/tutorial/Lesson03_FMSynthesis/Lesson03_FMSynthesis.pde +++ b/packages/Processing/examples/Lesson03_FMSynthesis/Lesson03_FMSynthesis.pde @@ -5,7 +5,7 @@ AudioContext ac; void setup() { size(300,300); - ac = new AudioContext(); + ac = AudioContext.getDefaultContext(); /* * In the last example, we used an Envelope to * control the frequency of a WavePlayer. @@ -16,7 +16,7 @@ void setup() { * Here's the modulating WavePlayer. It has a low * frequency. */ - WavePlayer freqModulator = new WavePlayer(ac, 50, Buffer.SINE); + WavePlayer freqModulator = new WavePlayer(50, Buffer.SINE); /* * The next line might look outrageous if you're not * experienced in Java. Basically we're defining a @@ -36,11 +36,11 @@ void setup() { * Now we plug in the function. Compare this to the previous * example, where we plugged in an envelope. */ - WavePlayer wp = new WavePlayer(ac, function, Buffer.SINE); + WavePlayer wp = new WavePlayer(function, Buffer.SINE); /* * Connect it all together as before. */ - Gain g = new Gain(ac, 1, 0.1); + Gain g = new Gain(1, 0.1); g.addInput(wp); ac.out.addInput(g); ac.start(); @@ -75,4 +75,4 @@ void draw() { pixels[vOffset * width + i] = fore; } updatePixels(); -} \ No newline at end of file +} diff --git a/packages/Processing/tutorial/Lesson04_SamplePlayer/Lesson04_SamplePlayer.pde b/packages/Processing/examples/Lesson04_SamplePlayer/Lesson04_SamplePlayer.pde similarity index 91% rename from packages/Processing/tutorial/Lesson04_SamplePlayer/Lesson04_SamplePlayer.pde rename to packages/Processing/examples/Lesson04_SamplePlayer/Lesson04_SamplePlayer.pde index 7368071..395f16c 100644 --- a/packages/Processing/tutorial/Lesson04_SamplePlayer/Lesson04_SamplePlayer.pde +++ b/packages/Processing/examples/Lesson04_SamplePlayer/Lesson04_SamplePlayer.pde @@ -5,7 +5,7 @@ AudioContext ac; void setup() { size(300,300); - ac = new AudioContext(); + ac = AudioContext.getDefaultContext(); selectInput("Select an audio file:", "fileSelected"); } @@ -23,18 +23,18 @@ void fileSelected(File selection) { * files according to their file names, so you don't have to load them again. */ String audioFileName = selection.getAbsolutePath(); - SamplePlayer player = new SamplePlayer(ac, SampleManager.sample(audioFileName)); + SamplePlayer player = new SamplePlayer(SampleManager.sample(audioFileName)); /* * And as before... */ - Gain g = new Gain(ac, 2, 0.2); + Gain g = new Gain(2, 0.2); g.addInput(player); ac.out.addInput(g); ac.start(); /* * Note there is a lot more you can do. e.g., Varispeed. Try adding this... - Envelope speedControl = new Envelope(ac, 1); + Envelope speedControl = new Envelope(1); player.setRate(speedControl); speedControl.addSegment(1, 1000); //wait a second speedControl.addSegment(-0.5, 3000); //now rewind @@ -73,4 +73,4 @@ void draw() { pixels[vOffset * width + i] = fore; } updatePixels(); -} \ No newline at end of file +} diff --git a/packages/Processing/tutorial/Lesson05_Clock/Lesson05_Clock.pde b/packages/Processing/examples/Lesson05_Clock/Lesson05_Clock.pde similarity index 93% rename from packages/Processing/tutorial/Lesson05_Clock/Lesson05_Clock.pde rename to packages/Processing/examples/Lesson05_Clock/Lesson05_Clock.pde index f40bc5f..c8751d8 100644 --- a/packages/Processing/tutorial/Lesson05_Clock/Lesson05_Clock.pde +++ b/packages/Processing/examples/Lesson05_Clock/Lesson05_Clock.pde @@ -6,7 +6,7 @@ AudioContext ac; void setup() { frameRate(200); size(300,300); -ac = new AudioContext(); +ac = AudioContext.getDefaultContext(); /* * This is a boring example. See Lesson_07_Music for * something more complex. @@ -21,7 +21,7 @@ ac = new AudioContext(); * * So we begin with the envelope as before. */ - Envelope intervalEnvelope = new Envelope(ac, 1000); + Envelope intervalEnvelope = new Envelope(1000); intervalEnvelope.addSegment(600, 10000); intervalEnvelope.addSegment(1000, 10000); intervalEnvelope.addSegment(400, 10000); @@ -30,7 +30,7 @@ ac = new AudioContext(); * Then the clock, which gets initialised with the * envelope. */ - Clock clock = new Clock(ac, intervalEnvelope); + Clock clock = new Clock(intervalEnvelope); /* * Tell the clock to tick (you probably don't want * to do this except for debugging. @@ -75,4 +75,4 @@ void draw() { pixels[vOffset * width + i] = fore; } updatePixels(); -} \ No newline at end of file +} diff --git a/packages/Processing/tutorial/Lesson06_Trigger/Lesson06_Trigger.pde b/packages/Processing/examples/Lesson06_Trigger/Lesson06_Trigger.pde similarity index 90% rename from packages/Processing/tutorial/Lesson06_Trigger/Lesson06_Trigger.pde rename to packages/Processing/examples/Lesson06_Trigger/Lesson06_Trigger.pde index c903ac2..aea5cf3 100644 --- a/packages/Processing/tutorial/Lesson06_Trigger/Lesson06_Trigger.pde +++ b/packages/Processing/examples/Lesson06_Trigger/Lesson06_Trigger.pde @@ -6,7 +6,7 @@ AudioContext ac; void setup() { frameRate(200); size(300,300); -ac = new AudioContext(); +ac = AudioContext.getDefaultContext(); /* * How do you trigger events to happen in the future? * @@ -18,22 +18,22 @@ ac = new AudioContext(); /* * Here is the master gain object. */ - Gain masterGain = new Gain(ac, 1, 1); + Gain masterGain = new Gain(1, 1); /* * Now two things. Firstly, a WavePlayer with an Envelope controlling * its frequency, connected to a Gain. */ - Envelope freqEnv = new Envelope(ac, 250); - WavePlayer wp = new WavePlayer(ac, freqEnv, Buffer.SINE); - Gain g1 = new Gain(ac, 1, 0.3); + Envelope freqEnv = new Envelope(250); + WavePlayer wp = new WavePlayer(freqEnv, Buffer.SINE); + Gain g1 = new Gain(1, 0.3); g1.addInput(wp); /* * Secondly, just another WavePlayer connected to a Gain (no Envelope). */ - WavePlayer wp2 = new WavePlayer(ac, 255, Buffer.SQUARE); - Gain g2 = new Gain(ac, 1, 0.1); + WavePlayer wp2 = new WavePlayer(255, Buffer.SQUARE); + Gain g2 = new Gain(1, 0.1); g2.addInput(wp2); /* @@ -110,4 +110,4 @@ void draw() { pixels[vOffset * width + i] = fore; } updatePixels(); -} \ No newline at end of file +} diff --git a/packages/Processing/tutorial/Lesson07_Music/Lesson07_Music.pde b/packages/Processing/examples/Lesson07_Music/Lesson07_Music.pde similarity index 85% rename from packages/Processing/tutorial/Lesson07_Music/Lesson07_Music.pde rename to packages/Processing/examples/Lesson07_Music/Lesson07_Music.pde index 52cfa23..d64aceb 100644 --- a/packages/Processing/tutorial/Lesson07_Music/Lesson07_Music.pde +++ b/packages/Processing/examples/Lesson07_Music/Lesson07_Music.pde @@ -6,7 +6,7 @@ AudioContext ac; void setup() { frameRate(200); size(300,300); -ac = new AudioContext(); +ac = AudioContext.getDefaultContext(); /* * In this example a Clock is used to trigger events. We do this * by adding a listener to the Clock (which is of type Bead). @@ -17,7 +17,7 @@ ac = new AudioContext(); * This example is more sophisticated than the previous * ones. It uses nested code. */ - Clock clock = new Clock(ac, 700); + Clock clock = new Clock(700); clock.addMessageListener( //this is the on-the-fly bead new Bead() { @@ -30,8 +30,8 @@ ac = new AudioContext(); if(random(1) < 0.5) return; pitch = Pitch.forceToScale((int)random(12), Pitch.dorian); float freq = Pitch.mtof(pitch + (int)random(5) * 12 + 32); - WavePlayer wp = new WavePlayer(ac, freq, Buffer.SINE); - Gain g = new Gain(ac, 1, new Envelope(ac, 0)); + WavePlayer wp = new WavePlayer(freq, Buffer.SINE); + Gain g = new Gain(1, new Envelope(0)); g.addInput(wp); ac.out.addInput(g); ((Envelope)g.getGainEnvelope()).addSegment(0.1, random(200)); @@ -42,20 +42,20 @@ ac = new AudioContext(); int pitchAlt = pitch; if(random(1) < 0.2) pitchAlt = Pitch.forceToScale((int)random(12), Pitch.dorian) + (int)random(2) * 12; float freq = Pitch.mtof(pitchAlt + 32); - WavePlayer wp = new WavePlayer(ac, freq, Buffer.SQUARE); - Gain g = new Gain(ac, 1, new Envelope(ac, 0)); + WavePlayer wp = new WavePlayer(freq, Buffer.SQUARE); + Gain g = new Gain(1, new Envelope(0)); g.addInput(wp); - Panner p = new Panner(ac, random(1)); + Panner p = new Panner(random(1)); p.addInput(g); ac.out.addInput(p); ((Envelope)g.getGainEnvelope()).addSegment(random(0.1), random(50)); ((Envelope)g.getGainEnvelope()).addSegment(0, random(400), new KillTrigger(p)); } if(c.getCount() % 8 == 0) { - Noise n = new Noise(ac); - Gain g = new Gain(ac, 1, new Envelope(ac, 0.05)); + Noise n = new Noise(); + Gain g = new Gain(1, new Envelope(0.05)); g.addInput(n); - Panner p = new Panner(ac, random(0.5, 1)); + Panner p = new Panner(random(0.5, 1)); p.addInput(g); ac.out.addInput(p); ((Envelope)g.getGainEnvelope()).addSegment(0, random(100), new KillTrigger(p)); @@ -96,4 +96,4 @@ void draw() { pixels[vOffset * width + i] = fore; } updatePixels(); -} \ No newline at end of file +} diff --git a/packages/Processing/tutorial/Lesson08_Granulation/Lesson08_Granulation.pde b/packages/Processing/examples/Lesson08_Granulation/Lesson08_Granulation.pde similarity index 90% rename from packages/Processing/tutorial/Lesson08_Granulation/Lesson08_Granulation.pde rename to packages/Processing/examples/Lesson08_Granulation/Lesson08_Granulation.pde index 32779ce..2bca3a5 100644 --- a/packages/Processing/tutorial/Lesson08_Granulation/Lesson08_Granulation.pde +++ b/packages/Processing/examples/Lesson08_Granulation/Lesson08_Granulation.pde @@ -5,7 +5,7 @@ AudioContext ac; void setup() { size(300,300); - ac = new AudioContext(); + ac = AudioContext.getDefaultContext(); selectInput("Select an audio file:", "fileSelected"); } @@ -20,7 +20,7 @@ void fileSelected(File selection) { */ String audioFileName = selection.getAbsolutePath(); Sample sample = SampleManager.sample(audioFileName); - GranularSamplePlayer player = new GranularSamplePlayer(ac, sample); + GranularSamplePlayer player = new GranularSamplePlayer(sample); /* * Have some fun with the controls. */ @@ -29,11 +29,11 @@ void fileSelected(File selection) { player.getLoopStartEnvelope().setValue(0); player.getLoopEndEnvelope().setValue((float)sample.getLength()); //control the rate of grain firing - Envelope grainIntervalEnvelope = new Envelope(ac, 30); + Envelope grainIntervalEnvelope = new Envelope(30); grainIntervalEnvelope.addSegment(20, 10000); player.setGrainIntervalEnvelope(grainIntervalEnvelope); //control the playback rate - Envelope rateEnvelope = new Envelope(ac, 1); + Envelope rateEnvelope = new Envelope(1); rateEnvelope.addSegment(1, 5000); rateEnvelope.addSegment(0, 5000); rateEnvelope.addSegment(0, 2000); @@ -44,7 +44,7 @@ void fileSelected(File selection) { /* * And as before... */ - Gain g = new Gain(ac, 2, 0.2); + Gain g = new Gain(2, 0.2); g.addInput(player); ac.out.addInput(g); ac.start(); @@ -80,4 +80,4 @@ void draw() { pixels[vOffset * width + i] = fore; } updatePixels(); -} \ No newline at end of file +} diff --git a/packages/Processing/tutorial/Lesson09_Analysis/Lesson09_Analysis.pde b/packages/Processing/examples/Lesson09_Analysis/Lesson09_Analysis.pde similarity index 92% rename from packages/Processing/tutorial/Lesson09_Analysis/Lesson09_Analysis.pde rename to packages/Processing/examples/Lesson09_Analysis/Lesson09_Analysis.pde index 6f2c84a..5009724 100644 --- a/packages/Processing/tutorial/Lesson09_Analysis/Lesson09_Analysis.pde +++ b/packages/Processing/examples/Lesson09_Analysis/Lesson09_Analysis.pde @@ -6,7 +6,7 @@ PowerSpectrum ps; void setup() { size(300,300); - ac = new AudioContext(); + ac = AudioContext.getDefaultContext(); selectInput("Select an audio file:", "fileSelected"); } @@ -16,8 +16,8 @@ void fileSelected(File selection) { */ String audioFileName = selection.getAbsolutePath(); Sample sample = SampleManager.sample(audioFileName); - SamplePlayer player = new SamplePlayer(ac, sample); - Gain g = new Gain(ac, 2, 0.2); + SamplePlayer player = new SamplePlayer(sample); + Gain g = new Gain(2, 0.2); g.addInput(player); ac.out.addInput(g); /* diff --git a/packages/Processing/tutorial/Lesson10_Interaction/Lesson10_Interaction.pde b/packages/Processing/examples/Lesson10_Interaction/Lesson10_Interaction.pde similarity index 85% rename from packages/Processing/tutorial/Lesson10_Interaction/Lesson10_Interaction.pde rename to packages/Processing/examples/Lesson10_Interaction/Lesson10_Interaction.pde index 4553ba3..968af92 100644 --- a/packages/Processing/tutorial/Lesson10_Interaction/Lesson10_Interaction.pde +++ b/packages/Processing/examples/Lesson10_Interaction/Lesson10_Interaction.pde @@ -6,26 +6,26 @@ Glide carrierFreq, modFreqRatio; void setup() { size(300,300); - ac = new AudioContext(); + ac = AudioContext.getDefaultContext(); /* * This is a copy of Lesson 3 with some mouse control. */ //this time we use the Glide object because it smooths the mouse input. - carrierFreq = new Glide(ac, 500); - modFreqRatio = new Glide(ac, 1); + carrierFreq = new Glide(500); + modFreqRatio = new Glide(1); Function modFreq = new Function(carrierFreq, modFreqRatio) { public float calculate() { return x[0] * x[1]; } }; - WavePlayer freqModulator = new WavePlayer(ac, modFreq, Buffer.SINE); + WavePlayer freqModulator = new WavePlayer(modFreq, Buffer.SINE); Function carrierMod = new Function(freqModulator, carrierFreq) { public float calculate() { return x[0] * 400.0 + x[1]; } }; - WavePlayer wp = new WavePlayer(ac, carrierMod, Buffer.SINE); - Gain g = new Gain(ac, 1, 0.1); + WavePlayer wp = new WavePlayer(carrierMod, Buffer.SINE); + Gain g = new Gain(1, 0.1); g.addInput(wp); ac.out.addInput(g); ac.start(); @@ -58,4 +58,4 @@ void draw() { //mouse listening code here carrierFreq.setValue((float)mouseX / width * 1000 + 50); modFreqRatio.setValue((1 - (float)mouseY / height) * 10 + 0.1); -} \ No newline at end of file +} diff --git a/packages/Processing/tutorial/Lesson11_OnsetDetection/Lesson11_OnsetDetection.pde b/packages/Processing/examples/Lesson11_OnsetDetection/Lesson11_OnsetDetection.pde similarity index 94% rename from packages/Processing/tutorial/Lesson11_OnsetDetection/Lesson11_OnsetDetection.pde rename to packages/Processing/examples/Lesson11_OnsetDetection/Lesson11_OnsetDetection.pde index 955fa6d..c33edf1 100644 --- a/packages/Processing/tutorial/Lesson11_OnsetDetection/Lesson11_OnsetDetection.pde +++ b/packages/Processing/examples/Lesson11_OnsetDetection/Lesson11_OnsetDetection.pde @@ -13,7 +13,7 @@ int time; // tracks the time void setup() { size(300,300); time = millis(); - ac = new AudioContext(); + ac = AudioContext.getDefaultContext(); selectInput("Select an audio file:", "fileSelected"); } @@ -24,8 +24,8 @@ void fileSelected(File selection) { */ String audioFileName = selection.getAbsolutePath(); Sample sample = SampleManager.sample(audioFileName); - SamplePlayer player = new SamplePlayer(ac, sample); - Gain g = new Gain(ac, 2, 0.2); + SamplePlayer player = new SamplePlayer(sample); + Gain g = new Gain(2, 0.2); g.addInput(player); ac.out.addInput(g); diff --git a/packages/Processing/library.properties b/packages/Processing/library.properties index 326526c..27c4144 100644 --- a/packages/Processing/library.properties +++ b/packages/Processing/library.properties @@ -39,7 +39,7 @@ paragraph = Beads offers powerful tools for performing realtime audio manipulati # is used to compare different versions of the same library, and # check if an update is available. You should think of it as a # counter, counting the total number of releases you've had. -version = 1 # This must be parsable as an int +version = 4 # This must be parsable as an int # The version as the user will see it. If blank, the version attribute will be used here -prettyVersion = 1.01 # This is treated as a String \ No newline at end of file +prettyVersion = 4.1 # This is treated as a String diff --git a/packages/release_notes.txt b/packages/release_notes.txt deleted file mode 100644 index 6cd2cbb..0000000 --- a/packages/release_notes.txt +++ /dev/null @@ -1,12 +0,0 @@ - ------------ --- V1.02 -- ------------ - - * Fixed Sample so that write methods throw IOExceptions rather than Exceptions. - ------------ --- V1.01 -- ------------ - - * Release notes started from V1.01. \ No newline at end of file diff --git a/pom.xml b/pom.xml deleted file mode 100644 index ef4fcfc..0000000 --- a/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - 4.0.0 - - com.github.samgwise - beads - 1.01-SNAPSHOT - - - - - maven-antrun-plugin - 1.6 - - - com.sun - tools - 1.5.0 - system - ${java.home}/../lib/tools.jar - - - - - compile - - - - - - - run - - - - - - - org.apache.maven.plugins - maven-install-plugin - 2.3.1 - - - install-library - install - - install-file - - - net.beadsproject - beads - ${project.version} - build/beads/library/beads.jar - jar - - - - - - - - - diff --git a/scripts/build.xml b/scripts/build.xml deleted file mode 100644 index bee3f4d..0000000 --- a/scripts/build.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Beads - a computer music and sound art library for Java. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scripts/upload_script.sh b/scripts/upload_script.sh deleted file mode 100755 index 692c6fb..0000000 --- a/scripts/upload_script.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# only run this from the folder it lives in. - -# create and upload the Processing 2.0 official distro (which lives at http://www.beadsproject.net/library/) - -cd ../build/beads_processing -zip -r beads.zip beads -scp beads.zip orsjb@beadsproject.net:beadsproject.net/library/ -scp beads/library.properties orsjb@beadsproject.net:beadsproject.net/library/beads.txt -rm beads.zip -cd ../.. - -# create and upload the two zip packages - -cd build -rm *.zip -NOW=`date +"%Y%m%d"` -zip -r Beads.zip beads -zip -r Beads_Processing.zip beads_processing -cp Beads.zip Beads${NOW}.zip -cp Beads_Processing.zip Beads_Processing${NOW}.zip -scp *.zip orsjb@beadsproject.net:beadsproject.net/downloads/ -rm *.zip -cd .. - -# upload the docs - -cd build -scp -r doc orsjb@beadsproject.net:beadsproject.net/ -cd .. diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..bce0d60 --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +//gradle settings file diff --git a/src/beads_io/net/beadsproject/beads/core/JackRemote.java b/src/beads_io/java/net/beadsproject/beads/core/JackRemote.java similarity index 100% rename from src/beads_io/net/beadsproject/beads/core/JackRemote.java rename to src/beads_io/java/net/beadsproject/beads/core/JackRemote.java diff --git a/src/beads_io/net/beadsproject/beads/core/io/JSTest.java b/src/beads_io/java/net/beadsproject/beads/core/io/JSTest.java similarity index 100% rename from src/beads_io/net/beadsproject/beads/core/io/JSTest.java rename to src/beads_io/java/net/beadsproject/beads/core/io/JSTest.java diff --git a/src/beads_io/net/beadsproject/beads/core/io/JavaSoundAudioIO.java b/src/beads_io/java/net/beadsproject/beads/core/io/JavaSoundAudioIO.java similarity index 70% rename from src/beads_io/net/beadsproject/beads/core/io/JavaSoundAudioIO.java rename to src/beads_io/java/net/beadsproject/beads/core/io/JavaSoundAudioIO.java index b2f5a8b..e7a9e16 100644 --- a/src/beads_io/net/beadsproject/beads/core/io/JavaSoundAudioIO.java +++ b/src/beads_io/java/net/beadsproject/beads/core/io/JavaSoundAudioIO.java @@ -36,17 +36,18 @@ public class JavaSoundAudioIO extends AudioIO { private Thread audioThread; /** The priority of the audio thread. */ - private int threadPriority; - - /** The current byte buffer. */ - private byte[] bbuf; - + private int threadPriority; + + /** The number of prepared output buffers ready to go to AudioOutput */ + final int NUM_OUTPUT_BUFFERS = 2; + public JavaSoundAudioIO() { this(DEFAULT_SYSTEM_BUFFER_SIZE); } public JavaSoundAudioIO(int systemBufferSize) { this.systemBufferSizeInFrames = systemBufferSize; + System.out.println("Beads System Buffer size=" + systemBufferSize); setThreadPriority(Thread.MAX_PRIORITY); } @@ -65,11 +66,15 @@ public boolean create() { audioFormat); try { sourceDataLine = (SourceDataLine) mixer.getLine(info); - if (systemBufferSizeInFrames < 0) + if (systemBufferSizeInFrames < 0) { sourceDataLine.open(audioFormat); - else - sourceDataLine.open(audioFormat, systemBufferSizeInFrames - * audioFormat.getFrameSize()); + }else { + int sound_output_buffer_size = systemBufferSizeInFrames + * audioFormat.getFrameSize() * 2; + + sourceDataLine.open(audioFormat, sound_output_buffer_size); + System.out.println("Beads Output buffer size=" + sound_output_buffer_size); + } } catch (LineUnavailableException ex) { System.out .println(getClass().getName() + " : Error getting line\n"); @@ -85,7 +90,7 @@ public boolean create() { */ private void getDefaultMixerIfNotAlreadyChosen() { if(mixer == null) { - selectMixer(0); + selectMixer(-1); } } @@ -109,13 +114,17 @@ public void chooseMixerCommandLine() { * @param i the index of the selected mixer. */ public void selectMixer(int i) { - Mixer.Info[] mixerinfo = AudioSystem.getMixerInfo(); - mixer = AudioSystem.getMixer(mixerinfo[i]); - if(mixer != null) { - System.out.print("JavaSoundAudioIO: Chosen mixer is "); - System.out.println(mixer.getMixerInfo().getName() + "."); + if (i < 0) { + mixer = AudioSystem.getMixer(null); } else { - System.out.println("JavaSoundAudioIO: Failed to get mixer."); + Mixer.Info[] mixerinfo = AudioSystem.getMixerInfo(); + mixer = AudioSystem.getMixer(mixerinfo[i]); + if (mixer != null) { + System.out.print("JavaSoundAudioIO: Chosen mixer is "); + System.out.println(mixer.getMixerInfo().getName() + "."); + } else { + System.out.println("JavaSoundAudioIO: Failed to get mixer."); + } } } @@ -192,20 +201,58 @@ private void runRealTime() { AudioFormat audioFormat = new AudioFormat(ioAudioFormat.sampleRate, ioAudioFormat.bitDepth, ioAudioFormat.outputs, ioAudioFormat.signed, ioAudioFormat.bigEndian); int bufferSizeInFrames = context.getBufferSize(); - bbuf = new byte[bufferSizeInFrames * audioFormat.getFrameSize()]; - float[] interleavedOutput = new float[audioFormat.getChannels() * bufferSizeInFrames]; + + final int outputBufferLength = bufferSizeInFrames * audioFormat.getFrameSize(); + + byte [][] output_buffers = new byte [NUM_OUTPUT_BUFFERS] [outputBufferLength]; + + final int sampleBufferSize = audioFormat.getChannels() * bufferSizeInFrames; + float[] interleavedOutput = new float[sampleBufferSize]; + sourceDataLine.start(); + + int buffers_sent = 0; + + // first let is prime our output buffer + if (context.isRunning()){ + for (int i = 0; i < NUM_OUTPUT_BUFFERS; i++){ + byte [] current_buffer = output_buffers[i]; + prepareLineBuffer(audioFormat, current_buffer, interleavedOutput, bufferSizeInFrames, sampleBufferSize); + } + } + + while (context.isRunning()) { - update(); // this propagates update call to context - for (int i = 0, counter = 0; i < bufferSizeInFrames; ++i) { - for (int j = 0; j < audioFormat.getChannels(); ++j) { - interleavedOutput[counter++] = context.out.getValue(j, i); - } + + byte [] current_buffer = output_buffers[buffers_sent % NUM_OUTPUT_BUFFERS]; + buffers_sent++; + sourceDataLine.write(current_buffer, 0, outputBufferLength); + + current_buffer = output_buffers[buffers_sent % NUM_OUTPUT_BUFFERS]; + prepareLineBuffer(audioFormat, current_buffer, interleavedOutput, bufferSizeInFrames, sampleBufferSize); + //AudioUtils.floatToByte(bbuf, interleavedOutput, audioFormat.isBigEndian()); + + } + } + + /** + * Read audio from UGens and copy them into a buffer ready to write to Audio Line + * @param audioFormat The AudioFormat + * @param outputBUffer The buffer that will contain the prepared bytes for the AudioLine + * @param interleavedSamples Interleaved samples as floats + * @param bufferSizeInFrames The size of interleaved samples in frames + * @param sampleBufferSize The size of our actual sample buffer size + */ + private void prepareLineBuffer(AudioFormat audioFormat, byte[] outputBUffer, float[] interleavedSamples, int bufferSizeInFrames, int sampleBufferSize){ + update(); // this propagates update call to context + for (int i = 0, counter = 0; i < bufferSizeInFrames; ++i) { + for (int j = 0; j < audioFormat.getChannels(); ++j) { + interleavedSamples[counter++] = context.out.getValue(j, i); } - AudioUtils.floatToByte(bbuf, interleavedOutput, - audioFormat.isBigEndian()); - sourceDataLine.write(bbuf, 0, bbuf.length); } + + AudioUtils.floatToByte(outputBUffer,0, interleavedSamples,0, sampleBufferSize, audioFormat.isBigEndian()); + } @Override @@ -219,7 +266,6 @@ protected UGen getAudioInput(int[] channels) { /** * JavaSoundRTInput gathers audio from the JavaSound audio input device. - * @beads.category input */ private class JavaSoundRTInput extends UGen { @@ -248,7 +294,16 @@ private class JavaSoundRTInput extends UGen { this.audioFormat = audioFormat; javaSoundInitialized = false; } - + + /** + * Instantiates a new RTInput. + * + * @param audioFormat + * the AudioFormat. + */ + JavaSoundRTInput( AudioFormat audioFormat) { + this(getDefaultContext(), audioFormat); + } /** * Set up JavaSound. Requires that JavaSound has been set up in AudioContext. */ diff --git a/src/beads_io/net/beadsproject/beads/data/audiofile/JavaSoundAudioFile.java b/src/beads_io/java/net/beadsproject/beads/data/audiofile/JavaSoundAudioFile.java similarity index 95% rename from src/beads_io/net/beadsproject/beads/data/audiofile/JavaSoundAudioFile.java rename to src/beads_io/java/net/beadsproject/beads/data/audiofile/JavaSoundAudioFile.java index 2999475..518b115 100644 --- a/src/beads_io/net/beadsproject/beads/data/audiofile/JavaSoundAudioFile.java +++ b/src/beads_io/java/net/beadsproject/beads/data/audiofile/JavaSoundAudioFile.java @@ -43,8 +43,8 @@ public JavaSoundAudioFile() { /** * Convert a Javasound AudioFormat object to a Beads SampleAudioFormat object. - * @param af - * @return + * @param af audio format + * @return new audio format */ static public SampleAudioFormat convertJavasoundAudioFormatToBeadsAudioFormat( javax.sound.sampled.AudioFormat af) { @@ -57,8 +57,8 @@ static public SampleAudioFormat convertJavasoundAudioFormatToBeadsAudioFormat( /** * Convert a Beads SampleAudioFormat object to a Javasound AudioFormat object. - * @param saf - * @return + * @param saf sample audio format + * @return audio format */ static public AudioFormat convertBeadsAudioFormatToJavasoundAudioFormat(SampleAudioFormat saf) { AudioFormat af = new AudioFormat(saf.sampleRate, saf.bitDepth, saf.channels, saf.signed, saf.bigEndian); @@ -149,12 +149,12 @@ public HashSet getSupportedFileTypesForReading() { private void prepareForReading() throws IOException { finished = false; - try { encodedStream = getStream(); } catch (UnsupportedAudioFileException e) { throw (new IOException(e.getMessage())); // converts UnsupportedAudioFileException, which is JavaSound specific, to more generic IOException. } + encodedFormat = encodedStream.getFormat(); int bitDepth = 16; diff --git a/src/beads_main/net/beadsproject/beads/data/audiofile/package.html b/src/beads_io/java/net/beadsproject/beads/data/audiofile/package.html similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/audiofile/package.html rename to src/beads_io/java/net/beadsproject/beads/data/audiofile/package.html diff --git a/src/beads_io/net/beadsproject/beads/ugens/RecordToFile.java b/src/beads_io/java/net/beadsproject/beads/ugens/RecordToFile.java similarity index 78% rename from src/beads_io/net/beadsproject/beads/ugens/RecordToFile.java rename to src/beads_io/java/net/beadsproject/beads/ugens/RecordToFile.java index 295cd18..1878528 100644 --- a/src/beads_io/net/beadsproject/beads/ugens/RecordToFile.java +++ b/src/beads_io/java/net/beadsproject/beads/ugens/RecordToFile.java @@ -23,8 +23,7 @@ * You must {@link #kill() kill} this object when finished to finalise the writing of the file header. * * IMPORTANT NOTE: At the moment only the WAVE (*.wav) type is supported. - * - * @beads.category utilities + * * @author bp */ public class RecordToFile extends UGen { @@ -74,7 +73,24 @@ public RecordToFile(AudioContext context, int numberOfChannels, File file, Audio AudioSystem.NOT_SPECIFIED, file); } - + + /** + * Instantiates a recorder for file recording. + * + * @param numberOfChannels + * The number of channels + * @param file + * The file to output to + * @param type + * The type of the file + * @throws IOException + * if the audio format is not supported on this machine. + * + */ + public RecordToFile(int numberOfChannels, File file, AudioFileFormat.Type type) throws IOException { + this(getDefaultContext(), numberOfChannels, file, type); + } + /** * Instantiates a recorder for file recording. Uses the .wav format. * @@ -90,7 +106,20 @@ public RecordToFile(AudioContext context, int numberOfChannels, File file, Audio public RecordToFile(AudioContext context, int numberOfChannels, File file) throws IOException { this(context,numberOfChannels,file,AudioFileFormat.Type.WAVE); } - + /** + * Instantiates a recorder for file recording. Uses the .wav format. + * + * @param numberOfChannels + * The number of channels + * @param file + * The file to output to. Extension should be .wav. + * @throws IOException if the audio format is not supported on this machine. + * + */ + public RecordToFile(int numberOfChannels, File file) throws IOException { + this(getDefaultContext(), numberOfChannels, file); + } + @Override public void calculateBuffer() { // INV: bufIn[0] exists diff --git a/src/beads_io/java/org/jaudiolibs/beads/AudioServerIO.java b/src/beads_io/java/org/jaudiolibs/beads/AudioServerIO.java new file mode 100644 index 0000000..82f1893 --- /dev/null +++ b/src/beads_io/java/org/jaudiolibs/beads/AudioServerIO.java @@ -0,0 +1,260 @@ + +package org.jaudiolibs.beads; + +import java.nio.FloatBuffer; +import java.util.List; +import java.util.ServiceLoader; +import java.util.logging.Level; +import java.util.logging.Logger; + +import net.beadsproject.beads.core.AudioContext; +import net.beadsproject.beads.core.AudioIO; +import net.beadsproject.beads.core.UGen; + +import org.jaudiolibs.audioservers.AudioClient; +import org.jaudiolibs.audioservers.AudioConfiguration; +import org.jaudiolibs.audioservers.AudioServer; +import org.jaudiolibs.audioservers.AudioServerProvider; +import org.jaudiolibs.audioservers.ext.ClientID; +import org.jaudiolibs.audioservers.ext.Connections; +import org.jaudiolibs.audioservers.ext.Device; +import org.jaudiolibs.audioservers.javasound.JSTimingMode; + +/** + * + * @author Neil C Smith http://neilcsmith.net + */ +public abstract class AudioServerIO extends AudioIO implements AudioClient { + + protected AudioServer server; + protected AudioConfiguration config; + private List inputs; + + public AudioServerIO() { + } + + @Override + protected UGen getAudioInput(int[] channels) { + return new RTInput(context, channels); + } + + public void configure(AudioConfiguration ac) throws Exception { + if (config.getSampleRate() != ac.getSampleRate() + || config.getInputChannelCount() != ac.getInputChannelCount() + || config.getOutputChannelCount() != ac.getOutputChannelCount() + || config.getMaxBufferSize() != ac.getMaxBufferSize() + || !ac.isFixedBufferSize()) { + System.out.println("Unexpected audio configuration"); + throw new IllegalArgumentException("Unexpected audio configuration"); + } + } + + + protected boolean runThread() { + Thread audioThread = new Thread(new Runnable() { + + public void run() { + try { + server.run(); + } catch (Exception ex) { + Logger.getLogger(AudioServerIO.class.getName()).log(Level.SEVERE, null, ex); + } + } + }, "audio"); + audioThread.setPriority(Thread.MAX_PRIORITY); + audioThread.start(); + return true; + } + + public boolean process(long time, List inputs, List outputs, int nFrames) { + if (!context.isRunning()) { + return false; + } + this.inputs = inputs; + update(); + for (int i=0; i < outputs.size(); i++ ) { + outputs.get(i).put(context.out.getOutBuffer(i)); + } + this.inputs = null; + return true; + } + + public void shutdown() { + // no op + } + + private class RTInput extends UGen { + + private int[] channels; + + /** + * Create UGen with default AudioContext + * @param channels number of channels + */ + RTInput(int[] channels){ + this(getDefaultContext(), channels); + } + + RTInput(AudioContext context, int[] channels) { + super(context, channels.length); + this.channels = channels; + } + + @Override + public void calculateBuffer() { + for (int i=0; i < channels.length; i++) { + inputs.get(channels[i]-1).get(bufOut[i]); + } + } + + } + + /** + * + * @author Neil C Smith http://neilcsmith.net + */ + public static class Jack extends AudioServerIO { + + private String name = "Beads"; + + public Jack() { + super(); + } + + public Jack(String name) { + super(); + this.name = name; + } + + protected boolean start() { + System.out.println("Starting Jack implementation of AudioServerIO"); + config = new AudioConfiguration( + context.getSampleRate(), + context.getAudioFormat().inputs, + context.getAudioFormat().outputs, + context.getBufferSize(), + new ClientID(name), + Connections.ALL); + + String jaudioLib = "JACK"; + + AudioServerProvider provider = null; + for (AudioServerProvider p : ServiceLoader.load(AudioServerProvider.class)) { + if (jaudioLib.equals(p.getLibraryName())) { + provider = p; + break; + } + } + if (provider == null) { + throw new NullPointerException("No AudioServer found that matches : " + jaudioLib); + } + + try { + server = provider.createServer(config, this); + } catch (Exception e) { + e.printStackTrace(); + } + + return runThread(); + } + } + + public static class JavaSound extends AudioServerIO { + + JSTimingMode jsTiming = JSTimingMode.FramePosition; + String device = null; + String name = "Beads"; + + /** + * Creates Javasound Server object as the audio output format, + * using JAudioLibs interface. The default audio output device + * will be used. + */ + public JavaSound() { + super(); + // If user's OS is Windows, change JSTiming to Estimated for better performance. + if (System.getProperty("os.name").toLowerCase().contains("win")) + jsTiming = JSTimingMode.Estimated; + } + + /** + * Creates Javasound Server object as the audio output format, + * using JAudioLibs interface. + * + * @param device the name of the output device + */ + public JavaSound(String device) { + super(); + this.device = device; + // If user's OS is Windows, change JSTiming to Estimated for better performance. + if (System.getProperty("os.name").toLowerCase().contains("win")) + jsTiming = JSTimingMode.Estimated; + } + + protected boolean start() { + System.out.println("Starting JavaSound implementation of AudioServerIO"); + + if (device != null) { + config = new AudioConfiguration( + context.getSampleRate(), + context.getAudioFormat().inputs, + context.getAudioFormat().outputs, + context.getBufferSize(), + new ClientID(name), + Connections.ALL, + jsTiming, + new audioDevice(device) + ); + } else { + config = new AudioConfiguration( + context.getSampleRate(), + context.getAudioFormat().inputs, + context.getAudioFormat().outputs, + context.getBufferSize(), + new ClientID(name), + Connections.ALL, + jsTiming + ); + } + + String jaudioLib = "JavaSound"; + + AudioServerProvider provider = null; + for (AudioServerProvider p : ServiceLoader.load(AudioServerProvider.class)) { + if (jaudioLib.equals(p.getLibraryName())) { + provider = p; + break; + } + } + if (provider == null) { + throw new NullPointerException("No AudioServer found that matches : " + jaudioLib); + } + + try { + server = provider.createServer(config, this); + } catch (Exception e) { + e.printStackTrace(); + } + + return runThread(); + } + } + + /** + * Creates a Device object containing information about the desired output + * device. AudioDevices may be used as inputs when creating a JavaSound server + * if you want to specify an output that is not your system's default output + * device. + * + */ + protected class audioDevice extends Device { + + protected audioDevice(String name, int maxInputChannels, int maxOutputChannels) { + super(name, maxInputChannels, maxOutputChannels); + } + + protected audioDevice(String name) { + super(name, 1, 1); + } + } +} diff --git a/src/beads_io/org/jaudiolibs/beads/AudioServerIO.java b/src/beads_io/org/jaudiolibs/beads/AudioServerIO.java deleted file mode 100644 index fbcf79c..0000000 --- a/src/beads_io/org/jaudiolibs/beads/AudioServerIO.java +++ /dev/null @@ -1,168 +0,0 @@ - -package org.jaudiolibs.beads; - -import java.nio.FloatBuffer; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.beadsproject.beads.core.AudioContext; -import net.beadsproject.beads.core.AudioIO; -import net.beadsproject.beads.core.UGen; - -import org.jaudiolibs.audioservers.AudioClient; -import org.jaudiolibs.audioservers.AudioConfiguration; -import org.jaudiolibs.audioservers.AudioServer; -import org.jaudiolibs.audioservers.jack.JackAudioServer; -import org.jaudiolibs.audioservers.javasound.JavasoundAudioServer; -import org.jaudiolibs.audioservers.javasound.JavasoundAudioServer.TimingMode; - -/** - * - * @author Neil C Smith - */ -public abstract class AudioServerIO extends AudioIO implements AudioClient { - - protected AudioServer server; - protected AudioConfiguration config; - private List inputs; - - public AudioServerIO() { - } - - @Override - protected UGen getAudioInput(int[] channels) { - return new RTInput(context, channels); - } - - public void configure(AudioConfiguration ac) throws Exception { - if (config.getSampleRate() != ac.getSampleRate() - || config.getInputChannelCount() != ac.getInputChannelCount() - || config.getOutputChannelCount() != ac.getOutputChannelCount() - || config.getMaxBufferSize() != ac.getMaxBufferSize() - || !ac.isFixedBufferSize()) { - System.out.println("Unexpected audio configuration"); - throw new IllegalArgumentException("Unexpected audio configuration"); - } - } - - - protected boolean runThread() { - Thread audioThread = new Thread(new Runnable() { - - public void run() { - try { - server.run(); - } catch (Exception ex) { - Logger.getLogger(AudioServerIO.class.getName()).log(Level.SEVERE, null, ex); - } - } - }, "audio"); - audioThread.setPriority(Thread.MAX_PRIORITY); - audioThread.start(); - return true; - } - - public boolean process(long time, List inputs, List outputs, int nFrames) { - if (!context.isRunning()) { - return false; - } - this.inputs = inputs; - update(); - for (int i=0; i < outputs.size(); i++ ) { - outputs.get(i).put(context.out.getOutBuffer(i)); - } - this.inputs = null; - return true; - } - - public void shutdown() { - // no op - } - - private class RTInput extends UGen { - - private int[] channels; - - RTInput(AudioContext context, int[] channels) { - super(context, channels.length); - this.channels = channels; - } - - @Override - public void calculateBuffer() { - for (int i=0; i < channels.length; i++) { - inputs.get(channels[i]-1).get(bufOut[i]); - } - } - - } - - /** - * - * @author Neil C Smith - */ - public static class Jack extends AudioServerIO { - - private String name = "Beads"; - - public Jack() { - super(); - } - - public Jack(String name) { - super(); - this.name = name; - } - - protected boolean start() { - System.out.println("Starting Jack implementation of AudioServerIO"); - config = new AudioConfiguration( - context.getSampleRate(), - context.getAudioFormat().inputs, - context.getAudioFormat().outputs, - context.getBufferSize(), - true); - server = JackAudioServer.create(name, config, true, this); - return runThread(); - } - - - } - - public static class JavaSound extends AudioServerIO { - - String device = null; - - public JavaSound() { - super(); - } - - public JavaSound(String device) { - super(); - this.device = device; - } - - protected boolean start() { - System.out.println("Starting JavaSound implementation of AudioServerIO"); - config = new AudioConfiguration( - context.getSampleRate(), - context.getAudioFormat().inputs, - context.getAudioFormat().outputs, - context.getBufferSize(), - true); - try { - server = JavasoundAudioServer.create(device, config, TimingMode.FramePosition, this); - } catch (Exception e) { - e.printStackTrace(); - } - return runThread(); - } - - } - - - - - -} diff --git a/src/beads_main/net/beadsproject/beads/analysis/Analyzer.java b/src/beads_main/java/net/beadsproject/beads/analysis/Analyzer.java similarity index 99% rename from src/beads_main/net/beadsproject/beads/analysis/Analyzer.java rename to src/beads_main/java/net/beadsproject/beads/analysis/Analyzer.java index b32cb6b..ce18ad0 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/Analyzer.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/Analyzer.java @@ -139,7 +139,7 @@ public void listenTo(UGen ugen) { /** * Update from this source ugen. * - * @param ugen + * @param ugen source */ public void updateFrom(UGen ugen) { ugen.addDependent(sfs); @@ -165,8 +165,8 @@ public FeatureFrame getLastBeatFrame() { /** * Gets the extractor or other element of the given class type. - * @param classID - * @return + * @param classID classid + * @return the element */ public Object getElement(Class classID) { return extractorArrangement.get(classID); diff --git a/src/beads_main/net/beadsproject/beads/analysis/AudioSegmenter.java b/src/beads_main/java/net/beadsproject/beads/analysis/AudioSegmenter.java similarity index 95% rename from src/beads_main/net/beadsproject/beads/analysis/AudioSegmenter.java rename to src/beads_main/java/net/beadsproject/beads/analysis/AudioSegmenter.java index a88171a..fd0784a 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/AudioSegmenter.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/AudioSegmenter.java @@ -36,7 +36,14 @@ public AudioSegmenter(AudioContext context) { listeners = new ArrayList>(); segmentListeners = new ArrayList(); } - + + /** + * Instantiates a new Segmenter. + */ + public AudioSegmenter() { + this(getDefaultContext()); + } + /** * Adds a FeatureExtractor as a responder to this Segmenter. * @@ -89,14 +96,14 @@ protected void segment(TimeStamp startTime, TimeStamp endTime, float[] data) { public abstract void resetTimeStamp(); /** Set the TimeStamp of this AudioSegmenter when the AudioContext is at t=0. - * @param ts + * @param ts timestamp */ public abstract void setBeginningTimeStamp(TimeStamp ts); /** Set the last TimeStamp of this AudioSegmenter. The next time a segment is * produced, the start time of the segment will be this value. The counter is * reset with this operation. - * @param ts + * @param ts timestamp */ public abstract void setLastTimeStamp(TimeStamp ts); diff --git a/src/beads_main/net/beadsproject/beads/analysis/FeatureExtractor.java b/src/beads_main/java/net/beadsproject/beads/analysis/FeatureExtractor.java similarity index 93% rename from src/beads_main/net/beadsproject/beads/analysis/FeatureExtractor.java rename to src/beads_main/java/net/beadsproject/beads/analysis/FeatureExtractor.java index 78fb372..f796ff9 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/FeatureExtractor.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/FeatureExtractor.java @@ -42,13 +42,16 @@ public FeatureExtractor() { /** * Process some data of type P (specified by the class def). This method must be overidden by implementing classes. - * + * @param startTime start time + * @param endTime end time * @param data the data. */ public abstract void process(TimeStamp startTime, TimeStamp endTime, P data); - + /** - * Subclasses should call this at end of their process() method to forward features to listeners. + * Subclasses should call this at end of their process() method to forward features to listeners. + * @param startTime Start Time + * @param endTime end time */ public void forward(TimeStamp startTime, TimeStamp endTime) { //forward to the feature extractor listeners diff --git a/src/beads_main/net/beadsproject/beads/analysis/FeatureFrame.java b/src/beads_main/java/net/beadsproject/beads/analysis/FeatureFrame.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/analysis/FeatureFrame.java rename to src/beads_main/java/net/beadsproject/beads/analysis/FeatureFrame.java diff --git a/src/beads_main/net/beadsproject/beads/analysis/FeatureManager.java b/src/beads_main/java/net/beadsproject/beads/analysis/FeatureManager.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/analysis/FeatureManager.java rename to src/beads_main/java/net/beadsproject/beads/analysis/FeatureManager.java diff --git a/src/beads_main/net/beadsproject/beads/analysis/FeatureSet.java b/src/beads_main/java/net/beadsproject/beads/analysis/FeatureSet.java similarity index 96% rename from src/beads_main/net/beadsproject/beads/analysis/FeatureSet.java rename to src/beads_main/java/net/beadsproject/beads/analysis/FeatureSet.java index bc85d51..89ddaae 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/FeatureSet.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/FeatureSet.java @@ -129,12 +129,12 @@ public Object getGlobal(String s) { * @param feature name to check. * @return true if feature name is found. */ - public boolean containsGlobal(String s) { - return globalFeatures.containsKey(s); + public boolean containsGlobal(String feature) { + return globalFeatures.containsKey(feature); } /** - * Writes to a file. Assumes file has already been specified by {@link write(File)} or {@link new FeatureSet(File)}. + * Writes to a file. Assumes file has already been specified by write File or {@link FeatureSet(File)}. */ public void write() { try { @@ -206,7 +206,7 @@ public void write(String fn) { /** * Returns the tracks. - * @return A Map structure. + * @return A Map structure. */ public Map tracks() { return tracks; diff --git a/src/beads_main/net/beadsproject/beads/analysis/FeatureTrack.java b/src/beads_main/java/net/beadsproject/beads/analysis/FeatureTrack.java similarity index 98% rename from src/beads_main/net/beadsproject/beads/analysis/FeatureTrack.java rename to src/beads_main/java/net/beadsproject/beads/analysis/FeatureTrack.java index 2a499b2..5980b59 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/FeatureTrack.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/FeatureTrack.java @@ -195,7 +195,7 @@ public FeatureFrame getLastFrame() { } /** - * Adds a new {@link FeatureExtractor}. When {@link newSegment()} is called, the FeatureTrack creates a new {@link FeatureFrame} + * Adds a new {@link FeatureExtractor}. When {@link #newSegment(TimeStamp, TimeStamp)}} is called, the FeatureTrack creates a new {@link FeatureFrame} * with the given start and end times and adds the data from all of its {@link FeatureExtractor}s to the {@link FeatureFrame}. * * @param e the FeatureExtractor. @@ -216,7 +216,6 @@ public void removeFeatureExtractor(FeatureExtractor e) { /** * Tells this FeatureTrack to log a new {@link FeatureFrame}, with the given startTime and endTime. The FeatureTrack * will gather features from its various {@link FeatureExtractor}s at this point. - * @throws CloneNotSupportedException */ public void newSegment(TimeStamp startTime, TimeStamp endTime) { FeatureFrame ff = new FeatureFrame(startTime.getTimeMS(), endTime.getTimeMS()); diff --git a/src/beads_main/net/beadsproject/beads/analysis/SegmentListener.java b/src/beads_main/java/net/beadsproject/beads/analysis/SegmentListener.java similarity index 72% rename from src/beads_main/net/beadsproject/beads/analysis/SegmentListener.java rename to src/beads_main/java/net/beadsproject/beads/analysis/SegmentListener.java index 9b27c5a..c47c48c 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/SegmentListener.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/SegmentListener.java @@ -6,7 +6,7 @@ import net.beadsproject.beads.core.TimeStamp; /** - * SegmentListeners get notified with a {@link newSegment()} event by a {@link SegmentMaker}. + * SegmentListeners get notified with an event by a {@link SegmentMaker}. */ public interface SegmentListener { @@ -16,5 +16,5 @@ public interface SegmentListener { * @param start the start time. * @param end the end time. */ - public void newSegment(TimeStamp start, TimeStamp end); + void newSegment(TimeStamp start, TimeStamp end); } diff --git a/src/beads_main/net/beadsproject/beads/analysis/SegmentMaker.java b/src/beads_main/java/net/beadsproject/beads/analysis/SegmentMaker.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/analysis/SegmentMaker.java rename to src/beads_main/java/net/beadsproject/beads/analysis/SegmentMaker.java diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/BasicDataWriter.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/BasicDataWriter.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/BasicDataWriter.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/BasicDataWriter.java diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/BasicTimeDataWriter.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/BasicTimeDataWriter.java similarity index 94% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/BasicTimeDataWriter.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/BasicTimeDataWriter.java index 07402f0..f805d48 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/BasicTimeDataWriter.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/BasicTimeDataWriter.java @@ -23,7 +23,7 @@ public class BasicTimeDataWriter extends FeatureExtractor { /** * Instantiates a new BasicDataWriter with the given FileOutputStream. - * + * @param ac audio context * @param fos the FileOutputStream. */ public BasicTimeDataWriter(AudioContext ac, FileOutputStream fos) { diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/FFT.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/FFT.java similarity index 97% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/FFT.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/FFT.java index 3582fd2..57591c1 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/FFT.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/FFT.java @@ -11,8 +11,7 @@ * FFT performs a Fast Fourier Transform and forwards the complex data to any listeners. * The complex data is a float of the form float[2][frameSize], with real and imaginary * parts stored respectively. - * - * @beads.category analysis + * */ public class FFT extends FeatureExtractor { @@ -54,7 +53,8 @@ public void process(TimeStamp startTime, TimeStamp endTime, float[] data) { * * @param samplingFrequency The Sampling Frequency of the AudioContext * @param blockSize The size of the block analysed - * @param binNumber + * @param binNumber bin number + * @return bin frequency */ public static float binFrequency(float samplingFrequency, int blockSize, float binNumber) { @@ -68,6 +68,7 @@ public static float binFrequency(float samplingFrequency, int blockSize, float b * @param samplingFrequency The Sampling Frequency of the AudioContext * @param blockSize The size of the fft block * @param freq The frequency + * @return bin NUmber */ public static float binNumber(float samplingFrequency, int blockSize, float freq) @@ -77,7 +78,8 @@ public static float binNumber(float samplingFrequency, int blockSize, float freq /** The nyquist frequency for this samplingFrequency * - * @params samplingFrequency the sample + * @param samplingFrequency the sample + * @return nyquist frequency */ public static float nyquist(float samplingFrequency) { @@ -132,7 +134,6 @@ protected static float[] calculateImaginary(float[] spectrum, int length) { * @param n the length * @param isign true for regular, false for inverse. */ - /** @TODO this can be optimized */ protected static void fft(float[] data, int n, boolean isign) { float c1 = 0.5f; float c2, h1r, h1i, h2r, h2i; diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/Frequency.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/Frequency.java similarity index 98% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/Frequency.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/Frequency.java index eb41127..6223021 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/Frequency.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/Frequency.java @@ -10,8 +10,7 @@ /** * Frequency processes spectral data forwarded to it by a {@link PowerSpectrum} * to determine the best estimate for the frequency of the current signal. - * - * @beads.category analysis + * */ public class Frequency extends FeatureExtractor { diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/GnuplotDataWriter.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/GnuplotDataWriter.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/GnuplotDataWriter.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/GnuplotDataWriter.java diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/MFCC.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/MFCC.java similarity index 98% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/MFCC.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/MFCC.java index d9ebd14..4f69450 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/MFCC.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/MFCC.java @@ -14,8 +14,6 @@ * music and speech processing. MFCC receives feature data from a {@link MelSpectrum}, * and must be set as a listener to a {@link MelSpectrum}, not a pure audio stream, * in order to work properly. - * - * @beads.category analysis */ public class MFCC extends FeatureExtractor { diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/MelSpectrum.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/MelSpectrum.java similarity index 99% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/MelSpectrum.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/MelSpectrum.java index 1667cec..af796d8 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/MelSpectrum.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/MelSpectrum.java @@ -12,7 +12,7 @@ * converts it to the mel frequency spectrum. To use MelSpectrum, make sure it * is set as a listener to a {@link PowerSpectrum} object, not directly from an audio stream. * - * @beads.category analysis + * */ public class MelSpectrum extends FeatureExtractor { diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/PeakDetector.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/PeakDetector.java similarity index 94% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/PeakDetector.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/PeakDetector.java index d466b1d..7a17497 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/PeakDetector.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/PeakDetector.java @@ -23,8 +23,7 @@ * The algorithm follows the one described in: Dixon, S (2006) * "Onset Detection Revisited" Proc. of the 9th Int. Conference on Digital Audio * Effects (DAFx-06), Montreal, Canada, September 18-20, 2006 - * - * @beads.category analysis + * * @author ben */ @@ -92,7 +91,8 @@ public int getLagInFrames() { } /** - * Get the correct BufferSize for the OnsetDetector + * Get the correct BufferSize for the OnsetDetector + * @return buffer size */ public int getBufferSize() { return M; diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/Power.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/Power.java similarity index 97% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/Power.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/Power.java index d168543..8ec4c6f 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/Power.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/Power.java @@ -8,8 +8,7 @@ /** * Power calculates the RMS power over a frame directly from an audio signal. - * - * @beads.category analysis + * */ public class Power extends FeatureExtractor { diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/PowerSpectrum.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/PowerSpectrum.java similarity index 97% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/PowerSpectrum.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/PowerSpectrum.java index 45fe712..0c9453d 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/PowerSpectrum.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/PowerSpectrum.java @@ -9,8 +9,6 @@ /** * PowerSpectrum calculates the power spectrum from the output of {@link FFT}. * PowerSpectrum forwards the full power spectrum data to its listeners. - * - * @beads.category analysis */ public class PowerSpectrum extends FeatureExtractor { diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/ReBin.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/ReBin.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/ReBin.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/ReBin.java diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/SpectralCentroid.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/SpectralCentroid.java similarity index 98% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/SpectralCentroid.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/SpectralCentroid.java index 3640c74..1e449c6 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/SpectralCentroid.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/SpectralCentroid.java @@ -10,8 +10,6 @@ /** * SpectralCentroid calculates the spectral centroid of a signal. It should be set up to listen to a {@link PowerSpectrum} object. - * - * @beads.category analysis */ public class SpectralCentroid extends FeatureExtractor { diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/SpectralDifference.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/SpectralDifference.java similarity index 99% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/SpectralDifference.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/SpectralDifference.java index 247dd94..ffe67de 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/SpectralDifference.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/SpectralDifference.java @@ -8,8 +8,6 @@ /** * SpectralDifference calculates the spectral difference between one frame and the next. - * - * @beads.category analysis */ public class SpectralDifference extends FeatureExtractor { diff --git a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/SpectralPeaks.java b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/SpectralPeaks.java similarity index 97% rename from src/beads_main/net/beadsproject/beads/analysis/featureextractors/SpectralPeaks.java rename to src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/SpectralPeaks.java index 57a23fc..d3cf7e7 100644 --- a/src/beads_main/net/beadsproject/beads/analysis/featureextractors/SpectralPeaks.java +++ b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/SpectralPeaks.java @@ -13,9 +13,7 @@ * where N is the specified number of features. Peaks must be set as a listener to * a {@link PowerSpectrum} object to work properly. * - * Its output is an array of [frequency, power] tuples. - * - * @beads.category analysis + * Its output is an array of [frequency, power] tuples. */ public class SpectralPeaks extends FeatureExtractor { diff --git a/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/package.html b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/package.html new file mode 100644 index 0000000..164b6f3 --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/analysis/featureextractors/package.html @@ -0,0 +1,7 @@ + + + + + Provides a set of classes for performing feature extraction on audio data. + + \ No newline at end of file diff --git a/src/beads_main/java/net/beadsproject/beads/analysis/package.html b/src/beads_main/java/net/beadsproject/beads/analysis/package.html new file mode 100644 index 0000000..f406dc2 --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/analysis/package.html @@ -0,0 +1,7 @@ + + + + + Provides a set of classes for performing audio analysis on a stream of audio data. + + \ No newline at end of file diff --git a/src/beads_main/net/beadsproject/beads/analysis/segmenters/ShortFrameSegmenter.java b/src/beads_main/java/net/beadsproject/beads/analysis/segmenters/ShortFrameSegmenter.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/analysis/segmenters/ShortFrameSegmenter.java rename to src/beads_main/java/net/beadsproject/beads/analysis/segmenters/ShortFrameSegmenter.java diff --git a/src/beads_main/java/net/beadsproject/beads/analysis/segmenters/package.html b/src/beads_main/java/net/beadsproject/beads/analysis/segmenters/package.html new file mode 100644 index 0000000..f523ff8 --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/analysis/segmenters/package.html @@ -0,0 +1,7 @@ + + + + + Provides Segmenters for dividing audio data into segments. + + \ No newline at end of file diff --git a/src/beads_main/net/beadsproject/beads/core/AudioContext.java b/src/beads_main/java/net/beadsproject/beads/core/AudioContext.java similarity index 93% rename from src/beads_main/net/beadsproject/beads/core/AudioContext.java rename to src/beads_main/java/net/beadsproject/beads/core/AudioContext.java index f440b66..6059c15 100644 --- a/src/beads_main/net/beadsproject/beads/core/AudioContext.java +++ b/src/beads_main/java/net/beadsproject/beads/core/AudioContext.java @@ -25,13 +25,15 @@ * the IO device, the audio buffer size and the system IO buffer size. An * AudioContext also provides a {@link UGen} called {@link #out}, which is * the output point for networks of UGens in a Beads project. - * - * @beads.category control + * * @author ollie */ public class AudioContext { public static final int DEFAULT_BUFFER_SIZE = 512; + + /** The default context, for using UGens without explicitly declaring context **/ + private static AudioContext defaultContext; /** The audio IO device. */ private AudioIO audioIO; @@ -97,7 +99,9 @@ public AudioContext(int bufferSize) { //attempt to find the default (JavaSound) AudioIO by reflection AudioIO ioSystem = null; try { - Class javaSoundAudioIOClass = Class.forName("net.beadsproject.beads.core.io.JavaSoundAudioIO"); //alt choice is org.jaudiolibs.beads.AudioServerIO$JavaSound. + Class javaSoundAudioIOClass = Class.forName("net.beadsproject.beads.core.io.JavaSoundAudioIO"); + //alt choice is org.jaudiolibs.beads.AudioServerIO$JavaSound. + //Class javaSoundAudioIOClass = Class.forName("org.jaudiolibs.beads.AudioServerIO$JavaSound"); Constructor noArgsConstructor = javaSoundAudioIOClass.getConstructor(); ioSystem = (AudioIO)noArgsConstructor.newInstance(); System.out.println("AudioContext : no AudioIO specified, using default => " + javaSoundAudioIOClass.getName() + "."); @@ -247,7 +251,7 @@ protected void update() { * * @return buffer of size bufSize, unknown contents. */ - public float[] getBuf() { + synchronized float[] getBuf() { if (bufStoreIndex < bufferStore.size()) { return bufferStore.get(bufStoreIndex++); } else { @@ -266,7 +270,7 @@ public float[] getBuf() { * * @return buffer of size bufSize, all zeros. */ - public float[] getCleanBuf() { + float[] getCleanBuf() { float[] buf = getBuf(); Arrays.fill(buf, 0f); return buf; @@ -280,7 +284,7 @@ public float[] getCleanBuf() { * * @return buffer of size bufSize, all zeros. */ - public float[] getZeroBuf() { + float[] getZeroBuf() { return zeroBuf; } @@ -288,7 +292,7 @@ public float[] getZeroBuf() { * Starts the AudioContext running in non-realtime. This occurs in the * current Thread. */ - public void runNonRealTime() { + private void runNonRealTime() { if (stopped) { stopped = false; reset(); @@ -366,9 +370,9 @@ public IOAudioFormat getAudioFormat() { /** * Generates a new AudioFormat with the same everything as the * AudioContext's AudioFormat except for the number of channels. - * - * @param numChannels - * the number of channels. + * + * @param inputs number of inputs. + * @param outputs number of outputs. * @return a new AudioFormat with the given number of channels, all other * properties coming from the original AudioFormat. */ @@ -381,9 +385,10 @@ public IOAudioFormat getAudioFormat(int inputs, int outputs) { * Generates the default {@link IOAudioFormat} for AudioContext, with the * given number of channels. The default values are: sampleRate=44100, * sampleSizeInBits=16, signed=true, bigEndian=true. - * - * @param numChannels - * the number of channels to use. + * + * @param inputs number of inputs. + * @param outputs number of outputs. + * * @return the generated AudioFormat. */ public static IOAudioFormat defaultAudioFormat(int inputs, int outputs) { @@ -479,6 +484,7 @@ public TimeStamp generateTimeStamp(int index) { /** * Get the runtime (in ms) since starting. + * @return runtime */ public double getTime() { return samplesToMs(getTimeStep() * getBufferSize()); @@ -686,4 +692,27 @@ private void sendAfterFrameMessages() { bead.message(null); } } + + /** + * Get the default AudioContext. If none exists, create a new one. + * + * @return the default AudioContext + */ + public static AudioContext getDefaultContext() { + if (defaultContext == null) + defaultContext = new AudioContext(); + return defaultContext; + } + + /** + * Set the default AudioContext. + * If you are using a custom defaultcontext, make sure setDefaultContext + * is always called before getDefaultContext and any UGen constructors + * that will use the custom defaultcontext. + * + * @param defaultContext the default AudioContext object to use + */ + public static void setDefaultContext(AudioContext newContext) { + defaultContext = newContext; + } } diff --git a/src/beads_main/net/beadsproject/beads/core/AudioIO.java b/src/beads_main/java/net/beadsproject/beads/core/AudioIO.java similarity index 95% rename from src/beads_main/net/beadsproject/beads/core/AudioIO.java rename to src/beads_main/java/net/beadsproject/beads/core/AudioIO.java index aff16bc..de09c9d 100644 --- a/src/beads_main/net/beadsproject/beads/core/AudioIO.java +++ b/src/beads_main/java/net/beadsproject/beads/core/AudioIO.java @@ -7,7 +7,7 @@ /** * AudioIO is the abstract base class for setting up interaction between {@link AudioContext} and the world. It is * designed to be largely controlled by {@link AudioContext}. To be precise, AudioContext will prepare(), start(), and stop() the - * AudioIO it is initialised with. However, certain AudioIO implementations may need to be set up before being passed to AudioContext(). By default, AudioContext creates a {@link JavaSoundAudioIO}. + * AudioIO it is initialised with. However, certain AudioIO implementations may need to be set up before being passed to AudioContext(). By default, AudioContext creates a {@link net.beadsproject.beads.core.io.JavaSoundAudioIO}. * * @author ollie * diff --git a/src/beads_main/net/beadsproject/beads/core/AudioUtils.java b/src/beads_main/java/net/beadsproject/beads/core/AudioUtils.java similarity index 97% rename from src/beads_main/net/beadsproject/beads/core/AudioUtils.java rename to src/beads_main/java/net/beadsproject/beads/core/AudioUtils.java index ec1bd53..a7f7340 100644 --- a/src/beads_main/net/beadsproject/beads/core/AudioUtils.java +++ b/src/beads_main/java/net/beadsproject/beads/core/AudioUtils.java @@ -309,8 +309,8 @@ static final public void interleave(float[][] source, int nChannels, /** * "Stretches" source into dest. Linearly interpolates. * - * @param source - * @param dest + * @param source source + * @param dest destination */ static final public void stretchBuffer(float[][] source, float[][] dest) { @@ -370,7 +370,7 @@ static final public void stretchBuffer(float[][] source, float[][] dest) /** * Reverse the data in each channel. - * @param buffer + * @param buffer buffer */ static final public void reverseBuffer(float[][] buffer) { @@ -389,7 +389,7 @@ static final public void reverseBuffer(float[][] buffer) /** * Does a freaky shortcut for calculating pow (limited to base with range 0-1), faster but less accurate than regular Math.pow(). * - *

CREDIT: this method is copied directly from http://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/ + * CREDIT: this method is copied directly from http://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/ * * @param a the base. * @param b the exponent. diff --git a/src/beads_main/net/beadsproject/beads/core/Bead.java b/src/beads_main/java/net/beadsproject/beads/core/Bead.java similarity index 77% rename from src/beads_main/net/beadsproject/beads/core/Bead.java rename to src/beads_main/java/net/beadsproject/beads/core/Bead.java index 95d1e07..99d9a5d 100644 --- a/src/beads_main/net/beadsproject/beads/core/Bead.java +++ b/src/beads_main/java/net/beadsproject/beads/core/Bead.java @@ -7,13 +7,13 @@ /** * Bead is an abstract class which defines basic behaviour such as starting and stopping, pausing and handling messages. * - *

Messages: A Bead can send a message to another Bead using the {@link #message(Bead)} method. Implementations of Bead handle these messages by subclassing the {@link #messageReceived(Bead)} method. {@link BeadArray} can be used to gather Beads into groups, which is useful for defining message channels in a system. + * Messages: A Bead can send a message to another Bead using the {@link #message(Bead)} method. Implementations of Bead handle these messages by subclassing the {@link #messageReceived(Bead)} method. {@link BeadArray} can be used to gather Beads into groups, which is useful for defining message channels in a system. * - *

Pausing: the method {@link #pause(boolean)} toggles the pause mode of a Bead. Beads are unpaused by default. A paused Bead will no longer respond to incoming messages. + * Pausing: the method {@link #pause(boolean)} toggles the pause mode of a Bead. Beads are unpaused by default. A paused Bead will no longer respond to incoming messages. * - *

Deleting: The method {@link #kill()} deletes a Bead. Deleted Beads are automatically removed from {@link BeadArray}s. The method {@link Bead#setKillListener(Bead)} allows you to specify another Bead that gets notified when this Bead is killed. + * Deleting: The method {@link #kill()} deletes a Bead. Deleted Beads are automatically removed from {@link BeadArray}s. The method {@link Bead#setKillListener(Bead)} allows you to specify another Bead that gets notified when this Bead is killed. * - *

UGens: An important subclass of Bead is {@link UGen}. When a UGen is paused, it does not calculate audio. When it is deleted, it is automatically removed from any signal chains. + * UGens: An important subclass of Bead is {@link UGen}. When a UGen is paused, it does not calculate audio. When it is deleted, it is automatically removed from any signal chains. * * @author ollie */ diff --git a/src/beads_main/net/beadsproject/beads/core/BeadArray.java b/src/beads_main/java/net/beadsproject/beads/core/BeadArray.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/core/BeadArray.java rename to src/beads_main/java/net/beadsproject/beads/core/BeadArray.java diff --git a/src/beads_main/java/net/beadsproject/beads/core/BuildVersion.java b/src/beads_main/java/net/beadsproject/beads/core/BuildVersion.java new file mode 100644 index 0000000..f101b4b --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/core/BuildVersion.java @@ -0,0 +1,53 @@ +package net.beadsproject.beads.core; + +public final class BuildVersion { + static final int MAJOR = 2; + static final int MINOR = 0; + static final int BUILD = 3; + + public static int getMajor() { + return MAJOR; + } + + public static int getMinor() { + return MINOR; + } + + public static int getBuild() { + return BUILD; + } + + + /** + * Gets the text to display minimum compatibility between device and plugin + * + * @return Minimum device compatibility + */ + public static String getMinimumCompatibilityVersion() { + String ret = MAJOR + "." + MINOR + ".X.X"; + return ret; + + } + + + /** + * Get The full version info as a string + * + * @return version details as a string + */ + public static String getVersionText() { + String ret = MAJOR + "." + MINOR + "." + BUILD + "." + getDate(); + return ret; + } + + /** + * Get the date that the class was actually compiled + * + * @return n integer representing date - not implemented yet + */ + public static int getDate() { + int ret = 0; + + return ret; + } +} diff --git a/src/beads_main/net/beadsproject/beads/core/IOAudioFormat.java b/src/beads_main/java/net/beadsproject/beads/core/IOAudioFormat.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/core/IOAudioFormat.java rename to src/beads_main/java/net/beadsproject/beads/core/IOAudioFormat.java diff --git a/src/beads_main/net/beadsproject/beads/core/TimeStamp.java b/src/beads_main/java/net/beadsproject/beads/core/TimeStamp.java similarity index 95% rename from src/beads_main/net/beadsproject/beads/core/TimeStamp.java rename to src/beads_main/java/net/beadsproject/beads/core/TimeStamp.java index 5293de6..90df2a6 100644 --- a/src/beads_main/net/beadsproject/beads/core/TimeStamp.java +++ b/src/beads_main/java/net/beadsproject/beads/core/TimeStamp.java @@ -42,8 +42,7 @@ public TimeStamp(AudioContext context, long timeStep, int index) { * TimeStamp for the current time. * * @param context the AudioContext. - * @param timeStep the time step. - * @param index the index. + * @param timeInSamples time in samples */ public TimeStamp(AudioContext context, long timeInSamples) { this.context = context; @@ -98,7 +97,7 @@ public boolean isAfter(TimeStamp other) { } /** - * Returns the time stamp formatted as timeStep-index, useful + * Returns the time stamp formatted as timeStep-index, useful * for debugging purposes. */ public String toString() { diff --git a/src/beads_main/net/beadsproject/beads/core/UGen.java b/src/beads_main/java/net/beadsproject/beads/core/UGen.java similarity index 72% rename from src/beads_main/net/beadsproject/beads/core/UGen.java rename to src/beads_main/java/net/beadsproject/beads/core/UGen.java index 6cfc8a5..504edbd 100644 --- a/src/beads_main/net/beadsproject/beads/core/UGen.java +++ b/src/beads_main/java/net/beadsproject/beads/core/UGen.java @@ -10,6 +10,7 @@ import net.beadsproject.beads.ugens.Clock; import net.beadsproject.beads.ugens.Envelope; import net.beadsproject.beads.ugens.Gain; +import net.beadsproject.beads.ugens.SamplePlayer.EnvelopeType; /** * A UGen is the main base class for implementing signal generation and processing units (unit generators). UGens can have any number of audio input and output channels, which adopt the audio format of the {@link AudioContext} used to construct the UGen. Any UGen output can be connected to any other UGen input, using {@link #addInput(int, UGen, int)} (or use {@link #addInput(UGen)} to connect all outputs of one UGen to all inputs of another). UGens are constructed using an @@ -20,11 +21,11 @@ * manually to the call chain using {@link #addDependent(UGen)} from any UGen * that is part of the call chain (such as the root UGen of the {@link AudioContext}). * - *

UGen inherits the + * UGen inherits the * {@link Bead#start()}, {@link Bead#kill()} and {@link Bead#pause(boolean)} behaviour, and messaging system from * {@link Bead}. Importantly, when UGens are paused, they cease audio processing, and when they are killed, they are automatically removed from any audio chains. This allows for very easy removal of elements from the call chain. * - *

The method {@link #calculateBuffer()} must be implemented by subclasses of UGen that actually do something. Each UGen has two 2D arrays of floats, {@link #bufIn}, {@link #bufOut}, holding the current input and output audio buffers (this is stored in the form float[numChannels][bufferSize]). The goal of a {@link UGen#calculateBuffer()} method, therefore, is to fill {@link #bufOut} with appropriate data for the current audio frame. Examples can be found in the source code of classes in the {@link net.beadsproject.beads.ugens} package. + * The method {@link #calculateBuffer()} must be implemented by subclasses of UGen that actually do something. Each UGen has two 2D arrays of floats, {@link #bufIn}, {@link #bufOut}, holding the current input and output audio buffers (this is stored in the form float[numChannels][bufferSize]). The goal of a {@link UGen#calculateBuffer()} method, therefore, is to fill {@link #bufOut} with appropriate data for the current audio frame. Examples can be found in the source code of classes in the {@link net.beadsproject.beads.ugens} package. * * @author ollie */ @@ -49,10 +50,10 @@ public abstract class UGen extends Bead { protected int bufferSize; /** An collection of pointers to the output buffers of UGens connected to this UGen's inputs. */ - private ArrayList[] inputsAtChannel; + private List[] inputsAtChannel; /** A collection of UGens that should be triggered by this one. */ - private ArrayList dependents; + private List dependents; /** Flag used to avoid calling {@link #pullInputs()} unless required. */ private boolean noInputs; @@ -70,6 +71,43 @@ protected enum OutputInitializationRegime {ZERO, NULL, JUNK, RETAIN}; protected enum OutputPauseRegime {ZERO, RETAIN, NULL}; protected OutputPauseRegime outputPauseRegime; + + /** + * Used to determine what data structure is used by the UGen's internal storage list, either + * {@link UGenStorageType#LINKEDLIST} for increased sequential access efficiency, or + * {@link UGenStorageType#ARRAYLIST} for increased random access efficiency. + */ + public static enum UGenStorageType { + /** + * Faster random access speeds for specific ugens in the list, but + * adding or removing ugens incurs more performance penalties. + */ + ARRAYLIST, + + /** + * Slower access speeds for specific ugens in the list, but + * has better addition and removal performance than arraylists. + */ + LINKEDLIST + }; + + private UGenStorageType ugenStorageType; + + /** + * Get the default AudioContext used in UGen objects + * @return the default AudioContext + */ + public static AudioContext getDefaultContext() { + return AudioContext.getDefaultContext(); + } + + /** + * Set the default AudioContext to use in UGen objects + * @param defaultContext the default UGen object to use for specialised class constructors + */ + public static void setDefaultContext(AudioContext defaultContext) { + AudioContext.setDefaultContext(defaultContext); + } /** * Create a new UGen from the given AudioContext but with no inputs or @@ -101,7 +139,6 @@ public UGen(AudioContext context, int outs) { * @param outs number of outputs. */ public UGen(AudioContext context, int ins, int outs) { - dependents = new ArrayList(); noInputs = true; lastTimeStep = -1; outputInitializationRegime = OutputInitializationRegime.JUNK; @@ -109,8 +146,9 @@ public UGen(AudioContext context, int ins, int outs) { timerMode = false; timeTemp = 0; // inputProxy = outputProxy = null; - setIns(ins); + setIns(ins, UGenStorageType.ARRAYLIST); setOuts(outs); + setDependents(UGenStorageType.ARRAYLIST); setContext(context); } @@ -144,16 +182,39 @@ public AudioContext getContext() { } /** - * Set the number of inputs. + * Set the number of inputs and the {@link UGenStorageType}. The value + * {@link UGenStorageType#ARRAYLIST} means that the BufferPointer List + * will use an ArrayList structure. The value {@link UGenStorageType#LINKEDLIST} + * means that the BufferPointer List will use a LinkedList structure. + * A new, empty list structure will be made if no previous one exists. If a + * previous list exists, a copy of it will be made in the new List structure. * * @param ins number of inputs. + * @param ugenType the {@link UGenStorageType}. */ @SuppressWarnings("unchecked") - private synchronized void setIns(int ins) { + private synchronized void setIns(int ins, UGenStorageType ugenType) { this.ins = ins; - inputsAtChannel = new ArrayList[ins]; - for (int i = 0; i < ins; i++) { - inputsAtChannel[i] = new ArrayList(); + + switch(ugenType) { + case LINKEDLIST: + inputsAtChannel = new LinkedList[ins]; + for (int i = 0; i < ins; i++) { + inputsAtChannel[i] = (inputsAtChannel[i] == null) ? + new LinkedList() : new LinkedList(inputsAtChannel[i]); + } + ugenStorageType = UGenStorageType.LINKEDLIST; + break; + + default: + case ARRAYLIST: + inputsAtChannel = new ArrayList[ins]; + for (int i = 0; i < ins; i++) { + inputsAtChannel[i] = (inputsAtChannel[i] == null) ? + new ArrayList() : new ArrayList(inputsAtChannel[i]); + } + ugenStorageType = UGenStorageType.ARRAYLIST; + break; } } @@ -184,6 +245,53 @@ public int getOuts() { return outs; } + /** + * Initialise and set the storage type for the list of dependents. The value + * {@link UGenStorageType#ARRAYLIST} means that the list will use an ArrayList + * structure. The value {@link UGenStorageType#LINKEDLIST} + * means that the list will use a LinkedList structure. If a previous dependents + * list exists, a copy of that will be made in the new specified list structure. + * If not, a new blank list structure will be made and assigned to dependents. + * + * @param ugenType the {@link UGenStorageType}. + */ + @SuppressWarnings("unchecked") + private synchronized void setDependents(UGenStorageType ugenType) { + switch(ugenType) { + case LINKEDLIST: + dependents = (dependents == null) ? new LinkedList() : new LinkedList(dependents); + break; + + default: + case ARRAYLIST: + dependents = (dependents == null) ? new ArrayList() : new ArrayList(dependents); + break; + } + } + + /** + * Set the storage structure type for UGen. + * + * @param ugenType the {@link UGenStorageType}. + */ + public void setStorageType(UGenStorageType ugenType) { + switch(ugenType) { + case LINKEDLIST: + setIns(this.ins, UGenStorageType.LINKEDLIST); + setDependents(UGenStorageType.LINKEDLIST); + break; + default: + case ARRAYLIST: + setIns(this.ins, UGenStorageType.ARRAYLIST); + setDependents(UGenStorageType.ARRAYLIST); + break; + } + } + + public UGenStorageType getStorageType() { + return ugenStorageType; + } + /** * Sets up the input buffer. Called when number of inputs or buffer size is changed. */ @@ -268,13 +376,12 @@ private synchronized void pullInputs() { //ArrayList dependentsClone = (ArrayList) dependents.clone(); //this may be slow, but avoids concurrent mod exceptions //don't need to clone the array any more; we'll just be careful how we traverse the array. int size = dependents.size(); - for(int index = 0; index < size; index++) { - UGen dependent = dependents.get(index); + Iterator it1 = dependents.iterator(); + while (it1.hasNext()) { + UGen dependent = it1.next(); if (dependent.isDeleted()) { // don't need to work with a cloned ArrayList if we adjust our indices properly - dependents.remove(index); - index--; - size--; + it1.remove(); } else { dependent.update(); } @@ -290,7 +397,7 @@ private synchronized void pullInputs() { if(size == 1) { BufferPointer bp = inputsAtChannel[i].get(0); if (bp.ugen.isDeleted()) { - removeInputAtChannel(i, bp); + inputsAtChannel[i].remove(0); } else { bp.ugen.update(); noInputs = false; //we actually updated something, so we must have inputs @@ -308,13 +415,12 @@ private synchronized void pullInputs() { } } else if(size != 0) { float[] bi = bufIn[i] = context.getCleanBuf(); - for (int index = 0; index < size; index++) { - BufferPointer bp = inputsAtChannel[i].get(index); + Iterator it2 = inputsAtChannel[i].iterator(); + while (it2.hasNext()) { + BufferPointer bp = it2.next(); if (bp.ugen.isDeleted()) { // don't need to work with a cloned array if we adjust our indices properly - removeInputAtChannel(i, bp); - size--; - index--; + it2.remove(); } else { bp.ugen.update(); noInputs = false; //we actually updated something, so we must have inputs @@ -344,6 +450,7 @@ public void update() { if(timerMode) { timeTemp = System.nanoTime(); } + lastTimeStep = context.getTimeStep(); // do this first to break call chain loops pullInputs(); //this sets up the output buffers - default behaviour is to use dirty buffers from the AudioContexts @@ -389,6 +496,34 @@ public synchronized void addInput(UGen sourceUGen) { } } + + /** + * Connect another UGen's outputs to the inputs of this UGen. If the number + * of outputs is greater than the number of inputs then the extra outputs are not connected. If the number of inputs is greater than the number of outputs then the outputs are cycled to fill all inputs. If + * multiple UGens are connected to any one input then the outputs from those + * UGens are summed on their way into the input. + * + * @param the UGen to connect to this UGen. + */ + + /** + * Connect this UGen's outputs to the inputs of the targetGen. If the number + * of outputs is greater than the number of inputs then the extra outputs are not connected. If the number of inputs is greater than the number of outputs then the outputs are cycled to fill all inputs. If + * multiple UGens are connected to any one input then the outputs from those + * UGens are summed on their way into the input. + * by returning the target, we can connect sequentially. + * eg. source - intermediate- end + * source.connectTo(intermediate).connectTo(end); + * + * @param targetGen The ugen we are connecting our output to + * @return the target gen + */ + public UGen connectTo(UGen targetGen){ + targetGen.addInput(this); + return targetGen; + } + + /** * Connect a specific output from another UGen to a specific input of this * UGen. @@ -403,7 +538,23 @@ public synchronized void addInput(int inputIndex, UGen sourceUGen, int sourceOut //System.out.println("new input added, channel=" + inputIndex + " total=" + inputsAtChannel[inputIndex].size()); noInputs = false; } - + + /** + * Connect a Specific output from this UGen to a specific input of targetUGen + * by returning the target, we can connect sequentially. + * eg. source- intermediate- end + * source.connectTo(intermediate).connectTo(end); + * + * @param sourceOutputIndex the output of this UGEN we want to conect from + * @param targetUgen the UGen we are connecting into + * @param inputIndex the Input channel of the target UGen we are connecting into + * @return the targetUgen + */ + public UGen connectTo(int sourceOutputIndex, UGen targetUgen, int inputIndex){ + targetUgen.addInput(inputIndex, this, sourceOutputIndex); + return targetUgen; + } + /** * Performs a crossfade from one UGen (which must already be connected) to another. Only works if you * @param source the UGen to crossfade away from (assumed to already be connected), will be disconnected once cross-fade is over. @@ -483,7 +634,7 @@ public synchronized int getNumberOfDependents() { */ @SuppressWarnings("unchecked") public synchronized List getDependents() { - return (List) dependents.clone(); + return dependents; } /** @@ -497,7 +648,14 @@ public synchronized boolean containsInput(UGen ugen) { return false; } else { for (int i = 0; i < inputsAtChannel.length; i++) { - ArrayList bplist = (ArrayList) inputsAtChannel[i].clone(); + + List bplist; + if(ugenStorageType == UGenStorageType.ARRAYLIST) { + bplist = new ArrayList(inputsAtChannel[i]); + } else { + bplist = new LinkedList(inputsAtChannel[i]); + } + for (BufferPointer bp : bplist) { if (ugen.equals(bp.ugen)) { return true; @@ -532,7 +690,7 @@ public synchronized Set getConnectedInputs() { */ @SuppressWarnings("unchecked") public synchronized List getBufferPointers(int index) { - return (List) inputsAtChannel[index].clone(); + return inputsAtChannel[index]; } private static Hashtable, Hashtable> envelopeGetterMethods = new Hashtable, Hashtable>(); @@ -587,13 +745,17 @@ public synchronized void removeAllConnections(UGen sourceUGen) { if (!noInputs) { int inputCount = 0; for (int i = 0; i < inputsAtChannel.length; i++) { - ArrayList bplist = (ArrayList) inputsAtChannel[i].clone(); - for (BufferPointer bp : bplist) { + + Iterator bplist = inputsAtChannel[i].iterator(); + while (bplist.hasNext()) { + BufferPointer bp = bplist.next(); if (sourceUGen.equals(bp.ugen)) { - removeInputAtChannel(i,bp); - } else + bplist.remove(); + } else { inputCount++; + } } + } if (inputCount == 0) { noInputs = true; @@ -620,19 +782,24 @@ public synchronized boolean removeConnection(int inputChannel, if (!noInputs) { int inputCount = 0; boolean ret = false; - ArrayList bplist = (ArrayList) inputsAtChannel[inputChannel].clone(); - for (BufferPointer bp : bplist) { + + List bplist = inputsAtChannel[inputChannel]; + + Iterator it = bplist.iterator(); + while (it.hasNext()) { + BufferPointer bp = it.next(); if (sourceUGen.equals(bp.ugen) && bp.index == sourceOutputChannel) { - removeInputAtChannel(inputChannel, bp); + it.remove(); ret = true; + break; } else { inputCount++; } } if (inputCount == 0) { // include inputs on all channels in count - for (ArrayList ch : inputsAtChannel) + for (List ch : inputsAtChannel) inputCount += ch.size(); } if (inputCount == 0) { @@ -645,16 +812,68 @@ public synchronized boolean removeConnection(int inputChannel, } } + /** + * Disconnects the connection of the UGen at the specified index from this UGen's buffer. + * + * @param inputChannel + * The channel of this UGen to check. + * @param index + * The index of the UGen to disconnect. + * @param sourceOutputChannel + * The channel of the source UGen. + * @return True if a connection was removed; false otherwise. + */ + @SuppressWarnings("unchecked") + public synchronized boolean removeConnectionAtIndex(int inputChannel, + int index, int sourceOutputChannel) { + if (!noInputs) { + int inputCount = 0; + boolean ret = false; + + List bplist = inputsAtChannel[inputChannel]; + + int i = -1; + Iterator it = bplist.iterator(); + while (it.hasNext()) { + BufferPointer bp = it.next(); + i ++; + if (index == i && bp.index == sourceOutputChannel) { + it.remove(); + ret = true; + break; + } else { + inputCount++; + } + } + if (inputCount == 0) { + // include inputs on all channels in count + for (List ch : inputsAtChannel) + inputCount += ch.size(); + } + if (inputCount == 0) { + System.out.println("CHEATED"); + noInputs = true; + zeroIns(); + } + return ret; + } else { + return false; + } + } + /** * Clear all of this UGen's input connections. */ @SuppressWarnings("unchecked") public synchronized void clearInputConnections() { for(int i = 0; i < inputsAtChannel.length; i++) { - ArrayList bplist = (ArrayList) inputsAtChannel[i].clone(); - for (BufferPointer bp : bplist) { - removeInputAtChannel(i, bp); + + Iterator bplist = inputsAtChannel[i].iterator(); + while (bplist.hasNext()) { + bplist.next(); + bplist.remove(); } + noInputs = true; zeroIns(); } diff --git a/src/beads_main/net/beadsproject/beads/core/UGenChain.java b/src/beads_main/java/net/beadsproject/beads/core/UGenChain.java similarity index 94% rename from src/beads_main/net/beadsproject/beads/core/UGenChain.java rename to src/beads_main/java/net/beadsproject/beads/core/UGenChain.java index 26e07dc..aa68c0c 100644 --- a/src/beads_main/net/beadsproject/beads/core/UGenChain.java +++ b/src/beads_main/java/net/beadsproject/beads/core/UGenChain.java @@ -43,6 +43,10 @@ public void calculateBuffer() { } + public UGenChain(int ins, int outs) { + this(getDefaultContext(), ins, outs); + } + /** * Adds the Chain inputs to the target UGen's inputs. * diff --git a/src/beads_main/net/beadsproject/beads/core/io/NonrealtimeIO.java b/src/beads_main/java/net/beadsproject/beads/core/io/NonrealtimeIO.java similarity index 85% rename from src/beads_main/net/beadsproject/beads/core/io/NonrealtimeIO.java rename to src/beads_main/java/net/beadsproject/beads/core/io/NonrealtimeIO.java index 9754d44..f65d715 100644 --- a/src/beads_main/net/beadsproject/beads/core/io/NonrealtimeIO.java +++ b/src/beads_main/java/net/beadsproject/beads/core/io/NonrealtimeIO.java @@ -51,6 +51,14 @@ public ThisIsNotAnInput(AudioContext context, int outs) { pause(true); } + /** + * Instantiates a new this is not an input. + * @param outs the outs + */ + public ThisIsNotAnInput(int outs) { + this(getDefaultContext(), outs); + } + /* (non-Javadoc) * @see net.beadsproject.beads.core.UGen#calculateBuffer() */ diff --git a/src/beads_main/java/net/beadsproject/beads/core/io/package.html b/src/beads_main/java/net/beadsproject/beads/core/io/package.html new file mode 100644 index 0000000..7615831 --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/core/io/package.html @@ -0,0 +1,7 @@ + + + + + Provides a set of implementations of AudioIO for different systems. + + \ No newline at end of file diff --git a/src/beads_main/java/net/beadsproject/beads/core/package.html b/src/beads_main/java/net/beadsproject/beads/core/package.html new file mode 100644 index 0000000..f2414b2 --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/core/package.html @@ -0,0 +1,7 @@ + + + + + Provides Beads' core classes, in particular, Bead, UGen and AudioContext. + + \ No newline at end of file diff --git a/src/beads_main/net/beadsproject/beads/data/Buffer.java b/src/beads_main/java/net/beadsproject/beads/data/Buffer.java similarity index 99% rename from src/beads_main/net/beadsproject/beads/data/Buffer.java rename to src/beads_main/java/net/beadsproject/beads/data/Buffer.java index 056b6c6..6bdc02e 100644 --- a/src/beads_main/net/beadsproject/beads/data/Buffer.java +++ b/src/beads_main/java/net/beadsproject/beads/data/Buffer.java @@ -15,8 +15,7 @@ /** * A Buffer stores a one-dimensional buffer of floats for use as a wavetable or a window. Buffer does not perform any interpolation in this version, you should just make sure your buffer * is high-res enough for what you need. Could add interpolation easily if needed. - * - * @beads.category data + * * @see Sample BufferFactory * @author ollie */ diff --git a/src/beads_main/net/beadsproject/beads/data/BufferFactory.java b/src/beads_main/java/net/beadsproject/beads/data/BufferFactory.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/BufferFactory.java rename to src/beads_main/java/net/beadsproject/beads/data/BufferFactory.java diff --git a/src/beads_main/net/beadsproject/beads/data/DataBead.java b/src/beads_main/java/net/beadsproject/beads/data/DataBead.java similarity index 95% rename from src/beads_main/net/beadsproject/beads/data/DataBead.java rename to src/beads_main/java/net/beadsproject/beads/data/DataBead.java index bb0e000..9e20815 100644 --- a/src/beads_main/net/beadsproject/beads/data/DataBead.java +++ b/src/beads_main/java/net/beadsproject/beads/data/DataBead.java @@ -134,7 +134,7 @@ public void putAll(Object... objects) { * Uses the parameters stored by this DataBead, this method configures the * given object by using reflection to discover appropriate setter methods. * For example, if the object has a method setX(float f) then - * the key-value pair will be used to invoke this + * the key-value pair <String "x", float 0.5f> will be used to invoke this * method. Errors are caught and printed (actually, not right now...). *

* Be aware that this may not work as expected with all objects. Use with @@ -175,7 +175,7 @@ public void configureObject(Object o) { * This method is a useful way to update float parameters in a * class: *

- * float param = startval;
+ * float param = startval;
* ...
* param = databead.getFloat("paramKey", param); * diff --git a/src/beads_main/net/beadsproject/beads/data/DataBeadReceiver.java b/src/beads_main/java/net/beadsproject/beads/data/DataBeadReceiver.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/DataBeadReceiver.java rename to src/beads_main/java/net/beadsproject/beads/data/DataBeadReceiver.java diff --git a/src/beads_main/java/net/beadsproject/beads/data/Pitch.java b/src/beads_main/java/net/beadsproject/beads/data/Pitch.java new file mode 100644 index 0000000..2401ec2 --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/data/Pitch.java @@ -0,0 +1,177 @@ +/* + * This file is part of Beads. See http://www.beadsproject.net for all information. + */ +package net.beadsproject.beads.data; + +/** + * A set of static fields and utility methods associated with pitch. + * + * @author ollie + */ +public abstract class Pitch { + + /** The constant log(2) = 0.6931472. */ + public final static float LOG2 = 0.6931472f; + + /** + * Convert frequency to MIDI note number. + * + * @param frequency + * the required frequency. + * + * @return the resulting MIDI note number. + */ + public static final float ftom(float frequency) { + return Math.max(0f, (float)Math.log(frequency / 440.0f) / LOG2 * 12f + 69f); + } + + /** + * Convert MIDI note number to frequency. + * + * @param midi + * the required MIDI note number. + * + * @return the resulting frequency. + */ + public static final float mtof(float midi) { + return 440.0f * (float)Math.pow(2.0f, (midi - 69f) / 12.0f); + } + + /** + * Takes a pitch and returns that pitch adjusted downwards to the nearest pitch in the given scale. + * + * @param pitch the pitch to modify. + * @param scale the scale to use. + * @param notesPerOctave how many notes in your octave (12 if you're not sure). + * @return adjusted pitch. + */ + public static final int forceToScale(int pitch, int[] scale, int notesPerOctave) { + int pitchClass = pitch % notesPerOctave; + int register = pitch / notesPerOctave; + int newPitchClass = -1; + for(int i = scale.length - 1; i >= 0; i--) { + if(pitchClass >= scale[i]) { + newPitchClass = scale[i]; + break; + } + } + if(newPitchClass == -1) { + newPitchClass = pitchClass; + } + return register * notesPerOctave + newPitchClass; + } + + /** + * Takes a pitch and returns that pitch adjusted downwards to the nearest pitch in the given scale. Assumes 12 pitches per octave. + * + * @param pitch the pitch to modify. + * @param scale the scale to use. + * @return adjusted pitch. + */ + public static final int forceToScale(int pitch, int[] scale) { + return forceToScale(pitch, scale, 12); + } + + public static final float forceFrequencyToScale(float freq, int[] scale) { + return mtof(forceToScale((int)ftom(freq), scale)); + } + + /** Pitch names for scale starting at C. */ + public static final String[] pitchNames = new String[]{"C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"}; + + /** The dorian scale relative to root. */ + public static final int[] dorian = {0, 2, 3, 5, 7, 9, 10}; + + /** The major scale relative to root. */ + public static final int[] major = {0, 2, 4, 5, 7, 9, 11}; + + /** The minor scale relative to root. */ + public static final int[] minor = {0, 2, 3, 5, 7, 8, 10}; + + /** The circle of fifths relative to root. */ + public static final int[] circleOfFifths = {0, 5, 10, 3, 8, 1, 6, 11, 4, 9, 2, 7}; + + /** Pentatonic. */ + public static final int[] pentatonic = {0, 2, 4, 7, 9}; + + /** + * Calculate the MIDI note that would be required given the tonic of a scale, the numbers + * in the scale relative to the tonic, and the index using zero based reference + * For example, with Midi Note C3 (60), using the Major scale, and scaleIndex of 8 (being major 9th) + * we would get 60 + 12 + 2 = 74 (D4) + * @param scaleTonic The note number that would be the zero index of the scale + * @param scaleData An array of notes for which to define our scale + * @param scaleIndex The index within the scale to find the value to add + * @return The scaleTonic + scaleIndex in the index. If scaleIndex is outside the range of array + * eg (scaleIndex < 0 || scaleIndex >= scaleData.length) then modulo mathematics will be used to + * return note from next or previous register + */ + public static int getRelativeMidiNote (int scaleTonic, int[] scaleData, int scaleIndex){ + int ret = scaleTonic; // this will be if a scaleIndex is zero + + // Note our comment text will assume scaleData is Picth.major for ease of understanding + if (scaleIndex > 0){ + // get the scale degree from the scale + // eg, if scaleIndex is 9, scale_degree = 9 % 7 = 2 + int scale_degree = scaleIndex % scaleData.length; + + // If our scale pitch is 2,Pitch.major[2] = 4 (major third) + int scale_pitch = scaleData[scale_degree]; + + // Now get the register of our note + // eg, if scaleIndex is 9, note_register = 9 / 7 = 1 + int note_register = scaleIndex / scaleData.length; + + // we multiply our register x 12 because that is an octave in MIDI + // if scaleIndex is 9 then 1 x 12 + 4 = 16 + int note_pitch = note_register * 12 + scale_pitch; + + // add the number to our base tonic to get the note based on key. Assume our scaleTonic is C2 (48) + // if scaleIndex is 9 then 48 + 16 = 64. This is E3 in MIDI + ret = scaleTonic + note_pitch; + + } + else if (scaleIndex < 0){ + int negative_index = scaleIndex * -1; + + // get the scale degree from the scale we need to reduce by + // eg, if scaleIndex is -9, scale_degree = 9 % 7 = 2 (we got absoly=te value of scaleIndex) + // We need to get index below this figure = eg, 2 array index points from end + int scale_degree = negative_index % scaleData.length; + + // If our scale scale_degree is 2, Pitch.major[7-2] = 9 (major sixth) + int scale_pitch = scaleData[(scaleData.length - scale_degree) % scaleData.length]; + + // Now get the register of our note + // eg, if scaleIndex is -9, note_register = -9 / 7 = -1 + int note_register = scaleIndex / scaleData.length; + + // if it is not exactly an octave, we need to calculate our range from and extra register below + if (scale_pitch != 0){ + // if scaleIndex is -9 then note_register = -2 + note_register -= 1; + } + // we multiply our register x 12 because that is an octave in MIDI + // if scaleIndex is -9 then -2 x 12 + 9 = -15 + int note_pitch = note_register * 12 + scale_pitch; + + // add the number to our base tonic to get the note based on key. Assume our Base Note C3 (60) + // if scaleIndex is -9 then 60 - 15 = 45. This is A1 in MIDI + ret = scaleTonic + note_pitch; + } + + return ret; + } + + /** + * Shift the Pitch based on the number of semitones + * @param frequency The frequency we want shifted + * @param midiDegree the number of semitones we want to shift + * @return the frequency value shifted by the number of semitones + */ + public static double shiftPitch (float frequency, int midiDegree){ + final double SEMITONE_CONSTANT = Math.pow(2 , 1f/12f); + return Math.pow(SEMITONE_CONSTANT, midiDegree) * frequency; + + } +} diff --git a/src/beads_main/net/beadsproject/beads/data/Sample.java b/src/beads_main/java/net/beadsproject/beads/data/Sample.java similarity index 91% rename from src/beads_main/net/beadsproject/beads/data/Sample.java rename to src/beads_main/java/net/beadsproject/beads/data/Sample.java index da0319f..82a8548 100644 --- a/src/beads_main/net/beadsproject/beads/data/Sample.java +++ b/src/beads_main/java/net/beadsproject/beads/data/Sample.java @@ -11,18 +11,20 @@ import net.beadsproject.beads.data.audiofile.AudioFileReader; import net.beadsproject.beads.data.audiofile.AudioFileType; import net.beadsproject.beads.data.audiofile.AudioFileWriter; +import net.beadsproject.beads.data.audiofile.FileFormatException; +import net.beadsproject.beads.data.audiofile.OperationUnsupportedException; /** * A Sample encapsulates audio data, either loaded from an audio file (such as - * an MP3) or written by a Recorder.
+ * an MP3) or written by a Recorder.
* The typical use of a Sample is through * {@link net.beadsproject.beads.data.SampleManager}. For example, to load an - * mp3, you would do the following.
- *
+ * mp3, you would do the following. + *

  * 
  * Sample wicked = SampleManager.sample("wickedTrack.mp3");	
- *  
- *
+ *
+ *
* *

* Samples are usually played with a @@ -32,8 +34,7 @@ * {@link #getFrames(int, float[][]) getFrames}. Sample data can be written * with: {@link #putFrame(int, float[]) putFrame} or * {@link #putFrames(int, float[][]) putFrames}. - * - * @beads.category data + * * @see SampleManager * @see net.beadsproject.beads.ugens.RecordToSample * @author Beads Team @@ -81,7 +82,7 @@ public class Sample { try { defaultAudioFileWriterClass = (Class) Class.forName("net.beadsproject.beads.data.audiofile.WavFileReaderWriter"); } catch (ClassNotFoundException e2) { - defaultAudioFileReaderClass = null; + defaultAudioFileWriterClass = null; } } } @@ -139,11 +140,10 @@ public Sample(double length, int nChannels, float sampleRate) { /** * Create a sample from a file. This constructor immediately loads the * entire audio file into memory. - * - * @throws UnsupportedAudioFileException + * * @throws IOException */ - public Sample(String filename) throws IOException { + public Sample(String filename) throws IOException, OperationUnsupportedException, FileFormatException { loadAudioFile(filename); this.filename = filename; } @@ -354,7 +354,7 @@ public void clear() { * isWriteable() is false, the behaviour is undefined/unstable. * * @param frame - * The frame to write into. Must be >=0 and theRealAudioFileReaderClass = audioFileReaderClass == null ? defaultAudioFileReaderClass : audioFileReaderClass; if(file.endsWith(".wav") || file.endsWith(".WAV")) { try { @@ -641,7 +654,7 @@ private void loadAudioFile(String file) throws IOException { try { this.theSampleData = audioFileReader.readAudioFile(file); } catch (Exception e) { - throw new IOException(e); + throw e; } this.sampleRate = audioFileReader.getSampleAudioFormat().sampleRate; this.nChannels = theSampleData.length; diff --git a/src/beads_main/net/beadsproject/beads/data/SampleAudioFormat.java b/src/beads_main/java/net/beadsproject/beads/data/SampleAudioFormat.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/SampleAudioFormat.java rename to src/beads_main/java/net/beadsproject/beads/data/SampleAudioFormat.java diff --git a/src/beads_main/net/beadsproject/beads/data/SampleManager.java b/src/beads_main/java/net/beadsproject/beads/data/SampleManager.java similarity index 95% rename from src/beads_main/net/beadsproject/beads/data/SampleManager.java rename to src/beads_main/java/net/beadsproject/beads/data/SampleManager.java index f916fab..1f07971 100644 --- a/src/beads_main/net/beadsproject/beads/data/SampleManager.java +++ b/src/beads_main/java/net/beadsproject/beads/data/SampleManager.java @@ -5,6 +5,7 @@ import java.io.File; import java.io.FileNotFoundException; +import java.io.IOException; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import java.net.URL; @@ -16,10 +17,12 @@ import java.util.Set; import java.util.TreeMap; +import net.beadsproject.beads.data.audiofile.FileFormatException; +import net.beadsproject.beads.data.audiofile.OperationUnsupportedException; + /** * SampleManager provides a static repository for {@link Sample} data and provides methods to organise samples into groups. - * - * @beads.category data + * */ public class SampleManager { @@ -77,10 +80,14 @@ public static Sample sample(String ref, String fn) { try { sample = new Sample(fn); samples.put(ref, sample); - if(verbose) System.out.println("Loaded " + fn); - } catch (Exception e) { - //swallow exception - } + if(verbose) System.out.println("Sample loaded " + fn); + } catch (OperationUnsupportedException e) { + System.out.println("OperationUnsupportedException: The reading operation failed " + fn); + } catch (FileFormatException e) { + System.out.println("FileFormatException: Sample format malformed " + fn); + } catch (IOException e) { + System.out.println("IOException: Sample not found/supported " + fn); + } } return sample; } diff --git a/src/beads_main/net/beadsproject/beads/data/audiofile/AudioFileReader.java b/src/beads_main/java/net/beadsproject/beads/data/audiofile/AudioFileReader.java similarity index 55% rename from src/beads_main/net/beadsproject/beads/data/audiofile/AudioFileReader.java rename to src/beads_main/java/net/beadsproject/beads/data/audiofile/AudioFileReader.java index b1a6616..605eb11 100644 --- a/src/beads_main/net/beadsproject/beads/data/audiofile/AudioFileReader.java +++ b/src/beads_main/java/net/beadsproject/beads/data/audiofile/AudioFileReader.java @@ -15,23 +15,20 @@ public interface AudioFileReader { /** * Single method to read an entire audio file in one go. - * @param data - upon return, this will point to a 2D array containing all the audio data. - * The first dimension (data.length) is the number of channels. - * The second dimension (data[0].length) is the number of frames. * @param filename - the name of the file to be read - * @param saf - upon return, this will point to a SampleAudioFormat object containing the details of the sample data that was read. + * @return the samples as arrays */ - public float[][] readAudioFile(String filename) throws IOException, OperationUnsupportedException, FileFormatException; + float[][] readAudioFile(String filename) throws IOException, OperationUnsupportedException, FileFormatException; /** * After reading, the SampleAudioFormat can be obtained. * @return the SampleAudioFormat object describing the sample data that has been read in. */ - public SampleAudioFormat getSampleAudioFormat(); + SampleAudioFormat getSampleAudioFormat(); /** * Get the supported file types. * @return - the supported file types. */ - public HashSet getSupportedFileTypesForReading(); + HashSet getSupportedFileTypesForReading(); } diff --git a/src/beads_main/net/beadsproject/beads/data/audiofile/AudioFileType.java b/src/beads_main/java/net/beadsproject/beads/data/audiofile/AudioFileType.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/audiofile/AudioFileType.java rename to src/beads_main/java/net/beadsproject/beads/data/audiofile/AudioFileType.java diff --git a/src/beads_main/net/beadsproject/beads/data/audiofile/AudioFileWriter.java b/src/beads_main/java/net/beadsproject/beads/data/audiofile/AudioFileWriter.java similarity index 84% rename from src/beads_main/net/beadsproject/beads/data/audiofile/AudioFileWriter.java rename to src/beads_main/java/net/beadsproject/beads/data/audiofile/AudioFileWriter.java index bbb1b6c..a1ec20a 100644 --- a/src/beads_main/net/beadsproject/beads/data/audiofile/AudioFileWriter.java +++ b/src/beads_main/java/net/beadsproject/beads/data/audiofile/AudioFileWriter.java @@ -19,8 +19,9 @@ public interface AudioFileWriter { * @param filename - the name of the file to be written * @param type - the type of audio file to be written (mp3, wav, etc.) * @param saf - a SampleAudioFormat object specifying the attributes of the sample data to be written. Can be NULL, in which case default values will be used. + * */ - public void writeAudioFile(float[][] data, String filename, AudioFileType type, SampleAudioFormat saf) throws IOException, OperationUnsupportedException, FileFormatException; + void writeAudioFile(float[][] data, String filename, AudioFileType type, SampleAudioFormat saf) throws IOException, OperationUnsupportedException, FileFormatException; /** * Get the supported file types. diff --git a/src/beads_main/net/beadsproject/beads/data/audiofile/FileFormatException.java b/src/beads_main/java/net/beadsproject/beads/data/audiofile/FileFormatException.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/audiofile/FileFormatException.java rename to src/beads_main/java/net/beadsproject/beads/data/audiofile/FileFormatException.java diff --git a/src/beads_main/net/beadsproject/beads/data/audiofile/OperationUnsupportedException.java b/src/beads_main/java/net/beadsproject/beads/data/audiofile/OperationUnsupportedException.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/audiofile/OperationUnsupportedException.java rename to src/beads_main/java/net/beadsproject/beads/data/audiofile/OperationUnsupportedException.java diff --git a/src/beads_main/net/beadsproject/beads/data/audiofile/WavFileReaderWriter.java b/src/beads_main/java/net/beadsproject/beads/data/audiofile/WavFileReaderWriter.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/audiofile/WavFileReaderWriter.java rename to src/beads_main/java/net/beadsproject/beads/data/audiofile/WavFileReaderWriter.java diff --git a/src/beads_main/java/net/beadsproject/beads/data/audiofile/package.html b/src/beads_main/java/net/beadsproject/beads/data/audiofile/package.html new file mode 100644 index 0000000..a0d10f0 --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/data/audiofile/package.html @@ -0,0 +1,8 @@ + + + + + Provides classes involved in handling audio files. Mostly these would not be + handled by the user, but accessed via Sample. + + \ No newline at end of file diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/CosineWindow.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/CosineWindow.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/CosineWindow.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/CosineWindow.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/CurveBuffer.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/CurveBuffer.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/CurveBuffer.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/CurveBuffer.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/Exp01Buffer.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/Exp01Buffer.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/Exp01Buffer.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/Exp01Buffer.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/HanningWindow.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/HanningWindow.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/HanningWindow.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/HanningWindow.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/Log01Buffer.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/Log01Buffer.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/Log01Buffer.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/Log01Buffer.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/MeanFilter.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/MeanFilter.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/MeanFilter.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/MeanFilter.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/NoiseBuffer.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/NoiseBuffer.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/NoiseBuffer.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/NoiseBuffer.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/OneWindow.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/OneWindow.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/OneWindow.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/OneWindow.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/RampBuffer.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/RampBuffer.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/RampBuffer.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/RampBuffer.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/SawBuffer.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/SawBuffer.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/SawBuffer.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/SawBuffer.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/SineBuffer.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/SineBuffer.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/SineBuffer.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/SineBuffer.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/SquareBuffer.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/SquareBuffer.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/SquareBuffer.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/SquareBuffer.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/TriangleBuffer.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/TriangleBuffer.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/TriangleBuffer.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/TriangleBuffer.java diff --git a/src/beads_main/net/beadsproject/beads/data/buffers/TriangularWindow.java b/src/beads_main/java/net/beadsproject/beads/data/buffers/TriangularWindow.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/data/buffers/TriangularWindow.java rename to src/beads_main/java/net/beadsproject/beads/data/buffers/TriangularWindow.java diff --git a/src/beads_main/java/net/beadsproject/beads/data/buffers/package.html b/src/beads_main/java/net/beadsproject/beads/data/buffers/package.html new file mode 100644 index 0000000..abe0cf2 --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/data/buffers/package.html @@ -0,0 +1,7 @@ + + + + + Provides BufferFactories for generating various types of wavetables and windows. + + \ No newline at end of file diff --git a/src/beads_main/java/net/beadsproject/beads/data/package.html b/src/beads_main/java/net/beadsproject/beads/data/package.html new file mode 100644 index 0000000..d33247a --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/data/package.html @@ -0,0 +1,7 @@ + + + + + Provides classes for handling buffers of data, including samples and common waveforms and windows. + + \ No newline at end of file diff --git a/src/beads_main/net/beadsproject/beads/events/AudioContextStopTrigger.java b/src/beads_main/java/net/beadsproject/beads/events/AudioContextStopTrigger.java similarity index 68% rename from src/beads_main/net/beadsproject/beads/events/AudioContextStopTrigger.java rename to src/beads_main/java/net/beadsproject/beads/events/AudioContextStopTrigger.java index 1ff102a..195cdeb 100644 --- a/src/beads_main/net/beadsproject/beads/events/AudioContextStopTrigger.java +++ b/src/beads_main/java/net/beadsproject/beads/events/AudioContextStopTrigger.java @@ -9,13 +9,13 @@ /** * Use AudioContextStopTrigger to cause the {@link AudioContext} to stop in response to a given event. * - *

For example, to cause the {@link AudioContext} to stop when a sample has finished playing: + * For example, to cause the {@link AudioContext} to stop when a sample has finished playing: * - *
AudioContext context = new AudioContext(); - *
SamplePlayer samplePlayer = new SamplePlayer(SampleManager.sample(pathToAudioFile)); - *
context.out.addInput(samplePlayer); - *
samplePlayer.setKillListener(new AudioContextStopTrigger(context)); - *
context.start(); + * AudioContext context = new AudioContext(); + * SamplePlayer samplePlayer = new SamplePlayer(SampleManager.sample(pathToAudioFile)); + * context.out.addInput(samplePlayer); + * samplePlayer.setKillListener(new AudioContextStopTrigger(context)); + * context.start(); *
*/ public class AudioContextStopTrigger extends Bead { diff --git a/src/beads_main/net/beadsproject/beads/events/FloatBead.java b/src/beads_main/java/net/beadsproject/beads/events/FloatBead.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/events/FloatBead.java rename to src/beads_main/java/net/beadsproject/beads/events/FloatBead.java diff --git a/src/beads_main/net/beadsproject/beads/events/IntegerBead.java b/src/beads_main/java/net/beadsproject/beads/events/IntegerBead.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/events/IntegerBead.java rename to src/beads_main/java/net/beadsproject/beads/events/IntegerBead.java diff --git a/src/beads_main/net/beadsproject/beads/events/KillTrigger.java b/src/beads_main/java/net/beadsproject/beads/events/KillTrigger.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/events/KillTrigger.java rename to src/beads_main/java/net/beadsproject/beads/events/KillTrigger.java diff --git a/src/beads_main/net/beadsproject/beads/events/PauseTrigger.java b/src/beads_main/java/net/beadsproject/beads/events/PauseTrigger.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/events/PauseTrigger.java rename to src/beads_main/java/net/beadsproject/beads/events/PauseTrigger.java diff --git a/src/beads_main/net/beadsproject/beads/events/SoundEvent.java b/src/beads_main/java/net/beadsproject/beads/events/SoundEvent.java similarity index 93% rename from src/beads_main/net/beadsproject/beads/events/SoundEvent.java rename to src/beads_main/java/net/beadsproject/beads/events/SoundEvent.java index a7ef909..fddbc91 100644 --- a/src/beads_main/net/beadsproject/beads/events/SoundEvent.java +++ b/src/beads_main/java/net/beadsproject/beads/events/SoundEvent.java @@ -10,7 +10,7 @@ /** * A general purpose interface for defining sound events. A SoundEvent is created with - * the method @link {@link #play(UGen, DataBead)} and can be passed a {@link DataBead} + * the method @link {@link #play(UGen, Map)} and can be passed a {@link DataBead} * which can contain additional classes for controlling the event after it has been * triggered. The SoundEvent also gets passed a {@link UGen} which it should connect to. * It should also return the {@link UGen} which is its root, so that callers of the diff --git a/src/beads_main/net/beadsproject/beads/events/SoundEventManager.java b/src/beads_main/java/net/beadsproject/beads/events/SoundEventManager.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/events/SoundEventManager.java rename to src/beads_main/java/net/beadsproject/beads/events/SoundEventManager.java diff --git a/src/beads_main/net/beadsproject/beads/events/StartTrigger.java b/src/beads_main/java/net/beadsproject/beads/events/StartTrigger.java similarity index 100% rename from src/beads_main/net/beadsproject/beads/events/StartTrigger.java rename to src/beads_main/java/net/beadsproject/beads/events/StartTrigger.java diff --git a/src/beads_main/java/net/beadsproject/beads/events/package.html b/src/beads_main/java/net/beadsproject/beads/events/package.html new file mode 100644 index 0000000..12cf842 --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/events/package.html @@ -0,0 +1,7 @@ + + + + + Provides classes for handling events. + + \ No newline at end of file diff --git a/src/beads_main/net/beadsproject/beads/ugens/ADSR.java b/src/beads_main/java/net/beadsproject/beads/ugens/ADSR.java similarity index 65% rename from src/beads_main/net/beadsproject/beads/ugens/ADSR.java rename to src/beads_main/java/net/beadsproject/beads/ugens/ADSR.java index b63a8b0..b09d37e 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/ADSR.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/ADSR.java @@ -26,6 +26,15 @@ public ADSR(AudioContext context, UGen src, float... adsr) { addInput(src); } + /** + * Create an ADSR with the given {@link UGen} as input. The array of float arguments should consist of a series of pairs [x,t] where x is the destination value and t is the time to destination, finishing with a single time value to zero. For example the array 1, 0, 1000 would give you an instant attack to 1, followed by a 1s decay to zero. The array 1, 500, 1000 would give you a ramp up from 0 to 1 over 500ms followed by a 1s decay to zero. An array with an even number of elements is incorrectly formed, but as a rule, the final value in the array will always dictate the decay time to zero. This object will self-destruct once the envelope has completed. The number of channels of this {@link UGen} is dictated by the number of channels of the src {@link UGen}. + * @param src the source UGen, which is plugged into this ADSR {@link UGen}. + * @param adsr the adsr parameters. + */ + public ADSR(UGen src, float... adsr) { + this(getDefaultContext(), src, adsr); + } + /** * Create an ADSR with the given number of channels. The array of float arguments should consist of a series of pairs [x,t] where x is the destination value and t is the time to destination, finishing with a single time value to zero. For example the array 1, 0, 1000 would give you an instant attack to 1, followed by a 1s decay to zero. The array 1, 500, 1000 would give you a ramp up from 0 to 1 over 500ms followed by a 1s decay to zero. An array with an even number of elements is incorrectly formed, but as a rule, the final value in the array will always dictate the decay time to zero. This object will self-destruct once the envelope has completed. * @param context the {@link AudioContext}. @@ -42,6 +51,16 @@ public ADSR(AudioContext context, int inouts, float... adsr) { env.addSegment(0, adsr[adsr.length - 1], new KillTrigger(this)); } + /** + * Create an ADSR with the given number of channels. The array of float arguments should consist of a series of pairs [x,t] where x is the destination value and t is the time to destination, finishing with a single time value to zero. For example the array 1, 0, 1000 would give you an instant attack to 1, followed by a 1s decay to zero. The array 1, 500, 1000 would give you a ramp up from 0 to 1 over 500ms followed by a 1s decay to zero. An array with an even number of elements is incorrectly formed, but as a rule, the final value in the array will always dictate the decay time to zero. This object will self-destruct once the envelope has completed. + * @param inouts the number of channels. + * @param adsr the adsr parameters. + */ + public ADSR(int inouts, float... adsr) { + this(getDefaultContext(), inouts, adsr); + } + + public void calculateBuffer() { env.update(); gain.update(); diff --git a/src/beads_main/net/beadsproject/beads/ugens/Add.java b/src/beads_main/java/net/beadsproject/beads/ugens/Add.java similarity index 78% rename from src/beads_main/net/beadsproject/beads/ugens/Add.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Add.java index d6918bf..80cf6b4 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Add.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Add.java @@ -9,8 +9,7 @@ /** * Takes an incoming signal (or signals in the multi-channel case) and adds * something (either a float value or another signal) to it (them). - * - * @beads.category utilities + * * @author ollie * @author Benito Crawford * @version 0.9.5 @@ -35,6 +34,20 @@ public Add(AudioContext context, int channels, UGen adderUGen) { super(context, channels, channels); setAdder(adderUGen); } + + /** + * Constructor for an Add object that sets a UGen to control the value to + * add. + * + * @param channels + * The number of channels. + * @param adderUGen + * The adder UGen controller. + */ + public Add(int channels, UGen adderUGen) { + this(getDefaultContext(), channels, adderUGen); + } + /** * Constructor for an Add object with a given UGen as input and another as adder. * i.e., use this as quickest way to add two UGens together. @@ -49,9 +62,20 @@ public Add(AudioContext context, UGen input, UGen adderUGen) { addInput(input); } + /** + * Constructor for an Add object with a given UGen as input and another as adder. + * i.e., use this as quickest way to add two UGens together. + * + * @param input the input UGen. + * @param adderUGen the adder UGen. + */ + public Add(UGen input, UGen adderUGen) { + this(getDefaultContext(), input, adderUGen); + } + /** * Constructor for an Add object that sets a static adder value. - * + * * @param context * The audio context. * @param channels @@ -64,6 +88,18 @@ public Add(AudioContext context, int channels, float adder) { setAdder(adder); } + /** + * Constructor for an Add object that sets a static adder value. + * + * @param channels + * The number of channels. + * @param adder + * The value to add. + */ + public Add(int channels, float adder) { + this(getDefaultContext(), channels, adder); + } + /* * (non-Javadoc) * diff --git a/src/beads_main/net/beadsproject/beads/ugens/AllpassFilter.java b/src/beads_main/java/net/beadsproject/beads/ugens/AllpassFilter.java similarity index 80% rename from src/beads_main/net/beadsproject/beads/ugens/AllpassFilter.java rename to src/beads_main/java/net/beadsproject/beads/ugens/AllpassFilter.java index 6df8e9d..23d6bdf 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/AllpassFilter.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/AllpassFilter.java @@ -14,8 +14,7 @@ * formula: Y(n) = X(n-d) + g * (Y(n-d) - X(n)), * * for delay time d and factor g. - * - * @beads.category filter + * * @author Benito Crawford * @version 0.9.5 */ @@ -44,6 +43,20 @@ public AllpassFilter(AudioContext context, int maxdel, int idel, float ig) { setDelay(idel).setG(ig); } + /** + * Constructor with delay and g specified by floats. + * + * @param maxdel + * The maximum delay in samples; cannot be changed. + * @param idel + * The initial delay in samples. + * @param ig + * The initial g parameter. + */ + public AllpassFilter(int maxdel, int idel, float ig) { + this(getDefaultContext(), maxdel, idel, ig); + } + /** * Constructor with delay specified by a UGen and g specified by a float. * @@ -61,9 +74,23 @@ public AllpassFilter(AudioContext context, int maxdel, UGen idel, float ig) { setDelay(idel).setG(ig); } + /** + * Constructor with delay specified by a UGen and g specified by a float. + * + * @param maxdel + * The maximum delay in samples; cannot be changed. + * @param idel + * The delay UGen. + * @param ig + * The initial g parameter. + */ + public AllpassFilter(int maxdel, UGen idel, float ig) { + this(getDefaultContext(), maxdel, idel, ig); + } + /** * Constructor with delay specified by a float and g specified by a UGen. - * + * * @param context * The AudioContext. * @param maxdel @@ -78,9 +105,23 @@ public AllpassFilter(AudioContext context, int maxdel, int idel, UGen ig) { setDelay(idel).setG(ig); } + /** + * Constructor with delay specified by a float and g specified by a UGen. + * + * @param maxdel + * The maximum delay in samples; cannot be changed. + * @param idel + * The initial delay in samples. + * @param ig + * The g UGen. + */ + public AllpassFilter(int maxdel, int idel, UGen ig) { + this(getDefaultContext(), maxdel, idel, ig); + } + /** * Constructor with delay and g specified by UGens. - * + * * @param context * The AudioContext. * @param maxdel @@ -95,6 +136,21 @@ public AllpassFilter(AudioContext context, int maxdel, UGen idel, UGen ig) { setDelay(idel).setG(ig); } + /** + * Constructor with delay and g specified by UGens. + * + * @param maxdel + * The maximum delay in samples; cannot be changed. + * @param idel + * The delay UGen. + * @param ig + * The g UGen. + */ + public AllpassFilter(int maxdel, UGen idel, UGen ig) { + this(getDefaultContext(), maxdel, idel, ig); + } + + private AllpassFilter(AudioContext context, int maxdel) { super(context, 1, 1); maxDelay = Math.max(maxdel, 1); @@ -145,7 +201,7 @@ public void calculateBuffer() { /** * Gets the current g parameter. - * + * * @return The g parameter. */ public float getG() { @@ -154,7 +210,7 @@ public float getG() { /** * Sets the g parameter. This clears the g UGen if there is one. - * + * * @param g * The g parameter. * @return This filter instance. @@ -172,7 +228,7 @@ public AllpassFilter setG(float g) { /** * Sets a UGen to determine the g value. - * + * * @param g * The g UGen. * @return This filter instance. @@ -191,7 +247,7 @@ public AllpassFilter setG(UGen g) { /** * Gets the g UGen, if there is one. - * + * * @return The g UGen. */ public UGen getGUGen() { @@ -204,7 +260,7 @@ public UGen getGUGen() { /** * Gets the current delay in samples. - * + * * @return The delay in samples. */ public int getDelay() { @@ -213,7 +269,7 @@ public int getDelay() { /** * Sets the delay. - * + * * @param del * The delay in samples. This will remove the delay UGen if there * is one. @@ -239,7 +295,7 @@ public AllpassFilter setDelay(int del) { /** * Sets a UGen to determine the delay in samples. Delay times are converted * to integers. Passing a null value freezes the delay at its current value. - * + * * @param del * The delay UGen. * @return This filter instance. @@ -262,7 +318,7 @@ public AllpassFilter setDelay(UGen del) { /** * Gets the delay UGen, if there is one. - * + * * @return The delay UGen. */ public UGen getDelayUGen() { @@ -282,7 +338,7 @@ public UGen getDelayUGen() { *

  • "delay": (float or UGen)
  • *
  • "g": (float or UGen)
  • * - * + * * @param paramBead * The DataBead specifying parameters. * @return This filter instance. @@ -320,7 +376,7 @@ public void messageReceived(Bead message) { /** * Gets a DataBead with properties "delay" and "g" set to the corresponding * filter parameters. - * + * * @return The parameter DataBead. */ public DataBead getParams() { @@ -343,7 +399,7 @@ public DataBead getParams() { /** * Gets a DataBead with properties "delay" and "g" set to static float * values corresponding to the current filter parameters. - * + * * @return The static parameter DataBead. */ public DataBead getStaticParams() { @@ -355,7 +411,7 @@ public DataBead getStaticParams() { /** * Sets the filter's parameters with a DataBead. - * + * * @return This filter instance. * @see #setParams(DataBead) */ diff --git a/src/beads_main/net/beadsproject/beads/ugens/BiquadCustomCoeffCalculator.java b/src/beads_main/java/net/beadsproject/beads/ugens/BiquadCustomCoeffCalculator.java similarity index 95% rename from src/beads_main/net/beadsproject/beads/ugens/BiquadCustomCoeffCalculator.java rename to src/beads_main/java/net/beadsproject/beads/ugens/BiquadCustomCoeffCalculator.java index 2796f6d..a96936a 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/BiquadCustomCoeffCalculator.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/BiquadCustomCoeffCalculator.java @@ -16,8 +16,7 @@ * according to the input parameters freq, q, and gain, as well as the useful * class variables {@link #sampFreq} and {@link #two_pi_over_sf}. *

    - * - * @beads.category filter + * * @author Benito Crawford * @version .9.1 */ diff --git a/src/beads_main/net/beadsproject/beads/ugens/BiquadFilter.java b/src/beads_main/java/net/beadsproject/beads/ugens/BiquadFilter.java similarity index 87% rename from src/beads_main/net/beadsproject/beads/ugens/BiquadFilter.java rename to src/beads_main/java/net/beadsproject/beads/ugens/BiquadFilter.java index 229a9b3..c76f586 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/BiquadFilter.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/BiquadFilter.java @@ -30,8 +30,7 @@ *

    * BiquadFilterMulti can also implement a user-defined filter algorithm by * calling {@link #setCustomType(CustomCoeffCalculator)}. - * - * @beads.category filter + * * @author Benito Crawford * @version 0.9.6 */ @@ -178,6 +177,17 @@ public BiquadFilter(AudioContext context, int channels) { this(context, channels, LP); } + /** + * Constructor for a multi-channel low-pass biquad filter UGen with the + * specified number of channels. + * + * @param channels + * The number of channels. + */ + public BiquadFilter(int channels) { + this(getDefaultContext(), channels); + } + /** * Constructor for a multi-channel biquad filter UGen of specified type with * the specified number of channels. See {@link #setType(int) setType} for a @@ -205,6 +215,21 @@ public BiquadFilter(AudioContext context, int channels, Type itype) { setFrequency(freq).setQ(q).setGain(gain); } + /** + * Constructor for a multi-channel biquad filter UGen of specified type with + * the specified number of channels. See {@link #setType(int) setType} for a + * list of supported filter types. + * + * @param channels + * The number of channels. + * @param itype + * The initial filter type, e.g. {@link #LP}, {@link #HP}, + * {@link #BP_SKIRT}, etc. + */ + public BiquadFilter(int channels, Type itype) { + this(getDefaultContext(), channels, itype); + } + /** * Constructor for a multi-channel biquad filter UGen with the specified * number of channels and parameters specified by a DataBead. @@ -222,6 +247,20 @@ public BiquadFilter(AudioContext context, int channels, DataBead params) { setParams(params); } + /** + * Constructor for a multi-channel biquad filter UGen with the specified + * number of channels and parameters specified by a DataBead. + * + * @param channels + * The number of channels. + * @param params + * A DataBead specifying parameter values; see + * {@link #setParams(DataBead)}. + */ + public BiquadFilter(int channels, DataBead params) { + this(getDefaultContext(), channels, params); + } + /** * Constructor for a multi-channel biquad filter UGen of specified type, * with the specified number of channels, and with parameters specified by a @@ -244,6 +283,26 @@ public BiquadFilter(AudioContext context, int channels, Type itype, setParams(params); } + /** + * Constructor for a multi-channel biquad filter UGen of specified type, + * with the specified number of channels, and with parameters specified by a + * DataBead. + * + * @param channels + * The number of channels. + * @param itype + * The initial filter type, e.g. {@link #LP}, {@link #HP}, + * {@link #BP_SKIRT}, etc. + * @param params + * A DataBead specifying parameter values; see + * {@link #setParams(DataBead)}. + */ + public BiquadFilter(int channels, Type itype, + DataBead params) { + + this(getDefaultContext(), channels, itype, params); + } + /** * Constructor for frequency and Q as floats. See {@link #setType(int) * setType} for a list of supported filter types. @@ -264,6 +323,24 @@ public BiquadFilter(AudioContext context, Type itype, float ifreq, setFrequency(ifreq).setQ(iqval); } + /** + * Constructor for frequency and Q as floats. See {@link #setType(int) + * setType} for a list of supported filter types. + * + * @param itype + * The initial filter type, e.g. {@link #LP}, {@link #HP}, + * {@link #BP_SKIRT}, etc. + * @param ifreq + * The initial frequency. + * @param iqval + * The initial Q-value. + */ + public BiquadFilter(Type itype, float ifreq, + float iqval) { + + this(getDefaultContext(), itype, ifreq, iqval); + } + /** * Constructor for frequency as a UGen and Q as a float. See * {@link #setType(int) setType} for a list of supported filter types. @@ -283,6 +360,22 @@ public BiquadFilter(AudioContext context, Type itype, UGen ifreq, float iqval) { setFrequency(ifreq).setQ(iqval); } + /** + * Constructor for frequency as a UGen and Q as a float. See + * {@link #setType(int) setType} for a list of supported filter types. + * + * @param itype + * The initial filter type, {@link #LP}, {@link #HP}, + * {@link #BP_SKIRT}, etc. + * @param ifreq + * The frequency UGen. + * @param iqval + * The initial Q-value. + */ + public BiquadFilter(Type itype, UGen ifreq, float iqval) { + this(getDefaultContext(), itype, ifreq, iqval); + } + /** * Constructor for frequency as a float and Q as a UGen. See * {@link #setType(int) setType} for a list of supported filter types. @@ -302,6 +395,22 @@ public BiquadFilter(AudioContext context, Type itype, float ifreq, UGen iqval) { setFrequency(ifreq).setQ(iqval); } + /** + * Constructor for frequency as a float and Q as a UGen. See + * {@link #setType(int) setType} for a list of supported filter types. + * + * @param itype + * The initial filter type, e.g. {@link #LP}, {@link #HP}, + * {@link #BP_SKIRT}, etc. + * @param ifreq + * The initial frequency. + * @param iqval + * The Q-value UGen. + */ + public BiquadFilter(Type itype, float ifreq, UGen iqval) { + this(getDefaultContext(), itype, ifreq, iqval); + } + /** * Constructor for frequency and Q as UGens. See {@link #setType(int) * setType} for a list of supported filter types. @@ -321,6 +430,22 @@ public BiquadFilter(AudioContext context, Type itype, UGen ifreq, UGen iqval) { setFrequency(ifreq).setQ(iqval); } + /** + * Constructor for frequency and Q as UGens. See {@link #setType(int) + * setType} for a list of supported filter types. + * + * @param itype + * The initial filter type, e.g. {@link #LP}, {@link #HP}, + * {@link #BP_SKIRT}, etc. + * @param ifreq + * The frequency UGen. + * @param iqval + * The Q-value UGen. + */ + public BiquadFilter(Type itype, UGen ifreq, UGen iqval) { + this(getDefaultContext(), itype, ifreq, iqval); + } + private void checkStaticStatus() { if (isFreqStatic && isQStatic && isGainStatic) { areAllStatic = true; diff --git a/src/beads_main/net/beadsproject/beads/ugens/Change.java b/src/beads_main/java/net/beadsproject/beads/ugens/Change.java similarity index 83% rename from src/beads_main/net/beadsproject/beads/ugens/Change.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Change.java index ece26bb..45f689a 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Change.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Change.java @@ -11,8 +11,7 @@ /** * Outputs 1 if the input signal is increasing; -1 if it is decreasing; 0 if it * is the same. Use {@link Delta} to find how much a signal is changing. - * - * @beads.category lowlevel + * * @author Benito Crawford * @version 0.9.5 */ @@ -31,6 +30,14 @@ public Change(AudioContext context) { super(context, 1, 1); } + /** + * Bare constructor. + */ + public Change() { + + this(getDefaultContext()); + } + /** * Constructor for a given input UGen. * @@ -44,6 +51,16 @@ public Change(AudioContext context, UGen ugen) { addInput(0, ugen, 0); } + /** + * Constructor for a given input UGen. + * + * @param ugen + * The input UGen. + */ + public Change(UGen ugen) { + this(getDefaultContext(), ugen); + } + @Override public void calculateBuffer() { diff --git a/src/beads_main/net/beadsproject/beads/ugens/Clicker.java b/src/beads_main/java/net/beadsproject/beads/ugens/Clicker.java similarity index 83% rename from src/beads_main/net/beadsproject/beads/ugens/Clicker.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Clicker.java index 5ce8da1..554e864 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Clicker.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Clicker.java @@ -9,7 +9,6 @@ /** * A very simple {@link UGen} that generates one click and then kills itself. * - * @beads.category synth * @author ollie */ public class Clicker extends UGen { @@ -30,6 +29,15 @@ public Clicker(AudioContext context, float strength) { done = false; } + /** + * Instantiates a new Clicker. + * + * @param strength the volume of the click (max = 1). + */ + public Clicker(float strength) { + this(getDefaultContext(), strength); + } + /* (non-Javadoc) * @see com.olliebown.beads.core.UGen#calculateBuffer() */ diff --git a/src/beads_main/net/beadsproject/beads/ugens/Clip.java b/src/beads_main/java/net/beadsproject/beads/ugens/Clip.java similarity index 91% rename from src/beads_main/net/beadsproject/beads/ugens/Clip.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Clip.java index 6b366e1..6deb9cc 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Clip.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Clip.java @@ -12,8 +12,7 @@ * Clip constrains a signal within a range. The range may be defined either by * static values, or by UGens. Use {@link RangeLimiter} to strictly (and more * efficiently) constrain a signal in the range [-1,1]. - * - * @beads.category lowlevel + * * @author Benito Crawford * @version 0.9.5 * @@ -47,6 +46,17 @@ public Clip(AudioContext context, int channels) { setRange(-1, 1); } + /** + * Constructor for a new Clip with the specified number of channels. + * + * @param channels + * The number of channels. + */ + public Clip(int channels) { + + this(getDefaultContext(), channels); + } + @Override public void calculateBuffer() { if (isMinStatic && isMaxStatic) { diff --git a/src/beads_main/net/beadsproject/beads/ugens/Clock.java b/src/beads_main/java/net/beadsproject/beads/ugens/Clock.java similarity index 88% rename from src/beads_main/net/beadsproject/beads/ugens/Clock.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Clock.java index 0adde5f..4f51caa 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Clock.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Clock.java @@ -14,7 +14,6 @@ /** * A sample rate Clock. A Clock generates timing data at two levels: ticks and beats. It notifies an {@link BeadArray} of listeners at each tick. These listeners can query the Clock to find out the current tick count, if it is on a beat, and the current beat count. The rate of ticking of the Clock is controlled by an interval envelope. * - * @beads.category control * @author ollie */ public class Clock extends UGen implements IntegerBead { @@ -40,7 +39,7 @@ public class Clock extends UGen implements IntegerBead { /** The strength (gain) of the audible click. */ private float clickStrength; - /** Used so that other objects can discover what */ + /** Used so that other objects can discover what the tick times were from the last buffer update. */ private double[] subticks; /** @@ -51,7 +50,15 @@ public class Clock extends UGen implements IntegerBead { public Clock(AudioContext context) { this(context, 1000.0f); } - + + /** + * Instantiates a new Clock with a static interval of 1000ms. + */ + public Clock() { + + this(getDefaultContext()); + } + /** * Instantiates a new Clock with the given static interval in milliseconds. * @@ -62,7 +69,21 @@ public Clock(AudioContext context, float interval) { this(context, new Static(context, interval)); ticksPerBeat = 16; } - + + /** + * Instantiates a new Clock with the given static interval in milliseconds. + * @param interval the interval in milliseconds. + */ + public Clock(float interval) { + + this(getDefaultContext(), interval); + + if (getDefaultContext() != null) + { + getDefaultContext().out.addDependent(this); + } + } + /** * Instantiates a new Clock with the given interval envelope. * @@ -78,7 +99,21 @@ public Clock(AudioContext context, UGen env) { clickStrength = 0.1f; subticks = new double[context.getBufferSize()]; } - + + /** + * Instantiates a new Clock with the given interval envelope. + * + * @param env the interval envelope. + */ + public Clock(UGen env) { + this(getDefaultContext(), env); + + if (getDefaultContext() != null) + { + getDefaultContext().out.addDependent(this); + } + } + /** * Checks if the Clock is set to make an audible click. * @@ -87,7 +122,7 @@ public Clock(AudioContext context, UGen env) { public boolean isClicking() { return click; } - + /** * Starts/stops the audible click. * @@ -129,8 +164,7 @@ public ArrayList getMessageListeners() { */ public void reset() { point = 0.0f; - count = -1; //OLLIE - hack to get the first tick to be a beat -// tick(); //OLLIE - this must be pointless, if we haven't connect the clock to anything + count = -1; } /** @@ -156,8 +190,8 @@ public void setIntervalEnvelope(UGen intervalEnvelope) { * Gets the interval envelope. * * @return the interval envelope. - * * @deprecated + * */ public UGen getIntervalEnvelope() { return intervalEnvelope; diff --git a/src/beads_main/net/beadsproject/beads/ugens/CombFilter.java b/src/beads_main/java/net/beadsproject/beads/ugens/CombFilter.java similarity index 93% rename from src/beads_main/net/beadsproject/beads/ugens/CombFilter.java rename to src/beads_main/java/net/beadsproject/beads/ugens/CombFilter.java index 61952e3..a19b210 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/CombFilter.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/CombFilter.java @@ -15,8 +15,7 @@ * components. *

    * y(n) = a * x(n) + g * x(n - d) - h * y(n - d) - * - * @beads.category filter + * * @author Benito Crawford * @version 0.9.1 */ @@ -47,6 +46,16 @@ public CombFilter(AudioContext con, int maxdel) { setA(a).setG(g).setH(h).setDelay(1); } + /** + * Constructor. + * + * @param maxdel + * The maximum delay in samples. + */ + public CombFilter(int maxdel) { + this(getDefaultContext(), maxdel); + } + private void checkStaticStatus() { if (isAStatic && isGStatic && isGStatic && isDelayStatic) { areAllStatic = true; diff --git a/src/beads_main/net/beadsproject/beads/ugens/Compressor.java b/src/beads_main/java/net/beadsproject/beads/ugens/Compressor.java similarity index 82% rename from src/beads_main/net/beadsproject/beads/ugens/Compressor.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Compressor.java index d6c033c..b19dd13 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Compressor.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Compressor.java @@ -15,7 +15,7 @@ * The amount of compression can also be controlled by an alternate side-chain. *

    * The following are the default parameter values: - *

    + *

    *
      *
    • {@link #setThreshold(float) threshold} - .5
    • *
    • {@link #setAttack(float) attack} - 1
    • @@ -24,8 +24,7 @@ *
    • {@link #setRatio(float) ratio} - 2
    • *
    • {@link #setSideChain(UGen) side-chain} - the input audio
    • *
    - * - * @beads.category dynamics + * * @author Benito Crawford * @version 0.9.5 */ @@ -57,6 +56,15 @@ public Compressor(AudioContext context) { this(context, 1); } + /** + * Constructor for a 1-channel compressor with no look-ahead time and other + * parameters set to their default values. + * + */ + public Compressor() { + this(getDefaultContext()); + } + /** * Constructor for a multi-channel compressor with no look-ahead time and * other parameters set to their default values. @@ -70,6 +78,17 @@ public Compressor(AudioContext context, int channels) { this(context, channels, 0, null); } + /** + * Constructor for a multi-channel compressor with no look-ahead time and + * other parameters set to their default values. + * + * @param channels + * The number of channels. + */ + public Compressor(int channels){ + this(getDefaultContext(), channels); + } + /** * Constructor for a multi-channel compressor with the specified side-chain, * no look-ahead time, and other parameters set to their default values. @@ -85,6 +104,19 @@ public Compressor(AudioContext context, int channels, UGen sideChain) { this(context, channels, 0, sideChain); } + /** + * Constructor for a multi-channel compressor with the specified side-chain, + * no look-ahead time, and other parameters set to their default values. + * + * @param channels + * The number of channels. + * @param sideChain + * The UGen to use as the side-chain. + */ + public Compressor( int channels, UGen sideChain){ + this(getDefaultContext(), channels, sideChain); + } + /** * Constructor for a multi-channel compressor with the specified look-ahead * time and other parameters set to their default values. @@ -100,6 +132,18 @@ public Compressor(AudioContext context, int channels, float lookAheadDelay) { this(context, channels, lookAheadDelay, null); } + /** + * Constructor for a multi-channel compressor with the specified look-ahead + * time and other parameters set to their default values. + * @param channels + * The number of channels. + * @param lookAheadDelay + * The look-ahead time in milliseconds. + */ + public Compressor(int channels, float lookAheadDelay) { + this(getDefaultContext(), channels, lookAheadDelay); + } + /** * Constructor for a multi-channel compressor with the specified look-ahead * time and side-chain, and other parameters set to their default values. @@ -141,6 +185,22 @@ public void calculateBuffer() { .setThreshold(.5f).setKnee(.5f); } + /** + * Constructor for a multi-channel compressor with the specified look-ahead + * time and side-chain, and other parameters set to their default values. + * @param channels + * The number of channels. + * @param lookAheadDelay + * The look-ahead time in milliseconds. + * @param sideChain + * The UGen to use as the side-chain. + */ + public Compressor(int channels, float lookAheadDelay, + UGen sideChain) { + + this(getDefaultContext(), channels, lookAheadDelay, sideChain); + } + @Override public void calculateBuffer() { diff --git a/src/beads_main/net/beadsproject/beads/ugens/CrossFade.java b/src/beads_main/java/net/beadsproject/beads/ugens/CrossFade.java similarity index 87% rename from src/beads_main/net/beadsproject/beads/ugens/CrossFade.java rename to src/beads_main/java/net/beadsproject/beads/ugens/CrossFade.java index 095ca0f..597d808 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/CrossFade.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/CrossFade.java @@ -9,8 +9,7 @@ * Note that UGen has it's own simpler crossFade method. * * TODO: non-linear fades. - * - * @beads.category utilities + * * @author ollie * */ @@ -34,7 +33,15 @@ public CrossFade(AudioContext context, int channels) { incoming = new Static(context, 0f); pauseAfterComplete = false; } - + + /** + * Create a new CrossFade with given number of channels. The CrossFade has no inputs + * since the input UGens are assigned in the method {@link #fadeTo(UGen, float)}. + * @param channels the number of output channels. + */ + public CrossFade(int channels) { + this(getDefaultContext(), channels); + } /** * Create a new CrossFade with given start UGen. @@ -46,7 +53,15 @@ public CrossFade(AudioContext context, UGen start) { incoming = start; pauseAfterComplete = false; } - + + /** + * Create a new CrossFade with given start UGen. + * @param start the UGen to start on. + */ + public CrossFade(UGen start) { + this(getDefaultContext(), start); + } + /** * Cross fades from the current UGen to the specified UGen the specified number of milliseconds. * @param target the new target UGen. diff --git a/src/beads_main/net/beadsproject/beads/ugens/CrossoverFilter.java b/src/beads_main/java/net/beadsproject/beads/ugens/CrossoverFilter.java similarity index 89% rename from src/beads_main/net/beadsproject/beads/ugens/CrossoverFilter.java rename to src/beads_main/java/net/beadsproject/beads/ugens/CrossoverFilter.java index b6a2e31..5086ff9 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/CrossoverFilter.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/CrossoverFilter.java @@ -13,20 +13,17 @@ * A multi-channel 4th-order Linkwitz-Riley crossover filter. For each input * channel, the filter outputs both a low-pass and a high-pass channel. If the * filter has two inputs, for example, then it will output four channels: - *

    *

      *
    • 0: Low-pass of input 0
    • *
    • 1: High-pass of input 0
    • *
    • 2: Low-pass of input 1
    • *
    • 3: High-pass of input 1
    • *
    - *

    * A key feature of Linkwitz-Riley filters is that the low- and high-pass bands * added together produce a flat frequency response, making them particularly * useful as crossover filters. A 4th-order version is equivalent to cascading * two identical 2nd-order Butterworth filters. - * - * @beads.category filter + * * @author Benito Crawford * @version 0.9.5 * @@ -70,6 +67,15 @@ public CrossoverFilter(AudioContext context) { this(context, 1, 800); } + /** + * Constructor for a one-channel crossover filter, initialized with a cutoff + * frequency of 800Hz. + * + */ + public CrossoverFilter() { + this(getDefaultContext()); + } + /** * Constructor for a crossover filter with the specified number of channels, * initialized with a cutoff frequency of 800Hz. @@ -83,6 +89,17 @@ public CrossoverFilter(AudioContext context, int channels) { this(context, channels, 800); } + /** + * Constructor for a crossover filter with the specified number of channels, + * initialized with a cutoff frequency of 800Hz. + * + * @param channels + * The number of channels. + */ + public CrossoverFilter(int channels) { + this(getDefaultContext(), channels); + } + /** * Constructor for a crossover filter with the specified number of channels, * set at the specified frequency. @@ -109,6 +126,19 @@ public CrossoverFilter(AudioContext context, int channels, float freq) { setFrequency(freq); } + /** + * Constructor for a crossover filter with the specified number of channels, + * set at the specified frequency. + * + * @param channels + * The number of channels. + * @param freq + * The initial cutoff frequency. + */ + public CrossoverFilter(int channels, float freq) { + this(getDefaultContext(), channels, freq); + } + @Override public void calculateBuffer() { diff --git a/src/beads_main/net/beadsproject/beads/ugens/DelayData.java b/src/beads_main/java/net/beadsproject/beads/ugens/DelayData.java similarity index 78% rename from src/beads_main/net/beadsproject/beads/ugens/DelayData.java rename to src/beads_main/java/net/beadsproject/beads/ugens/DelayData.java index 95c97ff..25f62e0 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/DelayData.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/DelayData.java @@ -41,6 +41,22 @@ public DelayData(AudioContext context, double delay, this.dataBead = db; } + /** + * Instantiates a new DelayMessage with the specified millisecond delay, + * receiver, and DataBead message. + * + * @param delay + * The delay time in milliseconds. + * @param receiver + * The DataBead receiver. + * @param db + * The DataBead to send. + */ + public DelayData(double delay, + DataBeadReceiver receiver, DataBead db) { + this(getDefaultContext(), delay, receiver, db); + } + @Override public void trigger() { if (receiver != null) { @@ -82,7 +98,7 @@ public DataBead getData() { /** * Sets the message to send when the DelayData fires. * - * @param dataBead + * @param db * The DataBead to be sent. * @return This DelayData instance. */ diff --git a/src/beads_main/net/beadsproject/beads/ugens/DelayEvent.java b/src/beads_main/java/net/beadsproject/beads/ugens/DelayEvent.java similarity index 77% rename from src/beads_main/net/beadsproject/beads/ugens/DelayEvent.java rename to src/beads_main/java/net/beadsproject/beads/ugens/DelayEvent.java index 306866a..6105051 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/DelayEvent.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/DelayEvent.java @@ -36,13 +36,23 @@ public abstract class DelayEvent extends UGen { * The audio context. * @param delay * The delay time in milliseconds. - * @param receiver - * The receiver. */ public DelayEvent(AudioContext context, double delay) { this(context, delay, false); } + /** + * Instantiates a new DelayEvent with the specified millisecond delay and + * receiver. By default, the object will be triggered at the beginning of + * the frame in which the delay time expires. + * + * @param delay + * The delay time in milliseconds. + */ + public DelayEvent(double delay){ + this(getDefaultContext(), delay); + } + /** * Instantiates a new DelayEvent with the specified millisecond delay and * receiver. triggerAfter indicates whether the object is @@ -53,8 +63,6 @@ public DelayEvent(AudioContext context, double delay) { * The audio context. * @param delay * The delay in milliseconds. - * @param receiver - * The receiver. * @param triggerAfter * Whether the object fires just before or just after the delay * time expires. @@ -68,6 +76,23 @@ public DelayEvent(AudioContext context, double delay, boolean triggerAfter) { triggeredAfter(triggerAfter); } + /** + * Instantiates a new DelayEvent with the specified millisecond delay and + * receiver. triggerAfter indicates whether the object is + * triggered at the beginning of the frame in which the delay time elapses ( + * false), or after (true). + * + * @param delay + * The delay in milliseconds. + * @param triggerAfter + * Whether the object fires just before or just after the delay + * time expires. + */ + public DelayEvent(double delay, boolean triggerAfter) { + this(getDefaultContext(), delay, triggerAfter); + + } + /** * Reset timer to zero. */ diff --git a/src/beads_main/net/beadsproject/beads/ugens/DelayTrigger.java b/src/beads_main/java/net/beadsproject/beads/ugens/DelayTrigger.java similarity index 76% rename from src/beads_main/net/beadsproject/beads/ugens/DelayTrigger.java rename to src/beads_main/java/net/beadsproject/beads/ugens/DelayTrigger.java index 113e2d7..dbb0964 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/DelayTrigger.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/DelayTrigger.java @@ -5,8 +5,7 @@ /** * A DelayTrigger waits for a specified duration and then notifies a receiver. - * - * @beads.category utilities + * * @author ollie * @author Benito Crawford * @version 0.9.5 @@ -37,6 +36,19 @@ public DelayTrigger(AudioContext context, double delay, Bead receiver) { this.message = this; } + /** + * Instantiates a new DelayTrigger with the specified millisecond delay and + * receiver. By default, a DelayTrigger object will send itself as the + * message. + * @param delay + * the delay in milliseconds. + * @param receiver + * the receiver. + */ + public DelayTrigger(double delay, Bead receiver) { + this(getDefaultContext(), delay, receiver); + } + /** * Instantiates a new DelayTrigger with the specified millisecond delay, * receiver, and message. @@ -55,6 +67,21 @@ public DelayTrigger(AudioContext context, double delay, Bead receiver, this.message = message; } + /** + * Instantiates a new DelayTrigger with the specified millisecond delay, + * receiver, and message. + * + * @param delay + * The delay in milliseconds. + * @param receiver + * The receiver. + */ + public DelayTrigger(double delay, Bead receiver, + Bead message) { + + this(getDefaultContext(), delay, receiver, message); + } + @Override public void trigger() { if (receiver != null) { diff --git a/src/beads_main/net/beadsproject/beads/ugens/Delta.java b/src/beads_main/java/net/beadsproject/beads/ugens/Delta.java similarity index 76% rename from src/beads_main/net/beadsproject/beads/ugens/Delta.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Delta.java index 9b7811c..ee1dbad 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Delta.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Delta.java @@ -8,8 +8,7 @@ /** * Outputs the change in the input signal from the previous sample to the current one. - * - * @beads.category lowlevel + * * @author Benito Crawford * @version 0.9 */ @@ -27,6 +26,14 @@ public Delta(AudioContext context) { super(context, 1, 1); } + /** + * Bare constructor. + * + */ + public Delta() { + this(getDefaultContext()); + } + /** * Constructor for a given input UGen. * @@ -40,6 +47,16 @@ public Delta(AudioContext context, UGen ugen) { addInput(0, ugen, 0); } + /** + * Constructor for a given input UGen. + * + * @param ugen + * The input UGen. + */ + public Delta(UGen ugen) { + this(getDefaultContext(), ugen); + } + @Override public void calculateBuffer() { diff --git a/src/beads_main/net/beadsproject/beads/ugens/Drain.java b/src/beads_main/java/net/beadsproject/beads/ugens/Drain.java similarity index 92% rename from src/beads_main/net/beadsproject/beads/ugens/Drain.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Drain.java index bb1ca32..6bf40e1 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Drain.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Drain.java @@ -40,7 +40,15 @@ public Drain(AudioContext context, int outs) { super(context, outs); grains = new LinkedList(); } - + + /** + * Instantiates a new Drain. + * + * @param outs the number of output channels. + */ + public Drain( int outs){ + this(getDefaultContext(), outs); + } /** * Adds a new grain of audio data. * diff --git a/src/beads_main/net/beadsproject/beads/ugens/Envelope.java b/src/beads_main/java/net/beadsproject/beads/ugens/Envelope.java similarity index 96% rename from src/beads_main/net/beadsproject/beads/ugens/Envelope.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Envelope.java index 93cba85..afc7d43 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Envelope.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Envelope.java @@ -25,7 +25,6 @@ * can be used. The curve is defined as the mapping of the range [0,1] * from y=x to y=x^p with a given exponent p. * - * @beads.category control * @author ollie */ public class Envelope extends UGen { @@ -117,7 +116,15 @@ public Envelope(AudioContext context) { myBufOut = new float[bufferSize]; bufOut[0] = myBufOut; } - + + /** + * Instantiates a new Envelope with start value 0. + * + */ + public Envelope() { + this(getDefaultContext()); + } + /** * Instantiates a new Envelope with the specified start value. * @@ -130,6 +137,16 @@ public Envelope(AudioContext context, float value) { this(context); setValue(value); } + + /** + * Instantiates a new Envelope with the specified start value. + * + * @param value + * the start value. + */ + public Envelope(float value) { + this(getDefaultContext(), value); + } /** * Locks/unlocks the Envelope. diff --git a/src/beads_main/java/net/beadsproject/beads/ugens/FastGranularSamplePlayer.java b/src/beads_main/java/net/beadsproject/beads/ugens/FastGranularSamplePlayer.java new file mode 100644 index 0000000..95ad4b6 --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/ugens/FastGranularSamplePlayer.java @@ -0,0 +1,831 @@ +/* + * This file is part of Beads. See http://www.beadsproject.net for all information. + */ +package net.beadsproject.beads.ugens; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +import net.beadsproject.beads.core.AudioContext; +import net.beadsproject.beads.core.Bead; +import net.beadsproject.beads.core.UGen; +import net.beadsproject.beads.data.Buffer; +import net.beadsproject.beads.data.Sample; +import net.beadsproject.beads.data.SampleManager; +import net.beadsproject.beads.data.buffers.CosineWindow; + +/** + * FastGranularSamplePlayer functions exactly the same as {@link GranularSamplePlayer} but trades off variable automation functionality to reduce + * computational costs and allow for more instances to be run simultaneously. As with GranularSamplePlayer, it inherits its main behaviour + * from {@link SamplePlayer} but replaces the direct {@link Sample} lookup with a granular process. {@link UGen}s can be used to control + * playback rate, pitch, loop points, grain size, grain interval, grain randomness and position (this last case assumes that the playback + * rate is zero). + * + * @see SamplePlayer Sample + */ +public class FastGranularSamplePlayer extends SamplePlayer { + + /** The pitch envelope. */ + private UGen pitchEnvelope; + + /** The grain interval envelope. */ + private float grainIntervalEnvelope; + + /** The grain size envelope. */ + private float grainSizeEnvelope; + + /** The randomness envelope. */ + private float randomnessEnvelope; + + /** The time in milliseconds since the last grain was activated. */ + private float timeSinceLastGrain; + + /** The starting point of the loop as a float. */ + private float loopStart; + + /** The starting point of the loop as a float. */ + private float loopEnd; + + /** The length of one sample in milliseconds. */ + private double msPerSample; + + /** The pitch, bound to the pitch envelope. */ + protected float pitch; + + /** The list of current grains. */ + private LinkedList grains; + + /** A list of free grains. */ + private LinkedList freeGrains; + + /** The window used by grains. */ + private Buffer window; + + /** Flag to determine whether, looping occurs within individual grains. */ + private boolean loopInsideGrains; + + /** + * The nested class Grain. Stores information about the start time, current position, age, and grain size of the grain. + */ + private static class Grain { + + /** The position in millseconds. */ + double position; + + /** The age of the grain in milliseconds. */ + double age; + + /** The grain size of the grain. Fixed at instantiation. */ + double grainSize; + + /** The grain's position in the buffer */ + int bufferPointer; + } + + /** + * Instantiates a new GranularSamplePlayer. + * + * @param context the AudioContext. + * @param outs the number of outputs. + */ + public FastGranularSamplePlayer(AudioContext context, int outs) { + super(context, outs); + grains = new LinkedList(); + freeGrains = new LinkedList(); + pitchEnvelope = new Static(context, 1f); + setGrainInterval(new Static(context, 70.0f)); + setGrainSize(new Static(context, 100.0f)); + setRandomness(new Static(context, 0.0f)); + setWindow(new CosineWindow().getDefault()); + msPerSample = context.samplesToMs(1f); + loopInsideGrains = false; + } + + /** + * Instantiates a new GranularSamplePlayer. + * + * @param outs the number of outputs. + */ + public FastGranularSamplePlayer(int outs) { + this(getDefaultContext(), outs); + } + + /** + * Instantiates a new GranularSamplePlayer. + * + * @param context the AudioContext. + * @param buffer the Sample played by the GranularSamplePlayer. + */ + public FastGranularSamplePlayer(AudioContext context, Sample buffer) { + this(context, buffer.getNumChannels()); + setSample(buffer); + loopStart = 0.0f; + loopEnd = (float)buffer.getLength(); + } + + /** + * Instantiates a new GranularSamplePlayer. + * + * @param buffer the Sample played by the GranularSamplePlayer. + */ + public FastGranularSamplePlayer(Sample buffer) { + this(getDefaultContext(), buffer); + } + + /** + * Gets the rate envelope. + * + * @deprecated use {@link #getRateUGen()} instead. + * + * @return the rate envelope. + */ + @Deprecated + public UGen getRateEnvelope() { + return new Static(rate); + } + + /** + * Gets the rate value as a UGen. + * + * @return the rate UGen. + */ + public UGen getRateUGen() { + return new Static(rate); + } + + /** + * Sets the rate envelope. + * + * @deprecated use {@link #setRate(float)} instead. + * + * @param rateEnvelope + * the new rate envelope. + */ + @Deprecated + public void setRateEnvelope(UGen rateEnvelope) { + rateEnvelope.update(); + this.rate = rateEnvelope.getValue(); + } + + /** + * Sets the rate to the UGen's current value. + * For better performance, use {@link #setRate(float)} + * + * @param rateUGen + * the new rate UGen. + */ + public void setRate(UGen rateUGen) { + rateUGen.update(); + this.rate = rateUGen.getValue(); + } + + /** + * Sets the rate. + * + * @param rate + * the new rate. + */ + public void setRate(float rate) { + this.rate = rate; + } + + /** + * Gets the pitch envelope. + * + * @deprecated use {@link #getPitchUGen()}. + * @return the pitch envelope. + */ + @Deprecated + public UGen getPitchEnvelope() { + return pitchEnvelope; + } + + + /** + * Gets the pitch value as a UGen. + * + * @return the pitch UGen. + */ + public UGen getPitchUGen() { + return pitchEnvelope; + } + + /** + * Sets the pitch envelope. + * + * @deprecated Use {@link #setPitch(UGen)} instead. + * + * @param pitchEnvelope + * the new pitch envelope. + */ + @Deprecated + public void setPitchEnvelope(UGen pitchEnvelope) { + pitchEnvelope.update(); + this.pitchEnvelope = pitchEnvelope; + } + + /** + * Sets the pitch to the UGen's value. + * + * @param pitchUGen + * the new pitch Ugen. + */ + public void setPitch(UGen pitchUGen) { + pitchUGen.update(); + this.pitchEnvelope = pitchUGen; + } + + /** + * Gets the loop end envelope. + * + * @deprecated Use {@link #getLoopEndUGen()} instead. + * + * @return the loop end envelope. + */ + @Deprecated + public UGen getLoopEndEnvelope() { + return new Static(loopEnd); + } + + /** + * Gets the loop end value as a UGen. + * + * @return the loop end UGen. + */ + public UGen getLoopEndUGen() { + return new Static(loopEnd); + } + + /** + * Sets the loop end envelope. + * + * @deprecated Use {@link #setLoopEnd(float)} instead. + * + * @param loopEndEnvelope + * the new loop end envelope. + */ + @Deprecated + public void setLoopEndEnvelope(UGen loopEndEnvelope) { + loopEndEnvelope.update(); + this.loopEnd = loopEndEnvelope.getValue(); + } + + /** + * Sets the loop end to the UGen's value. + * For better performance, use {@link #setLoopEnd(float)} instead. + * + * @param loopEndUGen + * the new loop end UGen. + */ + public void setLoopEnd(UGen loopEndUGen) { + loopEndUGen.update(); + this.loopEnd = loopEndUGen.getValue(); + } + + /** + * Sets the loop end. + * + * @param loopEnd + * the new loop end. + */ + public void setLoopEnd(float loopEnd) { + this.loopEnd = loopEnd; + } + + /** + * Gets the loop start envelope. + * + * @deprecated Use {@link #getLoopStartUGen()} instead. + * @return the loop start envelope + */ + @Deprecated + public UGen getLoopStartEnvelope() { + return new Static(loopStart); + } + + /** + * Gets the loop start value as a UGen. + * + * @return the loop start UGen + */ + public UGen getLoopStartUGen() { + return new Static(loopStart); + } + + /** + * Sets the loop start envelope. + * + * @deprecated Use {@link #setLoopStart(float)} instead. + * + * @param loopStartEnvelope + * the new loop start envelope. + */ + @Deprecated + public void setLoopStartEnvelope(UGen loopStartEnvelope) { + loopStartEnvelope.update(); + this.loopStart = loopStartEnvelope.getValue(); + } + + /** + * Sets the loop start as the UGen's value. + * For better performance, use {@link #setLoopStart(float)} instead. + * + * @param loopStartUGen + * the new loop start UGen. + */ + public void setLoopStart(UGen loopStartUGen) { + loopStartUGen.update(); + this.loopStart = loopStartUGen.getValue(); + } + + /** + * Sets the loop start. + * + * @param loopStart + * the new loop start. + */ + public void setLoopStart(float loopStart) { + this.loopStart = loopStart; + } + + /** + * Sets both loop points to static values as fractions of the Sample length, + * overriding any UGens that were controlling the loop points. + * + * @param start + * the start value, as fraction of the Sample length. + * @param end + * the end value, as fraction of the Sample length. + */ + public void setLoopPointsFraction(float start, float end) { + loopStart = start * (float) sample.getLength(); + loopEnd = end * (float) sample.getLength(); + } + + /** + * Gets the grain interval envelope. + * + * @deprecated Use {@link #getGrainIntervalUGen()} instead. + * + * @return the grain interval envelope. + */ + @Deprecated + public UGen getGrainIntervalEnvelope() { + return new Static(grainIntervalEnvelope); + } + + /** + * Gets the grain interval as a UGen. + * + * @return the grain interval UGen. + */ + public UGen getGrainInterval() { + return new Static(grainIntervalEnvelope); + } + + /** + * Sets the grain interval envelope. + * + * @deprecated Use {@link #setGrainInterval(float)} instead. + * + * @param grainIntervalEnvelope + * the new grain interval envelope. + */ + @Deprecated + public void setGrainIntervalEnvelope(UGen grainIntervalEnvelope) { + grainIntervalEnvelope.update(); + this.grainIntervalEnvelope = grainIntervalEnvelope.getValue(); + } + + /** + * Sets the grain interval as the UGen's value. + * For better performance, use {@link #setGrainInterval(float)} instead. + * + * @param grainIntervalUGen + * the new grain interval UGen. + */ + public void setGrainInterval(UGen grainIntervalUGen) { + grainIntervalUGen.update(); + this.grainIntervalEnvelope = grainIntervalUGen.getValue(); + } + + /** + * Sets the grain interval. + * + * @param grainInterval + * the new grain interval. + */ + public void setGrainInterval(float grainInterval) { + this.grainIntervalEnvelope = grainInterval; + } + + /** + * Gets the grain size envelope. + * + * @deprecated Use {@link #getGrainSizeUGen()} instead. + * + * @return the grain size envelope. + */ + @Deprecated + public UGen getGrainSizeEnvelope() { + return new Static(grainSizeEnvelope); + } + + + /** + * Gets the grain size as a UGen. + * + * @return the grain size UGen. + */ + public UGen getGrainSize() { + return new Static(grainSizeEnvelope); + } + + /** + * Sets the grain size envelope. + * + * @deprecated Use {@link #setGrainSize(float)} instead. + * + * @param grainSizeEnvelope the new grain size envelope. + */ + @Deprecated + public void setGrainSizeEnvelope(UGen grainSizeEnvelope) { + grainSizeEnvelope.update(); + this.grainSizeEnvelope = grainSizeEnvelope.getValue(); + } + + /** + * Sets the grain size as the UGen's value. + * For better performance, use {@link #setGrainSize(float)} instead. + * + * @param grainSizeUGen the new grain size UGen. + */ + public void setGrainSize(UGen grainSizeUGen) { + grainSizeUGen.update(); + this.grainSizeEnvelope = grainSizeUGen.getValue(); + } + + /** + * Sets the grain size. + * + * @param grainSize the new grain size. + */ + public void setGrainSize(float grainSize) { + this.grainSizeEnvelope = grainSize; + } + + public Buffer getWindow() { + return window; + } + + + public void setWindow(Buffer window) { + this.window = window; + } + + /** + * Gets the randomness envelope. + * + * @deprecated Use {@link #getRandomnessUGen()} instead. + * + * @return the randomness envelope. + */ + @Deprecated + public UGen getRandomnessEnvelope() { + return new Static(randomnessEnvelope); + } + + /** + * Gets the randomness as a UGen. + * + * @return the randomness UGen. + */ + public UGen getRandomness() { + return new Static(randomnessEnvelope); + } + + /** + * Sets the randomness envelope. + * + * @deprecated Use {@link #setRandomness(float)} instead. + * + * @param randomnessEnvelope the new randomness envelope. + */ + @Deprecated + public void setRandomnessEnvelope(UGen randomnessEnvelope) { + randomnessEnvelope.update(); + this.randomnessEnvelope = randomnessEnvelope.getValue(); + } + + /** + * Sets the randomness as the UGen's value. + * For better performance, use {@link #setRandomness(float)} instead. + * + * @param randomnessUGen the new randomness UGen. + */ + public void setRandomness(UGen randomnessUGen) { + randomnessUGen.update(); + this.randomnessEnvelope = randomnessUGen.getValue(); + } + + /** + * Sets the randomness. + * + * @param randomness the new randomness value. + */ + public void setRandomness(float randomness) { + this.randomnessEnvelope = randomness; + } + + /** + * @deprecated Use {@link #setSample(Sample)} instead. + */ + @Deprecated + public synchronized void setBuffer(Sample buffer) { + super.setSample(buffer); + grains.clear(); + timeSinceLastGrain = 0f; + } + + /* (non-Javadoc) + * @see net.beadsproject.beads.ugens.SamplePlayer#setBuffer(net.beadsproject.beads.data.Sample) + */ + public synchronized void setSample(Sample buffer) { + super.setSample(buffer); + grains.clear(); + timeSinceLastGrain = 0f; + } + + /* (non-Javadoc) + * @see com.olliebown.beads.core.UGen#start() + */ + @Override + public void start() { + super.start(); + timeSinceLastGrain = 0; + } + + /** + * Sets the given Grain to start immediately. + * + * @param g + * the grain + */ + private void resetGrain(Grain g, int bufferPointer) { + g.position = position + grainSizeEnvelope * randomnessEnvelope * (Math.random() * 2.0 - 1.0); + g.age = 0f; + g.grainSize = grainSizeEnvelope; + g.bufferPointer = bufferPointer; + } + + @Override + public void reset() { + super.reset(); + firstGrain = true; + } + + /** Flag to indicate special case for the first grain. */ + private boolean firstGrain = true; + + /** Special case method for playing first grain. */ + private void firstGrain() { + if(firstGrain) { + Grain g = new Grain(); + g.position = position; + g.age = grainSizeEnvelope / 4f; + g.grainSize = grainSizeEnvelope; + grains.add(g); + firstGrain = false; + timeSinceLastGrain = grainIntervalEnvelope / 2f; + g.bufferPointer = 0; + } + } + + /* (non-Javadoc) + * @see com.olliebown.beads.ugens.SamplePlayer#calculateBuffer() + */ + @Override + public synchronized void calculateBuffer() { + //special condition for first grain + //update the various envelopes + if(sample != null) { + if(positionEnvelope != null) { + positionEnvelope.update(); + } + pitchEnvelope.update(); + firstGrain(); + + //now loop through the buffer and calculate the required grains + for (int i = 0; i < bufferSize; i++) { + //determine if we need a new grain + if (timeSinceLastGrain > grainIntervalEnvelope) { + Grain g = null; + if(freeGrains.size() > 0) { + g = freeGrains.pollFirst(); + } else { + g = new Grain(); + } + resetGrain(g, i); + grains.add(g); + timeSinceLastGrain = 0f; + } + //for mono channel, start by resetting current output frame + bufOut[0][i] = 0.0f; + + //increment time and stuff + calculateNextPosition(i); + + //increment timeSinceLastGrain + timeSinceLastGrain += msPerSample; + } + + //gather the output from each grain + Iterator currentGrain = grains.iterator(); + while (currentGrain.hasNext()) { + //calculate value of grain window + Grain g = currentGrain.next(); + pitch = Math.abs(pitchEnvelope.getValue(0, g.bufferPointer)); + + while (g.age <= g.grainSize) { + float windowScale = window.getValueFraction((float)(g.age / g.grainSize)); + //get position in sample for this grain + //get the frame for this grain + switch (interpolationType) { + case ADAPTIVE: + if(pitch > ADAPTIVE_INTERP_HIGH_THRESH) { + sample.getFrameNoInterp(g.position, frame); + } else if(pitch > ADAPTIVE_INTERP_LOW_THRESH) { + sample.getFrameLinear(g.position, frame); + } else { + sample.getFrameCubic(g.position, frame); + } + break; + case LINEAR: + sample.getFrameLinear(g.position, frame); + break; + case CUBIC: + sample.getFrameCubic(g.position, frame); + break; + case NONE: + sample.getFrameNoInterp(g.position, frame); + break; + } + + //add it to the current output frame + bufOut[0][g.bufferPointer++] += windowScale * frame[0 % sample.getNumChannels()]; + + //if grain's buffer position exceeds bufferSize, + //exit loop at start at index 0 of next buffer. + if (g.bufferPointer >= bufferSize) { + g.bufferPointer = 0; + break; + } + + //increment time and stuff + pitch = Math.abs(pitchEnvelope.getValue(0, g.bufferPointer)); + calculateNextGrainPosition(g); + } + //see if this grain is dead + if (g.age > g.grainSize) { + freeGrains.add(g); + currentGrain.remove(); + } + } + } + } + + /** + * Calculate next position for the given Grain. + * + * @param g the Grain. + */ + private void calculateNextGrainPosition(Grain g) { + int direction = rate >= 0 ? 1 : -1; //this is a bit odd in the case when controlling grain from positionEnvelope + g.age += msPerSample; + if(loopInsideGrains) { + switch(loopType) { + case NO_LOOP_FORWARDS: + g.position += direction * positionIncrement * pitch; + break; + case NO_LOOP_BACKWARDS: + g.position -= direction * positionIncrement * pitch; + break; + case LOOP_FORWARDS: + g.position += direction * positionIncrement * pitch; + if(rate > 0 && g.position > Math.max(loopStart, loopEnd)) { + g.position = Math.min(loopStart, loopEnd); + } else if(rate < 0 && g.position < Math.min(loopStart, loopEnd)) { + g.position = Math.max(loopStart, loopEnd); + } + break; + case LOOP_BACKWARDS: + g.position -= direction * positionIncrement * pitch; + if(rate > 0 && g.position < Math.min(loopStart, loopEnd)) { + g.position = Math.max(loopStart, loopEnd); + } else if(rate < 0 && g.position > Math.max(loopStart, loopEnd)) { + g.position = Math.min(loopStart, loopEnd); + } + break; + case LOOP_ALTERNATING: + g.position += direction * (forwards ? positionIncrement * pitch : -positionIncrement * pitch); + if(forwards ^ (rate < 0)) { + if(g.position > Math.max(loopStart, loopEnd)) { + g.position = 2 * Math.max(loopStart, loopEnd) - g.position; + } + } else if(g.position < Math.min(loopStart, loopEnd)) { + g.position = 2 * Math.min(loopStart, loopEnd) - g.position; + } + break; + } + } else { + g.position += direction * positionIncrement * pitch; + } + } + + /** + * Used at each sample in the perform routine to determine the next playback + * position. + * + * @param i + * the index within the buffer loop. + */ + @Override + protected void calculateNextPosition(int i) { + if (positionEnvelope != null) { + position = positionEnvelope.getValueDouble(0, i); + } else { + switch (loopType) { + case NO_LOOP_FORWARDS: + position += positionIncrement * rate; + if (position > sample.getLength() || position < 0) + atEnd(); + break; + case NO_LOOP_BACKWARDS: + position -= positionIncrement * rate; + if (position > sample.getLength() || position < 0) + atEnd(); + break; + case LOOP_FORWARDS: + position += positionIncrement * rate; + if (rate > 0 && position > Math.max(loopStart, loopEnd)) { + position = Math.min(loopStart, loopEnd); + } else if (rate < 0 && position < Math.min(loopStart, loopEnd)) { + position = Math.max(loopStart, loopEnd); + } + break; + case LOOP_BACKWARDS: + position -= positionIncrement * rate; + if (rate > 0 && position < Math.min(loopStart, loopEnd)) { + position = Math.max(loopStart, loopEnd); + } else if (rate < 0 && position > Math.max(loopStart, loopEnd)) { + position = Math.min(loopStart, loopEnd); + } + break; + case LOOP_ALTERNATING: + position += forwards ? positionIncrement * rate + : -positionIncrement * rate; + if (forwards ^ (rate < 0)) { + if (position > Math.max(loopStart, loopEnd)) { + forwards = (rate < 0); + position = 2 * Math.max(loopStart, loopEnd) - position; + } + } else if (position < Math.min(loopStart, loopEnd)) { + forwards = (rate > 0); + position = 2 * Math.min(loopStart, loopEnd) - position; + } + break; + } + } + } + /** + * Calculates the average number of Grains given the current grain size and grain interval. + * @return the average number of Grains. + */ + public float getAverageNumberOfGrains() { + return grainSizeEnvelope / grainIntervalEnvelope; + } + + +// public static void main(String[] args) { +// AudioContext ac = new AudioContext(); +// ac.start(); +// //clock +// Clock c = new Clock(ac, 500); +// ac.out.addDependent(c); +// GranularSamplePlayer gsp = new GranularSamplePlayer(ac, SampleManager.sample("/Users/ollie/git/HappyBrackets/HappyBrackets/data/audio/guit.wav")); +// gsp.getRateUGen().setValue(0.1f); +// ac.out.addInput(gsp); +// c.addMessageListener(new Bead() { +// @Override +// protected void messageReceived(Bead bead) { +// if (c.getCount() % 32 == 0) { +// gsp.reset(); +// } +// } +// }); +// } + + +} diff --git a/src/beads_main/net/beadsproject/beads/ugens/Function.java b/src/beads_main/java/net/beadsproject/beads/ugens/Function.java similarity index 98% rename from src/beads_main/net/beadsproject/beads/ugens/Function.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Function.java index fda8b61..00e5b9a 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Function.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Function.java @@ -8,7 +8,6 @@ /** * Function is an abstract class which can be quickly subclassed to make a custom {@link UGen} on the fly. Subclasses of Function must implement {@link #calculate()}, getting data from the array {@link #x}, and returning the result. {@link #x} provides access to the array of {@link UGen}s that are passed to Function's constructor. * - * @beads.category utilities * @author ollie */ public abstract class Function extends UGen { diff --git a/src/beads_main/net/beadsproject/beads/ugens/Gain.java b/src/beads_main/java/net/beadsproject/beads/ugens/Gain.java similarity index 82% rename from src/beads_main/net/beadsproject/beads/ugens/Gain.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Gain.java index 91021f6..8e38cca 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Gain.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Gain.java @@ -11,8 +11,7 @@ /** * Gain modifies the gain of a multi-channel audio signal. The gain value can be * controlled by an audio signal. - * - * @beads.category effect + * * @author ollie */ public class Gain extends UGen implements DataBeadReceiver { @@ -33,6 +32,16 @@ public Gain(AudioContext context, int inouts, UGen gainEnvelope) { setGain(gainEnvelope); } + /** + * Instantiates a new Gain. + * + * @param inouts the number of inputs (= number of outputs). + * @param gainEnvelope the gain envelope. + */ + public Gain(int inouts, UGen gainEnvelope) { + this(getDefaultContext(), inouts, gainEnvelope); + } + /** * Instantiates a new Gain with a {@link Static} gain envelop with the given * value. @@ -46,6 +55,17 @@ public Gain(AudioContext context, int inouts, float gain) { setGain(gain); } + /** + * Instantiates a new Gain with a {@link Static} gain envelop with the given + * value. + * + * @param inouts the number of inputs (= number of outputs). + * @param gain the fixed gain level. + */ + public Gain(int inouts, float gain) { + this(getDefaultContext(), inouts, gain); + } + /** * Instantiates a new Gain with {@link Static} gain envelop set to 1. * @@ -58,6 +78,16 @@ public Gain(AudioContext context, int inouts) { this(context, inouts, 1f); } + /** + * Instantiates a new Gain with {@link Static} gain envelop set to 1. + * + * @param inouts + * the number of inputs (= number of outputs). + */ + public Gain(int inouts) { + this(getDefaultContext(), inouts); + } + /** * Gets the gain envelope. * diff --git a/src/beads_main/net/beadsproject/beads/ugens/Glide.java b/src/beads_main/java/net/beadsproject/beads/ugens/Glide.java similarity index 82% rename from src/beads_main/net/beadsproject/beads/ugens/Glide.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Glide.java index 83f27a1..471f824 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Glide.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Glide.java @@ -9,8 +9,7 @@ /** * * Simple UGen that ramps between given values over a given duration (e.g., for portamento). - * - * @beads.category control + * * @author ollie */ public class Glide extends UGen { @@ -43,7 +42,18 @@ public Glide(AudioContext context, float currentValue, float glideTimeMS) { bufOut[0] = new float[bufferSize]; setGlideTime(glideTimeMS); } - + + /** + * Creates a new Glide with the default AudioContext, initial value and glide time in milliseconds. + * @param currentValue + * the initial value. + * @param glideTimeMS + * the glide time in milliseconds. + */ + public Glide(float currentValue, float glideTimeMS) { + this(getDefaultContext(), currentValue, glideTimeMS); + } + /** * Creates a new Glide with the specified AudioContext, initial value. Uses the * default glide time of 100 milliseconds. @@ -55,7 +65,17 @@ public Glide(AudioContext context, float currentValue, float glideTimeMS) { public Glide(AudioContext context, float currentValue) { this(context, currentValue, 100); } - + + /** + * Creates a new Glide with the default AudioContext, initial value. Uses the + * default glide time of 100 milliseconds. + * @param currentValue + * the initial value. + */ + public Glide(float currentValue) { + this(getDefaultContext(), currentValue); + } + /** * Creates a new Glide with the specified AudioContext. Uses the * default inital value of zero and glide time of 100 milliseconds. @@ -66,6 +86,13 @@ public Glide(AudioContext context) { this(context, 0f); } + /** + * Creates a new Glide with the default AudioContext. Uses the + * default inital value of zero and glide time of 100 milliseconds. + */ + public Glide() { + this(getDefaultContext()); + } /** * Sets the target glide value. From its current value Glide immediately interpolates * its way to that value over the specified glideTime. diff --git a/src/beads_main/net/beadsproject/beads/ugens/GranularSamplePlayer.java b/src/beads_main/java/net/beadsproject/beads/ugens/GranularSamplePlayer.java similarity index 97% rename from src/beads_main/net/beadsproject/beads/ugens/GranularSamplePlayer.java rename to src/beads_main/java/net/beadsproject/beads/ugens/GranularSamplePlayer.java index d445039..7b19d16 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/GranularSamplePlayer.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/GranularSamplePlayer.java @@ -20,7 +20,6 @@ * {@link UGen}s can be used to control playback rate, pitch, loop points, grain size, grain interval, grain randomness and position (this last case assumes that the playback rate is zero). * * @see SamplePlayer Sample - * @beads.category sample players * @author ollie */ public class GranularSamplePlayer extends SamplePlayer { @@ -103,6 +102,15 @@ public GranularSamplePlayer(AudioContext context, int outs) { loopInsideGrains = false; } + /** + * Instantiates a new GranularSamplePlayer. + * + * @param outs the number of outputs. + */ + public GranularSamplePlayer(int outs) { + this(getDefaultContext(), outs); + } + /** * Instantiates a new GranularSamplePlayer. * @@ -116,6 +124,15 @@ public GranularSamplePlayer(AudioContext context, Sample buffer) { loopEndEnvelope = new Static(context, (float)buffer.getLength()); } + /** + * Instantiates a new GranularSamplePlayer. + * + * @param buffer the Sample played by the GranularSamplePlayer. + */ + public GranularSamplePlayer(Sample buffer) { + this(getDefaultContext(), buffer); + } + /** * Gets the pitch envelope. * @@ -447,6 +464,7 @@ public synchronized void calculateBuffer() { for (int j = 0; j < outs; j++) { bufOut[j][i] = 0.0f; } + //gather the output from each grain for(Grain g : grains) { //calculate value of grain window @@ -498,7 +516,7 @@ public synchronized void calculateBuffer() { } } } - + /** * Calculate next position for the given Grain. * diff --git a/src/beads_main/net/beadsproject/beads/ugens/IIRFilter.java b/src/beads_main/java/net/beadsproject/beads/ugens/IIRFilter.java similarity index 93% rename from src/beads_main/net/beadsproject/beads/ugens/IIRFilter.java rename to src/beads_main/java/net/beadsproject/beads/ugens/IIRFilter.java index 3fc20db..d16eb83 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/IIRFilter.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/IIRFilter.java @@ -10,8 +10,7 @@ * An abstract class that provides methods for analyzing infinite impulse * response (IIR) filters. IIR filters built on this class should implement * {@link #getFilterResponse(float)} appropriately. - * - * @beads.category filter + * * @author Benito Crawford * @version 0.9.5 */ @@ -21,6 +20,10 @@ public IIRFilter(AudioContext context, int ins, int outs) { super(context, ins, outs); } + public IIRFilter(int ins, int outs) { + this(getDefaultContext(), ins, outs); + } + public abstract IIRFilterAnalysis getFilterResponse(float freq); /** @@ -102,9 +105,8 @@ protected static double calculateGroupDelay(float[] bs, float[] as, /** * Does our analysis at the specified frequency. - * - * @param freq - * The frequency to analyze. + * + * @param freq The frequency to analyze. */ protected static IIRFilterAnalysis analyzeFilter(float[] bs, float[] as, float freq, float samplingFreq) { diff --git a/src/beads_main/net/beadsproject/beads/ugens/LPRezFilter.java b/src/beads_main/java/net/beadsproject/beads/ugens/LPRezFilter.java similarity index 78% rename from src/beads_main/net/beadsproject/beads/ugens/LPRezFilter.java rename to src/beads_main/java/net/beadsproject/beads/ugens/LPRezFilter.java index 1e8c4db..94f1ed9 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/LPRezFilter.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/LPRezFilter.java @@ -23,8 +23,7 @@ * or by passing a DataBead with "frequency" and "resonance" properties to * {@link #setParams(DataBead)}. (Messaging this object with a DataBead achieves * the same.) - * - * @beads.category filter + * * @author Benito Crawford * @version 0.9.5 */ @@ -52,6 +51,15 @@ public LPRezFilter(AudioContext con) { this(con, 1); } + /** + * Constructor for a single-channel LPRezFilter with default values for + * frequency and resonance. + * + */ + public LPRezFilter(){ + this(getDefaultContext()); + } + /** * Constructor for a multi-channel LPRezFilter with default values for * frequency and resonance. @@ -70,6 +78,17 @@ public LPRezFilter(AudioContext con, int channels) { setFrequency(freq).setRes(res); } + /** + * Constructor for a multi-channel LPRezFilter with default values for + * frequency and resonance. + * + * @param channels + * The number of channels. + */ + public LPRezFilter(int channels) { + this(getDefaultContext(), channels); + } + /** * Constructor for a single-channel LPRezFilter with frequency and resonance * specified by floats. @@ -85,6 +104,19 @@ public LPRezFilter(AudioContext con, float freq, float res) { this(con, 1, freq, res); } + /** + * Constructor for a single-channel LPRezFilter with frequency and resonance + * specified by floats. + * + * @param freq + * The filter cut-off frequency. + * @param res + * The resonance. + */ + public LPRezFilter(float freq, float res) { + this(getDefaultContext(), freq, res); + } + /** * Constructor for a single-channel LPRezFilter with frequency specified by * a UGen and resonance specified by a float. @@ -100,6 +132,19 @@ public LPRezFilter(AudioContext con, UGen freq, float res) { this(con, 1, freq, res); } + /** + * Constructor for a single-channel LPRezFilter with frequency specified by + * a UGen and resonance specified by a float. + * + * @param freq + * The filter cut-off frequency UGen. + * @param res + * The resonance. + */ + public LPRezFilter(UGen freq, float res) { + this(getDefaultContext(), freq, res); + } + /** * Constructor for a single-channel LPRezFilter with frequency specified by * a float and resonance specified by a UGen. @@ -115,6 +160,19 @@ public LPRezFilter(AudioContext con, float freq, UGen res) { this(con, 1, freq, res); } + /** + * Constructor for a single-channel LPRezFilter with frequency specified by + * a float and resonance specified by a UGen. + * + * @param freq + * The filter cut-off frequency. + * @param res + * The resonance UGen. + */ + public LPRezFilter(float freq, UGen res) { + this(getDefaultContext(), freq, res); + } + /** * Constructor for a single-channel LPRezFilter with frequency and resonance * specified by UGens. @@ -130,6 +188,19 @@ public LPRezFilter(AudioContext con, UGen freq, UGen res) { this(con, 1, freq, res); } + /** + * Constructor for a single-channel LPRezFilter with frequency and resonance + * specified by UGens. + * + * @param freq + * The filter cut-off frequency UGen. + * @param res + * The resonance UGen. + */ + public LPRezFilter(UGen freq, UGen res) { + this(getDefaultContext(), freq, res); + } + /** * Constructor for a multi-channel LPRezFilter with frequency and resonance * specified by floats. @@ -148,6 +219,21 @@ public LPRezFilter(AudioContext con, int channels, float freq, float res) { setFrequency(freq).setRes(res); } + /** + * Constructor for a multi-channel LPRezFilter with frequency and resonance + * specified by floats. + * + * @param channels + * The number of channels. + * @param freq + * The filter cut-off frequency. + * @param res + * The resonance. + */ + public LPRezFilter(int channels, float freq, float res) { + this(getDefaultContext(), channels, freq, res); + } + /** * Constructor for a multi-channel LPRezFilter with frequency specified by a * UGen and resonance specified by a float. @@ -166,6 +252,21 @@ public LPRezFilter(AudioContext con, int channels, UGen freq, float res) { setFrequency(freq).setRes(res); } + /** + * Constructor for a multi-channel LPRezFilter with frequency specified by a + * UGen and resonance specified by a float. + * + * @param channels + * The number of channels. + * @param freq + * The filter cut-off frequency UGen. + * @param res + * The resonance. + */ + public LPRezFilter(int channels, UGen freq, float res) { + this(getDefaultContext(), channels, freq, res); + } + /** * Constructor for a multi-channel LPRezFilter with frequency specified by a * float and resonance specified by a UGen. @@ -184,6 +285,21 @@ public LPRezFilter(AudioContext con, int channels, float freq, UGen res) { setFrequency(freq).setRes(res); } + /** + * Constructor for a multi-channel LPRezFilter with frequency specified by a + * float and resonance specified by a UGen. + * + * @param channels + * The number of channels. + * @param freq + * The filter cut-off frequency. + * @param res + * The resonance UGen. + */ + public LPRezFilter(int channels, float freq, UGen res) { + this(getDefaultContext(), channels, freq, res); + } + /** * Constructor for a multi-channel LPRezFilter with frequency and resonance * specified by UGens. @@ -202,6 +318,21 @@ public LPRezFilter(AudioContext con, int channels, UGen freq, UGen res) { setFrequency(freq).setRes(res); } + /** + * Constructor for a multi-channel LPRezFilter with frequency and resonance + * specified by UGens. + * + * @param channels + * The number of channels. + * @param freq + * The filter cut-off frequency UGen. + * @param res + * The resonance UGen. + */ + public LPRezFilter(int channels, UGen freq, UGen res) { + this(getDefaultContext(), channels, freq, res); + } + protected void calcVals() { a1 = -2 * res * cosw; a2 = res * res; @@ -497,10 +628,9 @@ public float getRes() { /** * Sets the filter resonance to a float value. This removes the resonance - * UGen, if it exists. (Should be >= 0 and < 1.) + * UGen, if it exists. (Should be >= 0 and < 1.) * - * @param r - * The resonance. + * @param r The resonance. * @return This filter instance. */ public LPRezFilter setRes(float r) { diff --git a/src/beads_main/net/beadsproject/beads/ugens/Maximum.java b/src/beads_main/java/net/beadsproject/beads/ugens/Maximum.java similarity index 68% rename from src/beads_main/net/beadsproject/beads/ugens/Maximum.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Maximum.java index acb2237..3c38f62 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Maximum.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Maximum.java @@ -8,8 +8,7 @@ /** * For each sample, outputs the maximum of its two inputs. - * - * @beads.category lowlevel + * * @author Benito Crawford * @version 0.9 */ @@ -25,6 +24,14 @@ public Maximum(AudioContext context) { super(context, 2, 1); } + /** + * Constructor with no assigned inputs. + * + */ + public Maximum() { + this(getDefaultContext()); + } + /** * Constructor for 1 UGen input and a static maximum value. * @@ -41,6 +48,18 @@ public Maximum(AudioContext context, UGen ugen, float maxVal) { addInput(1, new Static(context, maxVal), 0); } + /** + * Constructor for 1 UGen input and a static maximum value. + * + * @param ugen + * The input UGen. + * @param maxVal + * The minimum value. + */ + public Maximum( UGen ugen, float maxVal) { + this(getDefaultContext(), ugen, maxVal); + } + /** * Constructor for 2 UGen inputs. * @@ -57,6 +76,17 @@ public Maximum(AudioContext context, UGen ugen1, UGen ugen2) { addInput(1, ugen2, 0); } + /** + * Constructor for 2 UGen inputs. + * @param ugen1 + * The first UGen input. + * @param ugen2 + * The second UGen input. + */ + public Maximum(UGen ugen1, UGen ugen2) { + this(getDefaultContext(), ugen1, ugen2); + } + @Override public void calculateBuffer() { float[] bi1 = bufIn[0]; diff --git a/src/beads_main/net/beadsproject/beads/ugens/Minimum.java b/src/beads_main/java/net/beadsproject/beads/ugens/Minimum.java similarity index 65% rename from src/beads_main/net/beadsproject/beads/ugens/Minimum.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Minimum.java index 7ed5759..54c0758 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Minimum.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Minimum.java @@ -8,8 +8,7 @@ /** * For each sample, outputs the minimum of its two inputs. - * - * @beads.category lowlevel + * * @author Benito Crawford * @version 0.9 */ @@ -26,22 +25,41 @@ public Minimum(AudioContext context) { } /** - * Constructor for 1 UGen input and a static minimum value. - * - * @param context - * The audio context. - * @param ugen - * The input UGen. - * @param minVal - * The minimum value. + * Constructor with no assigned inputs. + * */ + public Minimum() { + this(getDefaultContext()); + } + /** + * Constructor for 1 UGen input and a static minimum value. + * + * @param context + * The audio context. + * @param ugen + * The input UGen. + * @param minVal + * The minimum value. + */ public Minimum(AudioContext context, UGen ugen, float minVal) { super(context, 2, 1); addInput(0, ugen, 0); addInput(1, new Static(context, minVal), 0); } + /** + * Constructor for 1 UGen input and a static minimum value. + * + * @param ugen + * The input UGen. + * @param minVal + * The minimum value. + */ + public Minimum(UGen ugen, float minVal) { + this(getDefaultContext(), ugen, minVal); + } + /** * Constructor for 2 UGen inputs. * @@ -58,6 +76,18 @@ public Minimum(AudioContext context, UGen ugen1, UGen ugen2) { addInput(1, ugen2, 0); } + /** + * Constructor for 2 UGen inputs. + * + * @param ugen1 + * The first UGen input. + * @param ugen2 + * The second UGen input. + */ + public Minimum(UGen ugen1, UGen ugen2) { + this(getDefaultContext(), ugen1, ugen2); + } + @Override public void calculateBuffer() { float[] bi1 = bufIn[0]; diff --git a/src/beads_main/net/beadsproject/beads/ugens/MonoPlug.java b/src/beads_main/java/net/beadsproject/beads/ugens/MonoPlug.java similarity index 88% rename from src/beads_main/net/beadsproject/beads/ugens/MonoPlug.java rename to src/beads_main/java/net/beadsproject/beads/ugens/MonoPlug.java index f1a1fd1..dd575ea 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/MonoPlug.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/MonoPlug.java @@ -9,8 +9,7 @@ /** * MonoPlug performs the simple task of channelling a single output from a multi-channel * {@link UGen}. - * - * @beads.category utilities + * * @author ollie */ public class MonoPlug extends UGen { @@ -26,6 +25,14 @@ public MonoPlug(AudioContext context) { outputPauseRegime = OutputPauseRegime.ZERO; } + /** + * Instantiates a new MonoPlug. + * + */ + public MonoPlug() { + this(getDefaultContext()); + } + /* (non-Javadoc) * @see net.beadsproject.beads.core.UGen#calculateBuffer() */ diff --git a/src/beads_main/net/beadsproject/beads/ugens/MouseResponder.java b/src/beads_main/java/net/beadsproject/beads/ugens/MouseResponder.java similarity index 93% rename from src/beads_main/net/beadsproject/beads/ugens/MouseResponder.java rename to src/beads_main/java/net/beadsproject/beads/ugens/MouseResponder.java index b412b58..fa089b5 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/MouseResponder.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/MouseResponder.java @@ -12,9 +12,7 @@ /** * A MouseResponder is a way of getting mouse input to control audio rate data. The mouse doesn't generate audio rate data, but it is interpolated. - * - * @beads.category utilities - * @beads.category control + * */ public class MouseResponder extends UGen { @@ -49,6 +47,13 @@ public MouseResponder(AudioContext context) { prevY = 0; } + /** + * Instantiates a new MouseResponder. + * + */ + public MouseResponder() { + this(getDefaultContext()); + } /** * Gets the current point. * diff --git a/src/beads_main/net/beadsproject/beads/ugens/Mult.java b/src/beads_main/java/net/beadsproject/beads/ugens/Mult.java similarity index 78% rename from src/beads_main/net/beadsproject/beads/ugens/Mult.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Mult.java index 3c1c848..07dfb6c 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Mult.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Mult.java @@ -9,8 +9,7 @@ /** * Takes an incoming signal (or signals in the multi-channel case) and * multiplies it with something (another signal or a float value). - * - * @beads.category utilities + * * @author ollie * @author Benito Crawford */ @@ -34,6 +33,18 @@ public Mult(AudioContext context, int channels, float multiplier) { setMultiplier(multiplier); } + /** + * Constructor for a Mult object with a static multiplier value. + * + * @param channels + * The number of channels. + * @param multiplier + * The multiplier value. + */ + public Mult(int channels, float multiplier) { + this(getDefaultContext(), channels, multiplier); + } + /** * Constructor for a Mult object with a UGen controlling the multiplier * value. @@ -49,7 +60,20 @@ public Mult(AudioContext context, int channels, UGen multiplierUGen) { super(context, channels, channels); setMultiplier(multiplierUGen); } - + + /** + * Constructor for a Mult object with a UGen controlling the multiplier + * value. + * + * @param channels + * The number of channels. + * @param multiplierUGen + * The UGen controlling the multiplier value. + */ + public Mult(int channels, UGen multiplierUGen) { + this(getDefaultContext(), channels, multiplierUGen); + } + /** * Constructor for a Mult object with a given UGen as input and another as multiplier. * i.e., use this as quickest way to multiply two UGens together. @@ -64,6 +88,17 @@ public Mult(AudioContext context, UGen input, UGen multiplierUGen) { addInput(input); } + /** + * Constructor for a Mult object with a given UGen as input and another as multiplier. + * i.e., use this as quickest way to multiply two UGens together. + * + * @param input the input UGen. + * @param multiplierUGen the multiplier UGen. + */ + public Mult(UGen input, UGen multiplierUGen) { + this(getDefaultContext(), input, multiplierUGen); + } + /* * (non-Javadoc) * diff --git a/src/beads_main/net/beadsproject/beads/ugens/MultiWrapper.java b/src/beads_main/java/net/beadsproject/beads/ugens/MultiWrapper.java similarity index 79% rename from src/beads_main/net/beadsproject/beads/ugens/MultiWrapper.java rename to src/beads_main/java/net/beadsproject/beads/ugens/MultiWrapper.java index 90d67f4..6c7134a 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/MultiWrapper.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/MultiWrapper.java @@ -39,10 +39,26 @@ public MultiWrapper(AudioContext context, int channels) { this(context, channels, 1, 1); } + /** + * Constructor for an multi-channel wrapper for 1-in/1-out UGens on each + * channel. {@link #buildUGens(int)} should be implemented to construct a + * UGen for each channel. + * + * @param channels + * The number of channels. + */ + public MultiWrapper(int channels){ + this(getDefaultContext(), channels); + } + private MultiWrapper(AudioContext context, int numIns, int numOuts) { super(context, numIns, numOuts); } + private MultiWrapper(int numIns, int numOuts){ + this(getDefaultContext(), numIns, numOuts); + } + /** * Constructor for an n-channel wrapper for UGens with a certain number * inputs and a certain number outputs on each channel. @@ -76,6 +92,24 @@ public MultiWrapper(AudioContext context, int channels, int insPerChannel, } + /** + * Constructor for an n-channel wrapper for UGens with a certain number + * inputs and a certain number outputs on each channel. + * {@link #buildUGens(int)} should be implemented to construct a UGen for + * each channel. + * + * @param channels + * The number of channels. + * @param insPerChannel + * The number of inputs per channel UGen. + * @param outsPerChannel + * The number of outputs per channel UGen. + */ + public MultiWrapper(int channels, int insPerChannel, + int outsPerChannel) { + this(getDefaultContext(), channels, insPerChannel, outsPerChannel); + } + /** * Constructor for a multi-channel wrapper for an array of UGens that * represent separate "channels". @@ -103,6 +137,21 @@ public MultiWrapper(AudioContext context, UGen[] ugens, int insPerChannel, } + /** + * Constructor for a multi-channel wrapper for an array of UGens that + * represent separate "channels". + * + * @param ugens + * The array of UGens to wrap. + * @param insPerChannel + * The number of inputs per channel. + * @param outsPerChannel + * The number of ouputs per channel. + */ + public MultiWrapper(UGen[] ugens, int insPerChannel, + int outsPerChannel) { + this(getDefaultContext(), ugens, insPerChannel, outsPerChannel ); + } private void setupUGens() { for (int i = 0; i < channels; i++) { diff --git a/src/beads_main/net/beadsproject/beads/ugens/NBitsConverter.java b/src/beads_main/java/net/beadsproject/beads/ugens/NBitsConverter.java similarity index 79% rename from src/beads_main/net/beadsproject/beads/ugens/NBitsConverter.java rename to src/beads_main/java/net/beadsproject/beads/ugens/NBitsConverter.java index e9904f6..2898e6d 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/NBitsConverter.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/NBitsConverter.java @@ -10,8 +10,7 @@ * Converts a signal to have n-bits, useful for 8-bit synthesis. * PRE: Signal must be in (-1,1) range * POST: Signal is in (-1,1) range - * - * @beads.category effect + * * @author ben * */ @@ -32,6 +31,15 @@ public NBitsConverter(AudioContext ac, int n) { } + + /** + * Creates a new NBitsConverter with the default {@link AudioContext} and number of bits to convert to. + + * @param n the number of bits to convert to. + */ + public NBitsConverter(int n) { + this(getDefaultContext(), n); + } public void calculateBuffer() { // for each float value (-1,1) diff --git a/src/beads_main/net/beadsproject/beads/ugens/Noise.java b/src/beads_main/java/net/beadsproject/beads/ugens/Noise.java similarity index 92% rename from src/beads_main/net/beadsproject/beads/ugens/Noise.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Noise.java index db7c137..5a353f1 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Noise.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Noise.java @@ -10,8 +10,7 @@ /** * Noise generates white noise. It uses a long buffer of sampled noise. - * - * @beads.category synth + * * @author ollie */ public class Noise extends UGen { @@ -35,6 +34,13 @@ public Noise(AudioContext context) { index = (int)(Math.random() * noiseBuffer.buf.length); } + /** + * Instantiates a new Noise. + */ + public Noise() { + this(getDefaultContext()); + } + /* (non-Javadoc) * @see net.beadsproject.beads.core.UGen#calculateBuffer() */ diff --git a/src/beads_main/net/beadsproject/beads/ugens/OnePoleFilter.java b/src/beads_main/java/net/beadsproject/beads/ugens/OnePoleFilter.java similarity index 89% rename from src/beads_main/net/beadsproject/beads/ugens/OnePoleFilter.java rename to src/beads_main/java/net/beadsproject/beads/ugens/OnePoleFilter.java index ebd966b..49e7ac5 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/OnePoleFilter.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/OnePoleFilter.java @@ -14,8 +14,7 @@ * either by UGen or a float. *

    * It uses the formula: y(n) = a * x(n) + (1 - a) * y(n - 1) - * - * @beads.category filter + * * @author Benito Crawford * @version 0.9 */ @@ -41,6 +40,16 @@ public OnePoleFilter(AudioContext con, float freq) { setFrequency(freq); } + /** + * Constructor for cut-off frequency specified by a static float. + * + * @param freq + * The cut-off frequency. + */ + public OnePoleFilter(float freq) { + this(getDefaultContext(), freq); + } + /** * Constructor for cut-off frequency specified by a UGen. * @@ -57,6 +66,16 @@ public OnePoleFilter(AudioContext con, UGen freq) { setFrequency(freq); } + /** + * Constructor for cut-off frequency specified by a UGen. + * + * @param freq + * The cut-off frequency UGen. + */ + public OnePoleFilter(UGen freq) { + this(getDefaultContext(), freq); + } + protected void calcVals() { a1 = (b0 = (float) Math.sin(two_pi_over_sf * freq)) - 1; } diff --git a/src/beads_main/net/beadsproject/beads/ugens/OscillatorBank.java b/src/beads_main/java/net/beadsproject/beads/ugens/OscillatorBank.java similarity index 93% rename from src/beads_main/net/beadsproject/beads/ugens/OscillatorBank.java rename to src/beads_main/java/net/beadsproject/beads/ugens/OscillatorBank.java index d59393e..9697583 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/OscillatorBank.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/OscillatorBank.java @@ -10,7 +10,6 @@ /** * An OscillatorBank sums the output of a set of oscillators with assignable frequencies and amplitudes. The frequencies and amplitudes of the set of oscillators can be assigned using arrays. * - * @beads.category synth * @author ollie */ public class OscillatorBank extends UGen { @@ -49,8 +48,17 @@ public OscillatorBank(AudioContext context, Buffer buffer, int numOscillators) { setNumOscillators(numOscillators); gain = 1f / (float)numOscillators; } - - + + /** + * Instantiates a new OscillatorBank. + * + * @param buffer the buffer used as a lookup table by the oscillators. + * @param numOscillators the number of oscillators. + */ + public OscillatorBank(Buffer buffer, int numOscillators) { + this(getDefaultContext(), buffer, numOscillators); + } + /** * Sets the number of oscillators. * diff --git a/src/beads_main/net/beadsproject/beads/ugens/Panner.java b/src/beads_main/java/net/beadsproject/beads/ugens/Panner.java similarity index 87% rename from src/beads_main/net/beadsproject/beads/ugens/Panner.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Panner.java index fbbb2d3..f1217bb 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Panner.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Panner.java @@ -16,8 +16,7 @@ * channel as a result. A pan value of -1 pans completely to the left, 1 pans * completely to the right, and 0 results in center panning. It uses an array to * approximate square roots for efficiency. - * - * @beads.category utilities + * * @author Benito Crawford * @version 0.9.1 */ @@ -39,6 +38,14 @@ public Panner(AudioContext con) { this(con, 0); } + /** + * Constructor that sets the pan to the middle by default. + * + */ + public Panner(){ + this (getDefaultContext()); + } + /** * Constructor that sets the pan to a static value. * @@ -52,6 +59,16 @@ public Panner(AudioContext con, float ipos) { setPos(ipos); } + /** + * Constructor that sets the pan to a static value. + * + * @param ipos + * The initial pan value. + */ + public Panner(float ipos) { + this(getDefaultContext(), ipos); + } + /** * Constructor that sets a UGen to specify the pan value. * @@ -65,6 +82,16 @@ public Panner(AudioContext con, UGen posUGen) { setPos(posUGen); } + /** + * Constructor that sets a UGen to specify the pan value. + * + * @param posUGen + * The pan UGen. + */ + public Panner(UGen posUGen) { + this(getDefaultContext(), posUGen); + } + @Override public void calculateBuffer() { diff --git a/src/beads_main/net/beadsproject/beads/ugens/Phasor.java b/src/beads_main/java/net/beadsproject/beads/ugens/Phasor.java similarity index 81% rename from src/beads_main/net/beadsproject/beads/ugens/Phasor.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Phasor.java index 6260391..136ba5f 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Phasor.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Phasor.java @@ -29,6 +29,14 @@ public Phasor(AudioContext con) { one_over_sr = 1d / con.getSampleRate(); } + /** + * Basic constructor. + * + */ + public Phasor() { + this(getDefaultContext()); + } + /** * Constructor that sets the initial frequency to a float value. * @@ -42,6 +50,16 @@ public Phasor(AudioContext con, float frequency) { setFrequency(frequency); } + /** + * Constructor that sets the initial frequency to a float value. + * + * @param frequency + * The initial frequency. + */ + public Phasor(float frequency) { + this(getDefaultContext(), frequency); + } + /** * Constructor that sets a UGen to control the frequency. * @@ -55,6 +73,16 @@ public Phasor(AudioContext con, UGen frequencyUGen) { setFrequency(frequencyUGen); } + /** + * Constructor that sets a UGen to control the frequency. + * + * @param frequencyUGen + * The frequency controller UGen. + */ + public Phasor(UGen frequencyUGen) { + this(getDefaultContext(), frequencyUGen); + } + @Override public void calculateBuffer() { float[] bo = bufOut[0]; diff --git a/src/beads_main/net/beadsproject/beads/ugens/Plug.java b/src/beads_main/java/net/beadsproject/beads/ugens/Plug.java similarity index 61% rename from src/beads_main/net/beadsproject/beads/ugens/Plug.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Plug.java index bd6c6a1..52e76d6 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Plug.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Plug.java @@ -28,13 +28,22 @@ public Plug(AudioContext context) { this(context, 1); } + /** + * Constructor for a one-channel Plug using the specified audio + * context. + * + */ + public Plug(){ + this(getDefaultContext()); + } + /** * Constructor for a mono Plug that takes input from the specified source * UGen. * * @param context * The audio context. - * @param souceUGen + * @param sourceUGen * The source UGen. */ public Plug(AudioContext context, UGen sourceUGen) { @@ -42,13 +51,24 @@ public Plug(AudioContext context, UGen sourceUGen) { this.addInput(sourceUGen); } + /** + * Constructor for a mono Plug that takes input from the specified source + * UGen. + * + * @param sourceUGen + * The source UGen. + */ + public Plug(UGen sourceUGen) { + this (getDefaultContext(), sourceUGen); + } + /** * Constructor for a mono Plug that takes input from the specified output * channel of a source UGen. * * @param context * The audio context. - * @param souceUGen + * @param sourceUGen * The source UGen. * @param sourceOutputChannel * The channel from the source UGen to take as input. @@ -58,6 +78,19 @@ public Plug(AudioContext context, UGen sourceUGen, int sourceOutputChannel) { this.addInput(0, sourceUGen, sourceOutputChannel); } + /** + * Constructor for a mono Plug that takes input from the specified output + * channel of a source UGen. + * + * @param sourceUGen + * The source UGen. + * @param sourceOutputChannel + * The channel from the source UGen to take as input. + */ + public Plug(UGen sourceUGen, int sourceOutputChannel) { + this (getDefaultContext(), sourceUGen, sourceOutputChannel); + } + /** * Constructor for a Plug with the specified number of channels, using * the specified audio context. @@ -73,6 +106,17 @@ public Plug(AudioContext context, int channels) { bufOut = bufIn; } + /** + * Constructor for a Plug with the specified number of channels, using + * the specified audio context. + * + * @param channels + * The number of channels. + */ + public Plug(int channels) { + this(getDefaultContext(), channels); + } + @Override public void calculateBuffer() { } diff --git a/src/beads_main/net/beadsproject/beads/ugens/PolyLimit.java b/src/beads_main/java/net/beadsproject/beads/ugens/PolyLimit.java similarity index 92% rename from src/beads_main/net/beadsproject/beads/ugens/PolyLimit.java rename to src/beads_main/java/net/beadsproject/beads/ugens/PolyLimit.java index 3cab618..9a4f086 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/PolyLimit.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/PolyLimit.java @@ -14,8 +14,7 @@ * An upper limit is given. If a new UGen is added but this takes the number of connected UGens over that * upper limit then the oldest connected UGen is dropped in order to allow * the new UGen to be connected. - * - * @beads.category utilities + * */ public class PolyLimit extends UGen { @@ -40,7 +39,17 @@ public PolyLimit(AudioContext context, int inouts, int maxInputs) { setMaxInputs(maxInputs); existingInputs = new LinkedList(); } - + + /** + * Instantiates a new PolyLimit. + * + * @param inouts the number of channels. + * @param maxInputs the max number of connected inputs. + */ + public PolyLimit(int inouts, int maxInputs) { + this(getDefaultContext(), inouts, maxInputs); + } + /** * Overrides {@link UGen#addInput(UGen)} such that if a new UGen pushes the total number of * connected UGens above the upper limit, the oldest UGen is removed. diff --git a/src/beads_main/net/beadsproject/beads/ugens/RMS.java b/src/beads_main/java/net/beadsproject/beads/ugens/RMS.java similarity index 83% rename from src/beads_main/net/beadsproject/beads/ugens/RMS.java rename to src/beads_main/java/net/beadsproject/beads/ugens/RMS.java index c79c0bd..b94c495 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/RMS.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/RMS.java @@ -11,8 +11,7 @@ * over a given time frame. The algorithm accounts for multi-channel input by * summing the squares of each channel and dividing by the square root of the * number of channels. - * - * @beads.category lowlevel + * * @author Benito Crawford * @version 0.9.5 */ @@ -41,6 +40,18 @@ public RMS(AudioContext context, int channels, int memorySize) { memScale = 1f / memorySize; } + /** + * Constructor. + * + * @param channels + * The number of channels. + * @param memorySize + * The number of samples over which to compute the RMS. + */ + public RMS(int channels, int memorySize) { + this(getDefaultContext(), channels, memorySize); + } + @Override public void calculateBuffer() { float[] bo = bufOut[0]; diff --git a/src/beads_main/net/beadsproject/beads/ugens/RandomPWM.java b/src/beads_main/java/net/beadsproject/beads/ugens/RandomPWM.java similarity index 88% rename from src/beads_main/net/beadsproject/beads/ugens/RandomPWM.java rename to src/beads_main/java/net/beadsproject/beads/ugens/RandomPWM.java index 554162f..c2091b5 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/RandomPWM.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/RandomPWM.java @@ -25,8 +25,7 @@ *

  • {@link #RAMPED_NOISE} - for random-length ramps between random values between -1 and 1.
  • *
  • {@link #NOISE_ENVELOPE} - for random-length ramps between random values between 0 and 1.
  • * - * - * @beads.category synth + * * @author Benito Crawford * @version 0.9.6 * @@ -64,7 +63,20 @@ public enum Mode { public RandomPWM(AudioContext context, Mode mode, float minl, float maxl) { this(context, mode, minl, maxl, 1); } - + + /** + * Constructor specifying mode, and minumum and maximum pulse lengths. + * @param mode + * The pulse mode; see {@link #setMode(Mode) setMode}. + * @param minl + * The minimum pulse length. + * @param maxl + * The maximum pulse length. + */ + public RandomPWM(Mode mode, float minl, float maxl){ + this(getDefaultContext(), mode, minl, maxl); + } + /** * Constructor specifying all parameters * @@ -85,6 +97,25 @@ public RandomPWM(AudioContext context, Mode mode, float minl, float maxl, setParams(mode, minl, maxl, lexp); } + /** + * Constructor specifying all parameters + * + * @param mode + * The pulse mode; see {@link #setMode(Mode) setMode}. + * @param minl + * The minimum pulse length. + * @param maxl + * The maximum pulse length. + * @param lexp + * The pulse length exponent. + */ + public RandomPWM(Mode mode, float minl, float maxl, + float lexp) { + + this(getDefaultContext(), mode, minl, maxl, lexp); + } + + public void calculateBuffer() { float[] bo = bufOut[0]; diff --git a/src/beads_main/net/beadsproject/beads/ugens/RangeLimiter.java b/src/beads_main/java/net/beadsproject/beads/ugens/RangeLimiter.java similarity index 85% rename from src/beads_main/net/beadsproject/beads/ugens/RangeLimiter.java rename to src/beads_main/java/net/beadsproject/beads/ugens/RangeLimiter.java index b138b1c..a00a81d 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/RangeLimiter.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/RangeLimiter.java @@ -9,8 +9,7 @@ /** * RangeLimiter forces a signal within the range [-1,1]. Use {@link Clip} for * constraining to other ranges. - * - * @beads.category utilities + * * @author ollie * @author benito * @version 0.9.5 @@ -29,6 +28,16 @@ public RangeLimiter(AudioContext context, int channels) { super(context, channels, channels); } + /** + * Instantiates a new RangeLimiter. + * + * @param channels + * The number of channels. + */ + public RangeLimiter(int channels) { + this(getDefaultContext(), channels); + } + /* * (non-Javadoc) * diff --git a/src/beads_main/net/beadsproject/beads/ugens/RecordToSample.java b/src/beads_main/java/net/beadsproject/beads/ugens/RecordToSample.java similarity index 91% rename from src/beads_main/net/beadsproject/beads/ugens/RecordToSample.java rename to src/beads_main/java/net/beadsproject/beads/ugens/RecordToSample.java index b494de2..473c9a1 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/RecordToSample.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/RecordToSample.java @@ -30,8 +30,7 @@ * ADVANCED: When resizing a sample in INFINITE mode, the recorder uses a set of parameters * that specify how it behaves. If necessary you can modify the parameters on a per-recorder basis. See * {@link #setResizingParameters(double, double)}. - * - * @beads.category utilities + * * */ public class RecordToSample extends UGen { @@ -79,12 +78,23 @@ public enum Mode { * the AudioContext. * @param sample * the Sample. - * @throws Exception if sample is not writeable. + * //@throws Exception if sample is not writeable. */ public RecordToSample(AudioContext context, Sample sample) { this(context, sample, Mode.FINITE); } - + + /** + * Instantiates a new RecordToSample. + * + * @param sample + * the Sample. + * //@throws Exception if sample is not writeable. + */ + public RecordToSample(Sample sample){ + this(getDefaultContext(), sample); + } + /** * Instantiates a new RecordToSample. * @@ -94,20 +104,36 @@ public RecordToSample(AudioContext context, Sample sample) { * the Sample. * @param mode * the Recording Mode to use. - * @throws Exception if sample is not writeable. + * //@throws Exception if sample is not writeable. */ public RecordToSample(AudioContext context, Sample sample, Mode mode) { this(context, sample.getNumChannels()); this.mode = mode; setSample(sample); } - + + /** + * Instantiates a new RecordToSample. + * + * @param sample + * the Sample. + * @param mode + * the Recording Mode to use. + * //@throws Exception if sample is not writeable. + */ + public RecordToSample(Sample sample, Mode mode) { + this(getDefaultContext(), sample, mode); + } + public RecordToSample(AudioContext context, int numChannels) { super(context, numChannels, 0); mode = Mode.FINITE; sample = null; } + public RecordToSample(int numChannels) { + this(getDefaultContext(), numChannels); + } /** * Gets the Sample. * @@ -293,6 +319,7 @@ public void setResizingParameters(double doubleUpTime, double constantResizeLeng * * @return true if loop record mode is enabled. * @deprecated Use {@link #getMode()} instead. + * //@Deprecated Use {@link #getMode()} instead. */ public boolean isLoopRecord() { return mode==Mode.LOOPING; @@ -303,6 +330,7 @@ public boolean isLoopRecord() { * * @param loopRecord true to enable loop record mode. * @deprecated Use {@link #setMode(Mode)} instead. + * //@Deprecated Use {@link #setMode(Mode)} instead. */ public void setLoopRecord(boolean loopRecord) { mode = Mode.LOOPING; diff --git a/src/beads_main/net/beadsproject/beads/ugens/Reverb.java b/src/beads_main/java/net/beadsproject/beads/ugens/Reverb.java similarity index 92% rename from src/beads_main/net/beadsproject/beads/ugens/Reverb.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Reverb.java index 6327385..0889662 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Reverb.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Reverb.java @@ -12,8 +12,7 @@ * A basic reverb unit with adjustable room size, high-frequency damping, and * early reflections and late reverb levels. If specified, creates a * de-correlated multi-channel effect. - * - * @beads.category effect + * * @author Benito Crawford * @version 0.9.5 */ @@ -40,6 +39,14 @@ public Reverb(AudioContext context) { this(context, 1); } + /** + * Constructor for a reverb unit with one output channel. + * + */ + public Reverb() { + this(getDefaultContext()); + } + /** * Constructor for a reverb unit with the specified number of output * channels. @@ -131,6 +138,17 @@ public Reverb(AudioContext context, int outChannels) { .setLateReverbLevel(1); } + /** + * Constructor for a reverb unit with the specified number of output + * channels. + * + * @param outChannels + * The number of output channels. + */ + public Reverb(int outChannels) { + this(getDefaultContext(), outChannels); + } + @Override protected void preFrame() { delayModulator.update(); diff --git a/src/beads_main/net/beadsproject/beads/ugens/SamplePlayer.java b/src/beads_main/java/net/beadsproject/beads/ugens/SamplePlayer.java similarity index 72% rename from src/beads_main/net/beadsproject/beads/ugens/SamplePlayer.java rename to src/beads_main/java/net/beadsproject/beads/ugens/SamplePlayer.java index d202e3b..2e58d13 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/SamplePlayer.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/SamplePlayer.java @@ -17,17 +17,14 @@ * {@link Sample} argument, the number of outputs of SamplePlayer is determined * by the number of channels of the {@link Sample}. {@link Sample} playback can * use either linear or cubic interpolation. - * - * TODO: Loop cross-fading has not been implemented yet. - * - * @beads.category sample players + * * @author ollie */ public class SamplePlayer extends UGen { public static final float ADAPTIVE_INTERP_LOW_THRESH = 0.5f; public static final float ADAPTIVE_INTERP_HIGH_THRESH = 2.5f; - + /** * Used to determine what kind of interpolation is used when access samples. */ @@ -133,7 +130,7 @@ public static enum EnvelopeType { protected LoopType loopType; /** The loop cross fade in milliseconds. */ - protected float loopCrossFade; // TODO loop crossfade behaviour + protected float loopCrossFade; /** * Flag to determine whether playback starts at the beginning of the sample @@ -164,6 +161,12 @@ public static enum EnvelopeType { /** Bead responding to sample at end (only applies when not in loop mode). */ private Bead endListener; + + /** + * Boolean array for determining whether or not the current + * sample is looping for each i in bufferSize. + */ + private boolean[] isLooping; /** * Instantiates a new SamplePlayer with given number of outputs. @@ -185,6 +188,18 @@ public SamplePlayer(AudioContext context, int outs) { loopStartEnvelope = new Static(context, 0.0f); loopEndEnvelope = new Static(context, 0.0f); positionIncrement = context.samplesToMs(1); + loopCrossFade = 0; + isLooping = new boolean[bufferSize]; + } + + /** + * Instantiates a new SamplePlayer with given number of outputs. + * + * @param outs + * the number of outputs. + */ + public SamplePlayer(int outs) { + this(getDefaultContext(), outs); } /** @@ -203,8 +218,18 @@ public SamplePlayer(AudioContext context, Sample buffer) { } /** - * Sets the Sample. + * Instantiates a new SamplePlayer with given Sample. Number of outputs is + * determined by number of channels in Sample. + * + * @param buffer + * the Sample. */ + public SamplePlayer(Sample buffer) { + this(getDefaultContext(), buffer); + } + /** + * Sets the Sample. + */ public void setSample(Sample sample) { this.sample = sample; // sampleRate = sample.getSampleRate(); @@ -484,24 +509,24 @@ public void setInterpolationType(InterpolationType interpolationType) { this.interpolationType = interpolationType; } -// /** -// * Gets the loop cross fade. -// * -// * @return the loop cross fade in milliseconds. -// */ -// public float getLoopCrossFade() { -// return loopCrossFade; -// } + /** + * Gets the loop cross fade. + * + * @return the loop cross fade in milliseconds. + */ + public float getLoopCrossFade() { + return loopCrossFade; + } -// /** -// * Sets the loop cross fade. -// * -// * @param loopCrossFade -// * the new loop cross fade in milliseconds. -// */ -// public void setLoopCrossFade(float loopCrossFade) { -// this.loopCrossFade = loopCrossFade; -// } + /** + * Sets the loop cross fade. + * + * @param loopCrossFade + * the new loop cross fade in milliseconds. + */ + public void setLoopCrossFade(float loopCrossFade) { + this.loopCrossFade = loopCrossFade; + } /** * Gets the loop end envelope. @@ -746,33 +771,158 @@ public void calculateBuffer() { } else // envelopeType==EnvelopeType.FINE { for (int i = 0; i < bufferSize; i++) { - // calculate the samples + // update the position, loop state, direction + calculateNextPosition(i); + + // Crossfade using sound before Loop Start: Requires loop start to be set after 0 for crossfade + // If half of crossfade is greater than gap at the start or at the end, set loopCrossFade to be that length. + if ((loopCrossFade / 2 > Math.min(loopStart, loopEnd)) + || (loopCrossFade / 2 > (sample.getLength() - Math.max(loopStart, loopEnd)))) + { + loopCrossFade = (float) (Math.min( + Math.min(loopStart, loopEnd), sample.getLength() - Math.max(loopStart, loopEnd)) * 2 + ); + } + + // if crossfade ends up larger than the length of the loop + // set it so it's exactly the same length, and if it + // is negative, set it to 0 length. + if (loopCrossFade > Math.abs(loopEnd - loopStart)) { + loopCrossFade = Math.abs(loopEnd - loopStart); + } else if (loopCrossFade < 0) { + loopCrossFade = 0; + } + + float[] crossfadeFrame = new float[sample.getNumChannels()]; + double crossPosition = -1; + double sampleLevel = 1; + + // Calculate the position of the crossfade frame, and the sample level for the current position + // provided there is a set loopCrossFade value, for backwards or forwards loops + if (isLooping[i] && loopCrossFade > 0 + && (loopType == LoopType.LOOP_FORWARDS + || loopType == LoopType.LOOP_BACKWARDS)) { + if (loopStart < loopEnd) { + // If current position is within the end segment of the loop + if (position > loopEnd - loopCrossFade / 2) { + // Set cross position to be the relative starting segment + // And set sample level to be relative decreasing (1 -> 0.5) for the end segment + crossPosition = loopStart - (loopEnd - position); + sampleLevel = 1 - Math.max( + Math.min( + ((position - (loopEnd - loopCrossFade / 2)) / loopCrossFade), + 0.5f), + 0); + // If current position is within the start segment of the loop + } else if (position < loopStart + loopCrossFade / 2) { + // Set cross position to be the relative ending segment + // And set sample level to be relative increasing (0.5 -> 1) for the start segment + crossPosition = loopEnd + (position - loopStart); + sampleLevel = Math.max( + Math.min( + ((position - (loopStart - loopCrossFade / 2)) / loopCrossFade), + 1), + 0.5f); + } + } else { + if (position < loopEnd + loopCrossFade / 2) { + crossPosition = loopStart + (position - loopEnd); + sampleLevel = 1 - Math.max( + Math.min( + (((loopEnd + loopCrossFade / 2) - position) / loopCrossFade), + 0.5f), + 0); + } else if (position > loopStart - loopCrossFade / 2) { + crossPosition = loopEnd - (loopStart - position); + sampleLevel = Math.max( + Math.min( + (((loopStart + loopCrossFade / 2) - position) / loopCrossFade), + 1), + 0.5f); + } + } + // Calculate crossfade frame and sample level for alternating loops + } else if (isLooping[i] && loopCrossFade > 0 + && loopType == LoopType.LOOP_ALTERNATING) { + // Alternating loops only reach the end of the loop by going LOOP_FORWARD, + // and only reach the beginning of the loop by going LOOP_BACKWARD. + + // If current position is within the end segment of the loop (LOOP_FORWARD) + if (position > loopEnd - loopCrossFade / 2) { + // Set cross position to be the relative starting segment for LOOP_BACKWARDS + // And set sample level to be relative decreasing (1 -> 0.5 forwards, 0.5 -> 1 backwards) + crossPosition = loopEnd + (loopEnd - position); + sampleLevel = 1 - Math.max( + Math.min( + ((position - (loopEnd - loopCrossFade / 2)) / loopCrossFade), + 0.5f), + 0); + // If current position is within the start segment of the loop (LOOP_BACKWARDS) + } else if (position < loopStart + loopCrossFade / 2) { + // Set cross position to be the relative ending segment for LOOP_FORWARDS + // And set sample level to be relative increasing (1 -> 0.5 backwards, 0.5 -> 1 forwards) + crossPosition = loopStart - (position - loopStart); + sampleLevel = Math.max( + Math.min( + ((position - (loopStart - loopCrossFade / 2)) / loopCrossFade), + 1), + 0.5f); + } + // Set isLooping once the first 'start segment' has played + // and we have reached the non crossfade section of the loop + } else if (!isLooping[i]){ + if (loopStart < loopEnd && + position > loopStart + loopCrossFade / 2) { + isLooping[i] = true; + } else if (loopEnd < loopStart && + position < loopStart - loopCrossFade / 2) { + isLooping[i] = true; + } + } + + // Reset crossfade position if it is not within the boundaries of loopStart - crossLength < p < loopStart + // or loopStart + crossLength > p > loopStart if LoopEnd < loopStart + if (crossPosition < (Math.min(loopStart, loopEnd) - loopCrossFade/2) + || crossPosition > (Math.max(loopStart, loopEnd) + loopCrossFade/2)) + crossPosition = -1; + //---- + + // calculate the samples using position and crossPosition pointers. + // if either are out of bounds, getFrame() handles this by returning 0-filled array. switch (interpolationType) { case ADAPTIVE: if (rate > ADAPTIVE_INTERP_HIGH_THRESH) { sample.getFrameNoInterp(position, frame); + sample.getFrameNoInterp(crossPosition, crossfadeFrame); } else if (rate > ADAPTIVE_INTERP_LOW_THRESH) { sample.getFrameLinear(position, frame); + sample.getFrameLinear(crossPosition, crossfadeFrame); } else { sample.getFrameCubic(position, frame); + sample.getFrameCubic(crossPosition, crossfadeFrame); } break; case LINEAR: sample.getFrameLinear(position, frame); + sample.getFrameLinear(crossPosition, crossfadeFrame); break; case CUBIC: sample.getFrameCubic(position, frame); + sample.getFrameCubic(crossPosition, crossfadeFrame); break; case NONE: sample.getFrameNoInterp(position, frame); + sample.getFrameNoInterp(crossPosition, crossfadeFrame); break; } + + for (int j = 0; j < outs; j++) { - bufOut[j][i] = frame[j % sample.getNumChannels()]; - //TODO loop crossfades here? + bufOut[j][i] = (crossPosition != -1) ? + (float) sampleLevel * frame[j % sample.getNumChannels()] + + (float) (1 - sampleLevel) * crossfadeFrame[j % sample.getNumChannels()] : + (float) sampleLevel * frame[j % sample.getNumChannels()]; } - // update the position, loop state, direction - calculateNextPosition(i); } } } @@ -804,7 +954,7 @@ public boolean getKillOnEnd() { * Called when at the end of the Sample, assuming the loop mode is * non-looping, or beginning, if the SamplePlayer is playing backwards.. */ - private void atEnd() { + protected void atEnd() { if (endListener != null) { endListener.message(this); } @@ -818,7 +968,7 @@ private void atEnd() { * the end. This occurs when the SamplePlayer's position reaches then end * when playing forwards in a non-looping mode, or reaches the the beginning * when playing backwards in a non-looping mode. It is never triggered in a - * looping mode. As an alternative, you can use the method {@link Bead.#setKillListener(Bead)} as long as {@link #setKillOnEnd(boolean)} is + * looping mode. As an alternative, you can use the method {@link Bead#setKillListener(Bead)} as long as {@link #setKillOnEnd(boolean)} is * set to true. In other words, you set this SamplePlayer to kill itself * when it reaches the end of the sample, and then use the functionality of * {@link Bead}, which allows you to create a trigger whenever a Bead is @@ -835,7 +985,7 @@ public void setEndListener(Bead endListener) { /** * Gets the current endListener. * - * @see {#setEndListener(Bead)}. + * //@see {@link #setEndListener(Bead)} * @return the current endListener. */ public Bead getEndListener() { diff --git a/src/beads_main/net/beadsproject/beads/ugens/ScalingMixer.java b/src/beads_main/java/net/beadsproject/beads/ugens/ScalingMixer.java similarity index 81% rename from src/beads_main/net/beadsproject/beads/ugens/ScalingMixer.java rename to src/beads_main/java/net/beadsproject/beads/ugens/ScalingMixer.java index 227db0b..3b07417 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/ScalingMixer.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/ScalingMixer.java @@ -9,7 +9,6 @@ /** * ScalingMixer scales the gain of the signal at each input by the number of {@link UGen}s connected to that input, passing the scaled signal to the corresponding output. * - * @beads.category effect * @author ollie */ public class ScalingMixer extends UGen { @@ -23,7 +22,15 @@ public class ScalingMixer extends UGen { public ScalingMixer(AudioContext context) { this(context, 1); } - + + /** + * Instantiates a new ScalingMixer. + * + */ + public ScalingMixer() { + this(getDefaultContext()); + } + /** * Instantiates a new ScalingMixer. * @@ -35,7 +42,17 @@ public ScalingMixer(AudioContext context) { public ScalingMixer(AudioContext context, int inouts) { super(context, inouts, inouts); } - + + /** + * Instantiates a new ScalingMixer. + * + * @param inouts + * the number of inputs (= the number of outputs). + */ + public ScalingMixer(int inouts) { + this(getDefaultContext(), inouts); + } + /* (non-Javadoc) * @see com.olliebown.beads.core.UGen#calculateBuffer() */ diff --git a/src/beads_main/net/beadsproject/beads/ugens/SignalReporter.java b/src/beads_main/java/net/beadsproject/beads/ugens/SignalReporter.java similarity index 81% rename from src/beads_main/net/beadsproject/beads/ugens/SignalReporter.java rename to src/beads_main/java/net/beadsproject/beads/ugens/SignalReporter.java index 7576871..f55da99 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/SignalReporter.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/SignalReporter.java @@ -8,8 +8,7 @@ /** * An easy way to monitor a signal; useful for debugging signal chains. - * - * @beads.category lowlevel + * * @author Benito Crawford * @version 0.9.3 */ @@ -40,6 +39,20 @@ public SignalReporter(AudioContext context, float reportInterval, context.out.addDependent(this); } + /** + * Constructor for a SignalReporter that calls {@link #notify()} at the + * specified interval, with the specified name. + * + * @param reportInterval + * The interval between reports, in milliseconds. + * @param name + * The SignalReporter name (used in reports). + */ + public SignalReporter(float reportInterval, + String name) { + + this(getDefaultContext(), reportInterval, name); + } /** * Sets the report interval. * diff --git a/src/beads_main/net/beadsproject/beads/ugens/Spatial.java b/src/beads_main/java/net/beadsproject/beads/ugens/Spatial.java similarity index 90% rename from src/beads_main/net/beadsproject/beads/ugens/Spatial.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Spatial.java index ddae6ed..d7493cb 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Spatial.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Spatial.java @@ -17,7 +17,7 @@ import net.beadsproject.beads.core.UGen; /** - * A mixer for a speaker config in any number of dimensions (we haven't tested D>3 yet). + * A mixer for a speaker config in any number of dimensions (we haven't tested D > 3 yet). * Add sources (UGens) and control their locations using other UGens. Locations are changed on a per-channel basis, * so that multichannel files can be located in the mixer independently. * @@ -32,8 +32,7 @@ * the x-axis follows the line joining 1 and 4 * the y-axis follows the line joining 1 and 2 * the z-axis follows the line joining 1 and 5 - * - * @beads.category utilities + * * @author ollie * */ @@ -192,7 +191,17 @@ void mixInAudio(float[][] output) { public Spatial(AudioContext context, int dimensions) { this(context, dimensions, (float)Math.sqrt(dimensions)); } - + + /** + * Instantiates a new Spatial with given AudioContext and dimensions. The default speaker config for the dimensionality + * is used, and the default sphereDiameter (equal to Math.sqrt(dimensions)). + * + * @param dimensions the dimensions + */ + public Spatial(int dimensions) { + this(getDefaultContext(), dimensions); + } + /** * Instantiates a new Spatial with given AudioContext and sphereDiameter. * @@ -239,10 +248,20 @@ public Spatial(AudioContext context, int dimensions, float sphereDiameter) { setup(); } + /** + * Instantiates a new Spatial with given AudioContext and sphereDiameter. + * + * @param dimensions the number of dimensions, between 1 and 3. + * @param sphereDiameter the sphere diameter. + */ + public Spatial(int dimensions, float sphereDiameter) { + this(getDefaultContext(), dimensions, sphereDiameter); + } + /** * Instantiates a new Spatial with given AudioContext, dimensions and locations. The locations array * is an array of the form float[speakerNumber][dimension]. - * + * * @param context the context. * @param dimensions the dimensions. * @param locations the locations. @@ -250,11 +269,22 @@ public Spatial(AudioContext context, int dimensions, float sphereDiameter) { public Spatial(AudioContext context, int dimensions, float[][] locations) { this(context, dimensions, locations, (float)Math.sqrt(dimensions)); } - + + /** + * Instantiates a new Spatial with given AudioContext, dimensions and locations. The locations array + * is an array of the form float[speakerNumber][dimension]. + * + * @param dimensions the dimensions. + * @param locations the locations. + */ + public Spatial( int dimensions, float[][] locations) { + this(getDefaultContext(), dimensions, locations); + } + /** * Instantiates a new Spatial with the given AudioContext, dimensions, locations and sphereDiamater. The locations array * is an array of the form float[speakerNumber][dimension]. - * + * * @param context the context * @param dimensions the dimensions * @param locations the locations @@ -267,7 +297,19 @@ public Spatial(AudioContext context, int dimensions, float[][] locations, float setSphereDiameter(sphereDiameter); setup(); } - + + /** + * Instantiates a new Spatial with the given AudioContext, dimensions, locations and sphereDiamater. The locations array + * is an array of the form float[speakerNumber][dimension]. + * + * @param dimensions the dimensions + * @param locations the locations + * @param sphereDiameter the sphere diameter + */ + public Spatial(int dimensions, float[][] locations, float sphereDiameter) { + this(getDefaultContext(), dimensions, locations, sphereDiameter); + } + /** * Setup. */ diff --git a/src/beads_main/net/beadsproject/beads/ugens/Static.java b/src/beads_main/java/net/beadsproject/beads/ugens/Static.java similarity index 95% rename from src/beads_main/net/beadsproject/beads/ugens/Static.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Static.java index bb5b670..cca6c0b 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Static.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Static.java @@ -9,7 +9,6 @@ /** * Static represents a {@link UGen} with a fixed value. Since the value is fixed, Static doesn't actually calculate anything, and overrides the methods {@link #getValue()} and {@link #getValue(int, int)} to return its fixed value. * - * @beads.category utilities * @author ollie */ public class Static extends UGen { @@ -33,6 +32,10 @@ public Static(AudioContext context, float x) { pause(true); //might as well be muted } + public Static(float x) { + this(getDefaultContext(), x); + } + /* (non-Javadoc) * @see com.olliebown.beads.core.UGen#calculateBuffer() */ diff --git a/src/beads_main/net/beadsproject/beads/ugens/TapIn.java b/src/beads_main/java/net/beadsproject/beads/ugens/TapIn.java similarity index 92% rename from src/beads_main/net/beadsproject/beads/ugens/TapIn.java rename to src/beads_main/java/net/beadsproject/beads/ugens/TapIn.java index 34042b1..cd9fc0b 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/TapIn.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/TapIn.java @@ -11,8 +11,7 @@ /** * TapIn stores and serves sound data. Can be used with TapOut to implement * delays, etc. - * - * @beads.category effect + * * @author ben * @author Benito Crawford * @version 0.9 @@ -42,6 +41,14 @@ public TapIn(AudioContext ac, float maxDelayInMS) { counter = 0; } + /** + * @param maxDelayInMS + * The size of the tapin memory buffer in milliseconds. + */ + public TapIn(float maxDelayInMS) { + this(getDefaultContext(), maxDelayInMS); + } + public float getMaxDelayMS() { return (float) context.samplesToMs(maxDelay); } diff --git a/src/beads_main/net/beadsproject/beads/ugens/TapOut.java b/src/beads_main/java/net/beadsproject/beads/ugens/TapOut.java similarity index 72% rename from src/beads_main/net/beadsproject/beads/ugens/TapOut.java rename to src/beads_main/java/net/beadsproject/beads/ugens/TapOut.java index 5918e1d..588af40 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/TapOut.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/TapOut.java @@ -12,8 +12,7 @@ * interpolation), and {@link #ALLPASS} (all-pass interpolation). Delay time is * specified in milliseconds and can be set by either a static float value or a * UGen. - * - * @beads.category effect + * * @author ben * @author Benito Crawford * @version 0.9 @@ -42,7 +41,20 @@ public class TapOut extends UGen { public static final InterpolationType ALLPASS = InterpolationType.ALLPASS; public enum InterpolationType { - NO_INTERP, LINEAR, ALLPASS + /** + * No Interpolation + */ + NO_INTERP, + + /** + * for linear interpolation + */ + LINEAR, + + /** + * all-pass interpolation + */ + ALLPASS } protected TapOut(AudioContext ac, TapIn ti) { @@ -69,6 +81,19 @@ public TapOut(AudioContext ac, TapIn ti, float delay) { setDelay(delay); } + /** + * Constructor for a given TapIn object with a static float delay. The mode + * is set to the default (no interpolation). + * + * @param ti + * The TapIn from which to draw the delayed signal. + * @param delay + * The delay time in milliseconds. + */ + public TapOut(TapIn ti, float delay) { + this(getDefaultContext(), ti, delay); + } + /** * Constructor for a given TapIn object with a delay time specified by a * UGen. The mode is set to the default (no interpolation). @@ -85,6 +110,19 @@ public TapOut(AudioContext ac, TapIn ti, UGen delayUGen) { setDelay(delayUGen); } + /** + * Constructor for a given TapIn object with a delay time specified by a + * UGen. The mode is set to the default (no interpolation). + * + * @param ti + * The TapIn from which to draw the delayed signal. + * @param delayUGen + * The UGen specifying the delay time in milliseconds. + */ + public TapOut(TapIn ti, UGen delayUGen) { + this(getDefaultContext(), ti, delayUGen); + } + /** * Constructor for a given TapIn object with a static float delay, using the * specified delay mode. @@ -103,6 +141,21 @@ public TapOut(AudioContext ac, TapIn ti, InterpolationType mode, float delay) { setDelay(delay).setMode(mode); } + /** + * Constructor for a given TapIn object with a static float delay, using the + * specified delay mode. + * + * @param ti + * The TapIn from which to draw the delayed signal. + * @param mode + * The delay mode; see {@link #setMode(InterpolationType)}. + * @param delay + * The delay time in milliseconds. + */ + public TapOut(TapIn ti, InterpolationType mode, float delay) { + this(getDefaultContext(), ti, mode, delay); + } + /** * Constructor for a given TapIn object with a delay time specified by a * UGen, using the specified delay mode. @@ -121,6 +174,21 @@ public TapOut(AudioContext ac, TapIn ti, InterpolationType mode, UGen delayUGen) setDelay(delay).setMode(mode); } + /** + * Constructor for a given TapIn object with a delay time specified by a + * UGen, using the specified delay mode. + * + * @param ti + * The TapIn from which to draw the delayed signal. + * @param mode + * The delay mode; see {@link #setMode(InterpolationType)}. + * @param delayUGen + * The UGen specifying the delay time in milliseconds. + */ + public TapOut(TapIn ti, InterpolationType mode, UGen delayUGen) { + this(getDefaultContext(), ti, mode, delayUGen); + } + @Override public void calculateBuffer() { @@ -217,13 +285,7 @@ public UGen getDelayUGen() { } /** - * Sets the delay mode. Use the following values: - *

    - *

      - *
    • {@value #NO_INTERP} for no interpolation.
    • - *
    • {@value #LINEAR} for linear interpolation.
    • - *
    • {@value #ALLPASS} for all-pass interpolation.
    • - *
    + * Sets the delay mode as {@link InterpolationType}. * * @param mode * The delay mode. diff --git a/src/beads_main/net/beadsproject/beads/ugens/Throughput.java b/src/beads_main/java/net/beadsproject/beads/ugens/Throughput.java similarity index 69% rename from src/beads_main/net/beadsproject/beads/ugens/Throughput.java rename to src/beads_main/java/net/beadsproject/beads/ugens/Throughput.java index e285e9f..750f9c0 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/Throughput.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/Throughput.java @@ -27,6 +27,14 @@ public Throughput(AudioContext context) { this(context, 1); } + /** + * Constructor for a one-channel Throughput using the defualt audio + * context. + */ + public Throughput() { + this(getDefaultContext()); + } + /** * Constructor for a Throughput with the specified number of channels, using * the specified audio context. @@ -42,6 +50,17 @@ public Throughput(AudioContext context, int channels) { bufOut = bufIn; } + /** + * Constructor for a Throughput with the specified number of channels, using + * the default audio context. + * + * @param channels + * The number of channels. + */ + public Throughput(int channels) { + this(getDefaultContext(), channels); + } + @Override public void calculateBuffer() { } diff --git a/src/beads_main/net/beadsproject/beads/ugens/TrapezoidWave.java b/src/beads_main/java/net/beadsproject/beads/ugens/TrapezoidWave.java similarity index 94% rename from src/beads_main/net/beadsproject/beads/ugens/TrapezoidWave.java rename to src/beads_main/java/net/beadsproject/beads/ugens/TrapezoidWave.java index 1bda27c..dd23608 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/TrapezoidWave.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/TrapezoidWave.java @@ -44,6 +44,14 @@ public TrapezoidWave(AudioContext con) { calcVals(); } + /** + * Constructor. + * + */ + public TrapezoidWave() { + this(getDefaultContext()); + } + @Override public void calculateBuffer() { float[] bo = bufOut[0]; diff --git a/src/beads_main/net/beadsproject/beads/ugens/WavePlayer.java b/src/beads_main/java/net/beadsproject/beads/ugens/WavePlayer.java similarity index 91% rename from src/beads_main/net/beadsproject/beads/ugens/WavePlayer.java rename to src/beads_main/java/net/beadsproject/beads/ugens/WavePlayer.java index 867fd5e..a3fcdc9 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/WavePlayer.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/WavePlayer.java @@ -23,8 +23,7 @@ * @see SineBuffer * @see SawBuffer * @see SquareBuffer - * - * @beads.category synth + * * @author ollie */ public class WavePlayer extends UGen { @@ -72,6 +71,20 @@ public WavePlayer(AudioContext context, UGen frequencyController, setFrequency(frequencyController); } + /** + * Instantiates a new WavePlayer with given frequency envelope and Buffer. + * + * @param frequencyController + * the frequency envelope. + * @param buffer + * the Buffer. + */ + public WavePlayer(UGen frequencyController, + Buffer buffer) { + this(getDefaultContext(), frequencyController, buffer); + + } + /** * Instantiates a new WavePlayer with given static frequency and Buffer. * @@ -87,6 +100,18 @@ public WavePlayer(AudioContext context, float frequency, Buffer buffer) { setFrequency(frequency); } + /** + * Instantiates a new WavePlayer with given static frequency and Buffer. + * + * @param frequency + * the frequency in Hz. + * @param buffer + * the Buffer. + */ + public WavePlayer(float frequency, Buffer buffer) { + this(getDefaultContext(), frequency, buffer); + } + /* * (non-Javadoc) * diff --git a/src/beads_main/net/beadsproject/beads/ugens/WaveShaper.java b/src/beads_main/java/net/beadsproject/beads/ugens/WaveShaper.java similarity index 85% rename from src/beads_main/net/beadsproject/beads/ugens/WaveShaper.java rename to src/beads_main/java/net/beadsproject/beads/ugens/WaveShaper.java index 2582941..987abe2 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/WaveShaper.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/WaveShaper.java @@ -12,7 +12,6 @@ /** * A simple wave-shaper. WaveShaper takes an incoming signal, maps it onto a * stored wave shape, and outputs the result. For each sample it: - *

    *

      *
    1. Multiplies by the preGain.
    2. *
    3. Clips between -1 and 1, and maps onto the stored wave shape, with linear @@ -27,8 +26,7 @@ * This UGen is a {@link DataBeadReceiver}, so you can set its parameters with a * DataBead. *

      - * - * @beads.category synth + * * @author Benito Crawford * @version 0.9.5 */ @@ -54,6 +52,15 @@ public WaveShaper(AudioContext context) { this(context, 1); } + /** + * Constructor for a mono-channel wave shaper that uses a default + * cosine-based wave shape. + * + */ + public WaveShaper() { + this(getDefaultContext()); + } + /** * Constructor for a multi-channel wave shaper that uses a default * cosine-based wave shape. @@ -70,6 +77,17 @@ public WaveShaper(AudioContext context, int channels) { setShape(generateCosineShape(1025)); } + /** + * Constructor for a multi-channel wave shaper that uses a default + * cosine-based wave shape. + * + * @param channels + * The number of channels. + */ + public WaveShaper(int channels) { + this(getDefaultContext(), channels); + } + /** * Constructor for a mono-channel wave shaper that uses the provided float * array for its wave shape. @@ -84,6 +102,17 @@ public WaveShaper(AudioContext context, float[] shape) { setShape(shape); } + /** + * Constructor for a mono-channel wave shaper that uses the provided float + * array for its wave shape. + * + * @param shape + * The float array. + */ + public WaveShaper(float[] shape) { + this(getDefaultContext(), shape); + } + /** * Constructor for a multi-channel wave shaper that uses the provided float * array for its wave shape. @@ -100,6 +129,19 @@ public WaveShaper(AudioContext context, int channels, float[] shape) { setShape(shape); } + /** + * Constructor for a multi-channel wave shaper that uses the provided float + * array for its wave shape. + * + * @param channels + * The number of channels. + * @param shape + * The float array. + */ + public WaveShaper(int channels, float[] shape) { + this(getDefaultContext(), channels, shape); + } + /** * Constructor for a mono-channel wave shaperthat uses the float array from * a Buffer for its wave shape. @@ -114,6 +156,17 @@ public WaveShaper(AudioContext context, Buffer shapeBuffer) { setShape(shapeBuffer.buf); } + /** + * Constructor for a mono-channel wave shaperthat uses the float array from + * a Buffer for its wave shape. + * + * @param shapeBuffer + * The Buffer from which to get the wave shape. + */ + public WaveShaper(Buffer shapeBuffer) { + this(getDefaultContext(), shapeBuffer); + } + /** * Constructor for a multi-channel wave shaper that uses the float array * from a Buffer for its wave shape. @@ -130,6 +183,19 @@ public WaveShaper(AudioContext context, int channels, Buffer shapeBuffer) { setShape(shapeBuffer.buf); } + /** + * Constructor for a multi-channel wave shaper that uses the float array + * from a Buffer for its wave shape. + * + * @param channels + * The number of channels. + * @param shapeBuffer + * The Buffer from which to get the wave shape. + */ + public WaveShaper(int channels, Buffer shapeBuffer) { + this(getDefaultContext(), channels, shapeBuffer); + } + /** * Generates a nice cosine-based waveform in a float array that will provide * a little warmth when used for wave-shaping. diff --git a/src/beads_main/net/beadsproject/beads/ugens/ZMap.java b/src/beads_main/java/net/beadsproject/beads/ugens/ZMap.java similarity index 90% rename from src/beads_main/net/beadsproject/beads/ugens/ZMap.java rename to src/beads_main/java/net/beadsproject/beads/ugens/ZMap.java index 04b9b0e..390e6b8 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/ZMap.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/ZMap.java @@ -13,8 +13,7 @@ * controlled by specifying the ranges from and to which to map, or by * specifying a multiplier and shift (addition) value. Optionally, the signal * can be clipped to the specified range. - * - * @beads.category lowlevel + * * @author Benito Crawford * @version 0.9.5 */ @@ -38,6 +37,16 @@ public ZMap(AudioContext context) { this(context, 1); } + /** + * Constructor for a 1-channel mapping object with default parameters + * (mapping [0,1] to [0,1] with no clipping, or multiplying by 1 and adding + * 0). + * + */ + public ZMap() { + this(getDefaultContext()); + } + /** * Constructor for a mapping object with the specified number of channels * and the default parameters (mapping [0,1] to [0,1] with no clipping, or @@ -54,6 +63,18 @@ public ZMap(AudioContext context, int channels) { clear(); } + /** + * Constructor for a mapping object with the specified number of channels + * and the default parameters (mapping [0,1] to [0,1] with no clipping, or + * multiplying by 1 and adding 0). + * + * @param channels + * The number of channels. + */ + public ZMap(int channels) { + this(getDefaultContext(), channels); + } + @Override public void calculateBuffer() { for (int j = 0; j < channels; j++) { diff --git a/src/beads_main/net/beadsproject/beads/ugens/ZeroCross.java b/src/beads_main/java/net/beadsproject/beads/ugens/ZeroCross.java similarity index 81% rename from src/beads_main/net/beadsproject/beads/ugens/ZeroCross.java rename to src/beads_main/java/net/beadsproject/beads/ugens/ZeroCross.java index 3c0aba1..3973fd8 100644 --- a/src/beads_main/net/beadsproject/beads/ugens/ZeroCross.java +++ b/src/beads_main/java/net/beadsproject/beads/ugens/ZeroCross.java @@ -9,8 +9,7 @@ /** * Counts and outputs as a signal the number of zero crossings in its input * signal over a specified time frame. - * - * @beads.category lowlevel + * * @author Benito Crawford * @version 0.9.5 */ @@ -35,6 +34,17 @@ public ZeroCross(AudioContext context, float memSizeInMS) { cross = new boolean[memSize]; } + /** + * Constructor. The specified memory size indicates the time frame over + * which zero crossings are counted. + * + * @param memSizeInMS + * The time frame in milliseconds. + */ + public ZeroCross(float memSizeInMS) { + this(getDefaultContext(), memSizeInMS); + } + @Override public void calculateBuffer() { diff --git a/src/beads_main/java/net/beadsproject/beads/ugens/package.html b/src/beads_main/java/net/beadsproject/beads/ugens/package.html new file mode 100644 index 0000000..6653476 --- /dev/null +++ b/src/beads_main/java/net/beadsproject/beads/ugens/package.html @@ -0,0 +1,7 @@ + + + + + Provides a set of useful UGens. + + \ No newline at end of file diff --git a/src/beads_main/net/beadsproject/beads/data/Pitch.java b/src/beads_main/net/beadsproject/beads/data/Pitch.java deleted file mode 100644 index 51b8747..0000000 --- a/src/beads_main/net/beadsproject/beads/data/Pitch.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * This file is part of Beads. See http://www.beadsproject.net for all information. - */ -package net.beadsproject.beads.data; - -/** - * A set of static fields and utility methods associated with pitch. - * - * @beads.category data - * @author ollie - */ -public abstract class Pitch { - - /** The constant log(2) = 0.6931472. */ - public final static float LOG2 = 0.6931472f; - - /** - * Convert frequency to MIDI note number. - * - * @param frequency - * the required frequency. - * - * @return the resulting MIDI note number. - */ - public static final float ftom(float frequency) { - return Math.max(0f, (float)Math.log(frequency / 440.0f) / LOG2 * 12f + 69f); - } - - /** - * Convert MIDI note number to frequency. - * - * @param midi - * the required MIDI note number. - * - * @return the resulting frequency. - */ - public static final float mtof(float midi) { - return 440.0f * (float)Math.pow(2.0f, (midi - 69f) / 12.0f); - } - - /** - * Takes a pitch and returns that pitch adjusted downwards to the nearest pitch in the given scale. - * - * @param pitch the pitch to modify. - * @param scale the scale to use. - * @param notesPerOctave how many notes in your octave (12 if you're not sure). - * @return adjusted pitch. - */ - public static final int forceToScale(int pitch, int[] scale, int notesPerOctave) { - int pitchClass = pitch % notesPerOctave; - int register = pitch / notesPerOctave; - int newPitchClass = -1; - for(int i = scale.length - 1; i >= 0; i--) { - if(pitchClass >= scale[i]) { - newPitchClass = scale[i]; - break; - } - } - if(newPitchClass == -1) { - newPitchClass = pitchClass; - } - return register * notesPerOctave + newPitchClass; - } - - /** - * Takes a pitch and returns that pitch adjusted downwards to the nearest pitch in the given scale. Assumes 12 pitches per octave. - * - * @param pitch the pitch to modify. - * @param scale the scale to use. - * @return adjusted pitch. - */ - public static final int forceToScale(int pitch, int[] scale) { - return forceToScale(pitch, scale, 12); - } - - public static final float forceFrequencyToScale(float freq, int[] scale) { - return mtof(forceToScale((int)ftom(freq), scale)); - } - - /** Pitch names for scale starting at C. */ - public static final String[] pitchNames = new String[]{"C", "Db", "D", "Eb", "E", "F", "Gb", "G", "Ab", "A", "Bb", "B"}; - - /** The dorian scale relative to root. */ - public static final int[] dorian = {0, 2, 3, 5, 7, 9, 10}; - - /** The major scale relative to root. */ - public static final int[] major = {0, 2, 4, 5, 7, 9, 11}; - - /** The minor scale relative to root. */ - public static final int[] minor = {0, 2, 3, 5, 7, 8, 10}; - - /** The circle of fifths relative to root. */ - public static final int[] circleOfFifths = {0, 5, 10, 3, 8, 1, 6, 11, 4, 9, 2, 7}; - - /** Pentatonic. */ - public static final int[] pentatonic = {0, 2, 4, 7, 9}; - -} diff --git a/packages/Beads/beads_tutorial/Lesson01_AudioContext.java b/src/beads_tutorial/java/Lesson01_AudioContext.java similarity index 70% rename from packages/Beads/beads_tutorial/Lesson01_AudioContext.java rename to src/beads_tutorial/java/Lesson01_AudioContext.java index 53a1806..b901baf 100644 --- a/packages/Beads/beads_tutorial/Lesson01_AudioContext.java +++ b/src/beads_tutorial/java/Lesson01_AudioContext.java @@ -19,6 +19,9 @@ public static void main(String[] args) { * Beads project. You need it to define various things to do with audio * processing. It also connects the the JavaSound system and provides * you with an output device. + * + * UPDATE: As of Beads (v3.2), Default Audio Contexts (defaultcontext) + * can now be used. Please see below for more details. */ ac = new AudioContext(); /* @@ -52,6 +55,19 @@ public static void main(String[] args) { * Finally, start things running. */ ac.start(); + + /* + * UPDATE: As of Beads v3.2, all UGens have a shared default Audio + * Context in them that can be accessed through AudioContext.getDefaultContext(). + * You will no longer need to explicitly create AudioContext ac and insert this + * when making new UGen objects. This defaultcontext will provide the same effects + * as creating a new AudioContext without any information. If you want to specify + * particular information such as the device or AudioIO you want to use, you will + * need to make your own AudioContext object for that, as shown in this lesson. + * + * Lesson02_EnvelopeAndWavePlayer onwards will instead be using the + * defaultcontext. + */ } } diff --git a/packages/Beads/beads_tutorial/Lesson02_EnvelopeAndWavePlayer.java b/src/beads_tutorial/java/Lesson02_EnvelopeAndWavePlayer.java similarity index 56% rename from packages/Beads/beads_tutorial/Lesson02_EnvelopeAndWavePlayer.java rename to src/beads_tutorial/java/Lesson02_EnvelopeAndWavePlayer.java index d4dfe09..732924a 100644 --- a/packages/Beads/beads_tutorial/Lesson02_EnvelopeAndWavePlayer.java +++ b/src/beads_tutorial/java/Lesson02_EnvelopeAndWavePlayer.java @@ -10,23 +10,33 @@ public class Lesson02_EnvelopeAndWavePlayer { public static void main(String[] args) { - - AudioContext ac; - - ac = new AudioContext(); + + /* + * As we are using the defaultcontext, there is no longer + * a need to create an AudioContext object. For simplicity's sake, + * we'll just give the defaultcontext a local name, and access it + * it using 'ac'. + */ + AudioContext ac = AudioContext.getDefaultContext(); + /* * This is an Envelope. It can be used to modify * the behaviour of other UGen object. We need to * do this to get precise control of certain parameters * at an audio rate. + * + * When using defaultcontexts, we no longer need to pass + * in an explicit AudioContext when constructing new UGens. + * Note that if you use a custom AudioContext, you will need + * pass it into the constructor of each UGen. */ - Envelope freqEnv = new Envelope(ac, 500); + Envelope freqEnv = new Envelope(500); /* * This is a WavePlayer. Here we've set it up using * the above Envelope, and a SineBuffer. We'll use * the Envelope to modify the freqency below. */ - WavePlayer wp = new WavePlayer(ac, freqEnv, Buffer.SINE); + WavePlayer wp = new WavePlayer(freqEnv, Buffer.SINE); /* * So now that the WavePlayer is set up with the * frequency Envelope, do stuff with the frequency @@ -40,8 +50,14 @@ public static void main(String[] args) { /* * Connect it all together as before. */ - Gain g = new Gain(ac, 1, 0.1f); + Gain g = new Gain(1, 0.1f); g.addInput(wp); + + /* + * We will still need to attach all the UGens to the output + * of the defaultcontext and make it start running in order + * for audio to play. We can do this the same way as before. + */ ac.out.addInput(g); ac.start(); diff --git a/packages/Beads/beads_tutorial/Lesson03_FMSynthesis.java b/src/beads_tutorial/java/Lesson03_FMSynthesis.java similarity index 86% rename from packages/Beads/beads_tutorial/Lesson03_FMSynthesis.java rename to src/beads_tutorial/java/Lesson03_FMSynthesis.java index 5790c3b..22175b8 100644 --- a/packages/Beads/beads_tutorial/Lesson03_FMSynthesis.java +++ b/src/beads_tutorial/java/Lesson03_FMSynthesis.java @@ -10,9 +10,8 @@ public class Lesson03_FMSynthesis { public static void main(String[] args) { - AudioContext ac; + AudioContext ac = AudioContext.getDefaultContext(); - ac = new AudioContext(); /* * In the last example, we used an Envelope to * control the frequency of a WavePlayer. @@ -23,7 +22,7 @@ public static void main(String[] args) { * Here's the modulating WavePlayer. It has a low * frequency. */ - WavePlayer freqModulator = new WavePlayer(ac, 50, Buffer.SINE); + WavePlayer freqModulator = new WavePlayer(50, Buffer.SINE); /* * The next line might look outrageous if you're not * experienced in Java. Basically we're defining a @@ -43,12 +42,13 @@ public float calculate() { * Now we plug in the function. Compare this to the previous * example, where we plugged in an envelope. */ - WavePlayer wp = new WavePlayer(ac, function, Buffer.SINE); + WavePlayer wp = new WavePlayer(function, Buffer.SINE); /* * Connect it all together as before. */ - Gain g = new Gain(ac, 1, 0.1f); + Gain g = new Gain(1, 0.1f); g.addInput(wp); + ac.out.addInput(g); ac.start(); diff --git a/packages/Beads/beads_tutorial/Lesson04_SamplePlayer.java b/src/beads_tutorial/java/Lesson04_SamplePlayer.java similarity index 70% rename from packages/Beads/beads_tutorial/Lesson04_SamplePlayer.java rename to src/beads_tutorial/java/Lesson04_SamplePlayer.java index 4c3ee31..cc8fb41 100644 --- a/packages/Beads/beads_tutorial/Lesson04_SamplePlayer.java +++ b/src/beads_tutorial/java/Lesson04_SamplePlayer.java @@ -1,18 +1,20 @@ +import org.jaudiolibs.beads.AudioServerIO; + import net.beadsproject.beads.core.AudioContext; import net.beadsproject.beads.data.SampleManager; import net.beadsproject.beads.ugens.Gain; import net.beadsproject.beads.ugens.SamplePlayer; +import net.beadsproject.beads.ugens.SamplePlayer.EnvelopeType; +import net.beadsproject.beads.ugens.SamplePlayer.LoopType; +import net.beadsproject.beads.ugens.Static; public class Lesson04_SamplePlayer { public static void main(String[] args) { - - AudioContext ac; - - ac = new AudioContext(); + AudioContext ac = AudioContext.getDefaultContext(); /* * Here's how to play back a sample. * @@ -23,18 +25,17 @@ public static void main(String[] args) { * keeps track of loaded audio files according to their file names, so * you don't have to load them again. */ - String audioFile = "audio/1234.aif"; + String audioFile = "audio/kick_back.wav"; // SampleManager.setBufferingRegime(Sample.Regime.newStreamingRegime(1000)); - SamplePlayer player = new SamplePlayer(ac, SampleManager + SamplePlayer player = new SamplePlayer(SampleManager .sample(audioFile)); + /* * And as before... */ - Gain g = new Gain(ac, 2, 0.2f); + Gain g = new Gain(2, 0.2f); g.addInput(player); ac.out.addInput(g); ac.start(); - - } } diff --git a/packages/Beads/beads_tutorial/Lesson05_Clock.java b/src/beads_tutorial/java/Lesson05_Clock.java similarity index 88% rename from packages/Beads/beads_tutorial/Lesson05_Clock.java rename to src/beads_tutorial/java/Lesson05_Clock.java index 9ed066e..62febe7 100644 --- a/packages/Beads/beads_tutorial/Lesson05_Clock.java +++ b/src/beads_tutorial/java/Lesson05_Clock.java @@ -8,10 +8,8 @@ public class Lesson05_Clock { public static void main(String[] args) { + AudioContext ac = AudioContext.getDefaultContext(); - AudioContext ac; - - ac = new AudioContext(); /* * A Clock is an unusual UGen because it doesn't * have any outputs and because objects can listen @@ -23,7 +21,7 @@ public static void main(String[] args) { * * So we begin with the envelope as before. */ - Envelope intervalEnvelope = new Envelope(ac, 1000); + Envelope intervalEnvelope = new Envelope(1000); intervalEnvelope.addSegment(600, 10000); intervalEnvelope.addSegment(1000, 10000); intervalEnvelope.addSegment(400, 10000); @@ -32,7 +30,7 @@ public static void main(String[] args) { * Then the clock, which gets initialised with the * envelope. */ - Clock clock = new Clock(ac, intervalEnvelope); + Clock clock = new Clock(intervalEnvelope); /* * Tell the clock to tick (you probably don't want * to do this except for debugging. diff --git a/packages/Beads/beads_tutorial/Lesson06_Trigger.java b/src/beads_tutorial/java/Lesson06_Trigger.java similarity index 87% rename from packages/Beads/beads_tutorial/Lesson06_Trigger.java rename to src/beads_tutorial/java/Lesson06_Trigger.java index 639577e..f77351d 100644 --- a/packages/Beads/beads_tutorial/Lesson06_Trigger.java +++ b/src/beads_tutorial/java/Lesson06_Trigger.java @@ -11,10 +11,8 @@ public class Lesson06_Trigger { public static void main(String[] args) { + AudioContext ac = AudioContext.getDefaultContext(); - AudioContext ac; - - ac = new AudioContext(); /* * How do you trigger events to happen in the future? * @@ -26,22 +24,22 @@ public static void main(String[] args) { /* * Here is the master gain object. */ - Gain masterGain = new Gain(ac, 1, 1); + Gain masterGain = new Gain(1, 1); /* * Now two things. Firstly, a WavePlayer with an Envelope controlling * its frequency, connected to a Gain. */ - Envelope freqEnv = new Envelope(ac, 250); - WavePlayer wp = new WavePlayer(ac, freqEnv, Buffer.SINE); - Gain g1 = new Gain(ac, 1, 0.3f); + Envelope freqEnv = new Envelope(250); + WavePlayer wp = new WavePlayer(freqEnv, Buffer.SINE); + Gain g1 = new Gain(1, 0.3f); g1.addInput(wp); /* * Secondly, just another WavePlayer connected to a Gain (no Envelope). */ - WavePlayer wp2 = new WavePlayer(ac, 255, Buffer.SQUARE); - Gain g2 = new Gain(ac, 1, 0.1f); + WavePlayer wp2 = new WavePlayer(255, Buffer.SQUARE); + Gain g2 = new Gain(1, 0.1f); g2.addInput(wp2); /* diff --git a/packages/Beads/beads_tutorial/Lesson07_Music.java b/src/beads_tutorial/java/Lesson07_Music.java similarity index 82% rename from packages/Beads/beads_tutorial/Lesson07_Music.java rename to src/beads_tutorial/java/Lesson07_Music.java index 21b708f..b21500c 100644 --- a/packages/Beads/beads_tutorial/Lesson07_Music.java +++ b/src/beads_tutorial/java/Lesson07_Music.java @@ -15,10 +15,8 @@ public class Lesson07_Music { public static void main(String[] args) { + AudioContext ac = AudioContext.getDefaultContext(); - final AudioContext ac; - - ac = new AudioContext(); /* * In this example a Clock is used to trigger events. We do this by * adding a listener to the Clock (which is of type Bead). @@ -29,7 +27,7 @@ public static void main(String[] args) { * This example is more sophisticated than the previous ones. It uses * nested code. */ - Clock clock = new Clock(ac, 700); + Clock clock = new Clock(700); clock.addMessageListener( //this is the on-the-fly bead new Bead() { @@ -42,8 +40,8 @@ public void messageReceived(Bead message) { if(random(1) < 0.5) return; pitch = Pitch.forceToScale((int)random(12), Pitch.dorian); float freq = Pitch.mtof(pitch + (int)random(5) * 12 + 32); - WavePlayer wp = new WavePlayer(ac, freq, Buffer.SINE); - Gain g = new Gain(ac, 1, new Envelope(ac, 0)); + WavePlayer wp = new WavePlayer(freq, Buffer.SINE); + Gain g = new Gain(1, new Envelope(0)); g.addInput(wp); ac.out.addInput(g); ((Envelope)g.getGainUGen()).addSegment(0.1f, random(200)); @@ -54,20 +52,20 @@ public void messageReceived(Bead message) { int pitchAlt = pitch; if(random(1) < 0.2) pitchAlt = Pitch.forceToScale((int)random(12), Pitch.dorian) + (int)random(2) * 12; float freq = Pitch.mtof(pitchAlt + 32); - WavePlayer wp = new WavePlayer(ac, freq, Buffer.SQUARE); - Gain g = new Gain(ac, 1, new Envelope(ac, 0)); + WavePlayer wp = new WavePlayer(freq, Buffer.SQUARE); + Gain g = new Gain(1, new Envelope(0)); g.addInput(wp); - Panner p = new Panner(ac, random(1)); + Panner p = new Panner(random(1)); p.addInput(g); ac.out.addInput(p); ((Envelope)g.getGainUGen()).addSegment(random(0.1), random(50)); ((Envelope)g.getGainUGen()).addSegment(0, random(400), new KillTrigger(p)); } if(c.getCount() % 4 == 0) { - Noise n = new Noise(ac); - Gain g = new Gain(ac, 1, new Envelope(ac, 0.05f)); + Noise n = new Noise(); + Gain g = new Gain(1, new Envelope(0.05f)); g.addInput(n); - Panner p = new Panner(ac, random(0.5) + 0.5f); + Panner p = new Panner(random(0.5) + 0.5f); p.addInput(g); ac.out.addInput(p); ((Envelope)g.getGainUGen()).addSegment(0, random(100), new KillTrigger(p)); diff --git a/packages/Beads/beads_tutorial/Lesson08_Granulation.java b/src/beads_tutorial/java/Lesson08_Granulation.java similarity index 82% rename from packages/Beads/beads_tutorial/Lesson08_Granulation.java rename to src/beads_tutorial/java/Lesson08_Granulation.java index 592597d..cd87030 100644 --- a/packages/Beads/beads_tutorial/Lesson08_Granulation.java +++ b/src/beads_tutorial/java/Lesson08_Granulation.java @@ -1,5 +1,3 @@ - - import net.beadsproject.beads.core.AudioContext; import net.beadsproject.beads.data.SampleManager; import net.beadsproject.beads.ugens.Envelope; @@ -10,17 +8,15 @@ public class Lesson08_Granulation { public static void main(String[] args) { + AudioContext ac = AudioContext.getDefaultContext(); - AudioContext ac; - - ac = new AudioContext(); /* * In lesson 4 we played back samples. This example is almost the same * but uses GranularSamplePlayer instead of SamplePlayer. See some of * the controls below. */ - String audioFile = "audio/1234.aif"; - GranularSamplePlayer player = new GranularSamplePlayer(ac, + String audioFile = "audio/kick_back.wav"; + GranularSamplePlayer player = new GranularSamplePlayer( SampleManager.sample(audioFile)); /* * Have some fun with the controls. @@ -31,11 +27,11 @@ public static void main(String[] args) { player.getLoopEndUGen().setValue( (float)SampleManager.sample(audioFile).getLength()); // control the rate of grain firing - Envelope grainIntervalEnvelope = new Envelope(ac, 100); + Envelope grainIntervalEnvelope = new Envelope(100); grainIntervalEnvelope.addSegment(20, 10000); player.setGrainInterval(grainIntervalEnvelope); // control the playback rate - Envelope rateEnvelope = new Envelope(ac, 1); + Envelope rateEnvelope = new Envelope(1); rateEnvelope.addSegment(1, 5000); rateEnvelope.addSegment(0, 5000); rateEnvelope.addSegment(0, 2000); @@ -43,14 +39,15 @@ public static void main(String[] args) { player.setRate(rateEnvelope); // a bit of noise can be nice player.getRandomnessUGen().setValue(0.01f); + /* * And as before... */ - Gain g = new Gain(ac, 2, 0.2f); + Gain g = new Gain(2, 0.2f); g.addInput(player); ac.out.addInput(g); ac.start(); } -} +} \ No newline at end of file diff --git a/packages/Beads/beads_tutorial/Lesson09_RecordToSample.java b/src/beads_tutorial/java/Lesson09_RecordToSample.java similarity index 95% rename from packages/Beads/beads_tutorial/Lesson09_RecordToSample.java rename to src/beads_tutorial/java/Lesson09_RecordToSample.java index ab5f22c..918f0b4 100644 --- a/packages/Beads/beads_tutorial/Lesson09_RecordToSample.java +++ b/src/beads_tutorial/java/Lesson09_RecordToSample.java @@ -20,6 +20,8 @@ */ public class Lesson09_RecordToSample { public static void main(String[] args) { + AudioContext ac = AudioContext.getDefaultContext(); + /* * This example shows how to save the audio an AudioContext generates to * a file. You need two additional objects: @@ -34,12 +36,11 @@ public static void main(String[] args) { * chain that redirects the audio going through the chain into a * buffer to be saved to a file later. */ - final AudioContext ac = new AudioContext(); // Create the Sample we'll use for our recording buffer final Sample outputSample = new Sample(5000D); // Create the RecordToSample we'll use to take the audio generated by // the AudioContect and send it to the Sample. - final RecordToSample recordToSample = new RecordToSample(ac, + final RecordToSample recordToSample = new RecordToSample( outputSample, RecordToSample.Mode.INFINITE); /* @@ -55,7 +56,7 @@ public static void main(String[] args) { * up a lot of memory, so you don't want to record any more audio than * you actually intend to use. */ - Clock clock = new Clock(ac, 700); + Clock clock = new Clock(700); clock.addMessageListener( // this is the on-the-fly bead new Bead() { @@ -63,8 +64,8 @@ public void messageReceived(Bead message) { Clock c = (Clock) message; if (c.isBeat()) { // Play a tone about once a second - WavePlayer wp = new WavePlayer(ac, 660, Buffer.SQUARE); - Gain g = new Gain(ac, 1, new Envelope(ac, 0)); + WavePlayer wp = new WavePlayer(660, Buffer.SQUARE); + Gain g = new Gain(1, new Envelope(0)); g.addInput(wp); ac.out.addInput(g); ((Envelope) g.getGainUGen()).addSegment(0.1f, 200);