Giter Site home page Giter Site logo

foxdot's Introduction

FoxDot - Live Coding with Python v0.8

Please note

I am no longer actively developing FoxDot and will only be making minor changes to the code in response to issues / pull requests in this time. However, you can still ask questions on the TOPLAP FoxDot Forum and I will get back to you when I can. Please do not ask general questions in the "issues" section. Thanks.


FoxDot is a Python programming environment that provides a fast and user-friendly abstraction to SuperCollider. It also comes with its own IDE, which means it can be used straight out of the box; all you need is Python and SuperCollider and you're ready to go!

Important

If you are having trouble installing using pip install FoxDot, try updating Python's setuptools and wheel libraries using the following code and trying again.

pip install -U setuptools
pip install -U wheel

v0.8 Updates

  • Added stretch synth for timestretching samples, similar to loop but better and only plays the whole file. Stretches the audio's duration to the sus attribute without affecting pitch and does not require the tempo to be known.
# Stretches the audio to 4 beats without affecting pitch
p1 >> stretch("Basic_Rock_135", dur=4)

Installation and startup

Prerequisites

$ sudo apt-get install python3-tk (Linux)
$ sudo port install py-tkinter (MacOS)

Recommended

Installing FoxDot

  • Open up a command prompt and type pip install --user FoxDot. This will download and install the latest stable version of FoxDot from the Python Package Index if you have properly configured Python.
  • You can update FoxDot to the latest version if it's already installed by adding -U or --upgrade flag to this command.
  • Alternatively, you can build from source from directly from this repository:
$ git clone https://github.com/Qirky/FoxDot.git
$ cd FoxDot
$ python setup.py install
  • Open SuperCollder and install the FoxDot Quark and its dependencies (this allows FoxDot to communicate with SuperCollider) by entering the following and pressing Ctrl+Return (Note: this requires Git to be installed on your machine if it is not already):
Quarks.install("FoxDot")
  • Recompile the SuperCollider class library by going to Language -> Recompile Class Library or pressing Ctrl+Shift+L

Startup

  1. Open SuperCollider and type in FoxDot.start and evaluate this line. SuperCollider is now listening for messages from FoxDot.
  2. Start FoxDot by entering FoxDot at the command line. If that doesn't work, try python -m FoxDot.
  3. If you have installed the SC3 Plugins, use the "Code" drop-down menu to select "Use SC3 Plugins". Restart FoxDot and you'll have access to classes found in the SC3 Plugins.
  4. Keep up to date with the latest verion of FoxDot by running pip install FoxDot --upgrade every few weeks.
  5. Check out the YouTube tutorials for some in-depth tutorial videos on getting to grips with FoxDot

Installing with SuperCollider 3.7 or earlier

If you are having trouble installing the FoxDot Quark in SuperCollider, it is usually because the version of SuperCollider you are installing doesn’t have the functionality for installing Quarks or it doesn’t work properly. If this is the case, you can download the contents of the following SuperCollider script: foxdot.scd. Once downloaded, open the file in SuperCollider and press Ctrl+Return to run it. This will make SuperCollider start listening for messages from FoxDot.

Frequently Asked Questions

You can find answers to many frequently asked questions on the FAQ post on the FoxDot discussion forum.

Basics

Executing Code

A 'block' of code in FoxDot is made up of consecutive lines of code with no empty lines. Pressing Ctrl+Return (or Cmd+Return on a Mac) will execute the block of code that the cursor is currently in. Try print(1 + 1) to see what happens!

Player Objects

Python supports many different programming paradigms, including procedural and functional, but FoxDot implements a traditional object orientated approach with a little bit of cheating to make it easier to live code. A player object is what FoxDot uses to make music by assigning it a synth (the 'instrument' it will play) and some instructions, such as note pitches. All one and two character variable names are reserved for player objects at startup so, by default, the variables a, bd, and p1 are 'empty' player objects. If you use one of these variables to store something else but want to use it as a player object again, or you want to use a variable with more than two characters, you just have to reserve it by creating a Player and assigning it like so:

p1 = Player("p1") # The string name is optional

To stop a Player, use the stop method e.g. p1.stop(). If you want to stop all players, you can use the command Clock.clear() or the keyboard short-cut Ctrl+., which executes this command.

Assigning synths and instructions to a player object is done using the double-arrow operator >>. So if you wanted to assign a synth to p1 called 'pads' (execute print(SynthDefs) to see all available synths) you would use the following code:

p1 >> pads([0,1,2,3])

The empty player object, p1 is now assigned a the 'pads' synth and some playback instructions. p1 will play the first four notes of the default scale using a SuperCollider SynthDef with the name \pads. By default, each note lasts for 1 beat at 120 bpm. These defaults can be changed by specifying keyword arguments:

p1 >> pads([0,1,2,3], dur=[1/4,3/4], sus=1, vib=4, scale=Scale.minor)

The keyword arguments dur, oct, and scale apply to all player objects - any others, such as vib in the above example, refer to keyword arguments in the corresponding SynthDef. The first argument, degree, does not have to be stated explicitly. Notes can be grouped together so that they are played simultaneously using round brackets, (). The sequence [(0,2,4),1,2,3] will play the the the first harmonic triad of the default scale followed by the next three notes.

'Sample Player' Objects

In FoxDot, sound files can be played through using a specific SynthDef called play. A player object that uses this SynthDef is referred to as a Sample Player object. Instead of specifying a list of numbers to generate notes, the Sample Player takes a string of characters (known as a "PlayString") as its first argument. To see a list of what samples are associated to what characters, use print(Samples). To create a basic drum beat, you can execute the following line of code:

d1 >> play("x-o-")

To have samples play simultaneously, you can create a new 'Sample Player' object for some more complex patterns.

bd >> play("x( x)  ")
hh >> play("---[--]")
sn >> play("  o ")

Alternatively, you can do this in one line using <> arrows to separate patterns you want to play together like so:

d1 >> play("<x( x)  ><---[--]><  o >")

Or you can use PZip, the zip method, or the & sign to create one pattern that does this. This can be useful if you want to perform some function on individual layers later on:

d1 >> play(P["x( x)  "].palindrome().zip("---[--]").zip(P["  o "].amen()))  

# The first item must be a P[] pattern, not a string. 

d1 >> play(P["x( x)  "].palindrome() & "---[--]" & P["  o "].amen())

Grouping characters in round brackets laces the pattern so that on each play through of the sequence of samples, the next character in the group's sample is played. The sequence (xo)--- would be played back as if it were entered x---o---. Using square brackets will force the enclosed samples to played in the same time span as a single character e.g. --[--] will play two hi-hat hits at a half beat then two at a quarter beat. You can play a random sample from a selection by using curly braces in your Play String like so:

d1 >> play("x-o{-[--]o[-o]}")

There is now the functionality to specify the sample number for an individual sample when using the play SynthDef. This can be done from the play string itself by using the bar character in the form |<char><sample>|. These can also be patterns created using brackets:

# Plays the kick drum with sample 2 but the rest with sample 0
p1 >> play("|x2|-o-")

# You can use square brackets to play multiple samples
p1 >> play("|x[12]| o ")

# Round brackets alternate which sample is used on each loop through the sequence
p1 >> play("|x(12)| o ")

# Curly braces will pick a sample at random
p1 >> play("|x{0123}| o ")

Scheduling Player methods

You can perform actions like shuffle, mirror, and rotate on Player Objects just by calling the appropriate method.

bd >> play("x o  xo ")

# Shuffle the contents of bd
bd.shuffle()

You can schedule these methods by calling the every method, which takes a list of durations (in beats), the name of the method as a string, and any other arguments. The following syntax mirrors the string of sample characters after 6 beats, then again 2 beats later and also shuffles it every 8 beats.

bd >> play("x-o-[xx]-o(-[oo])").every([6,2], 'mirror').every(8, 'shuffle')

Documentation

Link to documentation website (still in progress)

Using alternative editors

FoxDot comes pre-packaged with its own basic editor so that you don't have to tinker with config files or download any other tools but if you want to use an existing editor you can. Koltes has written a plugin for the popular Atom editor. You can install it by going to Settings -> Install -> Searching "foxdot" and pressing install on the plug in. Press Ctrl+Alt+f or go to menu -> Packages -> FoxDot -> Toggle to start FoxDot running.

Running Python files with FoxDot code

You can import FoxDot into your own Python programs as you would any other module. If you are not writing an interactive program, i.e. only containing FoxDot code, then you need to call a function Go() at the end of your program to get playback otherwise the program will terminate immediately. For example your program, my_file.py, should look something like this:

from FoxDot import *
p1 >> pads([0, 1, 2, 3])
d1 >> play("x-o-")
Go()

Then just run like any other Python program: python my_file.py

Thanks

  • The SuperCollider development community and, of course, James McCartney, its original developer
  • PyOSC, Artem Baguinski et al
  • Members of the Live Coding community who have contributed to the project in one way or another including, but not limited to, Alex McLean, Sean Cotterill, and Dan Hett.
  • Big thanks to those who have used, tested, and submitted bugs, which have all helped improve FoxDot
  • Thank you to those who have found solutions for SuperCollider related issues, such as DavidS48

Samples

FoxDot's audio files have been obtained from a number of sources but I've lost record of which files are attributed to which original author. Here's a list of thanks for the unknowing creators of FoxDot's sample archive.

If you feel I've used a sample where I shouldn't have, please get in touch!

foxdot's People

Contributors

aguillon avatar ajtribick avatar ajyoon avatar bcgreen24 avatar berinhard avatar chovin avatar crashserver avatar dirkbosman avatar dyezz avatar fgonzalez-cespi avatar hughrawlinson avatar ianb avatar jack126guy avatar kfrncs avatar koltesdigital avatar levaitamas avatar lrs avatar mathigatti avatar moz-ljp avatar oboingo avatar prikhi avatar psykopear avatar qirky avatar roboticmind avatar ryan-kirkb avatar ryan-kirkbride avatar slink avatar stevearc avatar yaxu avatar zbdm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foxdot's Issues

problems making sound on linux

The simplest example 'd1 >> play("x-o-")' fails with an exception in the terminal I started main.py from, as if nothing is listening for OSC on the relevant port. Here's the complete log, in case something useful is there earlier:

claude@latte:~/emf/FoxDot$ python main.py 
/home/claude/emf/FoxDot/FoxDot/SCLang/OSCFunc.scd
init_OSC
empty
compiling class library...
initPassOne started
        NumPrimitives = 711
initPassOne done
        compiling dir: '/home/claude/opt/share/SuperCollider/SCClassLibrary'
        compiling dir: '/home/claude/opt/share/SuperCollider/Extensions'
        compiling dir: '/home/claude/.local/share/SuperCollider/downloaded-quarks/Vowel'
        compiling dir: '/home/claude/.local/share/SuperCollider/downloaded-quarks/Dirt-Samples'
        compiling dir: '/home/claude/.local/share/SuperCollider/downloaded-quarks/SuperDirt'
        pass 1 done
ERROR: Class extension for nonexistent class 'Document'
     In file:'/deprecated/3.7/deprecated-3.7.sc'
        numentries = 821770 / 11419716 = 0.072
        5089 method selectors, 2244 classes
        method table size 12415192 bytes, big table size 91357728
        Number of Symbols 11827
        Byte Code Size 361047
        compiled 318 files in 1.15 seconds

Info: 3 methods are currently overwritten by extensions. To see which, execute:
MethodOverride.printAll

compile done
Class tree inited in 0.06 seconds
Cleaning up temp synthdefs...
WARNING: Extension in '/home/claude/opt/share/SuperCollider/SCClassLibrary/Platform/linux/extMIDIOut.sc' overwrites Meta_MIDIClient:externalSources in main class library.
WARNING: Extension in '/home/claude/opt/share/SuperCollider/SCClassLibrary/Platform/linux/extMIDIOut.sc' overwrites Meta_MIDIClient:externalDestinations in main class library.
WARNING: Extension in '/home/claude/opt/share/SuperCollider/SCClassLibrary/Platform/linux/extMIDIOut.sc' overwrites Meta_MIDIIn:connectAll in main class library.
Intentional overwrites must be put in a 'SystemOverwrites' subfolder.


*** Welcome to SuperCollider 3.7.2. *** For help type ctrl-c ctrl-h (Emacs) or :SChelp (vim) or ctrl-U (sced/gedit).
booting 57110
JackDriver: client name is 'SuperCollider'
SC_AudioDriver: sample rate = 48000.000000, driver's block size = 2048
JackDriver: connected  system:capture_1 to SuperCollider:in_1
JackDriver: connected  system:capture_2 to SuperCollider:in_2
JackDriver: connected  SuperCollider:out_1 to system:playback_1
JackDriver: connected  SuperCollider:out_2 to system:playback_2
SuperCollider 3 server ready.
JackDriver: max output latency 128.0 ms
Receiving notification messages from server localhost
Shared memory server interface initialized
File '/home/claude/emf/FoxDot/FoxDot/Samples/foxdot/cs1.wav' could not be opened: System error : No such file or directory.
File '/home/claude/emf/FoxDot/FoxDot/Samples/foxdot/bd2.wav' could not be opened: System error : No such file or directory.
File '/home/claude/emf/FoxDot/FoxDot/Samples/foxdot/bd1.wav' could not be opened: System error : No such file or directory.
File '/home/claude/emf/FoxDot/FoxDot/Samples/foxdot/cs1.wav' could not be opened: System error : No such file or directory.
File '/home/claude/emf/FoxDot/FoxDot/Samples/foxdot/bd2.wav' could not be opened: System error : No such file or directory.
File '/home/claude/emf/FoxDot/FoxDot/Samples/foxdot/bd1.wav' could not be opened: System error : No such file or directory.
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:new
WARNING: keyword arg 'level' not found in call to Meta_Env:new
File '/home/claude/emf/FoxDot/FoxDot/Samples/foxdot/tom3.wav' could not be opened: System error : No such file or directory.
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:new
WARNING: keyword arg 'level' not found in call to Meta_Env:new
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:new
WARNING: keyword arg 'level' not found in call to Meta_Env:new
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:new
WARNING: keyword arg 'level' not found in call to Meta_Env:new
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:sine
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:new
WARNING: keyword arg 'level' not found in call to Meta_Env:new
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:new
WARNING: keyword arg 'level' not found in call to Meta_Env:new
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:new
WARNING: keyword arg 'level' not found in call to Meta_Env:new
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:new
WARNING: keyword arg 'level' not found in call to Meta_Env:new
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:new
WARNING: keyword arg 'level' not found in call to Meta_Env:new
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:new
WARNING: keyword arg 'level' not found in call to Meta_Env:new
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:new
WARNING: keyword arg 'level' not found in call to Meta_Env:new
WARNING: keyword arg 'releaseTime' not found in call to Meta_Env:new
WARNING: keyword arg 'level' not found in call to Meta_Env:new
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/claude/emf/FoxDot/FoxDot/TempoClock.py", line 104, in run
    item()
  File "/home/claude/emf/FoxDot/FoxDot/Players.py", line 201, in __call__
    self.send()
  File "/home/claude/emf/FoxDot/FoxDot/Players.py", line 590, in send
    self.server.sendNote( self.SynthDef, osc_msg )
  File "/home/claude/emf/FoxDot/FoxDot/ServerManager.py", line 59, in sendNote
    self.sendOSC(packet)
  File "/home/claude/emf/FoxDot/FoxDot/ServerManager.py", line 54, in sendOSC
    self.client.send( message )
  File "/home/claude/emf/FoxDot/FoxDot/OSC.py", line 1222, in send
    raise OSCClientError("while sending: %s" % str(e))
OSCClientError: while sending: [Errno 111] Connection refused

Workshop troubleshooting suggestions (ubuntu)

Hi! We found a few issues on the workshop on Thursday that might be worth documenting the workarounds for. None of them are actually FoxDot problems, but I think that two or three people hit each of them independently.

Setup: Ubuntu 14.04, SuperCollider 3.6.6, Jackd 0.122.0.

Problem: SuperCollider won't load the quark
Solution:
Put FoxDot.sc (from the github repo) in
/usr/share/SuperCollider/SCClassLibrary/
recompile class library

Problem: FoxDot.sc code loads and runs, FoxDot starts and connects, but there's no sound output. The QjackCtl Connect window's Audio tab shows no outputs available.
Solution: Go to QjackCtl's Setup window and change the "output" setting until you get the right device for your soundcard.

Another thing that might be worth mentioning is that if Supercollider or Jack falls over, you need to stop everything and start them again in order - just restarting Supercollider doesn't work because FoxDot doesn't know that it needs to resend the stuff it sends on loading.

Cheers!

Linux Packaging Improvements

Heya, I'm trying to package this up for the Arch Linux User Repository, some issues.

It'd be nice if each new release had a tag associated with it. Then I could just bump version numbers instead of having the find the release commit every time.

Once FoxDot is installed, it tries to write to the installed files. This causes a permissions error when FoxDot is installed globally, since the installed files are owned by root:

$ foxdot 
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
    mod_name, _Error)
  File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
    __import__(mod_name)  # Do not catch exceptions initializing package
  File "/usr/lib/python2.7/site-packages/FoxDot/__init__.py", line 11, in <module>
    from lib import *
  File "/usr/lib/python2.7/site-packages/FoxDot/lib/__init__.py", line 15, in <module>
    from TempoClock import *
  File "/usr/lib/python2.7/site-packages/FoxDot/lib/TempoClock.py", line 15, in <module>
    from Players import Player
  File "/usr/lib/python2.7/site-packages/FoxDot/lib/Players.py", line 152, in <module>
    from Effects import FxList
  File "/usr/lib/python2.7/site-packages/FoxDot/lib/Effects.py", line 209, in <module>
    fx.save()
  File "/usr/lib/python2.7/site-packages/FoxDot/lib/Effects.py", line 113, in save
    with open(self.filename, 'w') as f:
IOError: [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/FoxDot/osc/sceffects/slideTo.scd'

I think this code should either use the tempfile module or if you need files to persist between restarts, check for a HOME environmental variable & stick them under $HOME/.foxdot.

Foxdot 0.4.10 does not launch

After installing the latest version of Foxdot with pip on windows 10 with python 3.5.0 I get the following:

C:\WINDOWS\system32>python -m FoxDot
C:\Program Files\Python 3.5\python.exe: Error while finding spec for 'FoxDot.__main__' (<class 'AttributeError'>: module 'sys' has no attribute 'maxint'); 'FoxDot' is a package and cannot be directly executed

C:\WINDOWS\system32>python -m FoxDot.__main__
C:\Program Files\Python 3.5\python.exe: Error while finding spec for 'FoxDot.__main__' (<class 'AttributeError'>: module 'sys' has no attribute 'maxint')

C:\WINDOWS\system32>python -c "import FoxDot; module.main()"

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\Python 3.5\lib\site-packages\FoxDot\__init__.py", line 12, in <module>
    from .lib import *
  File "C:\Program Files\Python 3.5\lib\site-packages\FoxDot\lib\__init__.py", line 24, in <module>
    from .TempoClock import *
  File "C:\Program Files\Python 3.5\lib\site-packages\FoxDot\lib\TempoClock.py", line 53, in <module>
    from .Players import Player
  File "C:\Program Files\Python 3.5\lib\site-packages\FoxDot\lib\Players.py", line 158, in <module>
    from .Key import *
  File "C:\Program Files\Python 3.5\lib\site-packages\FoxDot\lib\Key.py", line 3, in <module>
    from .Patterns import *
  File "C:\Program Files\Python 3.5\lib\site-packages\FoxDot\lib\Patterns\__init__.py", line 72, in <module>
    from .Main       import *
  File "C:\Program Files\Python 3.5\lib\site-packages\FoxDot\lib\Patterns\Main.py", line 862, in <module>
    class GeneratorPattern(random.Random):
  File "C:\Program Files\Python 3.5\lib\site-packages\FoxDot\lib\Patterns\Main.py", line 867, in GeneratorPattern
    MAX_SIZE = sys.maxint
AttributeError: module 'sys' has no attribute 'maxint'

Foxdot 0.4.9 works, so it looks like this bug was introduced with v10.

Reset effects if kwarg not present

In FoxDot if you first define a synth let's say

s1 >> varsaw(0, room=1, mix=1)

and then you evaluate it again without room and mix parameters

s1 >> varsaw(0)

the mix and room parameters will stay at 1 unless you explicitly specify them to be 0.
I was wondering if that's the intended behaviour, otherwise I can work to make it reset effects params if kwargs are not present (if instead this is intended, I will see if I can add it as an opt in behaviour).

Undefined names

Undefined names can raise NameError at runtime.

flake8 testing of https://github.com/Qirky/FoxDot on Python 2.7.14

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./FoxDot/lib/OSC.py:535:52: F821 undefined name 'm'
raise ValueError("'%s' not in OSCMessage" % str(m))
^

./FoxDot/lib/OSC3.py:545:52: F821 undefined name 'm'
raise ValueError("'%s' not in OSCMessage" % str(m))
^

./FoxDot/lib/TempoClock.py:315:16: F821 undefined name 'Wrapper'
return Wrapper(self, obj, dur, args)
^

./FoxDot/lib/Patterns/Generators.py:86:74: F821 undefined name 'random'
def __init__(self, n=0, f=lambda x: (x + 1, x - 1), choose=lambda x: random.choice(x), **kwargs):
^

./FoxDot/lib/SCLang/SCLang.py:25:76: F821 undefined name 'args'
return instance("{}({}{})".format(self.name, self.ref, format_args(args, kwargs)))
^

./FoxDot/lib/SCLang/SCLang.py:25:82: F821 undefined name 'kwargs'
return instance("{}({}{})".format(self.name, self.ref, format_args(args, kwargs)))
^

./Tutorial/demo/3_using_patterns.py:8:7: F821 undefined name 'P'
print P[0,1,2,3] * 2
^

./Tutorial/demo/3_using_patterns.py:15:10: F821 undefined name 'P'
for n in P[0,1,2,[3,4]]:
^

./Tutorial/demo/3_using_patterns.py:21:10: F821 undefined name 'P'
for n in P[0,1,2,(3,4)]:
^

./Tutorial/demo/3_using_patterns.py:24:7: F821 undefined name 'P'
print P(0,2,4) + 2
^

./Tutorial/demo/3_using_patterns.py:30:7: F821 undefined name 'PRange'
print PRange(10) + [0,10]
^

./Tutorial/demo/3_using_patterns.py:32:7: F821 undefined name 'PRange'
print PRange(10) | [0,10]
^

./Tutorial/demo/3_using_patterns.py:36:6: F821 undefined name 'Pattern'
help(Pattern)
^

./Tutorial/demo/3_using_patterns.py:40:1: F821 undefined name 'p1'
p1 >> pads(Ptri(8), dur=1/2)
^

./Tutorial/demo/3_using_patterns.py:40:7: F821 undefined name 'pads'
p1 >> pads(Ptri(8), dur=1/2)
^

./Tutorial/demo/3_using_patterns.py:40:12: F821 undefined name 'Ptri'
p1 >> pads(Ptri(8), dur=1/2)
^

./Tutorial/demo/3_using_patterns.py:42:1: F821 undefined name 'd1'
d1 >> play("x", dur=PDur(5,8))
^

./Tutorial/demo/3_using_patterns.py:42:7: F821 undefined name 'play'
d1 >> play("x", dur=PDur(5,8))
^

./Tutorial/demo/3_using_patterns.py:42:21: F821 undefined name 'PDur'
d1 >> play("x", dur=PDur(5,8))
^

./Tutorial/demo/4_using_vars.py:5:5: F821 undefined name 'var'
a = var([0,4,5,3], 4)
^

./Tutorial/demo/4_using_vars.py:13:1: F821 undefined name 'b1'
b1 >> bass(a, dur=PDur(3,8))
^

./Tutorial/demo/4_using_vars.py:13:7: F821 undefined name 'bass'
b1 >> bass(a, dur=PDur(3,8))
^

./Tutorial/demo/4_using_vars.py:13:19: F821 undefined name 'PDur'
b1 >> bass(a, dur=PDur(3,8))
^

./Tutorial/demo/4_using_vars.py:15:1: F821 undefined name 'p1'
p1 >> pads(a + (0,2), dur=PDur(7,16))
^

./Tutorial/demo/4_using_vars.py:15:7: F821 undefined name 'pads'
p1 >> pads(a + (0,2), dur=PDur(7,16))
^

./Tutorial/demo/4_using_vars.py:15:27: F821 undefined name 'PDur'
p1 >> pads(a + (0,2), dur=PDur(7,16))
^

./Tutorial/demo/4_using_vars.py:19:1: F821 undefined name 'b1'
b1 >> bass(a, dur=PDur(3,8)) + var([0,1],[3,1])
^

./Tutorial/demo/4_using_vars.py:19:7: F821 undefined name 'bass'
b1 >> bass(a, dur=PDur(3,8)) + var([0,1],[3,1])
^

./Tutorial/demo/4_using_vars.py:19:19: F821 undefined name 'PDur'
b1 >> bass(a, dur=PDur(3,8)) + var([0,1],[3,1])
^

./Tutorial/demo/4_using_vars.py:19:32: F821 undefined name 'var'
b1 >> bass(a, dur=PDur(3,8)) + var([0,1],[3,1])
^

./Tutorial/demo/4_using_vars.py:21:9: F821 undefined name 'var'
b = a + var([0,10],8)
^

./Tutorial/demo/4_using_vars.py:31:1: F821 undefined name 'Clock'
Clock.clear()
^

./Tutorial/demo/4_using_vars.py:35:5: F821 undefined name 'linvar'
c = linvar([0,1],16)
^

./Tutorial/demo/4_using_vars.py:39:1: F821 undefined name 'p1'
p1 >> pads(a, amp=c)
^

./Tutorial/demo/4_using_vars.py:39:7: F821 undefined name 'pads'
p1 >> pads(a, amp=c)
^

./Tutorial/demo/4_using_vars.py:41:1: F821 undefined name 'Clock'
Clock.clear()
^

./Tutorial/demo/4_using_vars.py:45:5: F821 undefined name 'Pvar'
d = Pvar([PRange(12), PTri(5)], 8)
^

./Tutorial/demo/4_using_vars.py:45:11: F821 undefined name 'PRange'
d = Pvar([PRange(12), PTri(5)], 8)
^

./Tutorial/demo/4_using_vars.py:45:23: F821 undefined name 'PTri'
d = Pvar([PRange(12), PTri(5)], 8)
^

./Tutorial/demo/4_using_vars.py:49:1: F821 undefined name 'p1'
p1 >> pads(a, amp=c, dur=1/4) + d
^

./Tutorial/demo/4_using_vars.py:49:7: F821 undefined name 'pads'
p1 >> pads(a, amp=c, dur=1/4) + d
^

Synths build up eventually stopping sound

leaving this running causes the number of synths to go up forever eventually stopping all sound

p2 >> piano([6], dur=PDur(5,8), 
            amp=var([.2,.6], 16), 
            lpf=var([100,1200],6), 
            hpf=var([1400, 200], 10))

ModuleNotFoundError: No module named 'lib'

I'm getting the following error message when I try to run FoxDot on Python 3.6.0 (Anaconda 4.3.1 (x86_64)) on macOS 10.12.3:

jritchie$ pip install foxdot
Collecting foxdot
Downloading FoxDot-0.3.2.zip (31.9MB)
100% |████████████████████████████████| 31.9MB 21kB/s
Building wheels for collected packages: foxdot
Running setup.py bdist_wheel for foxdot ... done
Stored in directory: /Users/jritchie/Library/Caches/pip/wheels/81/21/e4/b86c6b1fa1a2a88cd4707f52ba4cd5e60d97d7297b558394ef
Successfully built foxdot
Installing collected packages: foxdot
Successfully installed foxdot-0.3.2

jritchie$ python -m FoxDot
Traceback (most recent call last):
File "/Users/jritchie/anaconda/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/Users/jritchie/anaconda/lib/python3.6/runpy.py", line 142, in _get_module_details
return _get_module_details(pkg_main_name, error)
File "/Users/jritchie/anaconda/lib/python3.6/runpy.py", line 109, in _get_module_details
import(pkg_name)
File "/Users/jritchie/anaconda/lib/python3.6/site-packages/FoxDot/init.py", line 11, in
from lib import *
ModuleNotFoundError: No module named 'lib'

TclError: bad event type or keysym "."

LinuxMusic% python main.py

from FoxDot import *
Clock.start()
Traceback (most recent call last):
File "main.py", line 83, in
a = interface()
File "main.py", line 29, in init
App.init(self, "FoxDot - Live Coding with Python and SuperCollider")
File "/home/user/FoxDot/FoxDot-master/FoxDot/Interface/init.py", line 86, in init
self.text.bind("<Control-.>", self.killall)
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1092, in bind
return self._bind(('bind', self._w), sequence, func, add)
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1047, in _bind
self.tk.call(what + (sequence, cmd))
_tkinter.TclError: bad event type or keysym "."

After this, the software does not close, but hang still.
My version of python is 2.7.9.

Stopping a Player

I have no idea how to stop a player, I see no documentation about this. I'm not sure if this is a bug or if I'm doing something wrong. If I delete a player from the environment and update, it just keeps going. I can't set it to None. I can set it to something else, but not to nothing. I was expecting that if I deleted it from the environment on screen, it would be set to None.

Timing issues

Hi,
just started to play around with foxdot and it is really awsome!

One issue I found, it seems that the timing is not always exact.
In a simple
d2 >> play("-")
the tick sometimes lags noticable behind.

Is this a known issue or is it just in my setup (windows 10)?

With some hints on how the timing works in foxdot I can also try to improve this if it turns out this is a real issue...

play('{-}') gives NameError: name 'xrange' is not defined

>>> p1 >> play('{xo}')
Traceback (most recent call last):
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/Code/main_lib.py", line 106, in __call__
    exec(self._compile(code), self.namespace)
  File "FoxDot", line 1, in <module>
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/Players.py", line 352, in __rshift__
    self.update(other.name, other.degree, **other.kwargs)
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/Players.py", line 777, in update
    setattr(self, "degree", degree if len(degree) > 0 else " ")
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/Players.py", line 436, in __setattr__
    for item in value:
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/Patterns/Main.py", line 223, in __iter__
    yield self.getitem(i)
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/Patterns/Main.py", line 199, in getitem
    val = val.getitem(j)
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/Patterns/Main.py", line 905, in getitem
    value = self.func(index)
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/Patterns/Generators.py", line 65, in func
    value = self.choose()
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/Patterns/Generators.py", line 60, in choose
    return self.data[self.choice(range(self.MAX_SIZE))]
NameError: name 'xrange' is not defined

OSCClient(("localhost", 8000)) -> ValueError: 'server' argument is not a valid OSCServer object

wanted to try out the new OSC stuff but got this:

DefaultServer.forward = OSCClient(("localhost", 8000))
Traceback (most recent call last):
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/Code/main_lib.py", line 106, in __call__
    exec(self._compile(code), self.namespace)
  File "FoxDot", line 2, in <module>
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/OSC3.py", line 1060, in __init__
    self.setServer(server)
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/OSC3.py", line 1096, in setServer
    raise ValueError("'server' argument is not a valid OSCServer object")
ValueError: 'server' argument is not a valid OSCServer object

ImportError: No module named parse

I get the error in the subject when running main.py.
I've seen other projects, where several python-versions lead to that problem.
I changed the shebang to:

#!/usr/bin/env python
to no avail.

/usr/bin/env python -V gives:
Python 2.7.12

This is on OSX 10.11.6 (El Capitan)

Here's the trace:

FoxDot-master bwagner$ ./main.py
Traceback (most recent call last):
  File "./main.py", line 11, in <module>
    import FoxDot
  File "/Users/bwagner/Downloads/FoxDot-master/FoxDot/__init__.py", line 9, in <module>
    from Code import *
  File "/Users/bwagner/Downloads/FoxDot-master/FoxDot/Code/__init__.py", line 7, in <module>
    from ..Patterns.Operations import modi
  File "/Users/bwagner/Downloads/FoxDot-master/FoxDot/Patterns/__init__.py", line 1, in <module>
    from Base import *
  File "/Users/bwagner/Downloads/FoxDot-master/FoxDot/Patterns/Base.py", line 4, in <module>
    from ..Code.parse import brackets, closing_brackets
ImportError: No module named parse

FoxDot 0.3.5 overeating cpu on Linux

Hi,
With this new version, python is overeating cpu at launch and FoxDot is not usable at all.
No usefull information with python -v -m FoxDot
This happens on Debian Sid (SC 3.7) and Void Linux (SC 3.8).
0.3.4 works well on both systems.

What do you think?

Thanks

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

In the FoxDot gui I try something as simple as evaluating print(2+2) and the gui instance crashes with the following error:

$ python -m FoxDot
Traceback (most recent call last):
  File "/Users/username/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/username/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/username/anaconda3/lib/python3.6/site-packages/FoxDot/__main__.py", line 23, in <module>
    FoxDot = workspace(FoxDotCode).run()
  File "/Users/username/anaconda3/lib/python3.6/site-packages/FoxDot/lib/Workspace/Editor.py", line 251, in run
    self.root.mainloop()
  File "/Users/username/anaconda3/lib/python3.6/tkinter/__init__.py", line 1277, in mainloop
    self.tk.mainloop(n)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

my python / FoxDot environment is as follows

$ pip list | grep FoxDot
FoxDot (0.4.7)
$ python --version
Python 3.6.1 :: Anaconda 4.4.0 (x86_64)

I'm pretty stumped by this error message. Suggestions on workarounds or how to best debug this issue?

sc3-plugins not loaded

Hi,
I updated today to 0.4.5 via pip and now FoxDot won't find sc3-plugins.
A strange thing too: print SynthDefs shows a syntax error in the console

PS: the new loop synth is absolutely awesome!)

high CPU usage

FoxDot seems to use 100% of one core, even when idle.

How do I import my own kit into FoxDot

I have my own kit of sounds, organized like

/808s
/Kicks
/Snares
/Hats
/Crashes
/Sweeps

etc - what's the best way for me to load this kit (or any kit) into FoxDot? I looks like the samples are just kind of thrown in random letters of the alphabet..

security of OSCFunc

There should be a warning in the getting started guide about

msg[1].asString.interpret;  //will execute the string sent from python

because the OSCFunc can be triggered by anything with access to the port, and unixCmd exists in SC (so anything with access to the port can run arbitrary code on the system as the user running SC).

Suggest using a strong firewall that blocks access from outside.

A strong TODO item should be figuring out a way to communicate with SC that doesn't go via network OSC, and so can't be injected.

supercollider boot is windows-specific

This line in FoxDot/ServerManager.py is Windows-specific:

        exe  = "sclang.exe"

I needed to drop the .exe suffix for Linux, it might be worth checking if it works without the suffix on Windows too? Otherwise some OS detection would be necessary.

[Bug] 'expvar' not working

Hi, playing around I found out expvar is not working.

The problem is here:

https://github.com/Qirky/FoxDot/blob/master/FoxDot/lib/TimeVar.py#L522

Basically when now() is called, expvar.get_timer_value gets called without the 'prop' argument.
Since this is not used inside the method I suppose it shouldn't be there (it takes the value from self.proportion), and in fact removing the argument from the definition makes it work again.

If that's correct I can open a PR with the fix if you want.

Triplet Time

If I want triple-time high hats, how do I do that? I don't see it in the docs.

PS I love this project! Hope to have a lot of fun with it.

Real Documentation

So - this is probably the big one. I really want to dive in pretty deep with this project, but it seems like other than watching you jam on YouTube, there really isn't a good way to learn FoxDot yet.

The docs folder really reads like a javadoc, etc - it's a reference for (some of) the API - but not documentation in any human-readable sense.

I know it's a big undertaking, and often the least fun part of a project, but I think you should try to make this a primary issue for a little while.

I actually think your current approach in the README file is perfect, I'm a huge fan of massive READMEs myself, I'd just love it if you could show a lot more advanced usage which exhausts the feature space of FoxDot.

FoxDot doesn't start after most recent commit

$ python3 -m FoxDot
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/__init__.py", line 12, in <module>
    from .lib import *
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/__init__.py", line 24, in <module>
    from .TempoClock import *
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/TempoClock.py", line 53, in <module>
    from .Players import Player
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/Players.py", line 153, in <module>
    from .SCLang.SynthDef import SynthDefProxy, SynthDef, SynthDefs
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/SCLang/__init__.py", line 4, in <module>
    from .SynthDef import SynthDefs, SynthDef, SynthDefProxy, SampleSynthDef, CompiledSynthDef
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/SCLang/SynthDef.py", line 6, in <module>
    from ..ServerManager import DefaultServer
  File "/Users/Chovin/Projects/LiveCoding/FoxDot/FoxDot/FoxDot/lib/ServerManager.py", line 5, in <module>
    import Queue
ModuleNotFoundError: No module named 'Queue'

doing something like from .TempoClock import Queue gives me a circular dependency

Saving session log?

It would be really good to save the session log from the console somewhere.

Keyboard shortcuts mislabeled on Mac

Under the Code menu: "Evaluate block" is labeled as ^-Enter, but is actually Cmd-Enter, and "Evaluate Line" is labeled as Option-Enter, but I can't figure out what the actual keyboard shortcut is. "Clear scheduling clock" is also labeled as ^. but is actually Cmd-.

Works on mac?

I tried it on OSx but I can't get the panel to evaluate commands. Maybe just a keybinding issue?

Problem on start

I cooked SuperCollider. it start to listen:
server already running Listening for messages from FoxDot FoxDot
Then i type

sudo python -m FoxDot

and errors come:
Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main mod_name, _Error) File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details __import__(mod_name) # Do not catch exceptions initializing package File "/usr/local/lib/python2.7/dist-packages/FoxDot/__init__.py", line 12, in <module> from .lib import * File "/usr/local/lib/python2.7/dist-packages/FoxDot/lib/__init__.py", line 27, in <module> from .Workspace import get_keywords File "/usr/local/lib/python2.7/dist-packages/FoxDot/lib/Workspace/__init__.py", line 3, in <module> from .Editor import * File "/usr/local/lib/python2.7/dist-packages/FoxDot/lib/Workspace/Editor.py", line 25, in <module> from tkinter import * ImportError: No module named tkinter

System is Linux Mint 18.2
SuperCollider version is 3.6.6

SuperCollider: *** ERROR: SynthDef startSound not found

I followed the installation guide, but can't get FoxDot to play a sound. Am I doing something wrong? How can I fix this?

Upon executing e.g.:

p1 >> pluck([0,2,4], dur=[1,1/2,1/2], amp=[1,3/4,3/4])

SuperCollider complains:

*** ERROR: SynthDef startSound not found
FAILURE IN SERVER /s_new SynthDef not found
*** ERROR: SynthDef pluck not found
FAILURE IN SERVER /s_new SynthDef not found
*** ERROR: SynthDef makeSound not found
FAILURE IN SERVER /s_new SynthDef not found

Using:

  • FoxDot 0.5.2
  • Supercollider 3.8.0
  • Python 3.6.3

FoxDot appears to start normally in SuperCollider when running FoxDot.start:

-> FoxDot

Device options:
  - MME : Microsoft Sound Mapper - Input   (device #0 with 2 ins 0 outs)
  - MME : Microphone (Realtek High Defini   (device #1 with 2 ins 0 outs)
  - MME : Stereo Mix (Realtek High Defini   (device #2 with 2 ins 0 outs)
  - MME : Microsoft Sound Mapper - Output   (device #3 with 0 ins 2 outs)
  - MME : Speakers/Headphones (Realtek Hi   (device #4 with 0 ins 2 outs)
  - Windows DirectSound : Primary Sound Capture Driver   (device #5 with 2 ins 0 outs)
  - Windows DirectSound : Microphone (Realtek High Definition Audio)   (device #6 with 2 ins 0 outs)
  - Windows DirectSound : Stereo Mix (Realtek High Definition Audio)   (device #7 with 2 ins 0 outs)
  - Windows DirectSound : Primary Sound Driver   (device #8 with 0 ins 2 outs)
  - Windows DirectSound : Speakers/Headphones (Realtek High Definition Audio)   (device #9 with 0 ins 2 outs)
  - Windows WASAPI : Speakers/Headphones (Realtek High Definition Audio)   (device #10 with 0 ins 2 outs)
  - Windows WASAPI : Microphone (Realtek High Definition Audio)   (device #11 with 2 ins 0 outs)
  - Windows WASAPI : Stereo Mix (Realtek High Definition Audio)   (device #12 with 2 ins 0 outs)
  - Windows WDM-KS : Speakers (Realtek HD Audio output)   (device #13 with 0 ins 2 outs)
  - Windows WDM-KS : Microphone (Realtek HD Audio Mic input)   (device #14 with 2 ins 0 outs)
  - Windows WDM-KS : Mic in at front panel (black) (Mic in at front panel (black))   (device #15 with 2 ins 0 outs)
  - Windows WDM-KS : Stereo Mix (Realtek HD Audio Stereo input)   (device #16 with 2 ins 0 outs)

Booting with:
  In: MME : Microphone (Realtek High Defini
  Out: MME : Speakers/Headphones (Realtek Hi
  Sample rate: 44100.000
  Latency (in/out): 0.013 / 0.091 sec
SC_AudioDriver: sample rate = 44100.000000, driver's block size = 64
SuperCollider 3 server ready.
Receiving notification messages from server localhost
Shared memory server interface initialized

FoxDot not recognizing new sample

Hello! I recently tried putting in a sample I created into one of the preexisting snd folders however, even after restarting, FoxDot still does not recognize the new sample. I converted my samples into .wav files as well. Do you know why it may not be working? Thanks!

ERROR: Class not defined.

I tried FoxDot in a virtual environment on Linux. SuperCollider returns following message for all the synth definitions.

*** Welcome to SuperCollider 3.7.1. *** For help press Ctrl-D.
Couldn't set realtime scheduling priority 1: Opération non permise
SCDoc: Indexing help-files...
SCDoc: Indexed 1339 documents in 0.87 seconds
booting 57110
-> OSCFunc(/foxdot, nil, nil, nil)
JackDriver: client name is 'SuperCollider'
SC_AudioDriver: sample rate = 48000.000000, driver's block size = 1024
JackDriver: connected  system:capture_1 to SuperCollider:in_1
JackDriver: connected  system:capture_2 to SuperCollider:in_2
JackDriver: connected  SuperCollider:out_1 to system:playback_1
JackDriver: connected  SuperCollider:out_2 to system:playback_2
SuperCollider 3 server ready.
JackDriver: max output latency 42.7 ms
Receiving notification messages from server localhost
Shared memory server interface initialized
/home/essicolo/python-venv/FoxDot/lib/python2.7/site-packages/FoxDot/lib/SCLang/scsyndef/play.scd
ERROR: Class not defined.
  in file 'selected text'
  line 16 char 13:

  osc=Decimator.ar(osc, rate: 44100, bits: bits);
               
  
-----------------------------------
/home/essicolo/python-venv/FoxDot/lib/python2.7/site-packages/FoxDot/lib/SCLang/scsyndef/pads.scd
ERROR: Class not defined.
  in file 'selected text'
  line 15 char 13:

  osc=Decimator.ar(osc, rate: 44100, bits: bits);
               
  
-----------------------------------

Pwrand not defined in Players.py

The exception is pretty self-explanatory:

>>> p >> pads([11, 10, 9, 13], room=0.5).degrade()
Traceback (most recent call last):
  File "/Users/ianbicking/.virtualenvs/foxdot/lib/python2.7/site-packages/FoxDot/lib/Code/main_lib.py", line 106, in __call__
    exec(self._compile(code), self.namespace)
  File "FoxDot", line 2, in <module>
  File "/Users/ianbicking/.virtualenvs/foxdot/lib/python2.7/site-packages/FoxDot/lib/Players.py", line 313, in __rshift__
    getattr(self, method).__call__(*args, **kwargs)
  File "/Users/ianbicking/.virtualenvs/foxdot/lib/python2.7/site-packages/FoxDot/lib/Players.py", line 1467, in degrade
    self.amp = Pwrand([0,1],[1-amount, amount])
NameError: global name 'Pwrand' is not defined

Dump To Midi File

Is there anyway to dump an instrument's current pattern to a MIDI file that I can open in Ableton?

SynthDefs and SynthDef are undefined

When I try to do anything with SynthDef or SynthDefs I get a name error. SuperCollider isn't playing any noise either because of the same error.

I'm on Windows 10 running Python 3

permissions errors for standard users in mac

All appears to go well with installation. However when I run "python -m FoxDot" in Terminal I get the following permission error:

Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 151, in _run_module_as_main
mod_name, loader, code, fname = _get_module_details(mod_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 109, in _get_module_details
return _get_module_details(pkg_main_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 101, in _get_module_details
loader = get_loader(mod_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 464, in get_loader
return find_loader(fullname)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 474, in find_loader
for importer in iter_importers(fullname):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 430, in iter_importers
import(pkg)
File "/Library/Python/2.7/site-packages/FoxDot/init.py", line 12, in
from .lib import *
File "/Library/Python/2.7/site-packages/FoxDot/lib/init.py", line 24, in
from .TempoClock import *
File "/Library/Python/2.7/site-packages/FoxDot/lib/TempoClock.py", line 53, in
from .Players import Player
File "/Library/Python/2.7/site-packages/FoxDot/lib/Players.py", line 154, in
from .Effects import FxList
File "/Library/Python/2.7/site-packages/FoxDot/lib/Effects.py", line 221, in
fx.save()
File "/Library/Python/2.7/site-packages/FoxDot/lib/Effects.py", line 125, in save
with open(self.filename, 'w') as f:
IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/FoxDot/osc/sceffects/vibrato.scd'

This is executing as a standard user. When I run it as an admin user and use sudo, it works. However I am trying to install this in on several machines in a lab environment where users will not have sudo ability. Am I doing something wrong? Is there any way around this so that standard users can use FoxDot?

Player and Time var

hi,

p1 >> play("a",sample=var([0,1,2,3],[1]))
is equal to
p1 >> play("a",sample=var([0,1,2,3],[1]),dur=1/2)

but
p1 >> play("a",sample=var([0,1,2,3],[1]),dur=1)
works as expected

Multiple find path errors when executing main.py in windows

  • OS: Microsoft Windows Version 10.0.14393
  • FoxDot version: v0.1.9

Description

"The system cannot find the path specified: 'D:\Apps\FoxDot\Samples\...".
I tried adding the missing folder each time I received the error a few times:

D:\Apps\FoxDot>python main.py
Traceback (most recent call last):
  File "main.py", line 10, in <module>
    import FoxDot
  File "D:\Apps\FoxDot\FoxDot\__init__.py", line 19, in <module>
    from TempoClock import *
  File "D:\Apps\FoxDot\FoxDot\TempoClock.py", line 10, in <module>
    from Players import Player, PlayerKey
  File "D:\Apps\FoxDot\FoxDot\Players.py", line 27, in <module>
    BufferManager = Buffers.BufferManager()
  File "D:\Apps\FoxDot\FoxDot\Buffers.py", line 74, in __init__
    for f in sorted(os.listdir(lower)):
WindowsError: [Error 3] The system cannot find the path specified: 'D:\\Apps\\FoxDot\\FoxDot\\Samples\\c\\lower/*.*'

D:\Apps\FoxDot>python main.py
Traceback (most recent call last):
  File "main.py", line 10, in <module>
    import FoxDot
  File "D:\Apps\FoxDot\FoxDot\__init__.py", line 19, in <module>
    from TempoClock import *
  File "D:\Apps\FoxDot\FoxDot\TempoClock.py", line 10, in <module>
    from Players import Player, PlayerKey
  File "D:\Apps\FoxDot\FoxDot\Players.py", line 27, in <module>
    BufferManager = Buffers.BufferManager()
  File "D:\Apps\FoxDot\FoxDot\Buffers.py", line 84, in __init__
    for f in sorted(os.listdir(upper)):
WindowsError: [Error 3] The system cannot find the path specified: 'D:\\Apps\\FoxDot\\FoxDot\\Samples\\g\\upper/*.*'

D:\Apps\FoxDot>python main.py
Traceback (most recent call last):
  File "main.py", line 10, in <module>
    import FoxDot
  File "D:\Apps\FoxDot\FoxDot\__init__.py", line 19, in <module>
    from TempoClock import *
  File "D:\Apps\FoxDot\FoxDot\TempoClock.py", line 10, in <module>
    from Players import Player, PlayerKey
  File "D:\Apps\FoxDot\FoxDot\Players.py", line 27, in <module>
    BufferManager = Buffers.BufferManager()
  File "D:\Apps\FoxDot\FoxDot\Buffers.py", line 84, in __init__
    for f in sorted(os.listdir(upper)):
WindowsError: [Error 3] The system cannot find the path specified: 'D:\\Apps\\FoxDot\\FoxDot\\Samples\\k\\upper/*.*'

D:\Apps\FoxDot>python main.py
Traceback (most recent call last):
  File "main.py", line 10, in <module>
    import FoxDot
  File "D:\Apps\FoxDot\FoxDot\__init__.py", line 19, in <module>
    from TempoClock import *
  File "D:\Apps\FoxDot\FoxDot\TempoClock.py", line 10, in <module>
    from Players import Player, PlayerKey
  File "D:\Apps\FoxDot\FoxDot\Players.py", line 27, in <module>
    BufferManager = Buffers.BufferManager()
  File "D:\Apps\FoxDot\FoxDot\Buffers.py", line 74, in __init__
    for f in sorted(os.listdir(lower)):
WindowsError: [Error 3] The system cannot find the path specified: 'D:\\Apps\\FoxDot\\FoxDot\\Samples\\l\\lower/*.*'

D:\Apps\FoxDot>python main.py
Traceback (most recent call last):
  File "main.py", line 10, in <module>
    import FoxDot
  File "D:\Apps\FoxDot\FoxDot\__init__.py", line 19, in <module>
    from TempoClock import *
  File "D:\Apps\FoxDot\FoxDot\TempoClock.py", line 10, in <module>
    from Players import Player, PlayerKey
  File "D:\Apps\FoxDot\FoxDot\Players.py", line 27, in <module>
    BufferManager = Buffers.BufferManager()
  File "D:\Apps\FoxDot\FoxDot\Buffers.py", line 84, in __init__
    for f in sorted(os.listdir(upper)):
WindowsError: [Error 3] The system cannot find the path specified: 'D:\\Apps\\FoxDot\\FoxDot\\Samples\\m\\upper/*.*'

D:\Apps\FoxDot>python main.py
Traceback (most recent call last):
  File "main.py", line 10, in <module>
    import FoxDot
  File "D:\Apps\FoxDot\FoxDot\__init__.py", line 19, in <module>
    from TempoClock import *
  File "D:\Apps\FoxDot\FoxDot\TempoClock.py", line 10, in <module>
    from Players import Player, PlayerKey
  File "D:\Apps\FoxDot\FoxDot\Players.py", line 27, in <module>
    BufferManager = Buffers.BufferManager()
  File "D:\Apps\FoxDot\FoxDot\Buffers.py", line 84, in __init__
    for f in sorted(os.listdir(upper)):
WindowsError: [Error 3] The system cannot find the path specified: 'D:\\Apps\\FoxDot\\FoxDot\\Samples\\n\\upper/*.*'

D:\Apps\FoxDot>python main.py
Traceback (most recent call last):
  File "main.py", line 10, in <module>
    import FoxDot
  File "D:\Apps\FoxDot\FoxDot\__init__.py", line 19, in <module>
    from TempoClock import *
  File "D:\Apps\FoxDot\FoxDot\TempoClock.py", line 10, in <module>
    from Players import Player, PlayerKey
  File "D:\Apps\FoxDot\FoxDot\Players.py", line 27, in <module>
    BufferManager = Buffers.BufferManager()
  File "D:\Apps\FoxDot\FoxDot\Buffers.py", line 84, in __init__
    for f in sorted(os.listdir(upper)):
WindowsError: [Error 3] The system cannot find the path specified: 'D:\\Apps\\FoxDot\\FoxDot\\Samples\\r\\upper/*.*'

D:\Apps\FoxDot>python main.py
Traceback (most recent call last):
  File "main.py", line 10, in <module>
    import FoxDot
  File "D:\Apps\FoxDot\FoxDot\__init__.py", line 19, in <module>
    from TempoClock import *
  File "D:\Apps\FoxDot\FoxDot\TempoClock.py", line 10, in <module>
    from Players import Player, PlayerKey
  File "D:\Apps\FoxDot\FoxDot\Players.py", line 27, in <module>
    BufferManager = Buffers.BufferManager()
  File "D:\Apps\FoxDot\FoxDot\Buffers.py", line 74, in __init__
    for f in sorted(os.listdir(lower)):
WindowsError: [Error 3] The system cannot find the path specified: 'D:\\Apps\\FoxDot\\FoxDot\\Samples\\u\\lower/*.*'

D:\Apps\FoxDot>python main.py
Traceback (most recent call last):
  File "main.py", line 10, in <module>
    import FoxDot
  File "D:\Apps\FoxDot\FoxDot\__init__.py", line 19, in <module>
    from TempoClock import *
  File "D:\Apps\FoxDot\FoxDot\TempoClock.py", line 10, in <module>
    from Players import Player, PlayerKey
  File "D:\Apps\FoxDot\FoxDot\Players.py", line 27, in <module>
    BufferManager = Buffers.BufferManager()
  File "D:\Apps\FoxDot\FoxDot\Buffers.py", line 98, in __init__
    for f in sorted(os.listdir(folder)):
WindowsError: [Error 3] The system cannot find the path specified: 'D:\\Apps\\FoxDot\\FoxDot\\Samples\\_\\ampersand/*.*'

D:\Apps\FoxDot>

[REQUEST] feature to recover unsaved work

Often times I'm playing about experimenting and end up crashing FoxDot various ways only to find that in the heat of things, I didn't save.

Having a feature to automatically save file changes to a separate directory that we could recover from, visible or invisible to the user would be awesome.

Can't open config file

on Mac OSX 10.12, Python3

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tkinter/__init__.py", line 1699, in __call__
    return self.func(*args)
  File "/Users/irdumb/Projects/LiveCoding/venv3/lib/python3.6/site-packages/FoxDot/lib/Workspace/Editor.py", line 515, in open_config_file
    from ConfigFile import Config
ModuleNotFoundError: No module named 'ConfigFile'

[Feature] Freesound integration

Hi Qirky,
I'm starting to work on Freesound integration.
I think it would be good to be able to search and download samples from within FoxDot.
At the beginning I'm thinking about handling authentication and samples download only, but later on, a gui can be implemented that could allow people to build their own samples library out of freesound creative commons resources.

To give you an idea of how i thought the interface could be:

from FoxDot import Freesound as FS

# The user should have an account on freesound. With this he can authorize
# our app to make requests on his behalf.
# This method opens a browser, and a little gui asking the user
# to copy/paste the code that will be displayed in the browser
FS.authorize()
# Search for samples by query string, this returns an iterable
results = FS.search("kick")
# We could have looked for id: FS.get(4829)
for result in results:
    # A preview could be heard
    result.preview()
    # add_to_library would actually download the sample 
    # and add it to the "x" folder in the library
    result.add_to_library("x", 4) # 4 is the position. so the old sample=4 will become sample=5 ecc.

That would be the basic building blocks from which some more friendly interface could be built for the end users.

What do you think? If that's ok for you, I will open a PR as soon as i have a basic infrastructure ready so we can discuss about it with some code to test the feature.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.