nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchzip,
5 libX11,
6 libXi,
7 libGL,
8 alsa-lib,
9 SDL2,
10 autoPatchelfHook,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "virtual-ans";
15 version = "3.0.3";
16
17 src = fetchzip {
18 url = "https://warmplace.ru/soft/ans/virtual_ans-${version}.zip";
19 sha256 = "sha256-tqR7icgURUFOyLJ8+mS17JRf2gK53I2FW/2m8IJPtJE=";
20 };
21
22 nativeBuildInputs = [
23 autoPatchelfHook
24 ];
25
26 buildInputs = [
27 (lib.getLib stdenv.cc.cc)
28 libX11
29 libXi
30 libGL
31 alsa-lib
32 SDL2
33 ];
34
35 installPhase = ''
36 mkdir -p $out
37 cp -R ./* $out/
38
39 # Remove all executables except for current architecture
40 ls -1d $out/START* | grep -v ${startScript} | xargs rm -rf
41 ls -1d $out/bin/pixilang_linux* | grep -v ${linuxExecutable} | xargs rm -rf
42
43 # Start script performs relative search for resources, so it cannot be moved
44 # to bin directory
45 ln -s $out/${startScript} $out/bin/virtual-ans
46 '';
47
48 startScript =
49 if stdenv.hostPlatform.isx86_32 then
50 "START_LINUX_X86"
51 else if stdenv.hostPlatform.isx86_64 then
52 "START_LINUX_X86_64"
53 #else if stdenv.hostPlatform.isDarwin then "START_MACOS.app" # disabled because I cannot test on Darwin
54 else
55 throw "Unsupported platform: ${stdenv.hostPlatform.linuxArch}.";
56
57 linuxExecutable =
58 if stdenv.hostPlatform.isx86_32 then
59 "pixilang_linux_x86"
60 else if stdenv.hostPlatform.isx86_64 then
61 "pixilang_linux_x86_64"
62 else
63 "";
64
65 meta = with lib; {
66 description = "Photoelectronic microtonal/spectral musical instrument";
67 longDescription = ''
68 Virtual ANS is a software simulator of the unique Russian synthesizer ANS
69 - photoelectronic musical instrument created by Evgeny Murzin from 1938 to
70 1958. The ANS made it possible to draw music in the form of a spectrogram
71 (sonogram), without live instruments and performers. It was used by
72 Stanislav Kreichi, Alfred Schnittke, Edward Artemiev and other Soviet
73 composers in their experimental works. You can also hear the sound of the
74 ANS in Andrei Tarkovsky's movies Solaris, The Mirror, Stalker.
75
76 The simulator extends the capabilities of the original instrument. Now
77 it's a full-featured graphics editor where you can convert sound into an
78 image, load and play pictures, draw microtonal/spectral music and create
79 some unusual deep atmospheric sounds. This app is for everyone who loves
80 experiments and is looking for something new.
81
82 Key features:
83
84 + unlimited number of pure tone generators;
85 + powerful sonogram editor - you can draw the spectrum and play it at the same time;
86 + any sound (from a WAV file or a Microphone/Line-in) can be converted to image (sonogram) and vice versa;
87 + support for MIDI devices;
88 + polyphonic synth mode with MIDI mapping;
89 + supported file formats: WAV, AIFF, PNG, JPEG, GIF;
90 + supported sound systems: ASIO, DirectSound, MME, ALSA, OSS, JACK, Audiobus, IAA.
91 '';
92 homepage = "https://warmplace.ru/soft/ans/";
93 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
94 license = licenses.unfreeRedistributable;
95 # I cannot test the Darwin version, so I'll leave it disabled
96 platforms = [
97 "x86_64-linux"
98 "i686-linux"
99 ];
100 maintainers = with maintainers; [ jacg ];
101 };
102
103}