Skip to content

Commit

Permalink
Merge pull request #42 from julianpoy/finalEffects
Browse files Browse the repository at this point in the history
Final effects
  • Loading branch information
julianpoy committed Feb 28, 2016
2 parents b732adb + d01fc46 commit 73aa69a
Show file tree
Hide file tree
Showing 13 changed files with 617 additions and 372 deletions.
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,70 @@ Currently our team contsits of Aaron Turner, @torch2424, and Julian Poyourow, @j
## License

Licensed under the [Apache License 2.0](http://choosealicense.com/licenses/apache-2.0/)

###Random Wad fixes to do

This is more a hackathon note to self. After this is over, should definitely make some pull request.

- Fix tuna in wad. Add the window.tuna check
````javascript
var setUpTunaOnPlay = function(that, arg){
if ( !( that.tuna || arg.tuna ) ) { return }
var tunaConfig = {}
if ( that.tuna ) {
for ( var key in that.tuna ) {
tunaConfig[key] = that.tuna[key]
}
}

// overwrite settings from `this` with settings from arg
if ( arg.tuna ) {
for ( var key in arg.tuna ) {
tunaConfig[key] = arg.tuna[key]
}
}
console.log('tunaconfig: ', tunaConfig);

//Try to set our tuna again
if ( Wad.tuna == undefined &&
window.Tuna != undefined ) {
Wad.tuna = new Tuna(Wad.audioContext)
}


for ( var key in tunaConfig) {
console.log(key);
var tunaEffect = new Wad.tuna[key](tunaConfig[key]);
that.nodes.push(tunaEffect)
}
// console.log(that.nodes)
}
````

- Add additonal effects to be manipulated live (Example with delay, can be done with all effects)
````javascript

//Delay
$scope.masterDelay = 0;
$scope.setDelay = function() {

var time = 1.5;
var delay = parseInt($scope.masterDelay) / 100;

for(var i=0;i<$scope.tracks.length;i++){
if($scope.tracks[i].playing){
//Set the value
$scope.tracks[i].player.delay.delayTime = time;
$scope.tracks[i].player.delay.wet = delay;
$scope.tracks[i].player.delay.feedback = delay;

//Set the node's value
$scope.tracks[i].player.delay.delayNode.delayNode.delayTime.value = time;

$scope.tracks[i].player.delay.delayNode.feedbackNode.gain.value = delay;
$scope.tracks[i].player.delay.delayNode.wetNode.gain.value = delay;
}
}
}

````
61 changes: 50 additions & 11 deletions app/scripts/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
var remote = require('remote');
var dialog = remote.require('dialog');

//Set up tuna node style for Wad :)
var Tuna = require("../../dist/vendor/tuna-min.js");
window.Tuna = Tuna;

//Electron File Menu
const electronRemote = require('electron').remote
const Menu = electronRemote.Menu;
Expand Down Expand Up @@ -239,6 +243,9 @@ Menu.setApplicationMenu(menu);
$scope.removeTrack = function(index){
if($scope.tracks[index].playing) $scope.toggleTrack(index);
$scope.tracks.splice(index, 1);

//Make sure that selected track index for our slider showing is reset
$scope.trackFader = -1;
}

$scope.restartTrack = function(index){
Expand All @@ -264,21 +271,29 @@ Menu.setApplicationMenu(menu);
$scope.tracks[index].player = new Wad({
source : 'file://' + $scope.tracks[index].uri,
volume: 1.0,
wait : 0,
loop: true,
env : { hold : 100000000 },
delay : {
delayTime : 0.5, // Time in seconds between each delayed playback.
wet : 0, // Relative volume change between the original sound and the first delayed playback.
feedback : 0, // Relative volume change between each delayed playback and the next.
wet : 0, // Relative volume change between the original sound and the first delayed playback.
feedback : 0, // Relative volume change between each delayed playback and the next.
},
reverb : {
wet : 0, // Volume of the reverberations.
wet : 0, // Volume of the reverberations.
impulse : '../sounds/impulse.wav' // A URL for an impulse response file, if you do not want to use the default impulse response.
},
filter : {
type : 'lowpass', // What type of filter is applied.
type : 'lowpass', // What type of filter is applied.
frequency : 4000, // The frequency, in hertz, to which the filter is applied.
q : 3, // Q-factor. No one knows what this does. The default value is 1. Sensible values are from 0 to 10.
q : 1, // Q-factor. No one knows what this does. The default value is 1. Sensible values are from 0 to 10.
},
tuna : {
Bitcrusher : {
bits: 16, //1 to 16
normfreq: 1, //0 to 1
bufferSize: 4096 //256 to 16384
}
}
});

Expand Down Expand Up @@ -353,16 +368,28 @@ Menu.setApplicationMenu(menu);

for(var i=0;i<$scope.tracks.length;i++){
if($scope.tracks[i].playing) {
$scope.tracks[i].player.nodes[3].output.gain.value = (parseInt($scope.masterVolume) / 100 * $scope.tracks[i].initVolumeMul);
$scope.tracks[i].playbackVolume = $scope.masterVolume;

//Making variables in relation to the master volume

$scope.tracks[i].player.nodes[4].output.gain.value = parseInt($scope.tracks[i].playbackVolume) / 100 * $scope.tracks[i].initVolumeMul * parseInt($scope.masterVolume) / 100;


console.log(parseInt($scope.tracks[i].playbackVolume));
console.log(parseInt($scope.masterVolume));
console.log($scope.tracks[i].player.nodes[4].output.gain.value);
}
}
}

//Volume
$scope.setTrackVolume = function(index) {

if($scope.tracks[index].playing) $scope.tracks[index].player.nodes[3].output.gain.value = (parseInt($scope.tracks[index].playbackVolume) / 100 * $scope.tracks[index].initVolumeMul);
//Making variables in relation to the master volume
if($scope.tracks[index].playing) $scope.tracks[index].player.nodes[4].output.gain.value = parseInt($scope.tracks[index].playbackVolume) / 100 * $scope.tracks[index].initVolumeMul * parseInt($scope.masterVolume) / 100;
console.log(parseInt($scope.tracks[index].playbackVolume));
console.log(parseInt($scope.masterVolume));
console.log($scope.tracks[index].player.nodes[4].output.gain.value);

}

//Speed
Expand All @@ -371,15 +398,15 @@ Menu.setApplicationMenu(menu);

for(var i=0;i<$scope.tracks.length;i++){
if($scope.tracks[i].playing) {
$scope.tracks[i].player.soundSource.playbackRate.value = parseInt($scope.masterSpeed) / 100;
$scope.tracks[i].playbackSpeed = $scope.masterSpeed;

$scope.tracks[i].player.soundSource.playbackRate.value = parseInt($scope.masterSpeed) / 100 * parseInt($scope.tracks[i].playbackSpeed) / 100;
}
}
}

//Speed
$scope.setTrackSpeed = function(index) {
if($scope.tracks[index].playing) $scope.tracks[index].player.soundSource.playbackRate.value = parseInt($scope.tracks[index].playbackSpeed) / 100;
if($scope.tracks[index].playing) $scope.tracks[index].player.soundSource.playbackRate.value = parseInt($scope.masterSpeed) / 100 * parseInt($scope.tracks[index].playbackSpeed) / 100;
}


Expand Down Expand Up @@ -436,6 +463,18 @@ Menu.setApplicationMenu(menu);
}
}

//BitCrushing
$scope.masterBitCrush = 16;
$scope.setBitCrush = function() {
for(var i=0;i<$scope.tracks.length;i++){
if($scope.tracks[i].playing){
//Set the value
$scope.tracks[i].player.nodes[2].processor.bits = parseInt($scope.masterBitCrush);
$scope.tracks[i].player.nodes[2].processor.normfreq = parseInt($scope.masterBitCrush) / 16;
}
}
}

//Start the timer thread
calculateTime();
}
Expand Down
10 changes: 6 additions & 4 deletions app/styles/_colors.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//Our colors throughpout the app!
$dirTreeBg: #e6d5ac;
$effectsBg: #5a9c4a;
$trackPlaying: lightgrey;

$light: #fafafa;
$cardBg: whitesmoke;
$shadeLight: lightgrey;
$dark: #090909;
$linkColor: #525294;
$buttonColor: $cardBg;

$dirTreeBg: #8bcd73;
$effectsBg: #5a9c4a;
$loopBg: $light;
$trackPlaying: lightgrey;
16 changes: 16 additions & 0 deletions app/styles/_ngAnimate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@
@extend .fadeIn;
}

&.ng-leave {

-webkit-animation-duration: 0s;
animation-duration: 0s;
}

}

.ngFadeTracksTitle {

@extend .crazyAnimated;

&.ng-enter {
@extend .fadeInUp;
}

&.ng-leave {

-webkit-animation-duration: 0s;
Expand Down
22 changes: 22 additions & 0 deletions app/styles/_scrollbars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

.scrollbar
{
overflow-y: scroll;

&::-webkit-scrollbar-track
{
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
background-color: $trackPlaying;
}

&::-webkit-scrollbar
{
width: 6px;
background-color: $trackPlaying;
}

&::-webkit-scrollbar-thumb
{
background-color: $light;
}
}
15 changes: 15 additions & 0 deletions app/styles/_tutorial.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,20 @@
margin-left: auto;
margin-right: auto;
display: block;
width: 200px;
height: 75px;


background-color: $light;
padding-bottom: 0px;
transition: box-shadow 0.5s ease-in-out, padding-bottom 0.5s ease-in-out;
box-shadow: 0px 2px 5px 0px $dark;

&:hover {

background-color: $cardBg;
box-shadow: none;
padding-bottom: 5px;
}
}
}
Loading

0 comments on commit 73aa69a

Please sign in to comment.