-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from UTC Sheffield's Algorave Club #270
base: master
Are you sure you want to change the base?
Changes from all commits
4305ee4
90566b1
c9c7a8e
69f418b
8ae8b0f
b376c77
dffb7eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.8.12 | ||
0.8.13 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,15 +48,18 @@ def __getitem__(self, key): | |
|
||
def player_method(f): | ||
""" Decorator for assigning functions as Player methods. | ||
If the function name contains "_player" that will be removed while assigning | ||
allowing you to a have a function a player method and group method all called the same thing | ||
|
||
>>> @player_method | ||
... def test(self): | ||
... print(self.degree) | ||
|
||
>>> p1.test() | ||
""" | ||
setattr(Player, f.__name__, f) | ||
return getattr(Player, f.__name__) | ||
name = f.__name__.replace("_player", "") | ||
setattr(Player, name, f) | ||
return getattr(Player, name) | ||
|
||
PlayerMethod = player_method # Temporary alias | ||
|
||
|
@@ -88,7 +91,7 @@ def next_bar(n=0): | |
|
||
nextBar = next_bar # temporary alias | ||
|
||
def futureBar(n=0): | ||
def future_bar(n=0): | ||
''' Schedule functions when you define them with @futureBar | ||
Functions will run n bars in the future (0 is the next bar) | ||
|
||
|
@@ -100,6 +103,63 @@ def futureBar(n=0): | |
''' | ||
return _futureBarDecorator(n, Clock.bar_length()) | ||
|
||
futureBar = future_bar # temporary alias | ||
|
||
@player_method | ||
def soloBars(self,n=2,end=False): | ||
''' Solo's the current player from the next bar for the specified amount of bars | ||
''' | ||
nextBar(self.solo) | ||
soloEnd = Clock.next_bar() + (n * Clock.bar_length()) | ||
Clock.schedule(self.metro.solo.reset, soloEnd) | ||
if(end): | ||
Clock.schedule(self.stop, soloEnd) | ||
|
||
|
||
@player_method | ||
def soloBeats(self, n=8, end=False): | ||
''' Solo's the current player from now for the specified amount of beats | ||
''' | ||
Clock.schedule(self.solo, Clock.now()) | ||
soloEnd = Clock.now() + n | ||
Clock.schedule(self.metro.solo.reset, soloEnd) | ||
if(end): | ||
Clock.schedule(self.stop, soloEnd) | ||
|
||
|
||
@group_method | ||
def soloBars_group(self,n=2, end=False): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could add these to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think so, can't remember why it ended up there in the first place. |
||
''' Solo's the current group from the next bar for the specified amount of bars | ||
''' | ||
if self.metro is None: | ||
self.__class__.metro = Player.metro | ||
|
||
soloEnd = Clock.next_bar() + (n * Clock.bar_length()) | ||
Clock.schedule(self.metro.solo.reset, soloEnd) | ||
if(end): | ||
for player in list(self.metro.playing): | ||
if player in self.players: | ||
Clock.schedule(player.stop, soloEnd) | ||
|
||
nextBar(self.solo) | ||
|
||
@group_method | ||
def soloBeats_group(self,n=8, end=False): | ||
''' Solo's the current group from now for the specified amount of beats | ||
''' | ||
if self.metro is None: | ||
self.__class__.metro = Player.metro | ||
|
||
soloEnd = Clock.now() + n | ||
Clock.schedule(self.metro.solo.reset, soloEnd) | ||
if(end): | ||
for player in list(self.metro.playing): | ||
if player in self.players: | ||
Clock.schedule(player.stop, soloEnd) | ||
|
||
Clock.schedule(self.solo, Clock.now()) | ||
|
||
|
||
def update_foxdot_clock(clock): | ||
""" Tells the TimeVar, Player, and MidiIn classes to use | ||
a new instance of TempoClock. """ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ lib, pkgs ? import <nixpkgs> { } }: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do I/we add comments to these files to specify they're required for NixOS? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will have to ask my NixOS guru on Monday |
||
|
||
with pkgs.python310Packages; | ||
|
||
buildPythonPackage rec { | ||
name = "FoxDot"; | ||
version = "0.1"; | ||
src = ./.; | ||
propagatedBuildInputs = [ setuptools wheel tkinter ]; | ||
pythonImportsCheck = [ "FoxDot" ]; | ||
doCheck = false; | ||
|
||
meta = with lib; { | ||
description = "Our FoxDot clone"; | ||
homepage = "https://github.com/UTCSheffield/FoxDot"; | ||
maintainers = with maintainers; [ devramsean0 ]; | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ pkgs ? import <nixpkgs> {} }: | ||
|
||
with pkgs; | ||
|
||
mkShell { | ||
name = "FoxDot"; | ||
buildInputs = [ (callPackage ./. {}) ]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @stretchyboy would you mind doing a quick pass on some of the commented out prints and I can merge this in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi I assume you mean delete them / tidy up? Can I do that in the pull request or do I do another?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's possible to do that in this pull request, that would be great - thanks!