This part of my script should start playback from the beginning of the entire song, but it starts from the beginning of the current pattern:
local t = renoise.song().transport
local startpos = t.playback_pos
local w=renoise.app().window
local follow_player=t.follow_player
if (t.playing == false) then
startpos.sequence = 1
startpos.line = 1
t.playback_pos = startpos
t:start(renoise.Transport.PLAYMODE_RESTART_PATTERN)
end