public static PlayableSound parse(String string)
            throws IllegalArgumentException, NumberFormatException {
        Matcher matcher = pattern.matcher(string);
        if (!matcher.matches()) {
            return null;
        }
        if (matcher.group(3) != null) {
            return new PlayableSound(Sound.valueOf(matcher.group(1)),
                    Float.parseFloat(matcher.group(2)),
                    Float.parseFloat(matcher.group(3)));
        }
        if (matcher.group(2) != null) {
            return new PlayableSound(Sound.valueOf(matcher.group(1)),
                    Float.parseFloat(matcher.group(2)));
        }
        return new PlayableSound(Sound.valueOf(matcher.group(1)));
    }