I am trying to install Tidal, and I am running in to trouble installing the Dirt-Samples quark in SuperCollider 3.6.6. I followed the directions in the SuperDirt repository and put the SuperDirt, Dirt-Samples, and Vowel quarks in ~/.local/share/SuperCollidor/Extensions/quarks/. I am running Ubuntu 14.04 on a Dell Inspiron 3521.
In SuperCollider I am running Quarks.gui. In the list of quarks, Vowel appears to be installed, with a + next to it, but Dirt-Samples and SuperDirt have a - next to them. When I select Dirt-Samples so there is a * next to it and click Apply, I get this error in the SuperCollidor IDE:
ARGS:
Character 47 '/'
PROTECTED CALL STACK:
Meta_MethodError:new 0x3c794c0
arg this = DoesNotUnderstandError
arg what = nil
arg receiver = nil
Meta_DoesNotUnderstandError:new 0x3c7b480
arg this = DoesNotUnderstandError
arg receiver = nil
arg selector = split
arg args = [ / ]
Object:doesNotUnderstand 0x2adebc0
arg this = nil
arg selector = split
arg args = nil
a FunctionDef 0x2fa4900
sourceCode = "<an open Function>"
arg oneq = Quark: Dirt-Samples
ArrayedCollection:do 0x3b8fe80
arg this = [ Quark: Dirt-Samples ]
arg function = a Function
var i = 0
QuarkSVNRepository:checkout 0x2fa43c0
arg this = a QuarkSVNRepository
arg q = Quark: Dirt-Samples
arg localRoot = /home/nathan/.local/share/SuperCollider/quarks
arg sync = true
var subfolders = nil
var fullCheckout = [ ]
var pathSoFar = nil
var skeletonCheckout = [ ]
var args = nil
Quarks:checkout 0x3907d00
arg this = a Quarks
arg name = Dirt-Samples
arg version = nil
arg sync = true
var q = Quark: Dirt-Samples
Quarks:install 0x3909ac0
arg this = a Quarks
arg name = Dirt-Samples
arg includeDependencies = true
arg checkoutIfNeeded = true
var q = nil
var deps = nil
var installed = nil
var dirname = nil
var quarksForDep = nil
a FunctionDef 0x39da400
sourceCode = "<an open Function>"
arg qView = a QuarkViewQt
ArrayedCollection:do 0x3b8fe80
arg this = [ a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, a QuarkViewQt, ...etc...
arg function = a Function
var i = 92
Function:prTry 0x2dc7300
arg this = a Function
var result = nil
var thread = a Thread
var next = a Function
var wasInProtectedFunc = true
Function:protect 0x2dc6880
arg this = a Function
arg handler = a Function
var result = nil
a FunctionDef 0x2d870c0
sourceCode = "<an open Function>"
Function:prTry 0x2dc7300
arg this = a Function
var result = nil
var thread = a Thread
var next = nil
var wasInProtectedFunc = false
CALL STACK:
DoesNotUnderstandError:reportError 0x4d51268
arg this = <instance of DoesNotUnderstandError>
< closed FunctionDef > 0x4d48418
arg error = <instance of DoesNotUnderstandError>
Integer:forBy 0x468a6d8
arg this = 0
arg endval = 0
arg stepval = 2
arg function = <instance of Function>
var i = 0
var j = 0
SequenceableCollection:pairsDo 0x49be958
arg this = [*2]
arg function = <instance of Function>
Scheduler:seconds_ 0x2a7cbd8
arg this = <instance of Scheduler>
arg newSeconds = 1470285930.1456
Meta_AppClock:tick 0x3ec45a8
arg this = <instance of Meta_AppClock>
var saveClock = <instance of Meta_SystemClock>
Process:tick 0x465a508
arg this = <instance of Main>
^^ The preceding error dump is for ERROR: Message 'split' not understood.
RECEIVER: nil
I don't know what is causing this 'split' error. Any help getting from here to being able to run SuperDirt.start in SuperCollider would be greatly appreciated. Thanks!
These quarks (SuperDirt, Dirt-Samples, Vocal) all appear to install correctly in SuperCollider v3.7+. There were major fixes and improvements to Quarks between 3.6.x and 3.7, so this will probably be solved by upgrading.
If you're dependent on 3.6.x specifically, you can probably proceed in using Tidal. Placing the files in the quarks folder as you described is ALL that's required to install them (the Quarks GUI does exactly and only this) - there's nothing additional done by the Quarks gui / Quarks.install(). A simple recompile / restart should pick up the quarks and everything should work fine.
https://supercollider.github.io/download
Related
I am learning to use the map of maps. In the following example, there are three nested maps.
package main
import (
"fmt"
)
func main() {
var data = map[string]map[string]map[string]string{}
data["Date_1"] = map[string]map[string]string{}
data["Date_1"] = make(map[string]map[string]string, 1)
data["Date_1"] = make(map[string]map[string]string, 0)
data["Date_1"]["Sistem_A"] = map[string]string{}
data["Date_1"]["Sistem_A"] = make(map[string]string, 0)
data["Date_1"]["Sistem_A"] = make(map[string]string, 0)
data["Date_1"]["Sistem_A"]["command_1"] = "white"
data["Date_1"]["Sistem_A"]["command_2"] = "blue"
data["Date_1"]["Sistem_A"]["command_3"] = "red"
fmt.Println("data: ", data)
}
Output
data: map[Date_1:map[Sistem_A:map[command_1:white command_2:blue command_3:red]]]
The problem is that if I want to add the values in one step I get a panic: assignment to entry in nil map.
package main
import (
"fmt"
)
func main() {
var data = map[string]map[string]map[string]string{}
data["Date_1"] = map[string]map[string]string{}
data["Date_1"] = make(map[string]map[string]string, 0)
data["Date_1"] = make(map[string]map[string]string, 0)
data["Date_1"]["Sistem_A"] = map[string]string{}
data["Date_1"]["Sistem_A"] = make(map[string]string, 0)
data["Date_1"]["Sistem_A"] = make(map[string]string, 0)
data["Date_1"]["Sistem_A"]["command_1"] = "white"
data["Date_1"]["Sistem_A"]["command_2"] = "blue"
data["Date_1"]["Sistem_A"]["command_3"] = "red"
data["Date_2"]["Sistem_A"]["command_5"] = "violet"
fmt.Println("data: ", data)
}
Output
panic: assignment to entry in nil map
There is very little guidance information at this point. Could you help me?
Thank you.
It is here:
data["Date_2"]["Sistem_A"]["command_5"] = "violet"
The expression data["Date_2"] will return a nil-map. It is never initialized, so looking for the index ["Sistem_A"] panics. Initialize the map first:
data["Date_2"] = make(map[string]map[string]string)
data["Date_2"]["Sistem_A"] = make(map[string]string)
data["Date_2"]["Sistem_A"]["command_5"] = "violet"
Your problem is, that you never initialized data["Date_2"] (so it is nil).
So by doing data["Date_2"]["Sistem_A"]["command_5"] = "violet", looking for the index panics.
you have to initialize first as follows:
data["Date_2"]=make(map[string]map[string]string)
data["Date_2"]["Sistem_A"]=make(map[string]string)
I need to change the output of a method a bit: Execute the function, and if it's a empty string, then convert it to a "1". How can i write this short on just one line?
var = some_really_long_method(foo)
var = "1" if var == ""
I tried below, but that does call the method twice, right?
var = some_really_long_method(foo) == "" ? "1" : some_really_long_method(foo)
You could use Object#then:
def some_really_long_method
p 'called'
p res = ["", "10"].sample
res
end
var = some_really_long_method.then { |m| m == "" ? '1' : m }
You can check for yourself that the method is called once.
Newlines are optional in Ruby, they can always be replaced with either an expression separator (;), a keyword (e.g. then, do), or sometimes just whitespace.
Therefore, every program, no matter how complex, can always be written in one line, just by removing the linebreaks:
var = some_really_long_method(foo); var = "1" if var == ""
var = "1" if (var = some_really_long_method(foo)) == ""
I have been using Supercollider 3.8 for a long time and have decided to change the version to 3.9.3,
but it has brought us problems, currently the script.scd returns the following error:
ERROR: Message 'addr' not understood.
RECEIVER:
Instance of Function { (0000022C4663FF48, gc=8C, fmt=00, flg=00, set=02)
instance variables [2]
def : instance of FunctionDef - closed
context : Frame (0000022C45014BD8) of Interpreter:functionCompileContext
}
ARGS:
CALL STACK:
DoesNotUnderstandError:reportError
arg this = <instance of DoesNotUnderstandError>
Nil:handleError
arg this = nil
arg error = <instance of DoesNotUnderstandError>
Thread:handleError
arg this = <instance of Thread>
arg error = <instance of DoesNotUnderstandError>
Object:throw
arg this = <instance of DoesNotUnderstandError>
Object:doesNotUnderstand
arg this = <instance of Function>
arg selector = 'addr'
arg args = [*0]
OSCFuncAddrMessageMatcher:value
arg this = <instance of OSCFuncAddrMessageMatcher>
arg msg = [*33]
arg time = 161.0420767
arg testAddr = <instance of NetAddr>
arg recvPort = 57121
OSCMessageDispatcher:value
arg this = <instance of OSCMessageDispatcher>
arg msg = [*33]
arg time = 161.0420767
arg addr = <instance of NetAddr>
arg recvPort = 57121
Main:recvOSCmessage
arg this = <instance of Main>
arg time = 161.0420767
arg replyAddr = <instance of NetAddr>
arg recvPort = 57121
arg msg = [*33]
^^ The preceding error dump is for ERROR: Message 'addr' not understood.
RECEIVER: a Function
It's impossible to diagnose the problem is without the code that's generating the error.
By way of explanation of the error messsage:
Message 'addr' not understood:
This means the method addr was called on something, e.g. something.addr() that doesn't have a method by that name.
RECEIVER:
Instance of Function:
This means that the "something" is a function.
So, somewhere you might be passing a function as an argument where some other type of object is expected (something that responds to .addr, so probably a NetAddr or Server).
In my ATS application, I am trying to read a input string from a user.
Is there any function in ATS that performs similar functionality as scanf function in C.. If not how to get the input from user without integrating ATS with JS or HTML.
Here is a simple way to read from STDIN:
#include
"share/atspre_staload.hats"
#include
"share/HATS/atspre_staload_libats_ML.hats"
implement
main0() =
{
//
val
lines =
streamize_fileref_line(stdin_ref)
//
val () = lines.foreach()(lam x => println! (x))
//
} (* end of [main0] *)
If you compile to C, then scanf is available. Here is a simple example:
#include
"share/atspre_staload.hats"
#staload
"libats/libc/SATS/stdio.sats"
implement
main0() =
{
//
var str1 = #[char][1024]()
var str2 = #[char][1024]()
//
val () = println! ("Enter name: ")
val ec = $extfcall(int, "scanf", "%s", addr#str1)
val () = assertloc (ec != 0)
val str1 = $UNSAFE.cast{string}(addr#str1)
//
val () = println! ("Enter your website name: ")
val ec = $extfcall(int, "scanf", "%s", addr#str2)
val () = assertloc (ec != 0)
val str2 = $UNSAFE.cast{string}(addr#str2)
//
val () = println! ("str1 = ", str1)
val () = println! ("str2 = ", str2)
//
}
I'm creating a utility to add archival events to a calendar.
example run
./create-events-from-dvd-contents.swift --path /Volumes/ARCHIVE/DVD\ 1255/2451-01_LLA_Assets\ Folder\ Nov\ 2015/
Optional("DVD 1255")
The class is
class Event {
var location: String? ;
var start: String? ;
var notes: String? ;
}
The code to print the dvd location is
let event = Event() ;
let pathArray = path.characters.split {$0 == "/"}.map { String($0) } ;
event.location = pathArray[2] ;
print(event.location) ;
What is the simplest way to get 'DVD 1255' output instead of 'Optional("DVD 1255")'?
you must unwrap the value first into its own (non optional) variable.
let event = Event() ;
let pathArray = path.characters.split {$0 == "/"}.map { String($0) } ;
event.location = pathArray[2];
if let location = event.location {
print(location);
}
or you could put an ! after event.location if you wanted.
let event = Event() ;
let pathArray = path.characters.split {$0 == "/"}.map { String($0) } ;
event.location = pathArray[2] ;
print(event.location!) ;
The nil-coalescing operator is a clean way to do this:
var x: String? = "foo"
print(x) // Optional('foo')
x = nil
var y: String = x ?? "bar" // note y is not an optional
print(y) // Bar
print(x ?? "Not optional") // Not optional
Also, I noticed you are using semi-colons, which are unnecessary in Swift. I mention this, not as an opinion, but because it is a good practice of Swift to not use semi-colons unless necessary (multiple statements on one line or something)