원본 파일(900 × 490 픽셀, 파일 크기: 3.21 MB, MIME 종류: image/gif, 반복됨, 23 프레임, 2.8 s)

파일 설명

설명 Illustration of a en:Tonnetz torus
날짜
출처 자작
저자 Davidwbulger

라이선스

Public domain 나는 이 작품의 저작권자로서, 이 작품을 퍼블릭 도메인으로 모두에게 공개합니다. 이 공개 선언은 전 세계적으로 유효합니다.
만약 저작권의 포기가 법률적으로 가능하지 않은 경우,
나는 이 작품을 법적으로 허용되는 한도 내에서 누구나 자유롭게 어떤 목적으로도 제한없이 사용할 수 있도록 허용합니다.
MATLAB source code

Thanks to Oleg Alexandrov, whose code at File:Plane_wave.gif I imitated.

% The idea here is to produce an animation of a "Tonnetz" torus (see
% http://en.wikipedia.org/wiki/Neo-Riemannian_theory), possibly for upload
% to Wikimedia.

% FIRSTLY CREATE THE TEXTURE.
% Regrettably, no screen to which I have access is anywhere near large
% enough to contain the whole texture (at sufficient resolution to look
% good after texture-mapping the torus' surface). I'm not certain it's
% impossible to draw the whole figure to a larger-than-screen invisible
% buffer & getframe from there, but I don't know how to do it. Instead I'll
% build the texture out of sections of the plot, using xlim & ylim to
% scroll in between. Gawd help me.

% First determine texture's pixel dimensions:
TextureWidth=2702;  %  A spike in this plot: n=1:5000; h=abs(round(n/sqrt(27))./n-1/sqrt(27)); plot(n, 1./h);
TextureHeight=round(TextureWidth/sqrt(27));

ScreenSize = get(0, 'ScreenSize');
PatternRect = [9*sqrt(3)/2, 1/2, 12*sqrt(3), 4];  %  left, bottom, width, height
notes = {'C', 'C$\sharp$', 'D', 'D$\sharp$', 'E', 'F', 'F$\sharp$', 'G', 'G$\sharp$', 'A', 'A$\sharp$', 'B'};
gap = .3;
xoffset = [0,0,0;sqrt(3)/2,0,-sqrt(3)/2];
yoffset = [0,0,0;.5,1,.5];
xoffset=(1-gap)*xoffset+gap*flipud(xoffset);
yoffset=(1-gap)*yoffset+gap*flipud(yoffset);
FontPts = round(TextureWidth/92);

close all
figure(1);
set(1, 'Position', [64, 64, ScreenSize(3:4)-128], 'Color', 'w');
FigureRect = get(1, 'Position');  %  should be the same but who knows
TilesAcross = ceil(TextureWidth/FigureRect(3));
TilesDown = ceil(TextureHeight/FigureRect(4));

hold on
%rectangle('Position', PatternRect, 'EdgeColor', 'none', 'FaceColor', [.2,.2,.2]);%[1,.5,0]);%[.65, .6, .55]);
for j=0:9,
    for k=0:16,
        x = sqrt(3)*(k+j/2);
        y = j/2;
        text(x, y, notes(1+mod(7*j-k, 12)), 'Interpreter', 'latex', 'HorizontalAlignment', 'center', 'fontsize', FontPts);
        plot(x+xoffset, y+yoffset, 'LineWidth', TextureWidth/600);
    end
end
axis equal
axis off
set(gca, 'Position', [0, 0, 1, 1]);

texture = zeros(FigureRect(4)*TilesDown, FigureRect(3)*TilesAcross, 3);
for j=1:TilesDown,
    for k=1:TilesAcross,
        xlim(PatternRect(1)+[k-1,k]*FigureRect(3)/TextureWidth*PatternRect(3));
        ylim(PatternRect(2)+[j-1,j]*FigureRect(4)/TextureHeight*PatternRect(4));
        [tile, map] = frame2im(getframe(gcf));
        texture(1+(TilesDown-j)*FigureRect(4):(TilesDown-j+1)*FigureRect(4), 1+(k-1)*FigureRect(3):k*FigureRect(3), :) = tile;
    end
end
texture = texture(1+end-TextureHeight:end, 1:TextureWidth, :);
background = 220+floor(35*rand(size(texture)));  %  mottle the surface a little
isblank = repmat(min(texture, [], 3)==255, [1,1,3]);
texture = isblank.*background + (1-isblank).*texture;
close(1);

% NOW CREATE THE TORUS:
sx = size(texture, 2)-1;
sy = size(texture, 1)-1;
close all
figure(1);
set(1, 'Position', [1, 31, 1366, 662]);
[phi, theta] = meshgrid(2*pi*(0:sx)/sx, 2*pi*(0:sy)/sy);
h=surf(cos(phi).*(100-20*sin(theta)), sin(phi).*(100-20*sin(theta)), -20*cos(theta), texture);
set(h, 'CDataMapping', 'direct', 'EdgeColor' ,'none', 'FaceColor', 'interp', 'AmbientStrength', 0.003, 'DiffuseStrength', 0.003, 'SpecularStrength', 0.9, 'SpecularExponent', 25);
light('Position', [2000, -2000, 1000], 'Color', [1, 1, .7]);
light('Position', [-2000, 2000, 1000], 'Color', [.7, .7, 1]);
set(gca, 'AmbientLightColor', [1, .9, .9]);
axis equal
axis off
campos([-870, -1266, 749]);
lighting gouraud

% NOW SPIN IT, SAVING THE FRAMES:
NumFrames = 23;
delete('MovieFrames/Frame*.eps');
delete('MovieFrames/Frame*.bmp');
for t=1:NumFrames;
    twist = t*pi/4/NumFrames;
    set(h, 'XData', cos(phi+twist).*(100-20*sin(theta+3*twist)));
    set(h, 'YData', sin(phi+twist).*(100-20*sin(theta+3*twist)));
    set(h, 'ZData', -20*cos(theta+3*twist));
    drawnow;
    fprintf('Writing frame number %d to disk.\n', t);
    FileName = sprintf('MovieFrames/Frame%03d.bmp', t);
    print(gcf, '-dbmp', FileName, '-r200')
    system(sprintf('convert %s -crop 900x490+378+333 %s', FileName, FileName));  %   This relies on having installed "ImageMagick," but it's free
end

% NOW MAKE THE GIF (ImageMagick needed again)
fprintf('Compiling frames into a gif ...');
system('convert -antialias -loop 0 -delay 12 -compress LZW MovieFrames/Frame* TonnetzTorus.gif');
fprintf(' complete.\n');
 
다이어그램MATLAB(으)로 제작되었습니다.

설명

이 파일이 나타내는 바에 대한 한 줄 설명을 추가합니다

이 파일에 묘사된 항목

다음을 묘사함

파일 역사

날짜/시간 링크를 클릭하면 해당 시간의 파일을 볼 수 있습니다.

날짜/시간섬네일크기사용자설명
현재2010년 9월 15일 (수) 14:242010년 9월 15일 (수) 14:24 판의 섬네일900 × 490 (3.21 MB)Davidwbulger{{Information |Description=Illustration of a Tonnetz torus |Source={{own}} |Date=15 September 2010 |Author= Davidwbulger |Permission= |other_versions= }}

다음 문서 1개가 이 파일을 사용하고 있습니다:

이 파일을 사용하고 있는 모든 위키의 문서 목록

다음 위키에서 이 파일을 사용하고 있습니다: